From 5b06c24839716a45b36e6cd6a2f46706201f466d Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Tue, 28 Jul 2026 10:56:10 +0000 Subject: [PATCH] Generate git --- services/git/api_default.go | 1413 ++++++++++++++--- services/git/model_authentication.go | 197 ++- services/git/model_authentication_test.go | 68 + services/git/model_create_user_payload.go | 373 +++++ .../git/model_create_user_payload_test.go | 11 + services/git/model_feature_toggle.go | 108 +- services/git/model_instance.go | 117 +- services/git/model_list_users.go | 311 ++++ services/git/model_list_users_test.go | 11 + services/git/model_patch_instance_payload.go | 120 +- services/git/model_pipelines.go | 241 +++ services/git/model_pipelines_test.go | 11 + services/git/model_runner_runtime.go | 2 +- services/git/model_update_user_payload.go | 270 ++++ .../git/model_update_user_payload_test.go | 11 + services/git/model_user.go | 317 ++++ services/git/model_user_test.go | 11 + services/git/oas_commit | 2 +- services/git/v1betaapi/api_default.go | 1118 +++++++++++-- services/git/v1betaapi/api_default_mock.go | 106 ++ .../git/v1betaapi/model_authentication.go | 53 +- .../v1betaapi/model_authentication_status.go | 120 ++ .../v1betaapi/model_create_user_payload.go | 300 ++++ .../git/v1betaapi/model_feature_toggle.go | 86 +- services/git/v1betaapi/model_instance.go | 72 +- services/git/v1betaapi/model_list_users.go | 257 +++ .../v1betaapi/model_patch_instance_payload.go | 80 +- services/git/v1betaapi/model_pipelines.go | 215 +++ .../git/v1betaapi/model_runner_runtime.go | 2 +- .../v1betaapi/model_update_user_payload.go | 231 +++ services/git/v1betaapi/model_user.go | 266 ++++ 31 files changed, 6057 insertions(+), 443 deletions(-) create mode 100644 services/git/model_create_user_payload.go create mode 100644 services/git/model_create_user_payload_test.go create mode 100644 services/git/model_list_users.go create mode 100644 services/git/model_list_users_test.go create mode 100644 services/git/model_pipelines.go create mode 100644 services/git/model_pipelines_test.go create mode 100644 services/git/model_update_user_payload.go create mode 100644 services/git/model_update_user_payload_test.go create mode 100644 services/git/model_user.go create mode 100644 services/git/model_user_test.go create mode 100644 services/git/v1betaapi/model_authentication_status.go create mode 100644 services/git/v1betaapi/model_create_user_payload.go create mode 100644 services/git/v1betaapi/model_list_users.go create mode 100644 services/git/v1betaapi/model_pipelines.go create mode 100644 services/git/v1betaapi/model_update_user_payload.go create mode 100644 services/git/v1betaapi/model_user.go diff --git a/services/git/api_default.go b/services/git/api_default.go index 21e1022e9..f56addcbe 100644 --- a/services/git/api_default.go +++ b/services/git/api_default.go @@ -96,6 +96,30 @@ type DefaultApi interface { // 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) + /* + CreateUser Create an Instance Local/Technical User. + Creates a new STACKIT Git instance Local/Technical User. + + + @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 ApiCreateUserRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + CreateUser(ctx context.Context, projectId string, instanceId string) ApiCreateUserRequest + /* + CreateUserExecute 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 User + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + CreateUserExecute(ctx context.Context, projectId string, instanceId string) (*User, error) /* DeleteAuthentication Delete Authentication Source Deletes the authentication source associated to this STACKIT Git instance. @@ -154,6 +178,26 @@ type DefaultApi interface { // 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 + /* + DeleteUser Delete Instance User. + Deletes a STACKIT Git instance User 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. + @param username Instance User identifier. + @return ApiDeleteUserRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + DeleteUser(ctx context.Context, projectId string, instanceId string, username string) ApiDeleteUserRequest + /* + DeleteUserExecute executes the request + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + DeleteUserExecute(ctx context.Context, projectId string, instanceId string, username string) error /* GetAuthentication Get authentication provider Get authentication provider @@ -226,6 +270,50 @@ type DefaultApi interface { // 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) + /* + GetUser Get Instance User information. + Retrieves information about a STACKIT Git instance User. + + @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 username Instance User identifier. + @return ApiGetUserRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + GetUser(ctx context.Context, projectId string, instanceId string, username string) ApiGetUserRequest + /* + GetUserExecute executes the request + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + GetUserExecute(ctx context.Context, projectId string, instanceId string, username string) error + /* + GetUsers Get instance Users. + Lists STACKIT Git Users within an instance. Supports pagination via the + optional `page` query parameter. Each page returns up to 50 users. + + + @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 ApiGetUsersRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + GetUsers(ctx context.Context, projectId string, instanceId string) ApiGetUsersRequest + /* + GetUsersExecute 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 ListUsers + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + GetUsersExecute(ctx context.Context, projectId string, instanceId string) (*ListUsers, error) /* ListAuthentication List authentication sources Lists all authentication sources belonging to a specific instance @@ -365,6 +453,32 @@ type DefaultApi interface { // 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) + /* + UpdateUser Update Instance User. + Updates the Instance User. + + + @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 username Instance User identifier. + @return ApiUpdateUserRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + UpdateUser(ctx context.Context, projectId string, instanceId string, username string) ApiUpdateUserRequest + /* + UpdateUserExecute 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 username Instance User identifier. + @return User + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + UpdateUserExecute(ctx context.Context, projectId string, instanceId string, username string) (*User, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -394,6 +508,15 @@ type ApiCreateRunnerRequest interface { Execute() (*Runner, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiCreateUserRequest interface { + // Instance User details options. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + CreateUserPayload(createUserPayload CreateUserPayload) ApiCreateUserRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (*User, 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 @@ -412,6 +535,12 @@ type ApiDeleteRunnerRequest interface { Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiDeleteUserRequest 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 @@ -430,6 +559,21 @@ type ApiGetRunnerRequest interface { Execute() (*Runner, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiGetUserRequest 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 ApiGetUsersRequest interface { + // Page number for pagination (1-indexed). Each page contains up to 50 users. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Page(page int32) ApiGetUsersRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (*ListUsers, 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 @@ -471,6 +615,14 @@ type ApiPatchInstanceRequest interface { Execute() (*Instance, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiUpdateUserRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + UpdateUserPayload(updateUserPayload UpdateUserPayload) ApiUpdateUserRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (*User, 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 @@ -1045,60 +1197,64 @@ func (a *APIClient) CreateRunnerExecute(ctx context.Context, projectId string, i } // 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 +type CreateUserRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + instanceId string + createUserPayload *CreateUserPayload } +// Instance User details options. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r DeleteAuthenticationRequest) Execute() error { +func (r CreateUserRequest) CreateUserPayload(createUserPayload CreateUserPayload) ApiCreateUserRequest { + r.createUserPayload = &createUserPayload + return r +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r CreateUserRequest) Execute() (*User, error) { var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User ) 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.DeleteAuthentication") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateUser") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/authentications/{authenticationId}" + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/users" 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") + 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") - } - if strlen(r.authenticationId) < 36 { - return fmt.Errorf("authenticationId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("instanceId must have less than 36 elements") } - if strlen(r.authenticationId) > 36 { - return fmt.Errorf("authenticationId must have less than 36 elements") + if r.createUserPayload == nil { + return localVarReturnValue, fmt.Errorf("createUserPayload 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) @@ -1114,9 +1270,11 @@ func (r DeleteAuthenticationRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createUserPayload 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) @@ -1130,14 +1288,14 @@ func (r DeleteAuthenticationRequest) 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 { @@ -1151,104 +1309,90 @@ func (r DeleteAuthenticationRequest) Execute() error { 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 + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + 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 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 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 } /* -DeleteAuthentication: Delete Authentication Source +CreateUser: Create an Instance Local/Technical User. 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 + @return ApiCreateUserRequest */ -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, +func (a *APIClient) CreateUser(ctx context.Context, projectId string, instanceId string) ApiCreateUserRequest { + return CreateUserRequest{ + 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) DeleteAuthenticationExecute(ctx context.Context, projectId string, instanceId string, authenticationId string) error { - r := DeleteAuthenticationRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - authenticationId: authenticationId, +func (a *APIClient) CreateUserExecute(ctx context.Context, projectId string, instanceId string) (*User, error) { + r := CreateUserRequest{ + 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 DeleteInstanceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - instanceId string +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 DeleteInstanceRequest) Execute() error { +func (r DeleteAuthenticationRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -1259,14 +1403,15 @@ func (r DeleteInstanceRequest) Execute() error { if !ok { return 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.DeleteAuthentication") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}" + 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{} @@ -1283,6 +1428,12 @@ func (r DeleteInstanceRequest) Execute() error { 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{} @@ -1344,6 +1495,17 @@ func (r DeleteInstanceRequest) Execute() error { 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")) @@ -1383,14 +1545,190 @@ func (r DeleteInstanceRequest) Execute() error { } /* -DeleteInstance: Delete Instance. +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. - @return ApiDeleteInstanceRequest + @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{ @@ -1564,57 +1902,50 @@ func (a *APIClient) DeleteRunnerExecute(ctx context.Context, projectId string, i } // 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 +type DeleteUserRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + instanceId string + username 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) { +func (r DeleteUserRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Authentication + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { - return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAuthentication") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteUser") if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/authentications/{authenticationId}" + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/users/{username}" 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) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(ParameterValueToString(r.username, "username")), -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") + return 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") + return 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") + return 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") + return fmt.Errorf("instanceId must have less than 36 elements") } // to determine the Content-Type header @@ -1636,7 +1967,7 @@ func (r GetAuthenticationRequest) Execute() (*Authentication, error) { } req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, err + return err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -1650,14 +1981,14 @@ func (r GetAuthenticationRequest) Execute() (*Authentication, error) { *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err + return err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, err + return err } if localVarHTTPResponse.StatusCode >= 300 { @@ -1667,49 +1998,212 @@ func (r GetAuthenticationRequest) Execute() (*Authentication, error) { 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 + var v GenericErrorResponse err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 500 { - var v InternalServerErrorResponse + var v GenericErrorResponse err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } - return localVarReturnValue, newErr + return 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 nil +} + +/* +DeleteUser: Delete Instance User. + +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 username Instance User identifier. + @return ApiDeleteUserRequest +*/ +func (a *APIClient) DeleteUser(ctx context.Context, projectId string, instanceId string, username string) ApiDeleteUserRequest { + return DeleteUserRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + username: username, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) DeleteUserExecute(ctx context.Context, projectId string, instanceId string, username string) error { + r := DeleteUserRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + username: username, + } + 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 } @@ -1736,61 +2230,397 @@ func (a *APIClient) GetAuthentication(ctx context.Context, projectId string, ins } // 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, +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() +} + +// 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 +} + +// 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.MethodGet + 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.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, 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 == 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 +} + +/* +GetRunner: Get Runner 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 ApiGetRunnerRequest +*/ +func (a *APIClient) GetRunner(ctx context.Context, projectId string, instanceId string) ApiGetRunnerRequest { + return GetRunnerRequest{ + 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) GetRunnerExecute(ctx context.Context, projectId string, instanceId string) (*Runner, error) { + r := GetRunnerRequest{ + 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 GetInstanceRequest struct { +type GetUserRequest struct { ctx context.Context apiService *DefaultApiService projectId string instanceId string + username 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) { +func (r GetUserRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Instance + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { - return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + return 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.GetUser") if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/users/{username}" 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, "{"+"username"+"}", url.PathEscape(ParameterValueToString(r.username, "username")), -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") + return 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") + return 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") + return 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") + return fmt.Errorf("instanceId must have less than 36 elements") } // to determine the Content-Type header @@ -1812,7 +2642,7 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { } req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, err + return err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -1826,14 +2656,14 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err + return err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, err + return err } if localVarHTTPResponse.StatusCode >= 300 { @@ -1842,111 +2672,112 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v GenericErrorResponse + if localVarHTTPResponse.StatusCode == 302 { + var v User err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } - if localVarHTTPResponse.StatusCode == 404 { + 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 + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + 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 localVarReturnValue, newErr + return 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 newErr } - return localVarReturnValue, nil + return nil } /* -GetInstance: Get Instance information. +GetUser: Get Instance User 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 + @param username Instance User identifier. + @return ApiGetUserRequest */ -func (a *APIClient) GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest { - return GetInstanceRequest{ +func (a *APIClient) GetUser(ctx context.Context, projectId string, instanceId string, username string) ApiGetUserRequest { + return GetUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, instanceId: instanceId, + username: username, } } // 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{ +func (a *APIClient) GetUserExecute(ctx context.Context, projectId string, instanceId string, username string) error { + r := GetUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, instanceId: instanceId, + username: username, } return r.Execute() } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type GetRunnerRequest struct { +type GetUsersRequest struct { ctx context.Context apiService *DefaultApiService projectId string instanceId string + page *int32 } +// Page number for pagination (1-indexed). Each page contains up to 50 users. // 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) { +func (r GetUsersRequest) Page(page int32) ApiGetUsersRequest { + r.page = &page + return r +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r GetUsersRequest) Execute() (*ListUsers, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Runner + localVarReturnValue *ListUsers ) 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.GetRunner") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetUsers") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/runner" + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/users" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) @@ -1966,6 +2797,9 @@ func (r GetRunnerRequest) Execute() (*Runner, error) { return localVarReturnValue, fmt.Errorf("instanceId must have less than 36 elements") } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2053,17 +2887,17 @@ func (r GetRunnerRequest) Execute() (*Runner, error) { } /* -GetRunner: Get Runner information. +GetUsers: Get instance Users. 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 ApiGetRunnerRequest + @return ApiGetUsersRequest */ -func (a *APIClient) GetRunner(ctx context.Context, projectId string, instanceId string) ApiGetRunnerRequest { - return GetRunnerRequest{ +func (a *APIClient) GetUsers(ctx context.Context, projectId string, instanceId string) ApiGetUsersRequest { + return GetUsersRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -2072,8 +2906,8 @@ func (a *APIClient) GetRunner(ctx context.Context, projectId string, instanceId } // 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{ +func (a *APIClient) GetUsersExecute(ctx context.Context, projectId string, instanceId string) (*ListUsers, error) { + r := GetUsersRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -3100,3 +3934,182 @@ func (a *APIClient) PatchInstanceExecute(ctx context.Context, projectId string, } return r.Execute() } + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateUserRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + instanceId string + username string + updateUserPayload *UpdateUserPayload +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r UpdateUserRequest) UpdateUserPayload(updateUserPayload UpdateUserPayload) ApiUpdateUserRequest { + r.updateUserPayload = &updateUserPayload + return r +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r UpdateUserRequest) Execute() (*User, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + 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.UpdateUser") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/users/{username}" + 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, "{"+"username"+"}", url.PathEscape(ParameterValueToString(r.username, "username")), -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.updateUserPayload == nil { + return localVarReturnValue, fmt.Errorf("updateUserPayload 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.updateUserPayload + 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 == 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 +} + +/* +UpdateUser: Update Instance User. + +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 username Instance User identifier. + @return ApiUpdateUserRequest +*/ +func (a *APIClient) UpdateUser(ctx context.Context, projectId string, instanceId string, username string) ApiUpdateUserRequest { + return UpdateUserRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + username: username, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) UpdateUserExecute(ctx context.Context, projectId string, instanceId string, username string) (*User, error) { + r := UpdateUserRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + username: username, + } + return r.Execute() +} diff --git a/services/git/model_authentication.go b/services/git/model_authentication.go index 5291ed29d..6d2b847c0 100644 --- a/services/git/model_authentication.go +++ b/services/git/model_authentication.go @@ -13,6 +13,7 @@ package git import ( "encoding/json" + "fmt" "time" ) @@ -239,9 +240,144 @@ type AuthenticationGetScopesRetType = string types and functions for status */ -// isNotNullableString +// isEnum + +// AuthenticationStatus The current status of the authentication definition. +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationStatus string + +// List of Status +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + AUTHENTICATIONSTATUS_CREATING AuthenticationStatus = "Creating" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + AUTHENTICATIONSTATUS_UPDATING AuthenticationStatus = "Updating" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + AUTHENTICATIONSTATUS_DELETING AuthenticationStatus = "Deleting" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + AUTHENTICATIONSTATUS_READY AuthenticationStatus = "Ready" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + AUTHENTICATIONSTATUS_ERROR AuthenticationStatus = "Error" +) + +// All allowed values of Authentication enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedAuthenticationStatusEnumValues = []AuthenticationStatus{ + "Creating", + "Updating", + "Deleting", + "Ready", + "Error", +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *AuthenticationStatus) 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 AuthenticationStatus + 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 := AuthenticationStatus(value) + for _, existing := range AllowedAuthenticationStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Authentication", value) +} + +// NewAuthenticationStatusFromValue returns a pointer to a valid AuthenticationStatus +// 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 NewAuthenticationStatusFromValue(v AuthenticationStatus) (*AuthenticationStatus, error) { + ev := AuthenticationStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AuthenticationStatus: valid values are %v", v, AllowedAuthenticationStatusEnumValues) + } +} + +// 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 AuthenticationStatus) IsValid() bool { + for _, existing := range AllowedAuthenticationStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to StatusStatus value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v AuthenticationStatus) Ptr() *AuthenticationStatus { + return &v +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AuthenticationGetStatusAttributeType = *string +type NullableAuthenticationStatus struct { + value *AuthenticationStatus + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableAuthenticationStatus) Get() *AuthenticationStatus { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableAuthenticationStatus) Set(val *AuthenticationStatus) { + 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 NullableAuthenticationStatus) 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 *NullableAuthenticationStatus) 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 NewNullableAuthenticationStatus(val *AuthenticationStatus) *NullableAuthenticationStatus { + return &NullableAuthenticationStatus{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 NullableAuthenticationStatus) 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 *NullableAuthenticationStatus) 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 AuthenticationGetStatusAttributeType = *AuthenticationStatus + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetStatusArgType = AuthenticationStatus + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetStatusRetType = AuthenticationStatus // 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) { @@ -256,11 +392,32 @@ func setAuthenticationGetStatusAttributeType(arg *AuthenticationGetStatusAttribu *arg = &val } +/* + types and functions for status_message +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetStatusMessageAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getAuthenticationGetStatusMessageAttributeTypeOk(arg AuthenticationGetStatusMessageAttributeType) (ret AuthenticationGetStatusMessageRetType, 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 setAuthenticationGetStatusMessageAttributeType(arg *AuthenticationGetStatusMessageAttributeType, val AuthenticationGetStatusMessageRetType) { + *arg = &val +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AuthenticationGetStatusArgType = string +type AuthenticationGetStatusMessageArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AuthenticationGetStatusRetType = string +type AuthenticationGetStatusMessageRetType = 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 @@ -292,6 +449,8 @@ type Authentication struct { // The current status of the authentication definition. // REQUIRED Status AuthenticationGetStatusAttributeType `json:"status" required:"true"` + // Provides additional information or error details when the status is 'Error'. + StatusMessage AuthenticationGetStatusMessageAttributeType `json:"status_message,omitempty"` } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -505,6 +664,33 @@ func (o *Authentication) SetStatus(v AuthenticationGetStatusRetType) { setAuthenticationGetStatusAttributeType(&o.Status, v) } +// GetStatusMessage returns the StatusMessage 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 *Authentication) GetStatusMessage() (res AuthenticationGetStatusMessageRetType) { + res, _ = o.GetStatusMessageOk() + return +} + +// GetStatusMessageOk returns a tuple with the StatusMessage 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 *Authentication) GetStatusMessageOk() (ret AuthenticationGetStatusMessageRetType, ok bool) { + return getAuthenticationGetStatusMessageAttributeTypeOk(o.StatusMessage) +} + +// HasStatusMessage 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 *Authentication) HasStatusMessage() bool { + _, ok := o.GetStatusMessageOk() + return ok +} + +// SetStatusMessage gets a reference to the given string and assigns it to the StatusMessage field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Authentication) SetStatusMessage(v AuthenticationGetStatusMessageRetType) { + setAuthenticationGetStatusMessageAttributeType(&o.StatusMessage, 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{}{} @@ -535,6 +721,9 @@ func (o Authentication) ToMap() (map[string]interface{}, error) { if val, ok := getAuthenticationGetStatusAttributeTypeOk(o.Status); ok { toSerialize["Status"] = val } + if val, ok := getAuthenticationGetStatusMessageAttributeTypeOk(o.StatusMessage); ok { + toSerialize["StatusMessage"] = val + } return toSerialize, nil } diff --git a/services/git/model_authentication_test.go b/services/git/model_authentication_test.go index e39c866ed..2c98ac16e 100644 --- a/services/git/model_authentication_test.go +++ b/services/git/model_authentication_test.go @@ -9,3 +9,71 @@ API version: 1beta.0.4 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package git + +import ( + "testing" +) + +// isEnum + +func TestAuthenticationStatus_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(`"Creating"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 2`, + args: args{ + src: []byte(`"Updating"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 3`, + args: args{ + src: []byte(`"Deleting"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 4`, + args: args{ + src: []byte(`"Ready"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 5`, + args: args{ + src: []byte(`"Error"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := AuthenticationStatus("") + 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_user_payload.go b/services/git/model_create_user_payload.go new file mode 100644 index 000000000..00ae1fada --- /dev/null +++ b/services/git/model_create_user_payload.go @@ -0,0 +1,373 @@ +/* +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 CreateUserPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateUserPayload{} + +/* + types and functions for email +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadGetEmailAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateUserPayloadGetEmailAttributeTypeOk(arg CreateUserPayloadGetEmailAttributeType) (ret CreateUserPayloadGetEmailRetType, 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 setCreateUserPayloadGetEmailAttributeType(arg *CreateUserPayloadGetEmailAttributeType, val CreateUserPayloadGetEmailRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadGetEmailArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadGetEmailRetType = string + +/* + types and functions for force_send_reset_password +*/ + +// isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadgetForceSendResetPasswordAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadgetForceSendResetPasswordArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadgetForceSendResetPasswordRetType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateUserPayloadgetForceSendResetPasswordAttributeTypeOk(arg CreateUserPayloadgetForceSendResetPasswordAttributeType) (ret CreateUserPayloadgetForceSendResetPasswordRetType, 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 setCreateUserPayloadgetForceSendResetPasswordAttributeType(arg *CreateUserPayloadgetForceSendResetPasswordAttributeType, val CreateUserPayloadgetForceSendResetPasswordRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadGetNameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateUserPayloadGetNameAttributeTypeOk(arg CreateUserPayloadGetNameAttributeType) (ret CreateUserPayloadGetNameRetType, 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 setCreateUserPayloadGetNameAttributeType(arg *CreateUserPayloadGetNameAttributeType, val CreateUserPayloadGetNameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadGetNameRetType = string + +/* + types and functions for password +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadGetPasswordAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateUserPayloadGetPasswordAttributeTypeOk(arg CreateUserPayloadGetPasswordAttributeType) (ret CreateUserPayloadGetPasswordRetType, 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 setCreateUserPayloadGetPasswordAttributeType(arg *CreateUserPayloadGetPasswordAttributeType, val CreateUserPayloadGetPasswordRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadGetPasswordArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadGetPasswordRetType = string + +/* + types and functions for username +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadGetUsernameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateUserPayloadGetUsernameAttributeTypeOk(arg CreateUserPayloadGetUsernameAttributeType) (ret CreateUserPayloadGetUsernameRetType, 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 setCreateUserPayloadGetUsernameAttributeType(arg *CreateUserPayloadGetUsernameAttributeType, val CreateUserPayloadGetUsernameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadGetUsernameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadGetUsernameRetType = string + +// CreateUserPayload Request a STACKIT Git instance User 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 CreateUserPayload struct { + // A user chosen email to distinguish multiple STACKIT Git instance Users. + // REQUIRED + Email CreateUserPayloadGetEmailAttributeType `json:"email" required:"true"` + // Whether to force sending a reset password email. + ForceSendResetPassword CreateUserPayloadgetForceSendResetPasswordAttributeType `json:"force_send_reset_password,omitempty"` + // Name of the user. + // REQUIRED + Name CreateUserPayloadGetNameAttributeType `json:"name" required:"true"` + // A user password to allow user/pass instance login. + // REQUIRED + Password CreateUserPayloadGetPasswordAttributeType `json:"password" required:"true"` + // A user chosen username to distinguish multiple STACKIT Git instance Users. + // REQUIRED + Username CreateUserPayloadGetUsernameAttributeType `json:"username" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _CreateUserPayload CreateUserPayload + +// NewCreateUserPayload instantiates a new CreateUserPayload 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 NewCreateUserPayload(email CreateUserPayloadGetEmailArgType, name CreateUserPayloadGetNameArgType, password CreateUserPayloadGetPasswordArgType, username CreateUserPayloadGetUsernameArgType) *CreateUserPayload { + this := CreateUserPayload{} + setCreateUserPayloadGetEmailAttributeType(&this.Email, email) + setCreateUserPayloadGetNameAttributeType(&this.Name, name) + setCreateUserPayloadGetPasswordAttributeType(&this.Password, password) + setCreateUserPayloadGetUsernameAttributeType(&this.Username, username) + return &this +} + +// NewCreateUserPayloadWithDefaults instantiates a new CreateUserPayload 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 NewCreateUserPayloadWithDefaults() *CreateUserPayload { + this := CreateUserPayload{} + var forceSendResetPassword bool = false + this.ForceSendResetPassword = &forceSendResetPassword + return &this +} + +// GetEmail returns the Email field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserPayload) GetEmail() (ret CreateUserPayloadGetEmailRetType) { + ret, _ = o.GetEmailOk() + return ret +} + +// GetEmailOk returns a tuple with the Email field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserPayload) GetEmailOk() (ret CreateUserPayloadGetEmailRetType, ok bool) { + return getCreateUserPayloadGetEmailAttributeTypeOk(o.Email) +} + +// SetEmail sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserPayload) SetEmail(v CreateUserPayloadGetEmailRetType) { + setCreateUserPayloadGetEmailAttributeType(&o.Email, v) +} + +// GetForceSendResetPassword returns the ForceSendResetPassword 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 *CreateUserPayload) GetForceSendResetPassword() (res CreateUserPayloadgetForceSendResetPasswordRetType) { + res, _ = o.GetForceSendResetPasswordOk() + return +} + +// GetForceSendResetPasswordOk returns a tuple with the ForceSendResetPassword 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 *CreateUserPayload) GetForceSendResetPasswordOk() (ret CreateUserPayloadgetForceSendResetPasswordRetType, ok bool) { + return getCreateUserPayloadgetForceSendResetPasswordAttributeTypeOk(o.ForceSendResetPassword) +} + +// HasForceSendResetPassword 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 *CreateUserPayload) HasForceSendResetPassword() bool { + _, ok := o.GetForceSendResetPasswordOk() + return ok +} + +// SetForceSendResetPassword gets a reference to the given bool and assigns it to the ForceSendResetPassword field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserPayload) SetForceSendResetPassword(v CreateUserPayloadgetForceSendResetPasswordRetType) { + setCreateUserPayloadgetForceSendResetPasswordAttributeType(&o.ForceSendResetPassword, 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 *CreateUserPayload) GetName() (ret CreateUserPayloadGetNameRetType) { + 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 *CreateUserPayload) GetNameOk() (ret CreateUserPayloadGetNameRetType, ok bool) { + return getCreateUserPayloadGetNameAttributeTypeOk(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 *CreateUserPayload) SetName(v CreateUserPayloadGetNameRetType) { + setCreateUserPayloadGetNameAttributeType(&o.Name, v) +} + +// GetPassword returns the Password field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserPayload) GetPassword() (ret CreateUserPayloadGetPasswordRetType) { + ret, _ = o.GetPasswordOk() + return ret +} + +// GetPasswordOk returns a tuple with the Password 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 *CreateUserPayload) GetPasswordOk() (ret CreateUserPayloadGetPasswordRetType, ok bool) { + return getCreateUserPayloadGetPasswordAttributeTypeOk(o.Password) +} + +// SetPassword sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserPayload) SetPassword(v CreateUserPayloadGetPasswordRetType) { + setCreateUserPayloadGetPasswordAttributeType(&o.Password, v) +} + +// GetUsername returns the Username field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserPayload) GetUsername() (ret CreateUserPayloadGetUsernameRetType) { + ret, _ = o.GetUsernameOk() + return ret +} + +// GetUsernameOk returns a tuple with the Username 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 *CreateUserPayload) GetUsernameOk() (ret CreateUserPayloadGetUsernameRetType, ok bool) { + return getCreateUserPayloadGetUsernameAttributeTypeOk(o.Username) +} + +// SetUsername sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserPayload) SetUsername(v CreateUserPayloadGetUsernameRetType) { + setCreateUserPayloadGetUsernameAttributeType(&o.Username, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o CreateUserPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateUserPayloadGetEmailAttributeTypeOk(o.Email); ok { + toSerialize["Email"] = val + } + if val, ok := getCreateUserPayloadgetForceSendResetPasswordAttributeTypeOk(o.ForceSendResetPassword); ok { + toSerialize["ForceSendResetPassword"] = val + } + if val, ok := getCreateUserPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getCreateUserPayloadGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val + } + if val, ok := getCreateUserPayloadGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableCreateUserPayload struct { + value *CreateUserPayload + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateUserPayload) Get() *CreateUserPayload { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateUserPayload) Set(val *CreateUserPayload) { + 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 NullableCreateUserPayload) 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 *NullableCreateUserPayload) 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 NewNullableCreateUserPayload(val *CreateUserPayload) *NullableCreateUserPayload { + return &NullableCreateUserPayload{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 NullableCreateUserPayload) 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 *NullableCreateUserPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_create_user_payload_test.go b/services/git/model_create_user_payload_test.go new file mode 100644 index 000000000..e39c866ed --- /dev/null +++ b/services/git/model_create_user_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 index b2255d409..837eb793e 100644 --- a/services/git/model_feature_toggle.go +++ b/services/git/model_feature_toggle.go @@ -173,21 +173,21 @@ func setFeatureToggleGetDefaultEmailNotificationsAttributeType(arg *FeatureToggl } /* - types and functions for enable_commit_signatures + 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 FeatureTogglegetEnableCommitSignaturesAttributeType = *bool +type FeatureTogglegetEnableLocalLoginAttributeType = *bool // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type FeatureTogglegetEnableCommitSignaturesArgType = *bool +type FeatureTogglegetEnableLocalLoginArgType = *bool // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type FeatureTogglegetEnableCommitSignaturesRetType = *bool +type FeatureTogglegetEnableLocalLoginRetType = *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) { +func getFeatureTogglegetEnableLocalLoginAttributeTypeOk(arg FeatureTogglegetEnableLocalLoginAttributeType) (ret FeatureTogglegetEnableLocalLoginRetType, ok bool) { if arg == nil { return nil, false } @@ -195,35 +195,35 @@ func getFeatureTogglegetEnableCommitSignaturesAttributeTypeOk(arg FeatureToggleg } // 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) { +func setFeatureTogglegetEnableLocalLoginAttributeType(arg *FeatureTogglegetEnableLocalLoginAttributeType, val FeatureTogglegetEnableLocalLoginRetType) { *arg = val } /* - types and functions for enable_local_login + types and functions for pipelines */ -// isBoolean +// isModel // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type FeatureTogglegetEnableLocalLoginAttributeType = *bool +type FeatureToggleGetPipelinesAttributeType = *Pipelines // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type FeatureTogglegetEnableLocalLoginArgType = *bool +type FeatureToggleGetPipelinesArgType = Pipelines // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type FeatureTogglegetEnableLocalLoginRetType = *bool +type FeatureToggleGetPipelinesRetType = Pipelines // 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) { +func getFeatureToggleGetPipelinesAttributeTypeOk(arg FeatureToggleGetPipelinesAttributeType) (ret FeatureToggleGetPipelinesRetType, ok bool) { if arg == nil { - return nil, false + return ret, false } - return arg, true + 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 +func setFeatureToggleGetPipelinesAttributeType(arg *FeatureToggleGetPipelinesAttributeType, val FeatureToggleGetPipelinesRetType) { + *arg = &val } // FeatureToggle Feature toggles for the instance. @@ -231,10 +231,9 @@ func setFeatureTogglegetEnableLocalLoginAttributeType(arg *FeatureTogglegetEnabl 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"` + Pipelines FeatureToggleGetPipelinesAttributeType `json:"pipelines,omitempty"` } // NewFeatureToggle instantiates a new FeatureToggle object @@ -296,46 +295,6 @@ 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) { @@ -376,18 +335,45 @@ func (o *FeatureToggle) UnsetEnableLocalLogin() { o.EnableLocalLogin = nil } +// GetPipelines returns the Pipelines 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 *FeatureToggle) GetPipelines() (res FeatureToggleGetPipelinesRetType) { + res, _ = o.GetPipelinesOk() + return +} + +// GetPipelinesOk returns a tuple with the Pipelines 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 *FeatureToggle) GetPipelinesOk() (ret FeatureToggleGetPipelinesRetType, ok bool) { + return getFeatureToggleGetPipelinesAttributeTypeOk(o.Pipelines) +} + +// HasPipelines 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) HasPipelines() bool { + _, ok := o.GetPipelinesOk() + return ok +} + +// SetPipelines gets a reference to the given Pipelines and assigns it to the Pipelines field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FeatureToggle) SetPipelines(v FeatureToggleGetPipelinesRetType) { + setFeatureToggleGetPipelinesAttributeType(&o.Pipelines, v) +} + // 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 } + if val, ok := getFeatureToggleGetPipelinesAttributeTypeOk(o.Pipelines); ok { + toSerialize["Pipelines"] = val + } return toSerialize, nil } diff --git a/services/git/model_instance.go b/services/git/model_instance.go index 661e2d7fa..54099dc00 100644 --- a/services/git/model_instance.go +++ b/services/git/model_instance.go @@ -47,6 +47,33 @@ func setInstanceGetAclAttributeType(arg *InstanceGetAclAttributeType, val Instan *arg = &val } +/* + types and functions for admin_login +*/ + +// isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstancegetAdminLoginAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstancegetAdminLoginArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstancegetAdminLoginRetType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getInstancegetAdminLoginAttributeTypeOk(arg InstancegetAdminLoginAttributeType) (ret InstancegetAdminLoginRetType, 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 setInstancegetAdminLoginAttributeType(arg *InstancegetAdminLoginAttributeType, val InstancegetAdminLoginRetType) { + *arg = &val +} + /* types and functions for consumed_disk */ @@ -209,6 +236,33 @@ type InstanceGetIdArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetIdRetType = string +/* + types and functions for labels +*/ + +// isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceGetLabelsAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceGetLabelsArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceGetLabelsRetType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getInstanceGetLabelsAttributeTypeOk(arg InstanceGetLabelsAttributeType) (ret InstanceGetLabelsRetType, 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 setInstanceGetLabelsAttributeType(arg *InstanceGetLabelsAttributeType, val InstanceGetLabelsRetType) { + *arg = &val +} + /* types and functions for name */ @@ -455,6 +509,9 @@ type Instance struct { // Restricted ACL for instance access. // REQUIRED Acl InstanceGetAclAttributeType `json:"acl" required:"true"` + // Enable or disable Admin Idp + // REQUIRED + AdminLogin InstancegetAdminLoginAttributeType `json:"admin_login" required:"true"` // How many bytes of disk space is consumed. Read Only. // REQUIRED ConsumedDisk InstanceGetConsumedDiskAttributeType `json:"consumed_disk" required:"true"` @@ -472,6 +529,8 @@ type Instance struct { // A auto generated unique id which identifies the STACKIT Git instances. // REQUIRED Id InstanceGetIdAttributeType `json:"id" required:"true"` + // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. The `stackit-` prefix is reserved and cannot be used for Keys. + Labels InstanceGetLabelsAttributeType `json:"labels,omitempty"` // A user chosen name to distinguish multiple STACKIT Git instances. // REQUIRED Name InstanceGetNameAttributeType `json:"name" required:"true"` @@ -494,9 +553,10 @@ type _Instance Instance // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstance(acl InstanceGetAclArgType, consumedDisk InstanceGetConsumedDiskArgType, consumedObjectStorage InstanceGetConsumedObjectStorageArgType, created InstanceGetCreatedArgType, featureToggle InstanceGetFeatureToggleArgType, flavor InstanceGetFlavorArgType, id InstanceGetIdArgType, name InstanceGetNameArgType, state InstanceGetStateArgType, url InstanceGetUrlArgType, version InstanceGetVersionArgType) *Instance { +func NewInstance(acl InstanceGetAclArgType, adminLogin InstancegetAdminLoginArgType, 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) + setInstancegetAdminLoginAttributeType(&this.AdminLogin, adminLogin) setInstanceGetConsumedDiskAttributeType(&this.ConsumedDisk, consumedDisk) setInstanceGetConsumedObjectStorageAttributeType(&this.ConsumedObjectStorage, consumedObjectStorage) setInstanceGetCreatedAttributeType(&this.Created, created) @@ -516,6 +576,8 @@ func NewInstance(acl InstanceGetAclArgType, consumedDisk InstanceGetConsumedDisk // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewInstanceWithDefaults() *Instance { this := Instance{} + var adminLogin bool = false + this.AdminLogin = &adminLogin return &this } @@ -539,6 +601,26 @@ func (o *Instance) SetAcl(v InstanceGetAclRetType) { setInstanceGetAclAttributeType(&o.Acl, v) } +// GetAdminLogin returns the AdminLogin field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Instance) GetAdminLogin() (ret InstancegetAdminLoginRetType) { + ret, _ = o.GetAdminLoginOk() + return ret +} + +// GetAdminLoginOk returns a tuple with the AdminLogin 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) GetAdminLoginOk() (ret InstancegetAdminLoginRetType, ok bool) { + return getInstancegetAdminLoginAttributeTypeOk(o.AdminLogin) +} + +// SetAdminLogin 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) SetAdminLogin(v InstancegetAdminLoginRetType) { + setInstancegetAdminLoginAttributeType(&o.AdminLogin, 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) { @@ -659,6 +741,33 @@ func (o *Instance) SetId(v InstanceGetIdRetType) { setInstanceGetIdAttributeType(&o.Id, v) } +// GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Instance) GetLabels() (res InstanceGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Instance) GetLabelsOk() (ret InstanceGetLabelsRetType, ok bool) { + return getInstanceGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Instance) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Instance) SetLabels(v InstanceGetLabelsRetType) { + setInstanceGetLabelsAttributeType(&o.Labels, 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) { @@ -745,6 +854,9 @@ func (o Instance) ToMap() (map[string]interface{}, error) { if val, ok := getInstanceGetAclAttributeTypeOk(o.Acl); ok { toSerialize["Acl"] = val } + if val, ok := getInstancegetAdminLoginAttributeTypeOk(o.AdminLogin); ok { + toSerialize["AdminLogin"] = val + } if val, ok := getInstanceGetConsumedDiskAttributeTypeOk(o.ConsumedDisk); ok { toSerialize["ConsumedDisk"] = val } @@ -763,6 +875,9 @@ func (o Instance) ToMap() (map[string]interface{}, error) { if val, ok := getInstanceGetIdAttributeTypeOk(o.Id); ok { toSerialize["Id"] = val } + if val, ok := getInstanceGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } if val, ok := getInstanceGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } diff --git a/services/git/model_list_users.go b/services/git/model_list_users.go new file mode 100644 index 000000000..a976e3531 --- /dev/null +++ b/services/git/model_list_users.go @@ -0,0 +1,311 @@ +/* +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 ListUsers type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListUsers{} + +/* + types and functions for itemsCount +*/ + +// isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListUsersGetItemsCountAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListUsersGetItemsCountArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListUsersGetItemsCountRetType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getListUsersGetItemsCountAttributeTypeOk(arg ListUsersGetItemsCountAttributeType) (ret ListUsersGetItemsCountRetType, 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 setListUsersGetItemsCountAttributeType(arg *ListUsersGetItemsCountAttributeType, val ListUsersGetItemsCountRetType) { + *arg = &val +} + +/* + types and functions for offset +*/ + +// isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListUsersGetOffsetAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListUsersGetOffsetArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListUsersGetOffsetRetType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getListUsersGetOffsetAttributeTypeOk(arg ListUsersGetOffsetAttributeType) (ret ListUsersGetOffsetRetType, 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 setListUsersGetOffsetAttributeType(arg *ListUsersGetOffsetAttributeType, val ListUsersGetOffsetRetType) { + *arg = &val +} + +/* + types and functions for totalPages +*/ + +// isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListUsersGetTotalPagesAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListUsersGetTotalPagesArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListUsersGetTotalPagesRetType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getListUsersGetTotalPagesAttributeTypeOk(arg ListUsersGetTotalPagesAttributeType) (ret ListUsersGetTotalPagesRetType, 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 setListUsersGetTotalPagesAttributeType(arg *ListUsersGetTotalPagesAttributeType, val ListUsersGetTotalPagesRetType) { + *arg = &val +} + +/* + types and functions for users +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListUsersGetUsersAttributeType = *[]User + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListUsersGetUsersArgType = []User + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListUsersGetUsersRetType = []User + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getListUsersGetUsersAttributeTypeOk(arg ListUsersGetUsersAttributeType) (ret ListUsersGetUsersRetType, 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 setListUsersGetUsersAttributeType(arg *ListUsersGetUsersAttributeType, val ListUsersGetUsersRetType) { + *arg = &val +} + +// ListUsers A paginated list of STACKIT Git instance Users. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListUsers struct { + // Number of users returned in this page. + // REQUIRED + ItemsCount ListUsersGetItemsCountAttributeType `json:"itemsCount" required:"true"` + // Zero-based index of the first item in this page. + // REQUIRED + Offset ListUsersGetOffsetAttributeType `json:"offset" required:"true"` + // Total number of pages available based on the fixed page size of 50. + // REQUIRED + TotalPages ListUsersGetTotalPagesAttributeType `json:"totalPages" required:"true"` + // REQUIRED + Users ListUsersGetUsersAttributeType `json:"users" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _ListUsers ListUsers + +// NewListUsers instantiates a new ListUsers 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 NewListUsers(itemsCount ListUsersGetItemsCountArgType, offset ListUsersGetOffsetArgType, totalPages ListUsersGetTotalPagesArgType, users ListUsersGetUsersArgType) *ListUsers { + this := ListUsers{} + setListUsersGetItemsCountAttributeType(&this.ItemsCount, itemsCount) + setListUsersGetOffsetAttributeType(&this.Offset, offset) + setListUsersGetTotalPagesAttributeType(&this.TotalPages, totalPages) + setListUsersGetUsersAttributeType(&this.Users, users) + return &this +} + +// NewListUsersWithDefaults instantiates a new ListUsers 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 NewListUsersWithDefaults() *ListUsers { + this := ListUsers{} + return &this +} + +// GetItemsCount returns the ItemsCount field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListUsers) GetItemsCount() (ret ListUsersGetItemsCountRetType) { + ret, _ = o.GetItemsCountOk() + return ret +} + +// GetItemsCountOk returns a tuple with the ItemsCount 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 *ListUsers) GetItemsCountOk() (ret ListUsersGetItemsCountRetType, ok bool) { + return getListUsersGetItemsCountAttributeTypeOk(o.ItemsCount) +} + +// SetItemsCount sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListUsers) SetItemsCount(v ListUsersGetItemsCountRetType) { + setListUsersGetItemsCountAttributeType(&o.ItemsCount, v) +} + +// GetOffset returns the Offset field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListUsers) GetOffset() (ret ListUsersGetOffsetRetType) { + ret, _ = o.GetOffsetOk() + return ret +} + +// GetOffsetOk returns a tuple with the Offset 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 *ListUsers) GetOffsetOk() (ret ListUsersGetOffsetRetType, ok bool) { + return getListUsersGetOffsetAttributeTypeOk(o.Offset) +} + +// SetOffset sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListUsers) SetOffset(v ListUsersGetOffsetRetType) { + setListUsersGetOffsetAttributeType(&o.Offset, v) +} + +// GetTotalPages returns the TotalPages field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListUsers) GetTotalPages() (ret ListUsersGetTotalPagesRetType) { + ret, _ = o.GetTotalPagesOk() + return ret +} + +// GetTotalPagesOk returns a tuple with the TotalPages 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 *ListUsers) GetTotalPagesOk() (ret ListUsersGetTotalPagesRetType, ok bool) { + return getListUsersGetTotalPagesAttributeTypeOk(o.TotalPages) +} + +// SetTotalPages sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListUsers) SetTotalPages(v ListUsersGetTotalPagesRetType) { + setListUsersGetTotalPagesAttributeType(&o.TotalPages, v) +} + +// GetUsers returns the Users field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListUsers) GetUsers() (ret ListUsersGetUsersRetType) { + ret, _ = o.GetUsersOk() + return ret +} + +// GetUsersOk returns a tuple with the Users 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 *ListUsers) GetUsersOk() (ret ListUsersGetUsersRetType, ok bool) { + return getListUsersGetUsersAttributeTypeOk(o.Users) +} + +// SetUsers sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListUsers) SetUsers(v ListUsersGetUsersRetType) { + setListUsersGetUsersAttributeType(&o.Users, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o ListUsers) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getListUsersGetItemsCountAttributeTypeOk(o.ItemsCount); ok { + toSerialize["ItemsCount"] = val + } + if val, ok := getListUsersGetOffsetAttributeTypeOk(o.Offset); ok { + toSerialize["Offset"] = val + } + if val, ok := getListUsersGetTotalPagesAttributeTypeOk(o.TotalPages); ok { + toSerialize["TotalPages"] = val + } + if val, ok := getListUsersGetUsersAttributeTypeOk(o.Users); ok { + toSerialize["Users"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableListUsers struct { + value *ListUsers + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableListUsers) Get() *ListUsers { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableListUsers) Set(val *ListUsers) { + 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 NullableListUsers) 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 *NullableListUsers) 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 NewNullableListUsers(val *ListUsers) *NullableListUsers { + return &NullableListUsers{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 NullableListUsers) 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 *NullableListUsers) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_list_users_test.go b/services/git/model_list_users_test.go new file mode 100644 index 000000000..e39c866ed --- /dev/null +++ b/services/git/model_list_users_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 dd514da4a..82689cdea 100644 --- a/services/git/model_patch_instance_payload.go +++ b/services/git/model_patch_instance_payload.go @@ -45,6 +45,33 @@ func setPatchInstancePayloadGetAclAttributeType(arg *PatchInstancePayloadGetAclA *arg = val } +/* + types and functions for admin_login +*/ + +// isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchInstancePayloadgetAdminLoginAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchInstancePayloadgetAdminLoginArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchInstancePayloadgetAdminLoginRetType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getPatchInstancePayloadgetAdminLoginAttributeTypeOk(arg PatchInstancePayloadgetAdminLoginAttributeType) (ret PatchInstancePayloadgetAdminLoginRetType, 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 setPatchInstancePayloadgetAdminLoginAttributeType(arg *PatchInstancePayloadgetAdminLoginAttributeType, val PatchInstancePayloadgetAdminLoginRetType) { + *arg = &val +} + /* types and functions for feature_toggle */ @@ -72,12 +99,43 @@ func setPatchInstancePayloadGetFeatureToggleAttributeType(arg *PatchInstancePayl *arg = &val } +/* + types and functions for labels +*/ + +// isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchInstancePayloadGetLabelsAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchInstancePayloadGetLabelsArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchInstancePayloadGetLabelsRetType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getPatchInstancePayloadGetLabelsAttributeTypeOk(arg PatchInstancePayloadGetLabelsAttributeType) (ret PatchInstancePayloadGetLabelsRetType, 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 setPatchInstancePayloadGetLabelsAttributeType(arg *PatchInstancePayloadGetLabelsAttributeType, val PatchInstancePayloadGetLabelsRetType) { + *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"` + // Enable Admin IdP + AdminLogin PatchInstancePayloadgetAdminLoginAttributeType `json:"admin_login,omitempty"` FeatureToggle PatchInstancePayloadGetFeatureToggleAttributeType `json:"feature_toggle,omitempty"` + // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. The `stackit-` prefix is reserved and cannot be used for Keys. + Labels PatchInstancePayloadGetLabelsAttributeType `json:"labels,omitempty"` } // NewPatchInstancePayload instantiates a new PatchInstancePayload object @@ -127,6 +185,33 @@ func (o *PatchInstancePayload) SetAcl(v PatchInstancePayloadGetAclRetType) { setPatchInstancePayloadGetAclAttributeType(&o.Acl, v) } +// GetAdminLogin returns the AdminLogin 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) GetAdminLogin() (res PatchInstancePayloadgetAdminLoginRetType) { + res, _ = o.GetAdminLoginOk() + return +} + +// GetAdminLoginOk returns a tuple with the AdminLogin 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) GetAdminLoginOk() (ret PatchInstancePayloadgetAdminLoginRetType, ok bool) { + return getPatchInstancePayloadgetAdminLoginAttributeTypeOk(o.AdminLogin) +} + +// HasAdminLogin 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) HasAdminLogin() bool { + _, ok := o.GetAdminLoginOk() + return ok +} + +// SetAdminLogin gets a reference to the given bool and assigns it to the AdminLogin field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *PatchInstancePayload) SetAdminLogin(v PatchInstancePayloadgetAdminLoginRetType) { + setPatchInstancePayloadgetAdminLoginAttributeType(&o.AdminLogin, 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) { @@ -154,15 +239,48 @@ func (o *PatchInstancePayload) SetFeatureToggle(v PatchInstancePayloadGetFeature setPatchInstancePayloadGetFeatureToggleAttributeType(&o.FeatureToggle, v) } +// GetLabels returns the Labels 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) GetLabels() (res PatchInstancePayloadGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels 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) GetLabelsOk() (ret PatchInstancePayloadGetLabelsRetType, ok bool) { + return getPatchInstancePayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels 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) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *PatchInstancePayload) SetLabels(v PatchInstancePayloadGetLabelsRetType) { + setPatchInstancePayloadGetLabelsAttributeType(&o.Labels, 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 := getPatchInstancePayloadgetAdminLoginAttributeTypeOk(o.AdminLogin); ok { + toSerialize["AdminLogin"] = val + } if val, ok := getPatchInstancePayloadGetFeatureToggleAttributeTypeOk(o.FeatureToggle); ok { toSerialize["FeatureToggle"] = val } + if val, ok := getPatchInstancePayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } return toSerialize, nil } diff --git a/services/git/model_pipelines.go b/services/git/model_pipelines.go new file mode 100644 index 000000000..550ef3298 --- /dev/null +++ b/services/git/model_pipelines.go @@ -0,0 +1,241 @@ +/* +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 Pipelines type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Pipelines{} + +/* + types and functions for action_url +*/ + +// isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PipelinesGetActionUrlAttributeType = *NullableString + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getPipelinesGetActionUrlAttributeTypeOk(arg PipelinesGetActionUrlAttributeType) (ret PipelinesGetActionUrlRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setPipelinesGetActionUrlAttributeType(arg *PipelinesGetActionUrlAttributeType, val PipelinesGetActionUrlRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PipelinesGetActionUrlArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PipelinesGetActionUrlRetType = *string + +/* + types and functions for enabled +*/ + +// isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PipelinesgetEnabledAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PipelinesgetEnabledArgType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PipelinesgetEnabledRetType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getPipelinesgetEnabledAttributeTypeOk(arg PipelinesgetEnabledAttributeType) (ret PipelinesgetEnabledRetType, 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 setPipelinesgetEnabledAttributeType(arg *PipelinesgetEnabledAttributeType, val PipelinesgetEnabledRetType) { + *arg = val +} + +// Pipelines Feature toggles for instance pipelines +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type Pipelines struct { + // The action URL for the pipelines + ActionUrl PipelinesGetActionUrlAttributeType `json:"action_url,omitempty"` + // Enable pipelines for this instance + Enabled PipelinesgetEnabledAttributeType `json:"enabled,omitempty"` +} + +// NewPipelines instantiates a new Pipelines 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 NewPipelines() *Pipelines { + this := Pipelines{} + return &this +} + +// NewPipelinesWithDefaults instantiates a new Pipelines 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 NewPipelinesWithDefaults() *Pipelines { + this := Pipelines{} + return &this +} + +// GetActionUrl returns the ActionUrl 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 *Pipelines) GetActionUrl() (res PipelinesGetActionUrlRetType) { + res, _ = o.GetActionUrlOk() + return +} + +// GetActionUrlOk returns a tuple with the ActionUrl 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 *Pipelines) GetActionUrlOk() (ret PipelinesGetActionUrlRetType, ok bool) { + return getPipelinesGetActionUrlAttributeTypeOk(o.ActionUrl) +} + +// HasActionUrl 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 *Pipelines) HasActionUrl() bool { + _, ok := o.GetActionUrlOk() + return ok +} + +// SetActionUrl gets a reference to the given string and assigns it to the ActionUrl field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Pipelines) SetActionUrl(v PipelinesGetActionUrlRetType) { + setPipelinesGetActionUrlAttributeType(&o.ActionUrl, v) +} + +// SetActionUrlNil sets the value for ActionUrl 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 *Pipelines) SetActionUrlNil() { + o.ActionUrl = nil +} + +// UnsetActionUrl ensures that no value is present for ActionUrl, 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 *Pipelines) UnsetActionUrl() { + o.ActionUrl = nil +} + +// GetEnabled returns the Enabled 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 *Pipelines) GetEnabled() (res PipelinesgetEnabledRetType) { + res, _ = o.GetEnabledOk() + return +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +// 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 *Pipelines) GetEnabledOk() (ret PipelinesgetEnabledRetType, ok bool) { + return getPipelinesgetEnabledAttributeTypeOk(o.Enabled) +} + +// HasEnabled returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Pipelines) HasEnabled() bool { + _, ok := o.GetEnabledOk() + return ok +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Pipelines) SetEnabled(v PipelinesgetEnabledRetType) { + setPipelinesgetEnabledAttributeType(&o.Enabled, v) +} + +// SetEnabledNil sets the value for Enabled 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 *Pipelines) SetEnabledNil() { + o.Enabled = nil +} + +// UnsetEnabled ensures that no value is present for Enabled, 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 *Pipelines) UnsetEnabled() { + o.Enabled = nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o Pipelines) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getPipelinesGetActionUrlAttributeTypeOk(o.ActionUrl); ok { + toSerialize["ActionUrl"] = val + } + if val, ok := getPipelinesgetEnabledAttributeTypeOk(o.Enabled); ok { + toSerialize["Enabled"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullablePipelines struct { + value *Pipelines + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullablePipelines) Get() *Pipelines { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullablePipelines) Set(val *Pipelines) { + 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 NullablePipelines) 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 *NullablePipelines) 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 NewNullablePipelines(val *Pipelines) *NullablePipelines { + return &NullablePipelines{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 NullablePipelines) 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 *NullablePipelines) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_pipelines_test.go b/services/git/model_pipelines_test.go new file mode 100644 index 000000000..e39c866ed --- /dev/null +++ b/services/git/model_pipelines_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.go b/services/git/model_runner_runtime.go index 36e2e7c98..a1a1f16e4 100644 --- a/services/git/model_runner_runtime.go +++ b/services/git/model_runner_runtime.go @@ -159,7 +159,7 @@ 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. + // Human-friendly description of the runtime and its capabilities. // REQUIRED Description RunnerRuntimeGetDescriptionAttributeType `json:"description" required:"true"` // Human-friendly name of the runtime. diff --git a/services/git/model_update_user_payload.go b/services/git/model_update_user_payload.go new file mode 100644 index 000000000..9556386a8 --- /dev/null +++ b/services/git/model_update_user_payload.go @@ -0,0 +1,270 @@ +/* +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 UpdateUserPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateUserPayload{} + +/* + types and functions for email +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateUserPayloadGetEmailAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getUpdateUserPayloadGetEmailAttributeTypeOk(arg UpdateUserPayloadGetEmailAttributeType) (ret UpdateUserPayloadGetEmailRetType, 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 setUpdateUserPayloadGetEmailAttributeType(arg *UpdateUserPayloadGetEmailAttributeType, val UpdateUserPayloadGetEmailRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateUserPayloadGetEmailArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateUserPayloadGetEmailRetType = 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 UpdateUserPayloadGetNameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getUpdateUserPayloadGetNameAttributeTypeOk(arg UpdateUserPayloadGetNameAttributeType) (ret UpdateUserPayloadGetNameRetType, 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 setUpdateUserPayloadGetNameAttributeType(arg *UpdateUserPayloadGetNameAttributeType, val UpdateUserPayloadGetNameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateUserPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateUserPayloadGetNameRetType = string + +/* + types and functions for password +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateUserPayloadGetPasswordAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getUpdateUserPayloadGetPasswordAttributeTypeOk(arg UpdateUserPayloadGetPasswordAttributeType) (ret UpdateUserPayloadGetPasswordRetType, 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 setUpdateUserPayloadGetPasswordAttributeType(arg *UpdateUserPayloadGetPasswordAttributeType, val UpdateUserPayloadGetPasswordRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateUserPayloadGetPasswordArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateUserPayloadGetPasswordRetType = string + +// UpdateUserPayload Properties to update a Instance User. All fields are optional. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateUserPayload struct { + // A user chosen email to distinguish multiple STACKIT Git instance Users. + Email UpdateUserPayloadGetEmailAttributeType `json:"email,omitempty"` + // Name of the user. + Name UpdateUserPayloadGetNameAttributeType `json:"name,omitempty"` + // A user password to allow user/pass instance login. + Password UpdateUserPayloadGetPasswordAttributeType `json:"password,omitempty"` +} + +// NewUpdateUserPayload instantiates a new UpdateUserPayload 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 NewUpdateUserPayload() *UpdateUserPayload { + this := UpdateUserPayload{} + return &this +} + +// NewUpdateUserPayloadWithDefaults instantiates a new UpdateUserPayload 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 NewUpdateUserPayloadWithDefaults() *UpdateUserPayload { + this := UpdateUserPayload{} + return &this +} + +// GetEmail returns the Email 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 *UpdateUserPayload) GetEmail() (res UpdateUserPayloadGetEmailRetType) { + res, _ = o.GetEmailOk() + return +} + +// GetEmailOk returns a tuple with the Email 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 *UpdateUserPayload) GetEmailOk() (ret UpdateUserPayloadGetEmailRetType, ok bool) { + return getUpdateUserPayloadGetEmailAttributeTypeOk(o.Email) +} + +// HasEmail 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 *UpdateUserPayload) HasEmail() bool { + _, ok := o.GetEmailOk() + return ok +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UpdateUserPayload) SetEmail(v UpdateUserPayloadGetEmailRetType) { + setUpdateUserPayloadGetEmailAttributeType(&o.Email, v) +} + +// GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UpdateUserPayload) GetName() (res UpdateUserPayloadGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UpdateUserPayload) GetNameOk() (ret UpdateUserPayloadGetNameRetType, ok bool) { + return getUpdateUserPayloadGetNameAttributeTypeOk(o.Name) +} + +// HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UpdateUserPayload) HasName() bool { + _, ok := o.GetNameOk() + return ok +} + +// SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UpdateUserPayload) SetName(v UpdateUserPayloadGetNameRetType) { + setUpdateUserPayloadGetNameAttributeType(&o.Name, v) +} + +// GetPassword returns the Password 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 *UpdateUserPayload) GetPassword() (res UpdateUserPayloadGetPasswordRetType) { + res, _ = o.GetPasswordOk() + return +} + +// GetPasswordOk returns a tuple with the Password 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 *UpdateUserPayload) GetPasswordOk() (ret UpdateUserPayloadGetPasswordRetType, ok bool) { + return getUpdateUserPayloadGetPasswordAttributeTypeOk(o.Password) +} + +// HasPassword 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 *UpdateUserPayload) HasPassword() bool { + _, ok := o.GetPasswordOk() + return ok +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UpdateUserPayload) SetPassword(v UpdateUserPayloadGetPasswordRetType) { + setUpdateUserPayloadGetPasswordAttributeType(&o.Password, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o UpdateUserPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateUserPayloadGetEmailAttributeTypeOk(o.Email); ok { + toSerialize["Email"] = val + } + if val, ok := getUpdateUserPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getUpdateUserPayloadGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableUpdateUserPayload struct { + value *UpdateUserPayload + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableUpdateUserPayload) Get() *UpdateUserPayload { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableUpdateUserPayload) Set(val *UpdateUserPayload) { + 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 NullableUpdateUserPayload) 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 *NullableUpdateUserPayload) 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 NewNullableUpdateUserPayload(val *UpdateUserPayload) *NullableUpdateUserPayload { + return &NullableUpdateUserPayload{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 NullableUpdateUserPayload) 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 *NullableUpdateUserPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_update_user_payload_test.go b/services/git/model_update_user_payload_test.go new file mode 100644 index 000000000..e39c866ed --- /dev/null +++ b/services/git/model_update_user_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_user.go b/services/git/model_user.go new file mode 100644 index 000000000..98cdf503b --- /dev/null +++ b/services/git/model_user.go @@ -0,0 +1,317 @@ +/* +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 User type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &User{} + +/* + types and functions for email +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UserGetEmailAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getUserGetEmailAttributeTypeOk(arg UserGetEmailAttributeType) (ret UserGetEmailRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setUserGetEmailAttributeType(arg *UserGetEmailAttributeType, val UserGetEmailRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UserGetEmailArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UserGetEmailRetType = string + +/* + types and functions for id +*/ + +// isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UserGetIdAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UserGetIdArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UserGetIdRetType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getUserGetIdAttributeTypeOk(arg UserGetIdAttributeType) (ret UserGetIdRetType, 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 setUserGetIdAttributeType(arg *UserGetIdAttributeType, val UserGetIdRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UserGetNameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getUserGetNameAttributeTypeOk(arg UserGetNameAttributeType) (ret UserGetNameRetType, 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 setUserGetNameAttributeType(arg *UserGetNameAttributeType, val UserGetNameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UserGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UserGetNameRetType = string + +/* + types and functions for username +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UserGetUsernameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getUserGetUsernameAttributeTypeOk(arg UserGetUsernameAttributeType) (ret UserGetUsernameRetType, 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 setUserGetUsernameAttributeType(arg *UserGetUsernameAttributeType, val UserGetUsernameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UserGetUsernameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UserGetUsernameRetType = string + +// User Describes a STACKIT Git instance User. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type User struct { + // A user chosen email to distinguish multiple STACKIT Git instance Users. + // REQUIRED + Email UserGetEmailAttributeType `json:"email" required:"true"` + // A auto generated unique id which identifies the STACKIT Git instances. + Id UserGetIdAttributeType `json:"id,omitempty"` + // Name of the user. + // REQUIRED + Name UserGetNameAttributeType `json:"name" required:"true"` + // A user chosen username to distinguish multiple STACKIT Git instance Users. + // REQUIRED + Username UserGetUsernameAttributeType `json:"username" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _User User + +// NewUser instantiates a new User object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewUser(email UserGetEmailArgType, name UserGetNameArgType, username UserGetUsernameArgType) *User { + this := User{} + setUserGetEmailAttributeType(&this.Email, email) + setUserGetNameAttributeType(&this.Name, name) + setUserGetUsernameAttributeType(&this.Username, username) + return &this +} + +// NewUserWithDefaults instantiates a new User object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewUserWithDefaults() *User { + this := User{} + return &this +} + +// GetEmail returns the Email field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *User) GetEmail() (ret UserGetEmailRetType) { + ret, _ = o.GetEmailOk() + return ret +} + +// GetEmailOk returns a tuple with the Email field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *User) GetEmailOk() (ret UserGetEmailRetType, ok bool) { + return getUserGetEmailAttributeTypeOk(o.Email) +} + +// SetEmail sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *User) SetEmail(v UserGetEmailRetType) { + setUserGetEmailAttributeType(&o.Email, v) +} + +// GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *User) GetId() (res UserGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *User) GetIdOk() (ret UserGetIdRetType, ok bool) { + return getUserGetIdAttributeTypeOk(o.Id) +} + +// HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *User) HasId() bool { + _, ok := o.GetIdOk() + return ok +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *User) SetId(v UserGetIdRetType) { + setUserGetIdAttributeType(&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 *User) GetName() (ret UserGetNameRetType) { + 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 *User) GetNameOk() (ret UserGetNameRetType, ok bool) { + return getUserGetNameAttributeTypeOk(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 *User) SetName(v UserGetNameRetType) { + setUserGetNameAttributeType(&o.Name, v) +} + +// GetUsername returns the Username field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *User) GetUsername() (ret UserGetUsernameRetType) { + ret, _ = o.GetUsernameOk() + return ret +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *User) GetUsernameOk() (ret UserGetUsernameRetType, ok bool) { + return getUserGetUsernameAttributeTypeOk(o.Username) +} + +// SetUsername sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *User) SetUsername(v UserGetUsernameRetType) { + setUserGetUsernameAttributeType(&o.Username, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o User) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUserGetEmailAttributeTypeOk(o.Email); ok { + toSerialize["Email"] = val + } + if val, ok := getUserGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getUserGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getUserGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableUser struct { + value *User + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableUser) Get() *User { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableUser) Set(val *User) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableUser) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableUser) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableUser(val *User) *NullableUser { + return &NullableUser{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_user_test.go b/services/git/model_user_test.go new file mode 100644 index 000000000..e39c866ed --- /dev/null +++ b/services/git/model_user_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/oas_commit b/services/git/oas_commit index c08a6770d..abd8d51b0 100644 --- a/services/git/oas_commit +++ b/services/git/oas_commit @@ -1 +1 @@ -4407196dbbef4e53e6798809e856725cbc84ae05 +46f03c1468dd453695c05e72c088a6bfb5a4bbab diff --git a/services/git/v1betaapi/api_default.go b/services/git/v1betaapi/api_default.go index cbb5762dd..4186841cc 100644 --- a/services/git/v1betaapi/api_default.go +++ b/services/git/v1betaapi/api_default.go @@ -74,6 +74,23 @@ type DefaultAPI interface { // @return Runner CreateRunnerExecute(r ApiCreateRunnerRequest) (*Runner, error) + /* + CreateUser Create an Instance Local/Technical User. + + Creates a new STACKIT Git instance Local/Technical User. + + + @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 ApiCreateUserRequest + */ + CreateUser(ctx context.Context, projectId string, instanceId string) ApiCreateUserRequest + + // CreateUserExecute executes the request + // @return User + CreateUserExecute(r ApiCreateUserRequest) (*User, error) + /* DeleteAuthentication Delete Authentication Source @@ -123,6 +140,23 @@ type DefaultAPI interface { // DeleteRunnerExecute executes the request DeleteRunnerExecute(r ApiDeleteRunnerRequest) error + /* + DeleteUser Delete Instance User. + + Deletes a STACKIT Git instance User 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. + @param username Instance User identifier. + @return ApiDeleteUserRequest + */ + DeleteUser(ctx context.Context, projectId string, instanceId string, username string) ApiDeleteUserRequest + + // DeleteUserExecute executes the request + DeleteUserExecute(r ApiDeleteUserRequest) error + /* GetAuthentication Get authentication provider @@ -173,6 +207,40 @@ type DefaultAPI interface { // @return Runner GetRunnerExecute(r ApiGetRunnerRequest) (*Runner, error) + /* + GetUser Get Instance User information. + + Retrieves information about a STACKIT Git instance User. + + @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 username Instance User identifier. + @return ApiGetUserRequest + */ + GetUser(ctx context.Context, projectId string, instanceId string, username string) ApiGetUserRequest + + // GetUserExecute executes the request + GetUserExecute(r ApiGetUserRequest) error + + /* + GetUsers Get instance Users. + + Lists STACKIT Git Users within an instance. Supports pagination via the + optional `page` query parameter. Each page returns up to 50 users. + + + @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 ApiGetUsersRequest + */ + GetUsers(ctx context.Context, projectId string, instanceId string) ApiGetUsersRequest + + // GetUsersExecute executes the request + // @return ListUsers + GetUsersExecute(r ApiGetUsersRequest) (*ListUsers, error) + /* ListAuthentication List authentication sources @@ -271,6 +339,24 @@ type DefaultAPI interface { // PatchInstanceExecute executes the request // @return Instance PatchInstanceExecute(r ApiPatchInstanceRequest) (*Instance, error) + + /* + UpdateUser Update Instance User. + + Updates the Instance User. + + + @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 username Instance User identifier. + @return ApiUpdateUserRequest + */ + UpdateUser(ctx context.Context, projectId string, instanceId string, username string) ApiUpdateUserRequest + + // UpdateUserExecute executes the request + // @return User + UpdateUserExecute(r ApiUpdateUserRequest) (*User, error) } // DefaultAPIService DefaultAPI service @@ -813,6 +899,181 @@ func (a *DefaultAPIService) CreateRunnerExecute(r ApiCreateRunnerRequest) (*Runn return localVarReturnValue, nil } +type ApiCreateUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + createUserPayload *CreateUserPayload +} + +// Instance User details options. +func (r ApiCreateUserRequest) CreateUserPayload(createUserPayload CreateUserPayload) ApiCreateUserRequest { + r.createUserPayload = &createUserPayload + return r +} + +func (r ApiCreateUserRequest) Execute() (*User, error) { + return r.ApiService.CreateUserExecute(r) +} + +/* +CreateUser Create an Instance Local/Technical User. + +Creates a new STACKIT Git instance Local/Technical User. + + @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 ApiCreateUserRequest +*/ +func (a *DefaultAPIService) CreateUser(ctx context.Context, projectId string, instanceId string) ApiCreateUserRequest { + return ApiCreateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return User +func (a *DefaultAPIService) CreateUserExecute(r ApiCreateUserRequest) (*User, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateUser") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/users" + 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.createUserPayload == nil { + return localVarReturnValue, reportError("createUserPayload 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.createUserPayload + 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 + } + 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 + } + 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 + } + + 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 @@ -1295,80 +1556,71 @@ func (a *DefaultAPIService) DeleteRunnerExecute(r ApiDeleteRunnerRequest) error return nil } -type ApiGetAuthenticationRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string - authenticationId string +type ApiDeleteUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + username string } -func (r ApiGetAuthenticationRequest) Execute() (*Authentication, error) { - return r.ApiService.GetAuthenticationExecute(r) +func (r ApiDeleteUserRequest) Execute() error { + return r.ApiService.DeleteUserExecute(r) } /* -GetAuthentication Get authentication provider +DeleteUser Delete Instance User. -# Get authentication provider +Deletes a STACKIT Git instance User 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. - @param authenticationId Authentication Source identifier. - @return ApiGetAuthenticationRequest + @param username Instance User identifier. + @return ApiDeleteUserRequest */ -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, +func (a *DefaultAPIService) DeleteUser(ctx context.Context, projectId string, instanceId string, username string) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + username: username, } } // Execute executes the request -// -// @return Authentication -func (a *DefaultAPIService) GetAuthenticationExecute(r ApiGetAuthenticationRequest) (*Authentication, error) { +func (a *DefaultAPIService) DeleteUserExecute(r ApiDeleteUserRequest) error { var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Authentication + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetAuthentication") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteUser") if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/authentications/{authenticationId}" + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/users/{username}" 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) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -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") + return reportError("projectId must have at least 36 elements") } if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") + return reportError("projectId must have less than 36 elements") } if strlen(r.instanceId) < 36 { - return localVarReturnValue, reportError("instanceId must have at least 36 elements") + return 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") + return reportError("instanceId must have less than 36 elements") } // to determine the Content-Type header @@ -1390,7 +1642,7 @@ func (a *DefaultAPIService) GetAuthenticationExecute(r ApiGetAuthenticationReque } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, err + return err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -1404,7 +1656,485 @@ func (a *DefaultAPIService) GetAuthenticationExecute(r ApiGetAuthenticationReque *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err + 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 + } + 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 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 + } + 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 + } + 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 + } + + 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 + } + 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 + } + 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 + } + + 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) @@ -1421,18 +2151,7 @@ func (a *DefaultAPIService) GetAuthenticationExecute(r ApiGetAuthenticationReque 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 - } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedErrorResponse + var v GenericErrorResponse err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -1443,7 +2162,7 @@ func (a *DefaultAPIService) GetAuthenticationExecute(r ApiGetAuthenticationReque return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 500 { - var v InternalServerErrorResponse + var v GenericErrorResponse err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -1468,70 +2187,71 @@ func (a *DefaultAPIService) GetAuthenticationExecute(r ApiGetAuthenticationReque return localVarReturnValue, nil } -type ApiGetInstanceRequest struct { +type ApiGetUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string instanceId string + username string } -func (r ApiGetInstanceRequest) Execute() (*Instance, error) { - return r.ApiService.GetInstanceExecute(r) +func (r ApiGetUserRequest) Execute() error { + return r.ApiService.GetUserExecute(r) } /* -GetInstance Get Instance information. +GetUser Get Instance User information. -Retrieves information about a STACKIT Git instance. +Retrieves information about a STACKIT Git instance User. @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 + @param username Instance User identifier. + @return ApiGetUserRequest */ -func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest { - return ApiGetInstanceRequest{ +func (a *DefaultAPIService) GetUser(ctx context.Context, projectId string, instanceId string, username string) ApiGetUserRequest { + return ApiGetUserRequest{ ApiService: a, ctx: ctx, projectId: projectId, instanceId: instanceId, + username: username, } } // Execute executes the request -// -// @return Instance -func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) { +func (a *DefaultAPIService) GetUserExecute(r ApiGetUserRequest) error { var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Instance + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetInstance") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetUser") if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/users/{username}" 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, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -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") + return reportError("projectId must have at least 36 elements") } if strlen(r.projectId) > 36 { - return localVarReturnValue, reportError("projectId must have less than 36 elements") + return reportError("projectId must have less than 36 elements") } if strlen(r.instanceId) < 36 { - return localVarReturnValue, reportError("instanceId must have at least 36 elements") + return reportError("instanceId must have at least 36 elements") } if strlen(r.instanceId) > 36 { - return localVarReturnValue, reportError("instanceId must have less than 36 elements") + return reportError("instanceId must have less than 36 elements") } // to determine the Content-Type header @@ -1553,7 +2273,7 @@ func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*Instan } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, err + return err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -1567,14 +2287,14 @@ func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*Instan *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err + return err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, err + return err } if localVarHTTPResponse.StatusCode >= 300 { @@ -1583,77 +2303,75 @@ func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*Instan ErrorMessage: localVarHTTPResponse.Status, StatusCode: localVarHTTPResponse.StatusCode, } - if localVarHTTPResponse.StatusCode == 400 { - var v GenericErrorResponse + if localVarHTTPResponse.StatusCode == 302 { + var v User err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } - if localVarHTTPResponse.StatusCode == 404 { + 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 + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, 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 localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } - 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 newErr } - return localVarReturnValue, nil + return nil } -type ApiGetRunnerRequest struct { +type ApiGetUsersRequest struct { ctx context.Context ApiService DefaultAPI projectId string instanceId string + page *int32 } -func (r ApiGetRunnerRequest) Execute() (*Runner, error) { - return r.ApiService.GetRunnerExecute(r) +// Page number for pagination (1-indexed). Each page contains up to 50 users. +func (r ApiGetUsersRequest) Page(page int32) ApiGetUsersRequest { + r.page = &page + return r +} + +func (r ApiGetUsersRequest) Execute() (*ListUsers, error) { + return r.ApiService.GetUsersExecute(r) } /* -GetRunner Get Runner information. +GetUsers Get instance Users. -Retrieves information about a runner in a STACKIT Git instance. +Lists STACKIT Git Users within an instance. Supports pagination via the +optional `page` query parameter. Each page returns up to 50 users. @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 + @return ApiGetUsersRequest */ -func (a *DefaultAPIService) GetRunner(ctx context.Context, projectId string, instanceId string) ApiGetRunnerRequest { - return ApiGetRunnerRequest{ +func (a *DefaultAPIService) GetUsers(ctx context.Context, projectId string, instanceId string) ApiGetUsersRequest { + return ApiGetUsersRequest{ ApiService: a, ctx: ctx, projectId: projectId, @@ -1663,21 +2381,21 @@ func (a *DefaultAPIService) GetRunner(ctx context.Context, projectId string, ins // Execute executes the request // -// @return Runner -func (a *DefaultAPIService) GetRunnerExecute(r ApiGetRunnerRequest) (*Runner, error) { +// @return ListUsers +func (a *DefaultAPIService) GetUsersExecute(r ApiGetUsersRequest) (*ListUsers, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Runner + localVarReturnValue *ListUsers ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetRunner") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetUsers") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/runner" + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/users" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) @@ -1697,6 +2415,13 @@ func (a *DefaultAPIService) GetRunnerExecute(r ApiGetRunnerRequest) (*Runner, er return localVarReturnValue, reportError("instanceId must have less than 36 elements") } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } else { + var defaultValue int32 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2741,3 +3466,170 @@ func (a *DefaultAPIService) PatchInstanceExecute(r ApiPatchInstanceRequest) (*In return localVarReturnValue, nil } + +type ApiUpdateUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + username string + updateUserPayload *UpdateUserPayload +} + +func (r ApiUpdateUserRequest) UpdateUserPayload(updateUserPayload UpdateUserPayload) ApiUpdateUserRequest { + r.updateUserPayload = &updateUserPayload + return r +} + +func (r ApiUpdateUserRequest) Execute() (*User, error) { + return r.ApiService.UpdateUserExecute(r) +} + +/* +UpdateUser Update Instance User. + +Updates the Instance User. + + @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 username Instance User identifier. + @return ApiUpdateUserRequest +*/ +func (a *DefaultAPIService) UpdateUser(ctx context.Context, projectId string, instanceId string, username string) ApiUpdateUserRequest { + return ApiUpdateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + username: username, + } +} + +// Execute executes the request +// +// @return User +func (a *DefaultAPIService) UpdateUserExecute(r ApiUpdateUserRequest) (*User, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateUser") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/users/{username}" + 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, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -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.updateUserPayload == nil { + return localVarReturnValue, reportError("updateUserPayload 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.updateUserPayload + 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 + } + 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 + } + + 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 index 8bfd62212..642f16fe8 100644 --- a/services/git/v1betaapi/api_default_mock.go +++ b/services/git/v1betaapi/api_default_mock.go @@ -27,18 +27,26 @@ type DefaultAPIServiceMock struct { 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) + // CreateUserExecuteMock can be populated to implement the behavior of the CreateUserExecute function of this mock + CreateUserExecuteMock *func(r ApiCreateUserRequest) (*User, 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 + // DeleteUserExecuteMock can be populated to implement the behavior of the DeleteUserExecute function of this mock + DeleteUserExecuteMock *func(r ApiDeleteUserRequest) 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) + // GetUserExecuteMock can be populated to implement the behavior of the GetUserExecute function of this mock + GetUserExecuteMock *func(r ApiGetUserRequest) error + // GetUsersExecuteMock can be populated to implement the behavior of the GetUsersExecute function of this mock + GetUsersExecuteMock *func(r ApiGetUsersRequest) (*ListUsers, 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 @@ -51,6 +59,8 @@ type DefaultAPIServiceMock struct { 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) + // UpdateUserExecuteMock can be populated to implement the behavior of the UpdateUserExecute function of this mock + UpdateUserExecuteMock *func(r ApiUpdateUserRequest) (*User, error) } func (a DefaultAPIServiceMock) CreateAuthentication(ctx context.Context, projectId string, instanceId string) ApiCreateAuthenticationRequest { @@ -109,6 +119,25 @@ func (a DefaultAPIServiceMock) CreateRunnerExecute(r ApiCreateRunnerRequest) (*R return (*a.CreateRunnerExecuteMock)(r) } +func (a DefaultAPIServiceMock) CreateUser(ctx context.Context, projectId string, instanceId string) ApiCreateUserRequest { + return ApiCreateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// CreateUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateUserExecute(r ApiCreateUserRequest) (*User, error) { + if a.CreateUserExecuteMock == nil { + var localVarReturnValue *User + return localVarReturnValue, nil + } + + return (*a.CreateUserExecuteMock)(r) +} + func (a DefaultAPIServiceMock) DeleteAuthentication(ctx context.Context, projectId string, instanceId string, authenticationId string) ApiDeleteAuthenticationRequest { return ApiDeleteAuthenticationRequest{ ApiService: a, @@ -164,6 +193,25 @@ func (a DefaultAPIServiceMock) DeleteRunnerExecute(r ApiDeleteRunnerRequest) err return (*a.DeleteRunnerExecuteMock)(r) } +func (a DefaultAPIServiceMock) DeleteUser(ctx context.Context, projectId string, instanceId string, username string) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + username: username, + } +} + +// DeleteUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteUserExecute(r ApiDeleteUserRequest) error { + if a.DeleteUserExecuteMock == nil { + return nil + } + + return (*a.DeleteUserExecuteMock)(r) +} + func (a DefaultAPIServiceMock) GetAuthentication(ctx context.Context, projectId string, instanceId string, authenticationId string) ApiGetAuthenticationRequest { return ApiGetAuthenticationRequest{ ApiService: a, @@ -222,6 +270,44 @@ func (a DefaultAPIServiceMock) GetRunnerExecute(r ApiGetRunnerRequest) (*Runner, return (*a.GetRunnerExecuteMock)(r) } +func (a DefaultAPIServiceMock) GetUser(ctx context.Context, projectId string, instanceId string, username string) ApiGetUserRequest { + return ApiGetUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + username: username, + } +} + +// GetUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetUserExecute(r ApiGetUserRequest) error { + if a.GetUserExecuteMock == nil { + return nil + } + + return (*a.GetUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetUsers(ctx context.Context, projectId string, instanceId string) ApiGetUsersRequest { + return ApiGetUsersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// GetUsersExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetUsersExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetUsersExecute(r ApiGetUsersRequest) (*ListUsers, error) { + if a.GetUsersExecuteMock == nil { + var localVarReturnValue *ListUsers + return localVarReturnValue, nil + } + + return (*a.GetUsersExecuteMock)(r) +} + func (a DefaultAPIServiceMock) ListAuthentication(ctx context.Context, projectId string, instanceId string) ApiListAuthenticationRequest { return ApiListAuthenticationRequest{ ApiService: a, @@ -333,3 +419,23 @@ func (a DefaultAPIServiceMock) PatchInstanceExecute(r ApiPatchInstanceRequest) ( return (*a.PatchInstanceExecuteMock)(r) } + +func (a DefaultAPIServiceMock) UpdateUser(ctx context.Context, projectId string, instanceId string, username string) ApiUpdateUserRequest { + return ApiUpdateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + username: username, + } +} + +// UpdateUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateUserExecute(r ApiUpdateUserRequest) (*User, error) { + if a.UpdateUserExecuteMock == nil { + var localVarReturnValue *User + return localVarReturnValue, nil + } + + return (*a.UpdateUserExecuteMock)(r) +} diff --git a/services/git/v1betaapi/model_authentication.go b/services/git/v1betaapi/model_authentication.go index c741fae71..31cee068c 100644 --- a/services/git/v1betaapi/model_authentication.go +++ b/services/git/v1betaapi/model_authentication.go @@ -37,9 +37,10 @@ type Authentication struct { // 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"` + Scopes string `json:"scopes"` + Status AuthenticationStatus `json:"status"` + // Provides additional information or error details when the status is 'Error'. + StatusMessage *string `json:"status_message,omitempty"` AdditionalProperties map[string]interface{} } @@ -49,7 +50,7 @@ type _Authentication Authentication // 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 { +func NewAuthentication(autoDiscoverUrl string, clientId string, createdAt time.Time, iconUrl string, id string, name string, provider string, scopes string, status AuthenticationStatus) *Authentication { this := Authentication{} this.AutoDiscoverUrl = autoDiscoverUrl this.ClientId = clientId @@ -264,9 +265,9 @@ func (o *Authentication) SetScopes(v string) { } // GetStatus returns the Status field value -func (o *Authentication) GetStatus() string { +func (o *Authentication) GetStatus() AuthenticationStatus { if o == nil { - var ret string + var ret AuthenticationStatus return ret } @@ -275,7 +276,7 @@ func (o *Authentication) GetStatus() string { // 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) { +func (o *Authentication) GetStatusOk() (*AuthenticationStatus, bool) { if o == nil { return nil, false } @@ -283,10 +284,42 @@ func (o *Authentication) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *Authentication) SetStatus(v string) { +func (o *Authentication) SetStatus(v AuthenticationStatus) { o.Status = v } +// GetStatusMessage returns the StatusMessage field value if set, zero value otherwise. +func (o *Authentication) GetStatusMessage() string { + if o == nil || IsNil(o.StatusMessage) { + var ret string + return ret + } + return *o.StatusMessage +} + +// GetStatusMessageOk returns a tuple with the StatusMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Authentication) GetStatusMessageOk() (*string, bool) { + if o == nil || IsNil(o.StatusMessage) { + return nil, false + } + return o.StatusMessage, true +} + +// HasStatusMessage returns a boolean if a field has been set. +func (o *Authentication) HasStatusMessage() bool { + if o != nil && !IsNil(o.StatusMessage) { + return true + } + + return false +} + +// SetStatusMessage gets a reference to the given string and assigns it to the StatusMessage field. +func (o *Authentication) SetStatusMessage(v string) { + o.StatusMessage = &v +} + func (o Authentication) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -306,6 +339,9 @@ func (o Authentication) ToMap() (map[string]interface{}, error) { toSerialize["provider"] = o.Provider toSerialize["scopes"] = o.Scopes toSerialize["status"] = o.Status + if !IsNil(o.StatusMessage) { + toSerialize["status_message"] = o.StatusMessage + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -366,6 +402,7 @@ func (o *Authentication) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "provider") delete(additionalProperties, "scopes") delete(additionalProperties, "status") + delete(additionalProperties, "status_message") o.AdditionalProperties = additionalProperties } diff --git a/services/git/v1betaapi/model_authentication_status.go b/services/git/v1betaapi/model_authentication_status.go new file mode 100644 index 000000000..14fccf4b1 --- /dev/null +++ b/services/git/v1betaapi/model_authentication_status.go @@ -0,0 +1,120 @@ +/* +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" + "fmt" +) + +// AuthenticationStatus The current status of the authentication definition. +type AuthenticationStatus string + +// List of Authentication_status +const ( + AUTHENTICATIONSTATUS_CREATING AuthenticationStatus = "Creating" + AUTHENTICATIONSTATUS_UPDATING AuthenticationStatus = "Updating" + AUTHENTICATIONSTATUS_DELETING AuthenticationStatus = "Deleting" + AUTHENTICATIONSTATUS_READY AuthenticationStatus = "Ready" + AUTHENTICATIONSTATUS_ERROR AuthenticationStatus = "Error" + AUTHENTICATIONSTATUS_UNKNOWN_DEFAULT_OPEN_API AuthenticationStatus = "unknown_default_open_api" +) + +// All allowed values of AuthenticationStatus enum +var AllowedAuthenticationStatusEnumValues = []AuthenticationStatus{ + "Creating", + "Updating", + "Deleting", + "Ready", + "Error", + "unknown_default_open_api", +} + +func (v *AuthenticationStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AuthenticationStatus(value) + for _, existing := range AllowedAuthenticationStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = AUTHENTICATIONSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewAuthenticationStatusFromValue returns a pointer to a valid AuthenticationStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAuthenticationStatusFromValue(v string) (*AuthenticationStatus, error) { + ev := AuthenticationStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AuthenticationStatus: valid values are %v", v, AllowedAuthenticationStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AuthenticationStatus) IsValid() bool { + for _, existing := range AllowedAuthenticationStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Authentication_status value +func (v AuthenticationStatus) Ptr() *AuthenticationStatus { + return &v +} + +type NullableAuthenticationStatus struct { + value *AuthenticationStatus + isSet bool +} + +func (v NullableAuthenticationStatus) Get() *AuthenticationStatus { + return v.value +} + +func (v *NullableAuthenticationStatus) Set(val *AuthenticationStatus) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticationStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticationStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticationStatus(val *AuthenticationStatus) *NullableAuthenticationStatus { + return &NullableAuthenticationStatus{value: val, isSet: true} +} + +func (v NullableAuthenticationStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticationStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_create_user_payload.go b/services/git/v1betaapi/model_create_user_payload.go new file mode 100644 index 000000000..5244259c2 --- /dev/null +++ b/services/git/v1betaapi/model_create_user_payload.go @@ -0,0 +1,300 @@ +/* +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" + "fmt" +) + +// checks if the CreateUserPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateUserPayload{} + +// CreateUserPayload Request a STACKIT Git instance User to be created with these properties. +type CreateUserPayload struct { + // A user chosen email to distinguish multiple STACKIT Git instance Users. + Email string `json:"email"` + // Whether to force sending a reset password email. + ForceSendResetPassword *bool `json:"force_send_reset_password,omitempty"` + // Name of the user. + Name string `json:"name"` + // A user password to allow user/pass instance login. + Password string `json:"password"` + // A user chosen username to distinguish multiple STACKIT Git instance Users. + Username string `json:"username"` + AdditionalProperties map[string]interface{} +} + +type _CreateUserPayload CreateUserPayload + +// NewCreateUserPayload instantiates a new CreateUserPayload 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 NewCreateUserPayload(email string, name string, password string, username string) *CreateUserPayload { + this := CreateUserPayload{} + this.Email = email + var forceSendResetPassword bool = false + this.ForceSendResetPassword = &forceSendResetPassword + this.Name = name + this.Password = password + this.Username = username + return &this +} + +// NewCreateUserPayloadWithDefaults instantiates a new CreateUserPayload 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 NewCreateUserPayloadWithDefaults() *CreateUserPayload { + this := CreateUserPayload{} + var forceSendResetPassword bool = false + this.ForceSendResetPassword = &forceSendResetPassword + return &this +} + +// GetEmail returns the Email field value +func (o *CreateUserPayload) GetEmail() string { + if o == nil { + var ret string + return ret + } + + return o.Email +} + +// GetEmailOk returns a tuple with the Email field value +// and a boolean to check if the value has been set. +func (o *CreateUserPayload) GetEmailOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Email, true +} + +// SetEmail sets field value +func (o *CreateUserPayload) SetEmail(v string) { + o.Email = v +} + +// GetForceSendResetPassword returns the ForceSendResetPassword field value if set, zero value otherwise. +func (o *CreateUserPayload) GetForceSendResetPassword() bool { + if o == nil || IsNil(o.ForceSendResetPassword) { + var ret bool + return ret + } + return *o.ForceSendResetPassword +} + +// GetForceSendResetPasswordOk returns a tuple with the ForceSendResetPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserPayload) GetForceSendResetPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.ForceSendResetPassword) { + return nil, false + } + return o.ForceSendResetPassword, true +} + +// HasForceSendResetPassword returns a boolean if a field has been set. +func (o *CreateUserPayload) HasForceSendResetPassword() bool { + if o != nil && !IsNil(o.ForceSendResetPassword) { + return true + } + + return false +} + +// SetForceSendResetPassword gets a reference to the given bool and assigns it to the ForceSendResetPassword field. +func (o *CreateUserPayload) SetForceSendResetPassword(v bool) { + o.ForceSendResetPassword = &v +} + +// GetName returns the Name field value +func (o *CreateUserPayload) 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 *CreateUserPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateUserPayload) SetName(v string) { + o.Name = v +} + +// GetPassword returns the Password field value +func (o *CreateUserPayload) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *CreateUserPayload) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *CreateUserPayload) SetPassword(v string) { + o.Password = v +} + +// GetUsername returns the Username field value +func (o *CreateUserPayload) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *CreateUserPayload) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *CreateUserPayload) SetUsername(v string) { + o.Username = v +} + +func (o CreateUserPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateUserPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["email"] = o.Email + if !IsNil(o.ForceSendResetPassword) { + toSerialize["force_send_reset_password"] = o.ForceSendResetPassword + } + toSerialize["name"] = o.Name + toSerialize["password"] = o.Password + toSerialize["username"] = o.Username + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateUserPayload) 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{ + "email", + "name", + "password", + "username", + } + + 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) + } + } + + varCreateUserPayload := _CreateUserPayload{} + + err = json.Unmarshal(data, &varCreateUserPayload) + + if err != nil { + return err + } + + *o = CreateUserPayload(varCreateUserPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "email") + delete(additionalProperties, "force_send_reset_password") + delete(additionalProperties, "name") + delete(additionalProperties, "password") + delete(additionalProperties, "username") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateUserPayload struct { + value *CreateUserPayload + isSet bool +} + +func (v NullableCreateUserPayload) Get() *CreateUserPayload { + return v.value +} + +func (v *NullableCreateUserPayload) Set(val *CreateUserPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateUserPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateUserPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateUserPayload(val *CreateUserPayload) *NullableCreateUserPayload { + return &NullableCreateUserPayload{value: val, isSet: true} +} + +func (v NullableCreateUserPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateUserPayload) 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 index f1a63dbaa..ce1097e6e 100644 --- a/services/git/v1betaapi/model_feature_toggle.go +++ b/services/git/v1betaapi/model_feature_toggle.go @@ -21,10 +21,9 @@ var _ MappedNullable = &FeatureToggle{} // FeatureToggle Feature toggles for the instance. type FeatureToggle struct { DefaultEmailNotifications NullableFeatureToggleDefaultEmailNotifications `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"` + Pipelines *Pipelines `json:"pipelines,omitempty"` AdditionalProperties map[string]interface{} } @@ -90,49 +89,6 @@ 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()) { @@ -176,6 +132,38 @@ func (o *FeatureToggle) UnsetEnableLocalLogin() { o.EnableLocalLogin.Unset() } +// GetPipelines returns the Pipelines field value if set, zero value otherwise. +func (o *FeatureToggle) GetPipelines() Pipelines { + if o == nil || IsNil(o.Pipelines) { + var ret Pipelines + return ret + } + return *o.Pipelines +} + +// GetPipelinesOk returns a tuple with the Pipelines field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FeatureToggle) GetPipelinesOk() (*Pipelines, bool) { + if o == nil || IsNil(o.Pipelines) { + return nil, false + } + return o.Pipelines, true +} + +// HasPipelines returns a boolean if a field has been set. +func (o *FeatureToggle) HasPipelines() bool { + if o != nil && !IsNil(o.Pipelines) { + return true + } + + return false +} + +// SetPipelines gets a reference to the given Pipelines and assigns it to the Pipelines field. +func (o *FeatureToggle) SetPipelines(v Pipelines) { + o.Pipelines = &v +} + func (o FeatureToggle) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -189,12 +177,12 @@ func (o FeatureToggle) ToMap() (map[string]interface{}, error) { 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() } + if !IsNil(o.Pipelines) { + toSerialize["pipelines"] = o.Pipelines + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -218,8 +206,8 @@ func (o *FeatureToggle) UnmarshalJSON(data []byte) (err error) { if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "default_email_notifications") - delete(additionalProperties, "enable_commit_signatures") delete(additionalProperties, "enable_local_login") + delete(additionalProperties, "pipelines") o.AdditionalProperties = additionalProperties } diff --git a/services/git/v1betaapi/model_instance.go b/services/git/v1betaapi/model_instance.go index c58adccc1..70a1b4d79 100644 --- a/services/git/v1betaapi/model_instance.go +++ b/services/git/v1betaapi/model_instance.go @@ -24,6 +24,8 @@ var _ MappedNullable = &Instance{} type Instance struct { // Restricted ACL for instance access. Acl []string `json:"acl"` + // Enable or disable Admin Idp + AdminLogin bool `json:"admin_login"` // 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. @@ -35,6 +37,8 @@ type Instance struct { Flavor string `json:"flavor"` // A auto generated unique id which identifies the STACKIT Git instances. Id string `json:"id"` + // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. The `stackit-` prefix is reserved and cannot be used for Keys. + Labels *map[string]string `json:"labels,omitempty"` // A user chosen name to distinguish multiple STACKIT Git instances. Name string `json:"name"` State InstanceState `json:"state"` @@ -51,9 +55,10 @@ type _Instance Instance // 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 InstanceState, url string, version string) *Instance { +func NewInstance(acl []string, adminLogin bool, consumedDisk string, consumedObjectStorage string, created time.Time, featureToggle FeatureToggle, flavor string, id string, name string, state InstanceState, url string, version string) *Instance { this := Instance{} this.Acl = acl + this.AdminLogin = adminLogin this.ConsumedDisk = consumedDisk this.ConsumedObjectStorage = consumedObjectStorage this.Created = created @@ -72,6 +77,8 @@ func NewInstance(acl []string, consumedDisk string, consumedObjectStorage string // but it doesn't guarantee that properties required by API are set func NewInstanceWithDefaults() *Instance { this := Instance{} + var adminLogin bool = false + this.AdminLogin = adminLogin return &this } @@ -99,6 +106,30 @@ func (o *Instance) SetAcl(v []string) { o.Acl = v } +// GetAdminLogin returns the AdminLogin field value +func (o *Instance) GetAdminLogin() bool { + if o == nil { + var ret bool + return ret + } + + return o.AdminLogin +} + +// GetAdminLoginOk returns a tuple with the AdminLogin field value +// and a boolean to check if the value has been set. +func (o *Instance) GetAdminLoginOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.AdminLogin, true +} + +// SetAdminLogin sets field value +func (o *Instance) SetAdminLogin(v bool) { + o.AdminLogin = v +} + // GetConsumedDisk returns the ConsumedDisk field value func (o *Instance) GetConsumedDisk() string { if o == nil { @@ -243,6 +274,38 @@ func (o *Instance) SetId(v string) { o.Id = v } +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Instance) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + return ret + } + return *o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Instance) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *Instance) SetLabels(v map[string]string) { + o.Labels = &v +} + // GetName returns the Name field value func (o *Instance) GetName() string { if o == nil { @@ -350,12 +413,16 @@ func (o Instance) MarshalJSON() ([]byte, error) { func (o Instance) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["acl"] = o.Acl + toSerialize["admin_login"] = o.AdminLogin 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 + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } toSerialize["name"] = o.Name toSerialize["state"] = o.State toSerialize["url"] = o.Url @@ -374,6 +441,7 @@ func (o *Instance) UnmarshalJSON(data []byte) (err error) { // that every required field exists as a key in the generic map. requiredProperties := []string{ "acl", + "admin_login", "consumed_disk", "consumed_object_storage", "created", @@ -414,12 +482,14 @@ func (o *Instance) UnmarshalJSON(data []byte) (err error) { if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "acl") + delete(additionalProperties, "admin_login") delete(additionalProperties, "consumed_disk") delete(additionalProperties, "consumed_object_storage") delete(additionalProperties, "created") delete(additionalProperties, "feature_toggle") delete(additionalProperties, "flavor") delete(additionalProperties, "id") + delete(additionalProperties, "labels") delete(additionalProperties, "name") delete(additionalProperties, "state") delete(additionalProperties, "url") diff --git a/services/git/v1betaapi/model_list_users.go b/services/git/v1betaapi/model_list_users.go new file mode 100644 index 000000000..ba43d1032 --- /dev/null +++ b/services/git/v1betaapi/model_list_users.go @@ -0,0 +1,257 @@ +/* +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" + "fmt" +) + +// checks if the ListUsers type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListUsers{} + +// ListUsers A paginated list of STACKIT Git instance Users. +type ListUsers struct { + // Number of users returned in this page. + ItemsCount int32 `json:"itemsCount"` + // Zero-based index of the first item in this page. + Offset int32 `json:"offset"` + // Total number of pages available based on the fixed page size of 50. + TotalPages int32 `json:"totalPages"` + Users []User `json:"users"` + AdditionalProperties map[string]interface{} +} + +type _ListUsers ListUsers + +// NewListUsers instantiates a new ListUsers 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 NewListUsers(itemsCount int32, offset int32, totalPages int32, users []User) *ListUsers { + this := ListUsers{} + this.ItemsCount = itemsCount + this.Offset = offset + this.TotalPages = totalPages + this.Users = users + return &this +} + +// NewListUsersWithDefaults instantiates a new ListUsers 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 NewListUsersWithDefaults() *ListUsers { + this := ListUsers{} + return &this +} + +// GetItemsCount returns the ItemsCount field value +func (o *ListUsers) GetItemsCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ItemsCount +} + +// GetItemsCountOk returns a tuple with the ItemsCount field value +// and a boolean to check if the value has been set. +func (o *ListUsers) GetItemsCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ItemsCount, true +} + +// SetItemsCount sets field value +func (o *ListUsers) SetItemsCount(v int32) { + o.ItemsCount = v +} + +// GetOffset returns the Offset field value +func (o *ListUsers) GetOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +func (o *ListUsers) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Offset, true +} + +// SetOffset sets field value +func (o *ListUsers) SetOffset(v int32) { + o.Offset = v +} + +// GetTotalPages returns the TotalPages field value +func (o *ListUsers) GetTotalPages() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TotalPages +} + +// GetTotalPagesOk returns a tuple with the TotalPages field value +// and a boolean to check if the value has been set. +func (o *ListUsers) GetTotalPagesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TotalPages, true +} + +// SetTotalPages sets field value +func (o *ListUsers) SetTotalPages(v int32) { + o.TotalPages = v +} + +// GetUsers returns the Users field value +func (o *ListUsers) GetUsers() []User { + if o == nil { + var ret []User + return ret + } + + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value +// and a boolean to check if the value has been set. +func (o *ListUsers) GetUsersOk() ([]User, bool) { + if o == nil { + return nil, false + } + return o.Users, true +} + +// SetUsers sets field value +func (o *ListUsers) SetUsers(v []User) { + o.Users = v +} + +func (o ListUsers) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListUsers) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["itemsCount"] = o.ItemsCount + toSerialize["offset"] = o.Offset + toSerialize["totalPages"] = o.TotalPages + toSerialize["users"] = o.Users + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListUsers) 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{ + "itemsCount", + "offset", + "totalPages", + "users", + } + + 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) + } + } + + varListUsers := _ListUsers{} + + err = json.Unmarshal(data, &varListUsers) + + if err != nil { + return err + } + + *o = ListUsers(varListUsers) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "itemsCount") + delete(additionalProperties, "offset") + delete(additionalProperties, "totalPages") + delete(additionalProperties, "users") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListUsers struct { + value *ListUsers + isSet bool +} + +func (v NullableListUsers) Get() *ListUsers { + return v.value +} + +func (v *NullableListUsers) Set(val *ListUsers) { + v.value = val + v.isSet = true +} + +func (v NullableListUsers) IsSet() bool { + return v.isSet +} + +func (v *NullableListUsers) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListUsers(val *ListUsers) *NullableListUsers { + return &NullableListUsers{value: val, isSet: true} +} + +func (v NullableListUsers) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListUsers) 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 index 1f819c5df..4cd804ef1 100644 --- a/services/git/v1betaapi/model_patch_instance_payload.go +++ b/services/git/v1betaapi/model_patch_instance_payload.go @@ -21,8 +21,12 @@ 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"` + Acl []string `json:"acl,omitempty"` + // Enable Admin IdP + AdminLogin *bool `json:"admin_login,omitempty"` + FeatureToggle *FeatureToggle `json:"feature_toggle,omitempty"` + // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. The `stackit-` prefix is reserved and cannot be used for Keys. + Labels *map[string]string `json:"labels,omitempty"` AdditionalProperties map[string]interface{} } @@ -78,6 +82,38 @@ func (o *PatchInstancePayload) SetAcl(v []string) { o.Acl = v } +// GetAdminLogin returns the AdminLogin field value if set, zero value otherwise. +func (o *PatchInstancePayload) GetAdminLogin() bool { + if o == nil || IsNil(o.AdminLogin) { + var ret bool + return ret + } + return *o.AdminLogin +} + +// GetAdminLoginOk returns a tuple with the AdminLogin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchInstancePayload) GetAdminLoginOk() (*bool, bool) { + if o == nil || IsNil(o.AdminLogin) { + return nil, false + } + return o.AdminLogin, true +} + +// HasAdminLogin returns a boolean if a field has been set. +func (o *PatchInstancePayload) HasAdminLogin() bool { + if o != nil && !IsNil(o.AdminLogin) { + return true + } + + return false +} + +// SetAdminLogin gets a reference to the given bool and assigns it to the AdminLogin field. +func (o *PatchInstancePayload) SetAdminLogin(v bool) { + o.AdminLogin = &v +} + // GetFeatureToggle returns the FeatureToggle field value if set, zero value otherwise. func (o *PatchInstancePayload) GetFeatureToggle() FeatureToggle { if o == nil || IsNil(o.FeatureToggle) { @@ -110,6 +146,38 @@ func (o *PatchInstancePayload) SetFeatureToggle(v FeatureToggle) { o.FeatureToggle = &v } +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PatchInstancePayload) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + return ret + } + return *o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchInstancePayload) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PatchInstancePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *PatchInstancePayload) SetLabels(v map[string]string) { + o.Labels = &v +} + func (o PatchInstancePayload) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -123,9 +191,15 @@ func (o PatchInstancePayload) ToMap() (map[string]interface{}, error) { if o.Acl != nil { toSerialize["acl"] = o.Acl } + if !IsNil(o.AdminLogin) { + toSerialize["admin_login"] = o.AdminLogin + } if !IsNil(o.FeatureToggle) { toSerialize["feature_toggle"] = o.FeatureToggle } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -149,7 +223,9 @@ func (o *PatchInstancePayload) UnmarshalJSON(data []byte) (err error) { if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "acl") + delete(additionalProperties, "admin_login") delete(additionalProperties, "feature_toggle") + delete(additionalProperties, "labels") o.AdditionalProperties = additionalProperties } diff --git a/services/git/v1betaapi/model_pipelines.go b/services/git/v1betaapi/model_pipelines.go new file mode 100644 index 000000000..ba2e4e0df --- /dev/null +++ b/services/git/v1betaapi/model_pipelines.go @@ -0,0 +1,215 @@ +/* +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 Pipelines type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Pipelines{} + +// Pipelines Feature toggles for instance pipelines +type Pipelines struct { + // The action URL for the pipelines + ActionUrl NullableString `json:"action_url,omitempty"` + // Enable pipelines for this instance + Enabled NullableBool `json:"enabled,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Pipelines Pipelines + +// NewPipelines instantiates a new Pipelines 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 NewPipelines() *Pipelines { + this := Pipelines{} + return &this +} + +// NewPipelinesWithDefaults instantiates a new Pipelines 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 NewPipelinesWithDefaults() *Pipelines { + this := Pipelines{} + return &this +} + +// GetActionUrl returns the ActionUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Pipelines) GetActionUrl() string { + if o == nil || IsNil(o.ActionUrl.Get()) { + var ret string + return ret + } + return *o.ActionUrl.Get() +} + +// GetActionUrlOk returns a tuple with the ActionUrl 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 *Pipelines) GetActionUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ActionUrl.Get(), o.ActionUrl.IsSet() +} + +// HasActionUrl returns a boolean if a field has been set. +func (o *Pipelines) HasActionUrl() bool { + if o != nil && o.ActionUrl.IsSet() { + return true + } + + return false +} + +// SetActionUrl gets a reference to the given NullableString and assigns it to the ActionUrl field. +func (o *Pipelines) SetActionUrl(v string) { + o.ActionUrl.Set(&v) +} + +// SetActionUrlNil sets the value for ActionUrl to be an explicit nil +func (o *Pipelines) SetActionUrlNil() { + o.ActionUrl.Set(nil) +} + +// UnsetActionUrl ensures that no value is present for ActionUrl, not even an explicit nil +func (o *Pipelines) UnsetActionUrl() { + o.ActionUrl.Unset() +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Pipelines) GetEnabled() bool { + if o == nil || IsNil(o.Enabled.Get()) { + var ret bool + return ret + } + return *o.Enabled.Get() +} + +// GetEnabledOk returns a tuple with the Enabled 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 *Pipelines) GetEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.Enabled.Get(), o.Enabled.IsSet() +} + +// HasEnabled returns a boolean if a field has been set. +func (o *Pipelines) HasEnabled() bool { + if o != nil && o.Enabled.IsSet() { + return true + } + + return false +} + +// SetEnabled gets a reference to the given NullableBool and assigns it to the Enabled field. +func (o *Pipelines) SetEnabled(v bool) { + o.Enabled.Set(&v) +} + +// SetEnabledNil sets the value for Enabled to be an explicit nil +func (o *Pipelines) SetEnabledNil() { + o.Enabled.Set(nil) +} + +// UnsetEnabled ensures that no value is present for Enabled, not even an explicit nil +func (o *Pipelines) UnsetEnabled() { + o.Enabled.Unset() +} + +func (o Pipelines) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Pipelines) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.ActionUrl.IsSet() { + toSerialize["action_url"] = o.ActionUrl.Get() + } + if o.Enabled.IsSet() { + toSerialize["enabled"] = o.Enabled.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Pipelines) UnmarshalJSON(data []byte) (err error) { + varPipelines := _Pipelines{} + + err = json.Unmarshal(data, &varPipelines) + + if err != nil { + return err + } + + *o = Pipelines(varPipelines) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "action_url") + delete(additionalProperties, "enabled") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePipelines struct { + value *Pipelines + isSet bool +} + +func (v NullablePipelines) Get() *Pipelines { + return v.value +} + +func (v *NullablePipelines) Set(val *Pipelines) { + v.value = val + v.isSet = true +} + +func (v NullablePipelines) IsSet() bool { + return v.isSet +} + +func (v *NullablePipelines) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePipelines(val *Pipelines) *NullablePipelines { + return &NullablePipelines{value: val, isSet: true} +} + +func (v NullablePipelines) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePipelines) 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 index 77df79e8e..10970aa34 100644 --- a/services/git/v1betaapi/model_runner_runtime.go +++ b/services/git/v1betaapi/model_runner_runtime.go @@ -23,7 +23,7 @@ var _ MappedNullable = &RunnerRuntime{} type RunnerRuntime struct { // Indicates the availability of the runner label Availability string `json:"availability"` - // Human-friendly description of the runtime and it's capabilities. + // Human-friendly description of the runtime and its capabilities. Description string `json:"description"` // Human-friendly name of the runtime. DisplayName string `json:"display_name"` diff --git a/services/git/v1betaapi/model_update_user_payload.go b/services/git/v1betaapi/model_update_user_payload.go new file mode 100644 index 000000000..4c2549140 --- /dev/null +++ b/services/git/v1betaapi/model_update_user_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 ( + "encoding/json" +) + +// checks if the UpdateUserPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateUserPayload{} + +// UpdateUserPayload Properties to update a Instance User. All fields are optional. +type UpdateUserPayload struct { + // A user chosen email to distinguish multiple STACKIT Git instance Users. + Email *string `json:"email,omitempty"` + // Name of the user. + Name *string `json:"name,omitempty"` + // A user password to allow user/pass instance login. + Password *string `json:"password,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdateUserPayload UpdateUserPayload + +// NewUpdateUserPayload instantiates a new UpdateUserPayload 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 NewUpdateUserPayload() *UpdateUserPayload { + this := UpdateUserPayload{} + return &this +} + +// NewUpdateUserPayloadWithDefaults instantiates a new UpdateUserPayload 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 NewUpdateUserPayloadWithDefaults() *UpdateUserPayload { + this := UpdateUserPayload{} + return &this +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *UpdateUserPayload) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateUserPayload) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *UpdateUserPayload) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *UpdateUserPayload) SetEmail(v string) { + o.Email = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateUserPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateUserPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateUserPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateUserPayload) SetName(v string) { + o.Name = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *UpdateUserPayload) GetPassword() string { + if o == nil || IsNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateUserPayload) GetPasswordOk() (*string, bool) { + if o == nil || IsNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *UpdateUserPayload) HasPassword() bool { + if o != nil && !IsNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *UpdateUserPayload) SetPassword(v string) { + o.Password = &v +} + +func (o UpdateUserPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateUserPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateUserPayload) UnmarshalJSON(data []byte) (err error) { + varUpdateUserPayload := _UpdateUserPayload{} + + err = json.Unmarshal(data, &varUpdateUserPayload) + + if err != nil { + return err + } + + *o = UpdateUserPayload(varUpdateUserPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "email") + delete(additionalProperties, "name") + delete(additionalProperties, "password") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateUserPayload struct { + value *UpdateUserPayload + isSet bool +} + +func (v NullableUpdateUserPayload) Get() *UpdateUserPayload { + return v.value +} + +func (v *NullableUpdateUserPayload) Set(val *UpdateUserPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateUserPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateUserPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateUserPayload(val *UpdateUserPayload) *NullableUpdateUserPayload { + return &NullableUpdateUserPayload{value: val, isSet: true} +} + +func (v NullableUpdateUserPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateUserPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_user.go b/services/git/v1betaapi/model_user.go new file mode 100644 index 000000000..b6868fe2f --- /dev/null +++ b/services/git/v1betaapi/model_user.go @@ -0,0 +1,266 @@ +/* +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" + "fmt" +) + +// checks if the User type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &User{} + +// User Describes a STACKIT Git instance User. +type User struct { + // A user chosen email to distinguish multiple STACKIT Git instance Users. + Email string `json:"email"` + // A auto generated unique id which identifies the STACKIT Git instances. + Id *int32 `json:"id,omitempty"` + // Name of the user. + Name string `json:"name"` + // A user chosen username to distinguish multiple STACKIT Git instance Users. + Username string `json:"username"` + AdditionalProperties map[string]interface{} +} + +type _User User + +// NewUser instantiates a new User object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUser(email string, name string, username string) *User { + this := User{} + this.Email = email + this.Name = name + this.Username = username + return &this +} + +// NewUserWithDefaults instantiates a new User object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserWithDefaults() *User { + this := User{} + return &this +} + +// GetEmail returns the Email field value +func (o *User) GetEmail() string { + if o == nil { + var ret string + return ret + } + + return o.Email +} + +// GetEmailOk returns a tuple with the Email field value +// and a boolean to check if the value has been set. +func (o *User) GetEmailOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Email, true +} + +// SetEmail sets field value +func (o *User) SetEmail(v string) { + o.Email = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *User) GetId() int32 { + if o == nil || IsNil(o.Id) { + var ret int32 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetIdOk() (*int32, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *User) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given int32 and assigns it to the Id field. +func (o *User) SetId(v int32) { + o.Id = &v +} + +// GetName returns the Name field value +func (o *User) 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 *User) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *User) SetName(v string) { + o.Name = v +} + +// GetUsername returns the Username field value +func (o *User) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *User) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *User) SetUsername(v string) { + o.Username = v +} + +func (o User) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o User) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["email"] = o.Email + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + toSerialize["name"] = o.Name + toSerialize["username"] = o.Username + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *User) 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{ + "email", + "name", + "username", + } + + 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) + } + } + + varUser := _User{} + + err = json.Unmarshal(data, &varUser) + + if err != nil { + return err + } + + *o = User(varUser) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "email") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "username") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUser struct { + value *User + isSet bool +} + +func (v NullableUser) Get() *User { + return v.value +} + +func (v *NullableUser) Set(val *User) { + v.value = val + v.isSet = true +} + +func (v NullableUser) IsSet() bool { + return v.isSet +} + +func (v *NullableUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUser(val *User) *NullableUser { + return &NullableUser{value: val, isSet: true} +} + +func (v NullableUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +}