From 39f823a085469344f476979c1186c0083f580346 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Fri, 14 Mar 2025 16:15:18 +0000 Subject: [PATCH 1/2] Generate runcommand --- services/runcommand/api_default.go | 48 +- services/runcommand/api_default_test.go | 90 ++-- services/runcommand/client.go | 4 +- services/runcommand/configuration.go | 9 +- services/runcommand/model_command_details.go | 485 +++++++++++------- services/runcommand/model_command_template.go | 163 +++--- .../model_command_template_response.go | 55 +- .../model_command_template_schema.go | 270 ++++++---- services/runcommand/model_commands.go | 324 +++++++----- .../model_create_command_payload.go | 107 ++-- services/runcommand/model_error_response.go | 104 ++-- services/runcommand/model_field.go | 377 ++++++++------ .../runcommand/model_get_commands_response.go | 55 +- .../runcommand/model_new_command_response.go | 55 +- .../runcommand/model_parameters_schema.go | 55 +- services/runcommand/model_properties.go | 321 +++++++----- services/runcommand/utils.go | 28 +- 17 files changed, 1562 insertions(+), 988 deletions(-) diff --git a/services/runcommand/api_default.go b/services/runcommand/api_default.go index d22cb354d..9d474bc59 100644 --- a/services/runcommand/api_default.go +++ b/services/runcommand/api_default.go @@ -3,7 +3,7 @@ STACKIT Run Commands Service API API endpoints for the STACKIT Run Commands Service API -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -30,6 +30,7 @@ type ApiCreateCommandRequest struct { apiService *DefaultApiService projectId string serverId string + region string createCommandPayload *CreateCommandPayload } @@ -53,9 +54,10 @@ func (r ApiCreateCommandRequest) Execute() (*NewCommandResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/commands" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/commands" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -168,23 +170,26 @@ Creates a new command for execution @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId ID of the project @param serverId Server ID of the machine + @param region region @return ApiCreateCommandRequest */ -func (a *APIClient) CreateCommand(ctx context.Context, projectId string, serverId string) ApiCreateCommandRequest { +func (a *APIClient) CreateCommand(ctx context.Context, projectId string, serverId string, region string) ApiCreateCommandRequest { return ApiCreateCommandRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + region: region, } } -func (a *APIClient) CreateCommandExecute(ctx context.Context, projectId string, serverId string) (*NewCommandResponse, error) { +func (a *APIClient) CreateCommandExecute(ctx context.Context, projectId string, serverId string, region string) (*NewCommandResponse, error) { r := ApiCreateCommandRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + region: region, } return r.Execute() } @@ -193,6 +198,7 @@ type ApiGetCommandRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string serverId string commandId string } @@ -210,8 +216,9 @@ func (r ApiGetCommandRequest) Execute() (*CommandDetails, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/commands/{commandId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/commands/{commandId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"commandId"+"}", url.PathEscape(ParameterValueToString(r.commandId, "commandId")), -1) @@ -323,25 +330,28 @@ Returns details about a command @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId ID of the project + @param region region @param serverId Server ID of the machine @param commandId ID of the command @return ApiGetCommandRequest */ -func (a *APIClient) GetCommand(ctx context.Context, projectId string, serverId string, commandId string) ApiGetCommandRequest { +func (a *APIClient) GetCommand(ctx context.Context, projectId string, region string, serverId string, commandId string) ApiGetCommandRequest { return ApiGetCommandRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, commandId: commandId, } } -func (a *APIClient) GetCommandExecute(ctx context.Context, projectId string, serverId string, commandId string) (*CommandDetails, error) { +func (a *APIClient) GetCommandExecute(ctx context.Context, projectId string, region string, serverId string, commandId string) (*CommandDetails, error) { r := ApiGetCommandRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, serverId: serverId, commandId: commandId, } @@ -354,6 +364,7 @@ type ApiGetCommandTemplateRequest struct { projectId string serverId string commandTemplateName string + region string } func (r ApiGetCommandTemplateRequest) Execute() (*CommandTemplateSchema, error) { @@ -369,10 +380,11 @@ func (r ApiGetCommandTemplateRequest) Execute() (*CommandTemplateSchema, error) return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/command-templates/{commandTemplateName}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/command-templates/{commandTemplateName}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"commandTemplateName"+"}", url.PathEscape(ParameterValueToString(r.commandTemplateName, "commandTemplateName")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -484,25 +496,28 @@ Returns details about a command template @param projectId ID of the project @param serverId Server ID of the machine @param commandTemplateName Name of the template + @param region region @return ApiGetCommandTemplateRequest */ -func (a *APIClient) GetCommandTemplate(ctx context.Context, projectId string, serverId string, commandTemplateName string) ApiGetCommandTemplateRequest { +func (a *APIClient) GetCommandTemplate(ctx context.Context, projectId string, serverId string, commandTemplateName string, region string) ApiGetCommandTemplateRequest { return ApiGetCommandTemplateRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, commandTemplateName: commandTemplateName, + region: region, } } -func (a *APIClient) GetCommandTemplateExecute(ctx context.Context, projectId string, serverId string, commandTemplateName string) (*CommandTemplateSchema, error) { +func (a *APIClient) GetCommandTemplateExecute(ctx context.Context, projectId string, serverId string, commandTemplateName string, region string) (*CommandTemplateSchema, error) { r := ApiGetCommandTemplateRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, commandTemplateName: commandTemplateName, + region: region, } return r.Execute() } @@ -533,7 +548,7 @@ func (r ApiListCommandTemplatesRequest) Execute() (*CommandTemplateResponse, err return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/command-templates" + localVarPath := localBasePath + "/v2/command-templates" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -656,6 +671,7 @@ type ApiListCommandsRequest struct { apiService *DefaultApiService projectId string serverId string + region string } func (r ApiListCommandsRequest) Execute() (*GetCommandsResponse, error) { @@ -671,9 +687,10 @@ func (r ApiListCommandsRequest) Execute() (*GetCommandsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/commands" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/commands" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -784,23 +801,26 @@ Returns a list of commands @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId ID of the project @param serverId Server ID of the machine + @param region region @return ApiListCommandsRequest */ -func (a *APIClient) ListCommands(ctx context.Context, projectId string, serverId string) ApiListCommandsRequest { +func (a *APIClient) ListCommands(ctx context.Context, projectId string, serverId string, region string) ApiListCommandsRequest { return ApiListCommandsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + region: region, } } -func (a *APIClient) ListCommandsExecute(ctx context.Context, projectId string, serverId string) (*GetCommandsResponse, error) { +func (a *APIClient) ListCommandsExecute(ctx context.Context, projectId string, serverId string, region string) (*GetCommandsResponse, error) { r := ApiListCommandsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + region: region, } return r.Execute() } diff --git a/services/runcommand/api_default_test.go b/services/runcommand/api_default_test.go index 7077e9b3b..bc1341399 100644 --- a/services/runcommand/api_default_test.go +++ b/services/runcommand/api_default_test.go @@ -24,14 +24,16 @@ import ( func Test_runcommand_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService CreateCommand", func(t *testing.T) { - path := "/v1/projects/{projectId}/servers/{serverId}/commands" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/commands" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + regionValue := "region" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := NewCommandResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -65,30 +67,33 @@ func Test_runcommand_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue + region := regionValue - resp, reqErr := apiClient.CreateCommand(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.CreateCommand(context.Background(), projectId, serverId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService GetCommand", func(t *testing.T) { - path := "/v1/projects/{projectId}/servers/{serverId}/commands/{commandId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/commands/{commandId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) commandIdValue := "commandId" - path = strings.Replace(path, "{"+"commandId"+"}", url.PathEscape(ParameterValueToString(commandIdValue, "commandId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"commandId"+"}", url.PathEscape(ParameterValueToString(commandIdValue, "commandId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := CommandDetails{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -122,31 +127,34 @@ func Test_runcommand_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - commandId := "commandId" + projectId := projectIdValue + region := regionValue + serverId := serverIdValue + commandId := commandIdValue - resp, reqErr := apiClient.GetCommand(context.Background(), projectId, serverId, commandId).Execute() + resp, reqErr := apiClient.GetCommand(context.Background(), projectId, region, serverId, commandId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService GetCommandTemplate", func(t *testing.T) { - path := "/v1/projects/{projectId}/servers/{serverId}/command-templates/{commandTemplateName}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/command-templates/{commandTemplateName}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) commandTemplateNameValue := "commandTemplateName" - path = strings.Replace(path, "{"+"commandTemplateName"+"}", url.PathEscape(ParameterValueToString(commandTemplateNameValue, "commandTemplateName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"commandTemplateName"+"}", url.PathEscape(ParameterValueToString(commandTemplateNameValue, "commandTemplateName")), -1) + regionValue := "region" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := CommandTemplateSchema{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -180,25 +188,26 @@ func Test_runcommand_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - commandTemplateName := "commandTemplateName" + projectId := projectIdValue + serverId := serverIdValue + commandTemplateName := commandTemplateNameValue + region := regionValue - resp, reqErr := apiClient.GetCommandTemplate(context.Background(), projectId, serverId, commandTemplateName).Execute() + resp, reqErr := apiClient.GetCommandTemplate(context.Background(), projectId, serverId, commandTemplateName, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService ListCommandTemplates", func(t *testing.T) { - path := "/v1/command-templates" + _apiUrlPath := "/v2/command-templates" testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := CommandTemplateResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -237,20 +246,22 @@ func Test_runcommand_DefaultApiService(t *testing.T) { if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService ListCommands", func(t *testing.T) { - path := "/v1/projects/{projectId}/servers/{serverId}/commands" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/commands" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + regionValue := "region" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := GetCommandsResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -284,15 +295,16 @@ func Test_runcommand_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue + region := regionValue - resp, reqErr := apiClient.ListCommands(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.ListCommands(context.Background(), projectId, serverId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) diff --git a/services/runcommand/client.go b/services/runcommand/client.go index 4aba2f5c3..5c5066291 100644 --- a/services/runcommand/client.go +++ b/services/runcommand/client.go @@ -3,7 +3,7 @@ STACKIT Run Commands Service API API endpoints for the STACKIT Run Commands Service API -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the STACKIT Run Commands Service API API v1.0 +// APIClient manages communication with the STACKIT Run Commands Service API API v2.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *config.Configuration diff --git a/services/runcommand/configuration.go b/services/runcommand/configuration.go index 5ddfa35fd..80ece04bd 100644 --- a/services/runcommand/configuration.go +++ b/services/runcommand/configuration.go @@ -3,7 +3,7 @@ STACKIT Run Commands Service API API endpoints for the STACKIT Run Commands Service API -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,15 +22,12 @@ func NewConfiguration() *config.Configuration { Debug: false, Servers: config.ServerConfigurations{ { - URL: "https://run-command.api.{region}stackit.cloud", + URL: "https://run-command.api.stackit.cloud", Description: "No description provided", Variables: map[string]config.ServerVariable{ "region": { Description: "No description provided", - DefaultValue: "eu01.", - EnumValues: []string{ - "eu01.", - }, + DefaultValue: "global", }, }, }, diff --git a/services/runcommand/model_command_details.go b/services/runcommand/model_command_details.go index 7fb7867e5..c5cfe4aaf 100644 --- a/services/runcommand/model_command_details.go +++ b/services/runcommand/model_command_details.go @@ -3,7 +3,7 @@ STACKIT Run Commands Service API API endpoints for the STACKIT Run Commands Service API -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,19 +17,205 @@ import ( // checks if the CommandDetails type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CommandDetails{} +/* + types and functions for commandTemplateName +*/ + +// isNotNullableString +type CommandDetailsGetCommandTemplateNameAttributeType = *string + +func getCommandDetailsGetCommandTemplateNameAttributeTypeOk(arg CommandDetailsGetCommandTemplateNameAttributeType) (ret CommandDetailsGetCommandTemplateNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandDetailsGetCommandTemplateNameAttributeType(arg *CommandDetailsGetCommandTemplateNameAttributeType, val CommandDetailsGetCommandTemplateNameRetType) { + *arg = &val +} + +type CommandDetailsGetCommandTemplateNameArgType = string +type CommandDetailsGetCommandTemplateNameRetType = string + +/* + types and functions for commandTemplateTitle +*/ + +// isNotNullableString +type CommandDetailsGetCommandTemplateTitleAttributeType = *string + +func getCommandDetailsGetCommandTemplateTitleAttributeTypeOk(arg CommandDetailsGetCommandTemplateTitleAttributeType) (ret CommandDetailsGetCommandTemplateTitleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandDetailsGetCommandTemplateTitleAttributeType(arg *CommandDetailsGetCommandTemplateTitleAttributeType, val CommandDetailsGetCommandTemplateTitleRetType) { + *arg = &val +} + +type CommandDetailsGetCommandTemplateTitleArgType = string +type CommandDetailsGetCommandTemplateTitleRetType = string + +/* + types and functions for exitCode +*/ + +// isInteger +type CommandDetailsGetExitCodeAttributeType = *int64 +type CommandDetailsGetExitCodeArgType = int64 +type CommandDetailsGetExitCodeRetType = int64 + +func getCommandDetailsGetExitCodeAttributeTypeOk(arg CommandDetailsGetExitCodeAttributeType) (ret CommandDetailsGetExitCodeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandDetailsGetExitCodeAttributeType(arg *CommandDetailsGetExitCodeAttributeType, val CommandDetailsGetExitCodeRetType) { + *arg = &val +} + +/* + types and functions for finishedAt +*/ + +// isNotNullableString +type CommandDetailsGetFinishedAtAttributeType = *string + +func getCommandDetailsGetFinishedAtAttributeTypeOk(arg CommandDetailsGetFinishedAtAttributeType) (ret CommandDetailsGetFinishedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandDetailsGetFinishedAtAttributeType(arg *CommandDetailsGetFinishedAtAttributeType, val CommandDetailsGetFinishedAtRetType) { + *arg = &val +} + +type CommandDetailsGetFinishedAtArgType = string +type CommandDetailsGetFinishedAtRetType = string + +/* + types and functions for id +*/ + +// isInteger +type CommandDetailsGetIdAttributeType = *int64 +type CommandDetailsGetIdArgType = int64 +type CommandDetailsGetIdRetType = int64 + +func getCommandDetailsGetIdAttributeTypeOk(arg CommandDetailsGetIdAttributeType) (ret CommandDetailsGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandDetailsGetIdAttributeType(arg *CommandDetailsGetIdAttributeType, val CommandDetailsGetIdRetType) { + *arg = &val +} + +/* + types and functions for output +*/ + +// isNotNullableString +type CommandDetailsGetOutputAttributeType = *string + +func getCommandDetailsGetOutputAttributeTypeOk(arg CommandDetailsGetOutputAttributeType) (ret CommandDetailsGetOutputRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandDetailsGetOutputAttributeType(arg *CommandDetailsGetOutputAttributeType, val CommandDetailsGetOutputRetType) { + *arg = &val +} + +type CommandDetailsGetOutputArgType = string +type CommandDetailsGetOutputRetType = string + +/* + types and functions for script +*/ + +// isNotNullableString +type CommandDetailsGetScriptAttributeType = *string + +func getCommandDetailsGetScriptAttributeTypeOk(arg CommandDetailsGetScriptAttributeType) (ret CommandDetailsGetScriptRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandDetailsGetScriptAttributeType(arg *CommandDetailsGetScriptAttributeType, val CommandDetailsGetScriptRetType) { + *arg = &val +} + +type CommandDetailsGetScriptArgType = string +type CommandDetailsGetScriptRetType = string + +/* + types and functions for startedAt +*/ + +// isNotNullableString +type CommandDetailsGetStartedAtAttributeType = *string + +func getCommandDetailsGetStartedAtAttributeTypeOk(arg CommandDetailsGetStartedAtAttributeType) (ret CommandDetailsGetStartedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandDetailsGetStartedAtAttributeType(arg *CommandDetailsGetStartedAtAttributeType, val CommandDetailsGetStartedAtRetType) { + *arg = &val +} + +type CommandDetailsGetStartedAtArgType = string +type CommandDetailsGetStartedAtRetType = string + +/* + types and functions for status +*/ + +// isEnumRef +type CommandDetailsGetStatusAttributeType = *string +type CommandDetailsGetStatusArgType = string +type CommandDetailsGetStatusRetType = string + +func getCommandDetailsGetStatusAttributeTypeOk(arg CommandDetailsGetStatusAttributeType) (ret CommandDetailsGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandDetailsGetStatusAttributeType(arg *CommandDetailsGetStatusAttributeType, val CommandDetailsGetStatusRetType) { + *arg = &val +} + // CommandDetails struct for CommandDetails type CommandDetails struct { - CommandTemplateName *string `json:"commandTemplateName,omitempty"` - CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` + CommandTemplateName CommandDetailsGetCommandTemplateNameAttributeType `json:"commandTemplateName,omitempty"` + CommandTemplateTitle CommandDetailsGetCommandTemplateTitleAttributeType `json:"commandTemplateTitle,omitempty"` // Can be cast to int32 without loss of precision. - ExitCode *int64 `json:"exitCode,omitempty"` - FinishedAt *string `json:"finishedAt,omitempty"` + ExitCode CommandDetailsGetExitCodeAttributeType `json:"exitCode,omitempty"` + FinishedAt CommandDetailsGetFinishedAtAttributeType `json:"finishedAt,omitempty"` // Can be cast to int32 without loss of precision. - Id *int64 `json:"id,omitempty"` - Output *string `json:"output,omitempty"` - Script *string `json:"script,omitempty"` - StartedAt *string `json:"startedAt,omitempty"` - Status *string `json:"status,omitempty"` + Id CommandDetailsGetIdAttributeType `json:"id,omitempty"` + Output CommandDetailsGetOutputAttributeType `json:"output,omitempty"` + Script CommandDetailsGetScriptAttributeType `json:"script,omitempty"` + StartedAt CommandDetailsGetStartedAtAttributeType `json:"startedAt,omitempty"` + Status CommandDetailsGetStatusAttributeType `json:"status,omitempty"` } // NewCommandDetails instantiates a new CommandDetails object @@ -50,321 +236,240 @@ func NewCommandDetailsWithDefaults() *CommandDetails { } // GetCommandTemplateName returns the CommandTemplateName field value if set, zero value otherwise. -func (o *CommandDetails) GetCommandTemplateName() *string { - if o == nil || IsNil(o.CommandTemplateName) { - var ret *string - return ret - } - return o.CommandTemplateName +func (o *CommandDetails) GetCommandTemplateName() (res CommandDetailsGetCommandTemplateNameRetType) { + res, _ = o.GetCommandTemplateNameOk() + return } // GetCommandTemplateNameOk returns a tuple with the CommandTemplateName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandDetails) GetCommandTemplateNameOk() (*string, bool) { - if o == nil || IsNil(o.CommandTemplateName) { - return nil, false - } - return o.CommandTemplateName, true +func (o *CommandDetails) GetCommandTemplateNameOk() (ret CommandDetailsGetCommandTemplateNameRetType, ok bool) { + return getCommandDetailsGetCommandTemplateNameAttributeTypeOk(o.CommandTemplateName) } // HasCommandTemplateName returns a boolean if a field has been set. func (o *CommandDetails) HasCommandTemplateName() bool { - if o != nil && !IsNil(o.CommandTemplateName) { - return true - } - - return false + _, ok := o.GetCommandTemplateNameOk() + return ok } // SetCommandTemplateName gets a reference to the given string and assigns it to the CommandTemplateName field. -func (o *CommandDetails) SetCommandTemplateName(v *string) { - o.CommandTemplateName = v +func (o *CommandDetails) SetCommandTemplateName(v CommandDetailsGetCommandTemplateNameRetType) { + setCommandDetailsGetCommandTemplateNameAttributeType(&o.CommandTemplateName, v) } // GetCommandTemplateTitle returns the CommandTemplateTitle field value if set, zero value otherwise. -func (o *CommandDetails) GetCommandTemplateTitle() *string { - if o == nil || IsNil(o.CommandTemplateTitle) { - var ret *string - return ret - } - return o.CommandTemplateTitle +func (o *CommandDetails) GetCommandTemplateTitle() (res CommandDetailsGetCommandTemplateTitleRetType) { + res, _ = o.GetCommandTemplateTitleOk() + return } // GetCommandTemplateTitleOk returns a tuple with the CommandTemplateTitle field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandDetails) GetCommandTemplateTitleOk() (*string, bool) { - if o == nil || IsNil(o.CommandTemplateTitle) { - return nil, false - } - return o.CommandTemplateTitle, true +func (o *CommandDetails) GetCommandTemplateTitleOk() (ret CommandDetailsGetCommandTemplateTitleRetType, ok bool) { + return getCommandDetailsGetCommandTemplateTitleAttributeTypeOk(o.CommandTemplateTitle) } // HasCommandTemplateTitle returns a boolean if a field has been set. func (o *CommandDetails) HasCommandTemplateTitle() bool { - if o != nil && !IsNil(o.CommandTemplateTitle) { - return true - } - - return false + _, ok := o.GetCommandTemplateTitleOk() + return ok } // SetCommandTemplateTitle gets a reference to the given string and assigns it to the CommandTemplateTitle field. -func (o *CommandDetails) SetCommandTemplateTitle(v *string) { - o.CommandTemplateTitle = v +func (o *CommandDetails) SetCommandTemplateTitle(v CommandDetailsGetCommandTemplateTitleRetType) { + setCommandDetailsGetCommandTemplateTitleAttributeType(&o.CommandTemplateTitle, v) } // GetExitCode returns the ExitCode field value if set, zero value otherwise. -func (o *CommandDetails) GetExitCode() *int64 { - if o == nil || IsNil(o.ExitCode) { - var ret *int64 - return ret - } - return o.ExitCode +func (o *CommandDetails) GetExitCode() (res CommandDetailsGetExitCodeRetType) { + res, _ = o.GetExitCodeOk() + return } // GetExitCodeOk returns a tuple with the ExitCode field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandDetails) GetExitCodeOk() (*int64, bool) { - if o == nil || IsNil(o.ExitCode) { - return nil, false - } - return o.ExitCode, true +func (o *CommandDetails) GetExitCodeOk() (ret CommandDetailsGetExitCodeRetType, ok bool) { + return getCommandDetailsGetExitCodeAttributeTypeOk(o.ExitCode) } // HasExitCode returns a boolean if a field has been set. func (o *CommandDetails) HasExitCode() bool { - if o != nil && !IsNil(o.ExitCode) { - return true - } - - return false + _, ok := o.GetExitCodeOk() + return ok } // SetExitCode gets a reference to the given int64 and assigns it to the ExitCode field. -func (o *CommandDetails) SetExitCode(v *int64) { - o.ExitCode = v +func (o *CommandDetails) SetExitCode(v CommandDetailsGetExitCodeRetType) { + setCommandDetailsGetExitCodeAttributeType(&o.ExitCode, v) } // GetFinishedAt returns the FinishedAt field value if set, zero value otherwise. -func (o *CommandDetails) GetFinishedAt() *string { - if o == nil || IsNil(o.FinishedAt) { - var ret *string - return ret - } - return o.FinishedAt +func (o *CommandDetails) GetFinishedAt() (res CommandDetailsGetFinishedAtRetType) { + res, _ = o.GetFinishedAtOk() + return } // GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandDetails) GetFinishedAtOk() (*string, bool) { - if o == nil || IsNil(o.FinishedAt) { - return nil, false - } - return o.FinishedAt, true +func (o *CommandDetails) GetFinishedAtOk() (ret CommandDetailsGetFinishedAtRetType, ok bool) { + return getCommandDetailsGetFinishedAtAttributeTypeOk(o.FinishedAt) } // HasFinishedAt returns a boolean if a field has been set. func (o *CommandDetails) HasFinishedAt() bool { - if o != nil && !IsNil(o.FinishedAt) { - return true - } - - return false + _, ok := o.GetFinishedAtOk() + return ok } // SetFinishedAt gets a reference to the given string and assigns it to the FinishedAt field. -func (o *CommandDetails) SetFinishedAt(v *string) { - o.FinishedAt = v +func (o *CommandDetails) SetFinishedAt(v CommandDetailsGetFinishedAtRetType) { + setCommandDetailsGetFinishedAtAttributeType(&o.FinishedAt, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *CommandDetails) GetId() *int64 { - if o == nil || IsNil(o.Id) { - var ret *int64 - return ret - } - return o.Id +func (o *CommandDetails) GetId() (res CommandDetailsGetIdRetType) { + 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. -func (o *CommandDetails) GetIdOk() (*int64, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *CommandDetails) GetIdOk() (ret CommandDetailsGetIdRetType, ok bool) { + return getCommandDetailsGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *CommandDetails) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given int64 and assigns it to the Id field. -func (o *CommandDetails) SetId(v *int64) { - o.Id = v +func (o *CommandDetails) SetId(v CommandDetailsGetIdRetType) { + setCommandDetailsGetIdAttributeType(&o.Id, v) } // GetOutput returns the Output field value if set, zero value otherwise. -func (o *CommandDetails) GetOutput() *string { - if o == nil || IsNil(o.Output) { - var ret *string - return ret - } - return o.Output +func (o *CommandDetails) GetOutput() (res CommandDetailsGetOutputRetType) { + res, _ = o.GetOutputOk() + return } // GetOutputOk returns a tuple with the Output field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandDetails) GetOutputOk() (*string, bool) { - if o == nil || IsNil(o.Output) { - return nil, false - } - return o.Output, true +func (o *CommandDetails) GetOutputOk() (ret CommandDetailsGetOutputRetType, ok bool) { + return getCommandDetailsGetOutputAttributeTypeOk(o.Output) } // HasOutput returns a boolean if a field has been set. func (o *CommandDetails) HasOutput() bool { - if o != nil && !IsNil(o.Output) { - return true - } - - return false + _, ok := o.GetOutputOk() + return ok } // SetOutput gets a reference to the given string and assigns it to the Output field. -func (o *CommandDetails) SetOutput(v *string) { - o.Output = v +func (o *CommandDetails) SetOutput(v CommandDetailsGetOutputRetType) { + setCommandDetailsGetOutputAttributeType(&o.Output, v) } // GetScript returns the Script field value if set, zero value otherwise. -func (o *CommandDetails) GetScript() *string { - if o == nil || IsNil(o.Script) { - var ret *string - return ret - } - return o.Script +func (o *CommandDetails) GetScript() (res CommandDetailsGetScriptRetType) { + res, _ = o.GetScriptOk() + return } // GetScriptOk returns a tuple with the Script field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandDetails) GetScriptOk() (*string, bool) { - if o == nil || IsNil(o.Script) { - return nil, false - } - return o.Script, true +func (o *CommandDetails) GetScriptOk() (ret CommandDetailsGetScriptRetType, ok bool) { + return getCommandDetailsGetScriptAttributeTypeOk(o.Script) } // HasScript returns a boolean if a field has been set. func (o *CommandDetails) HasScript() bool { - if o != nil && !IsNil(o.Script) { - return true - } - - return false + _, ok := o.GetScriptOk() + return ok } // SetScript gets a reference to the given string and assigns it to the Script field. -func (o *CommandDetails) SetScript(v *string) { - o.Script = v +func (o *CommandDetails) SetScript(v CommandDetailsGetScriptRetType) { + setCommandDetailsGetScriptAttributeType(&o.Script, v) } // GetStartedAt returns the StartedAt field value if set, zero value otherwise. -func (o *CommandDetails) GetStartedAt() *string { - if o == nil || IsNil(o.StartedAt) { - var ret *string - return ret - } - return o.StartedAt +func (o *CommandDetails) GetStartedAt() (res CommandDetailsGetStartedAtRetType) { + res, _ = o.GetStartedAtOk() + return } // GetStartedAtOk returns a tuple with the StartedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandDetails) GetStartedAtOk() (*string, bool) { - if o == nil || IsNil(o.StartedAt) { - return nil, false - } - return o.StartedAt, true +func (o *CommandDetails) GetStartedAtOk() (ret CommandDetailsGetStartedAtRetType, ok bool) { + return getCommandDetailsGetStartedAtAttributeTypeOk(o.StartedAt) } // HasStartedAt returns a boolean if a field has been set. func (o *CommandDetails) HasStartedAt() bool { - if o != nil && !IsNil(o.StartedAt) { - return true - } - - return false + _, ok := o.GetStartedAtOk() + return ok } // SetStartedAt gets a reference to the given string and assigns it to the StartedAt field. -func (o *CommandDetails) SetStartedAt(v *string) { - o.StartedAt = v +func (o *CommandDetails) SetStartedAt(v CommandDetailsGetStartedAtRetType) { + setCommandDetailsGetStartedAtAttributeType(&o.StartedAt, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *CommandDetails) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - return o.Status +func (o *CommandDetails) GetStatus() (res CommandDetailsGetStatusRetType) { + res, _ = o.GetStatusOk() + return } // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandDetails) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *CommandDetails) GetStatusOk() (ret CommandDetailsGetStatusRetType, ok bool) { + return getCommandDetailsGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *CommandDetails) HasStatus() bool { - if o != nil && !IsNil(o.Status) { - return true - } - - return false + _, ok := o.GetStatusOk() + return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *CommandDetails) SetStatus(v *string) { - o.Status = v +func (o *CommandDetails) SetStatus(v CommandDetailsGetStatusRetType) { + setCommandDetailsGetStatusAttributeType(&o.Status, v) } func (o CommandDetails) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.CommandTemplateName) { - toSerialize["commandTemplateName"] = o.CommandTemplateName + if val, ok := getCommandDetailsGetCommandTemplateNameAttributeTypeOk(o.CommandTemplateName); ok { + toSerialize["CommandTemplateName"] = val } - if !IsNil(o.CommandTemplateTitle) { - toSerialize["commandTemplateTitle"] = o.CommandTemplateTitle + if val, ok := getCommandDetailsGetCommandTemplateTitleAttributeTypeOk(o.CommandTemplateTitle); ok { + toSerialize["CommandTemplateTitle"] = val } - if !IsNil(o.ExitCode) { - toSerialize["exitCode"] = o.ExitCode + if val, ok := getCommandDetailsGetExitCodeAttributeTypeOk(o.ExitCode); ok { + toSerialize["ExitCode"] = val } - if !IsNil(o.FinishedAt) { - toSerialize["finishedAt"] = o.FinishedAt + if val, ok := getCommandDetailsGetFinishedAtAttributeTypeOk(o.FinishedAt); ok { + toSerialize["FinishedAt"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getCommandDetailsGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Output) { - toSerialize["output"] = o.Output + if val, ok := getCommandDetailsGetOutputAttributeTypeOk(o.Output); ok { + toSerialize["Output"] = val } - if !IsNil(o.Script) { - toSerialize["script"] = o.Script + if val, ok := getCommandDetailsGetScriptAttributeTypeOk(o.Script); ok { + toSerialize["Script"] = val } - if !IsNil(o.StartedAt) { - toSerialize["startedAt"] = o.StartedAt + if val, ok := getCommandDetailsGetStartedAtAttributeTypeOk(o.StartedAt); ok { + toSerialize["StartedAt"] = val } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getCommandDetailsGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } return toSerialize, nil } diff --git a/services/runcommand/model_command_template.go b/services/runcommand/model_command_template.go index 8ec716ec0..7a134e74f 100644 --- a/services/runcommand/model_command_template.go +++ b/services/runcommand/model_command_template.go @@ -3,7 +3,7 @@ STACKIT Run Commands Service API API endpoints for the STACKIT Run Commands Service API -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,11 +17,73 @@ import ( // checks if the CommandTemplate type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CommandTemplate{} +/* + types and functions for name +*/ + +// isNotNullableString +type CommandTemplateGetNameAttributeType = *string + +func getCommandTemplateGetNameAttributeTypeOk(arg CommandTemplateGetNameAttributeType) (ret CommandTemplateGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandTemplateGetNameAttributeType(arg *CommandTemplateGetNameAttributeType, val CommandTemplateGetNameRetType) { + *arg = &val +} + +type CommandTemplateGetNameArgType = string +type CommandTemplateGetNameRetType = string + +/* + types and functions for osType +*/ + +// isArray +type CommandTemplateGetOsTypeAttributeType = *[]string +type CommandTemplateGetOsTypeArgType = []string +type CommandTemplateGetOsTypeRetType = []string + +func getCommandTemplateGetOsTypeAttributeTypeOk(arg CommandTemplateGetOsTypeAttributeType) (ret CommandTemplateGetOsTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandTemplateGetOsTypeAttributeType(arg *CommandTemplateGetOsTypeAttributeType, val CommandTemplateGetOsTypeRetType) { + *arg = &val +} + +/* + types and functions for title +*/ + +// isNotNullableString +type CommandTemplateGetTitleAttributeType = *string + +func getCommandTemplateGetTitleAttributeTypeOk(arg CommandTemplateGetTitleAttributeType) (ret CommandTemplateGetTitleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandTemplateGetTitleAttributeType(arg *CommandTemplateGetTitleAttributeType, val CommandTemplateGetTitleRetType) { + *arg = &val +} + +type CommandTemplateGetTitleArgType = string +type CommandTemplateGetTitleRetType = string + // CommandTemplate struct for CommandTemplate type CommandTemplate struct { - Name *string `json:"name,omitempty"` - OsType *[]string `json:"osType,omitempty"` - Title *string `json:"title,omitempty"` + Name CommandTemplateGetNameAttributeType `json:"name,omitempty"` + OsType CommandTemplateGetOsTypeAttributeType `json:"osType,omitempty"` + Title CommandTemplateGetTitleAttributeType `json:"title,omitempty"` } // NewCommandTemplate instantiates a new CommandTemplate object @@ -42,111 +104,84 @@ func NewCommandTemplateWithDefaults() *CommandTemplate { } // GetName returns the Name field value if set, zero value otherwise. -func (o *CommandTemplate) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *CommandTemplate) GetName() (res CommandTemplateGetNameRetType) { + 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. -func (o *CommandTemplate) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *CommandTemplate) GetNameOk() (ret CommandTemplateGetNameRetType, ok bool) { + return getCommandTemplateGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *CommandTemplate) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + _, ok := o.GetNameOk() + return ok } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *CommandTemplate) SetName(v *string) { - o.Name = v +func (o *CommandTemplate) SetName(v CommandTemplateGetNameRetType) { + setCommandTemplateGetNameAttributeType(&o.Name, v) } // GetOsType returns the OsType field value if set, zero value otherwise. -func (o *CommandTemplate) GetOsType() *[]string { - if o == nil || IsNil(o.OsType) { - var ret *[]string - return ret - } - return o.OsType +func (o *CommandTemplate) GetOsType() (res CommandTemplateGetOsTypeRetType) { + res, _ = o.GetOsTypeOk() + return } // GetOsTypeOk returns a tuple with the OsType field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandTemplate) GetOsTypeOk() (*[]string, bool) { - if o == nil || IsNil(o.OsType) { - return nil, false - } - return o.OsType, true +func (o *CommandTemplate) GetOsTypeOk() (ret CommandTemplateGetOsTypeRetType, ok bool) { + return getCommandTemplateGetOsTypeAttributeTypeOk(o.OsType) } // HasOsType returns a boolean if a field has been set. func (o *CommandTemplate) HasOsType() bool { - if o != nil && !IsNil(o.OsType) { - return true - } - - return false + _, ok := o.GetOsTypeOk() + return ok } // SetOsType gets a reference to the given []string and assigns it to the OsType field. -func (o *CommandTemplate) SetOsType(v *[]string) { - o.OsType = v +func (o *CommandTemplate) SetOsType(v CommandTemplateGetOsTypeRetType) { + setCommandTemplateGetOsTypeAttributeType(&o.OsType, v) } // GetTitle returns the Title field value if set, zero value otherwise. -func (o *CommandTemplate) GetTitle() *string { - if o == nil || IsNil(o.Title) { - var ret *string - return ret - } - return o.Title +func (o *CommandTemplate) GetTitle() (res CommandTemplateGetTitleRetType) { + res, _ = o.GetTitleOk() + return } // GetTitleOk returns a tuple with the Title field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandTemplate) GetTitleOk() (*string, bool) { - if o == nil || IsNil(o.Title) { - return nil, false - } - return o.Title, true +func (o *CommandTemplate) GetTitleOk() (ret CommandTemplateGetTitleRetType, ok bool) { + return getCommandTemplateGetTitleAttributeTypeOk(o.Title) } // HasTitle returns a boolean if a field has been set. func (o *CommandTemplate) HasTitle() bool { - if o != nil && !IsNil(o.Title) { - return true - } - - return false + _, ok := o.GetTitleOk() + return ok } // SetTitle gets a reference to the given string and assigns it to the Title field. -func (o *CommandTemplate) SetTitle(v *string) { - o.Title = v +func (o *CommandTemplate) SetTitle(v CommandTemplateGetTitleRetType) { + setCommandTemplateGetTitleAttributeType(&o.Title, v) } func (o CommandTemplate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getCommandTemplateGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.OsType) { - toSerialize["osType"] = o.OsType + if val, ok := getCommandTemplateGetOsTypeAttributeTypeOk(o.OsType); ok { + toSerialize["OsType"] = val } - if !IsNil(o.Title) { - toSerialize["title"] = o.Title + if val, ok := getCommandTemplateGetTitleAttributeTypeOk(o.Title); ok { + toSerialize["Title"] = val } return toSerialize, nil } diff --git a/services/runcommand/model_command_template_response.go b/services/runcommand/model_command_template_response.go index 6ad0932b0..8c4692604 100644 --- a/services/runcommand/model_command_template_response.go +++ b/services/runcommand/model_command_template_response.go @@ -3,7 +3,7 @@ STACKIT Run Commands Service API API endpoints for the STACKIT Run Commands Service API -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,9 +17,29 @@ import ( // checks if the CommandTemplateResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CommandTemplateResponse{} +/* + types and functions for items +*/ + +// isArray +type CommandTemplateResponseGetItemsAttributeType = *[]CommandTemplate +type CommandTemplateResponseGetItemsArgType = []CommandTemplate +type CommandTemplateResponseGetItemsRetType = []CommandTemplate + +func getCommandTemplateResponseGetItemsAttributeTypeOk(arg CommandTemplateResponseGetItemsAttributeType) (ret CommandTemplateResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandTemplateResponseGetItemsAttributeType(arg *CommandTemplateResponseGetItemsAttributeType, val CommandTemplateResponseGetItemsRetType) { + *arg = &val +} + // CommandTemplateResponse struct for CommandTemplateResponse type CommandTemplateResponse struct { - Items *[]CommandTemplate `json:"items,omitempty"` + Items CommandTemplateResponseGetItemsAttributeType `json:"items,omitempty"` } // NewCommandTemplateResponse instantiates a new CommandTemplateResponse object @@ -40,41 +60,32 @@ func NewCommandTemplateResponseWithDefaults() *CommandTemplateResponse { } // GetItems returns the Items field value if set, zero value otherwise. -func (o *CommandTemplateResponse) GetItems() *[]CommandTemplate { - if o == nil || IsNil(o.Items) { - var ret *[]CommandTemplate - return ret - } - return o.Items +func (o *CommandTemplateResponse) GetItems() (res CommandTemplateResponseGetItemsRetType) { + res, _ = o.GetItemsOk() + return } // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandTemplateResponse) GetItemsOk() (*[]CommandTemplate, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true +func (o *CommandTemplateResponse) GetItemsOk() (ret CommandTemplateResponseGetItemsRetType, ok bool) { + return getCommandTemplateResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. func (o *CommandTemplateResponse) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false + _, ok := o.GetItemsOk() + return ok } // SetItems gets a reference to the given []CommandTemplate and assigns it to the Items field. -func (o *CommandTemplateResponse) SetItems(v *[]CommandTemplate) { - o.Items = v +func (o *CommandTemplateResponse) SetItems(v CommandTemplateResponseGetItemsRetType) { + setCommandTemplateResponseGetItemsAttributeType(&o.Items, v) } func (o CommandTemplateResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Items) { - toSerialize["items"] = o.Items + if val, ok := getCommandTemplateResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val } return toSerialize, nil } diff --git a/services/runcommand/model_command_template_schema.go b/services/runcommand/model_command_template_schema.go index a4c7a8577..f2b2808f3 100644 --- a/services/runcommand/model_command_template_schema.go +++ b/services/runcommand/model_command_template_schema.go @@ -3,7 +3,7 @@ STACKIT Run Commands Service API API endpoints for the STACKIT Run Commands Service API -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,13 +17,116 @@ import ( // checks if the CommandTemplateSchema type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CommandTemplateSchema{} +/* + types and functions for description +*/ + +// isNotNullableString +type CommandTemplateSchemaGetDescriptionAttributeType = *string + +func getCommandTemplateSchemaGetDescriptionAttributeTypeOk(arg CommandTemplateSchemaGetDescriptionAttributeType) (ret CommandTemplateSchemaGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandTemplateSchemaGetDescriptionAttributeType(arg *CommandTemplateSchemaGetDescriptionAttributeType, val CommandTemplateSchemaGetDescriptionRetType) { + *arg = &val +} + +type CommandTemplateSchemaGetDescriptionArgType = string +type CommandTemplateSchemaGetDescriptionRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type CommandTemplateSchemaGetNameAttributeType = *string + +func getCommandTemplateSchemaGetNameAttributeTypeOk(arg CommandTemplateSchemaGetNameAttributeType) (ret CommandTemplateSchemaGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandTemplateSchemaGetNameAttributeType(arg *CommandTemplateSchemaGetNameAttributeType, val CommandTemplateSchemaGetNameRetType) { + *arg = &val +} + +type CommandTemplateSchemaGetNameArgType = string +type CommandTemplateSchemaGetNameRetType = string + +/* + types and functions for osType +*/ + +// isArray +type CommandTemplateSchemaGetOsTypeAttributeType = *[]string +type CommandTemplateSchemaGetOsTypeArgType = []string +type CommandTemplateSchemaGetOsTypeRetType = []string + +func getCommandTemplateSchemaGetOsTypeAttributeTypeOk(arg CommandTemplateSchemaGetOsTypeAttributeType) (ret CommandTemplateSchemaGetOsTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandTemplateSchemaGetOsTypeAttributeType(arg *CommandTemplateSchemaGetOsTypeAttributeType, val CommandTemplateSchemaGetOsTypeRetType) { + *arg = &val +} + +/* + types and functions for parameterSchema +*/ + +// isModel +type CommandTemplateSchemaGetParameterSchemaAttributeType = *ParametersSchema +type CommandTemplateSchemaGetParameterSchemaArgType = ParametersSchema +type CommandTemplateSchemaGetParameterSchemaRetType = ParametersSchema + +func getCommandTemplateSchemaGetParameterSchemaAttributeTypeOk(arg CommandTemplateSchemaGetParameterSchemaAttributeType) (ret CommandTemplateSchemaGetParameterSchemaRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandTemplateSchemaGetParameterSchemaAttributeType(arg *CommandTemplateSchemaGetParameterSchemaAttributeType, val CommandTemplateSchemaGetParameterSchemaRetType) { + *arg = &val +} + +/* + types and functions for title +*/ + +// isNotNullableString +type CommandTemplateSchemaGetTitleAttributeType = *string + +func getCommandTemplateSchemaGetTitleAttributeTypeOk(arg CommandTemplateSchemaGetTitleAttributeType) (ret CommandTemplateSchemaGetTitleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandTemplateSchemaGetTitleAttributeType(arg *CommandTemplateSchemaGetTitleAttributeType, val CommandTemplateSchemaGetTitleRetType) { + *arg = &val +} + +type CommandTemplateSchemaGetTitleArgType = string +type CommandTemplateSchemaGetTitleRetType = string + // CommandTemplateSchema struct for CommandTemplateSchema type CommandTemplateSchema struct { - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` - OsType *[]string `json:"osType,omitempty"` - ParameterSchema *ParametersSchema `json:"parameterSchema,omitempty"` - Title *string `json:"title,omitempty"` + Description CommandTemplateSchemaGetDescriptionAttributeType `json:"description,omitempty"` + Name CommandTemplateSchemaGetNameAttributeType `json:"name,omitempty"` + OsType CommandTemplateSchemaGetOsTypeAttributeType `json:"osType,omitempty"` + ParameterSchema CommandTemplateSchemaGetParameterSchemaAttributeType `json:"parameterSchema,omitempty"` + Title CommandTemplateSchemaGetTitleAttributeType `json:"title,omitempty"` } // NewCommandTemplateSchema instantiates a new CommandTemplateSchema object @@ -44,181 +147,136 @@ func NewCommandTemplateSchemaWithDefaults() *CommandTemplateSchema { } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *CommandTemplateSchema) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *CommandTemplateSchema) GetDescription() (res CommandTemplateSchemaGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return } // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandTemplateSchema) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *CommandTemplateSchema) GetDescriptionOk() (ret CommandTemplateSchemaGetDescriptionRetType, ok bool) { + return getCommandTemplateSchemaGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *CommandTemplateSchema) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false + _, ok := o.GetDescriptionOk() + return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *CommandTemplateSchema) SetDescription(v *string) { - o.Description = v +func (o *CommandTemplateSchema) SetDescription(v CommandTemplateSchemaGetDescriptionRetType) { + setCommandTemplateSchemaGetDescriptionAttributeType(&o.Description, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *CommandTemplateSchema) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *CommandTemplateSchema) GetName() (res CommandTemplateSchemaGetNameRetType) { + 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. -func (o *CommandTemplateSchema) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *CommandTemplateSchema) GetNameOk() (ret CommandTemplateSchemaGetNameRetType, ok bool) { + return getCommandTemplateSchemaGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *CommandTemplateSchema) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + _, ok := o.GetNameOk() + return ok } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *CommandTemplateSchema) SetName(v *string) { - o.Name = v +func (o *CommandTemplateSchema) SetName(v CommandTemplateSchemaGetNameRetType) { + setCommandTemplateSchemaGetNameAttributeType(&o.Name, v) } // GetOsType returns the OsType field value if set, zero value otherwise. -func (o *CommandTemplateSchema) GetOsType() *[]string { - if o == nil || IsNil(o.OsType) { - var ret *[]string - return ret - } - return o.OsType +func (o *CommandTemplateSchema) GetOsType() (res CommandTemplateSchemaGetOsTypeRetType) { + res, _ = o.GetOsTypeOk() + return } // GetOsTypeOk returns a tuple with the OsType field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandTemplateSchema) GetOsTypeOk() (*[]string, bool) { - if o == nil || IsNil(o.OsType) { - return nil, false - } - return o.OsType, true +func (o *CommandTemplateSchema) GetOsTypeOk() (ret CommandTemplateSchemaGetOsTypeRetType, ok bool) { + return getCommandTemplateSchemaGetOsTypeAttributeTypeOk(o.OsType) } // HasOsType returns a boolean if a field has been set. func (o *CommandTemplateSchema) HasOsType() bool { - if o != nil && !IsNil(o.OsType) { - return true - } - - return false + _, ok := o.GetOsTypeOk() + return ok } // SetOsType gets a reference to the given []string and assigns it to the OsType field. -func (o *CommandTemplateSchema) SetOsType(v *[]string) { - o.OsType = v +func (o *CommandTemplateSchema) SetOsType(v CommandTemplateSchemaGetOsTypeRetType) { + setCommandTemplateSchemaGetOsTypeAttributeType(&o.OsType, v) } // GetParameterSchema returns the ParameterSchema field value if set, zero value otherwise. -func (o *CommandTemplateSchema) GetParameterSchema() *ParametersSchema { - if o == nil || IsNil(o.ParameterSchema) { - var ret *ParametersSchema - return ret - } - return o.ParameterSchema +func (o *CommandTemplateSchema) GetParameterSchema() (res CommandTemplateSchemaGetParameterSchemaRetType) { + res, _ = o.GetParameterSchemaOk() + return } // GetParameterSchemaOk returns a tuple with the ParameterSchema field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandTemplateSchema) GetParameterSchemaOk() (*ParametersSchema, bool) { - if o == nil || IsNil(o.ParameterSchema) { - return nil, false - } - return o.ParameterSchema, true +func (o *CommandTemplateSchema) GetParameterSchemaOk() (ret CommandTemplateSchemaGetParameterSchemaRetType, ok bool) { + return getCommandTemplateSchemaGetParameterSchemaAttributeTypeOk(o.ParameterSchema) } // HasParameterSchema returns a boolean if a field has been set. func (o *CommandTemplateSchema) HasParameterSchema() bool { - if o != nil && !IsNil(o.ParameterSchema) { - return true - } - - return false + _, ok := o.GetParameterSchemaOk() + return ok } // SetParameterSchema gets a reference to the given ParametersSchema and assigns it to the ParameterSchema field. -func (o *CommandTemplateSchema) SetParameterSchema(v *ParametersSchema) { - o.ParameterSchema = v +func (o *CommandTemplateSchema) SetParameterSchema(v CommandTemplateSchemaGetParameterSchemaRetType) { + setCommandTemplateSchemaGetParameterSchemaAttributeType(&o.ParameterSchema, v) } // GetTitle returns the Title field value if set, zero value otherwise. -func (o *CommandTemplateSchema) GetTitle() *string { - if o == nil || IsNil(o.Title) { - var ret *string - return ret - } - return o.Title +func (o *CommandTemplateSchema) GetTitle() (res CommandTemplateSchemaGetTitleRetType) { + res, _ = o.GetTitleOk() + return } // GetTitleOk returns a tuple with the Title field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandTemplateSchema) GetTitleOk() (*string, bool) { - if o == nil || IsNil(o.Title) { - return nil, false - } - return o.Title, true +func (o *CommandTemplateSchema) GetTitleOk() (ret CommandTemplateSchemaGetTitleRetType, ok bool) { + return getCommandTemplateSchemaGetTitleAttributeTypeOk(o.Title) } // HasTitle returns a boolean if a field has been set. func (o *CommandTemplateSchema) HasTitle() bool { - if o != nil && !IsNil(o.Title) { - return true - } - - return false + _, ok := o.GetTitleOk() + return ok } // SetTitle gets a reference to the given string and assigns it to the Title field. -func (o *CommandTemplateSchema) SetTitle(v *string) { - o.Title = v +func (o *CommandTemplateSchema) SetTitle(v CommandTemplateSchemaGetTitleRetType) { + setCommandTemplateSchemaGetTitleAttributeType(&o.Title, v) } func (o CommandTemplateSchema) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getCommandTemplateSchemaGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getCommandTemplateSchemaGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.OsType) { - toSerialize["osType"] = o.OsType + if val, ok := getCommandTemplateSchemaGetOsTypeAttributeTypeOk(o.OsType); ok { + toSerialize["OsType"] = val } - if !IsNil(o.ParameterSchema) { - toSerialize["parameterSchema"] = o.ParameterSchema + if val, ok := getCommandTemplateSchemaGetParameterSchemaAttributeTypeOk(o.ParameterSchema); ok { + toSerialize["ParameterSchema"] = val } - if !IsNil(o.Title) { - toSerialize["title"] = o.Title + if val, ok := getCommandTemplateSchemaGetTitleAttributeTypeOk(o.Title); ok { + toSerialize["Title"] = val } return toSerialize, nil } diff --git a/services/runcommand/model_commands.go b/services/runcommand/model_commands.go index ff0c5b283..db96331d1 100644 --- a/services/runcommand/model_commands.go +++ b/services/runcommand/model_commands.go @@ -3,7 +3,7 @@ STACKIT Run Commands Service API API endpoints for the STACKIT Run Commands Service API -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,15 +17,139 @@ import ( // checks if the Commands type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Commands{} +/* + types and functions for commandTemplateName +*/ + +// isNotNullableString +type CommandsGetCommandTemplateNameAttributeType = *string + +func getCommandsGetCommandTemplateNameAttributeTypeOk(arg CommandsGetCommandTemplateNameAttributeType) (ret CommandsGetCommandTemplateNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandsGetCommandTemplateNameAttributeType(arg *CommandsGetCommandTemplateNameAttributeType, val CommandsGetCommandTemplateNameRetType) { + *arg = &val +} + +type CommandsGetCommandTemplateNameArgType = string +type CommandsGetCommandTemplateNameRetType = string + +/* + types and functions for commandTemplateTitle +*/ + +// isNotNullableString +type CommandsGetCommandTemplateTitleAttributeType = *string + +func getCommandsGetCommandTemplateTitleAttributeTypeOk(arg CommandsGetCommandTemplateTitleAttributeType) (ret CommandsGetCommandTemplateTitleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandsGetCommandTemplateTitleAttributeType(arg *CommandsGetCommandTemplateTitleAttributeType, val CommandsGetCommandTemplateTitleRetType) { + *arg = &val +} + +type CommandsGetCommandTemplateTitleArgType = string +type CommandsGetCommandTemplateTitleRetType = string + +/* + types and functions for finishedAt +*/ + +// isNotNullableString +type CommandsGetFinishedAtAttributeType = *string + +func getCommandsGetFinishedAtAttributeTypeOk(arg CommandsGetFinishedAtAttributeType) (ret CommandsGetFinishedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandsGetFinishedAtAttributeType(arg *CommandsGetFinishedAtAttributeType, val CommandsGetFinishedAtRetType) { + *arg = &val +} + +type CommandsGetFinishedAtArgType = string +type CommandsGetFinishedAtRetType = string + +/* + types and functions for id +*/ + +// isInteger +type CommandsGetIdAttributeType = *int64 +type CommandsGetIdArgType = int64 +type CommandsGetIdRetType = int64 + +func getCommandsGetIdAttributeTypeOk(arg CommandsGetIdAttributeType) (ret CommandsGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandsGetIdAttributeType(arg *CommandsGetIdAttributeType, val CommandsGetIdRetType) { + *arg = &val +} + +/* + types and functions for startedAt +*/ + +// isNotNullableString +type CommandsGetStartedAtAttributeType = *string + +func getCommandsGetStartedAtAttributeTypeOk(arg CommandsGetStartedAtAttributeType) (ret CommandsGetStartedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandsGetStartedAtAttributeType(arg *CommandsGetStartedAtAttributeType, val CommandsGetStartedAtRetType) { + *arg = &val +} + +type CommandsGetStartedAtArgType = string +type CommandsGetStartedAtRetType = string + +/* + types and functions for status +*/ + +// isEnumRef +type CommandsGetStatusAttributeType = *string +type CommandsGetStatusArgType = string +type CommandsGetStatusRetType = string + +func getCommandsGetStatusAttributeTypeOk(arg CommandsGetStatusAttributeType) (ret CommandsGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCommandsGetStatusAttributeType(arg *CommandsGetStatusAttributeType, val CommandsGetStatusRetType) { + *arg = &val +} + // Commands struct for Commands type Commands struct { - CommandTemplateName *string `json:"commandTemplateName,omitempty"` - CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` - FinishedAt *string `json:"finishedAt,omitempty"` + CommandTemplateName CommandsGetCommandTemplateNameAttributeType `json:"commandTemplateName,omitempty"` + CommandTemplateTitle CommandsGetCommandTemplateTitleAttributeType `json:"commandTemplateTitle,omitempty"` + FinishedAt CommandsGetFinishedAtAttributeType `json:"finishedAt,omitempty"` // Can be cast to int32 without loss of precision. - Id *int64 `json:"id,omitempty"` - StartedAt *string `json:"startedAt,omitempty"` - Status *string `json:"status,omitempty"` + Id CommandsGetIdAttributeType `json:"id,omitempty"` + StartedAt CommandsGetStartedAtAttributeType `json:"startedAt,omitempty"` + Status CommandsGetStatusAttributeType `json:"status,omitempty"` } // NewCommands instantiates a new Commands object @@ -46,216 +170,162 @@ func NewCommandsWithDefaults() *Commands { } // GetCommandTemplateName returns the CommandTemplateName field value if set, zero value otherwise. -func (o *Commands) GetCommandTemplateName() *string { - if o == nil || IsNil(o.CommandTemplateName) { - var ret *string - return ret - } - return o.CommandTemplateName +func (o *Commands) GetCommandTemplateName() (res CommandsGetCommandTemplateNameRetType) { + res, _ = o.GetCommandTemplateNameOk() + return } // GetCommandTemplateNameOk returns a tuple with the CommandTemplateName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Commands) GetCommandTemplateNameOk() (*string, bool) { - if o == nil || IsNil(o.CommandTemplateName) { - return nil, false - } - return o.CommandTemplateName, true +func (o *Commands) GetCommandTemplateNameOk() (ret CommandsGetCommandTemplateNameRetType, ok bool) { + return getCommandsGetCommandTemplateNameAttributeTypeOk(o.CommandTemplateName) } // HasCommandTemplateName returns a boolean if a field has been set. func (o *Commands) HasCommandTemplateName() bool { - if o != nil && !IsNil(o.CommandTemplateName) { - return true - } - - return false + _, ok := o.GetCommandTemplateNameOk() + return ok } // SetCommandTemplateName gets a reference to the given string and assigns it to the CommandTemplateName field. -func (o *Commands) SetCommandTemplateName(v *string) { - o.CommandTemplateName = v +func (o *Commands) SetCommandTemplateName(v CommandsGetCommandTemplateNameRetType) { + setCommandsGetCommandTemplateNameAttributeType(&o.CommandTemplateName, v) } // GetCommandTemplateTitle returns the CommandTemplateTitle field value if set, zero value otherwise. -func (o *Commands) GetCommandTemplateTitle() *string { - if o == nil || IsNil(o.CommandTemplateTitle) { - var ret *string - return ret - } - return o.CommandTemplateTitle +func (o *Commands) GetCommandTemplateTitle() (res CommandsGetCommandTemplateTitleRetType) { + res, _ = o.GetCommandTemplateTitleOk() + return } // GetCommandTemplateTitleOk returns a tuple with the CommandTemplateTitle field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Commands) GetCommandTemplateTitleOk() (*string, bool) { - if o == nil || IsNil(o.CommandTemplateTitle) { - return nil, false - } - return o.CommandTemplateTitle, true +func (o *Commands) GetCommandTemplateTitleOk() (ret CommandsGetCommandTemplateTitleRetType, ok bool) { + return getCommandsGetCommandTemplateTitleAttributeTypeOk(o.CommandTemplateTitle) } // HasCommandTemplateTitle returns a boolean if a field has been set. func (o *Commands) HasCommandTemplateTitle() bool { - if o != nil && !IsNil(o.CommandTemplateTitle) { - return true - } - - return false + _, ok := o.GetCommandTemplateTitleOk() + return ok } // SetCommandTemplateTitle gets a reference to the given string and assigns it to the CommandTemplateTitle field. -func (o *Commands) SetCommandTemplateTitle(v *string) { - o.CommandTemplateTitle = v +func (o *Commands) SetCommandTemplateTitle(v CommandsGetCommandTemplateTitleRetType) { + setCommandsGetCommandTemplateTitleAttributeType(&o.CommandTemplateTitle, v) } // GetFinishedAt returns the FinishedAt field value if set, zero value otherwise. -func (o *Commands) GetFinishedAt() *string { - if o == nil || IsNil(o.FinishedAt) { - var ret *string - return ret - } - return o.FinishedAt +func (o *Commands) GetFinishedAt() (res CommandsGetFinishedAtRetType) { + res, _ = o.GetFinishedAtOk() + return } // GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Commands) GetFinishedAtOk() (*string, bool) { - if o == nil || IsNil(o.FinishedAt) { - return nil, false - } - return o.FinishedAt, true +func (o *Commands) GetFinishedAtOk() (ret CommandsGetFinishedAtRetType, ok bool) { + return getCommandsGetFinishedAtAttributeTypeOk(o.FinishedAt) } // HasFinishedAt returns a boolean if a field has been set. func (o *Commands) HasFinishedAt() bool { - if o != nil && !IsNil(o.FinishedAt) { - return true - } - - return false + _, ok := o.GetFinishedAtOk() + return ok } // SetFinishedAt gets a reference to the given string and assigns it to the FinishedAt field. -func (o *Commands) SetFinishedAt(v *string) { - o.FinishedAt = v +func (o *Commands) SetFinishedAt(v CommandsGetFinishedAtRetType) { + setCommandsGetFinishedAtAttributeType(&o.FinishedAt, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *Commands) GetId() *int64 { - if o == nil || IsNil(o.Id) { - var ret *int64 - return ret - } - return o.Id +func (o *Commands) GetId() (res CommandsGetIdRetType) { + 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. -func (o *Commands) GetIdOk() (*int64, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *Commands) GetIdOk() (ret CommandsGetIdRetType, ok bool) { + return getCommandsGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *Commands) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given int64 and assigns it to the Id field. -func (o *Commands) SetId(v *int64) { - o.Id = v +func (o *Commands) SetId(v CommandsGetIdRetType) { + setCommandsGetIdAttributeType(&o.Id, v) } // GetStartedAt returns the StartedAt field value if set, zero value otherwise. -func (o *Commands) GetStartedAt() *string { - if o == nil || IsNil(o.StartedAt) { - var ret *string - return ret - } - return o.StartedAt +func (o *Commands) GetStartedAt() (res CommandsGetStartedAtRetType) { + res, _ = o.GetStartedAtOk() + return } // GetStartedAtOk returns a tuple with the StartedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Commands) GetStartedAtOk() (*string, bool) { - if o == nil || IsNil(o.StartedAt) { - return nil, false - } - return o.StartedAt, true +func (o *Commands) GetStartedAtOk() (ret CommandsGetStartedAtRetType, ok bool) { + return getCommandsGetStartedAtAttributeTypeOk(o.StartedAt) } // HasStartedAt returns a boolean if a field has been set. func (o *Commands) HasStartedAt() bool { - if o != nil && !IsNil(o.StartedAt) { - return true - } - - return false + _, ok := o.GetStartedAtOk() + return ok } // SetStartedAt gets a reference to the given string and assigns it to the StartedAt field. -func (o *Commands) SetStartedAt(v *string) { - o.StartedAt = v +func (o *Commands) SetStartedAt(v CommandsGetStartedAtRetType) { + setCommandsGetStartedAtAttributeType(&o.StartedAt, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Commands) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - return o.Status +func (o *Commands) GetStatus() (res CommandsGetStatusRetType) { + res, _ = o.GetStatusOk() + return } // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Commands) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *Commands) GetStatusOk() (ret CommandsGetStatusRetType, ok bool) { + return getCommandsGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *Commands) HasStatus() bool { - if o != nil && !IsNil(o.Status) { - return true - } - - return false + _, ok := o.GetStatusOk() + return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Commands) SetStatus(v *string) { - o.Status = v +func (o *Commands) SetStatus(v CommandsGetStatusRetType) { + setCommandsGetStatusAttributeType(&o.Status, v) } func (o Commands) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.CommandTemplateName) { - toSerialize["commandTemplateName"] = o.CommandTemplateName + if val, ok := getCommandsGetCommandTemplateNameAttributeTypeOk(o.CommandTemplateName); ok { + toSerialize["CommandTemplateName"] = val } - if !IsNil(o.CommandTemplateTitle) { - toSerialize["commandTemplateTitle"] = o.CommandTemplateTitle + if val, ok := getCommandsGetCommandTemplateTitleAttributeTypeOk(o.CommandTemplateTitle); ok { + toSerialize["CommandTemplateTitle"] = val } - if !IsNil(o.FinishedAt) { - toSerialize["finishedAt"] = o.FinishedAt + if val, ok := getCommandsGetFinishedAtAttributeTypeOk(o.FinishedAt); ok { + toSerialize["FinishedAt"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getCommandsGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.StartedAt) { - toSerialize["startedAt"] = o.StartedAt + if val, ok := getCommandsGetStartedAtAttributeTypeOk(o.StartedAt); ok { + toSerialize["StartedAt"] = val } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getCommandsGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } return toSerialize, nil } diff --git a/services/runcommand/model_create_command_payload.go b/services/runcommand/model_create_command_payload.go index a7451afdf..04eb000cb 100644 --- a/services/runcommand/model_create_command_payload.go +++ b/services/runcommand/model_create_command_payload.go @@ -3,7 +3,7 @@ STACKIT Run Commands Service API API endpoints for the STACKIT Run Commands Service API -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,11 +17,52 @@ import ( // checks if the CreateCommandPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateCommandPayload{} +/* + types and functions for commandTemplateName +*/ + +// isNotNullableString +type CreateCommandPayloadGetCommandTemplateNameAttributeType = *string + +func getCreateCommandPayloadGetCommandTemplateNameAttributeTypeOk(arg CreateCommandPayloadGetCommandTemplateNameAttributeType) (ret CreateCommandPayloadGetCommandTemplateNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateCommandPayloadGetCommandTemplateNameAttributeType(arg *CreateCommandPayloadGetCommandTemplateNameAttributeType, val CreateCommandPayloadGetCommandTemplateNameRetType) { + *arg = &val +} + +type CreateCommandPayloadGetCommandTemplateNameArgType = string +type CreateCommandPayloadGetCommandTemplateNameRetType = string + +/* + types and functions for parameters +*/ + +// isContainer +type CreateCommandPayloadGetParametersAttributeType = *map[string]string +type CreateCommandPayloadGetParametersArgType = map[string]string +type CreateCommandPayloadGetParametersRetType = map[string]string + +func getCreateCommandPayloadGetParametersAttributeTypeOk(arg CreateCommandPayloadGetParametersAttributeType) (ret CreateCommandPayloadGetParametersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateCommandPayloadGetParametersAttributeType(arg *CreateCommandPayloadGetParametersAttributeType, val CreateCommandPayloadGetParametersRetType) { + *arg = &val +} + // CreateCommandPayload struct for CreateCommandPayload type CreateCommandPayload struct { // REQUIRED - CommandTemplateName *string `json:"commandTemplateName"` - Parameters *map[string]string `json:"parameters,omitempty"` + CommandTemplateName CreateCommandPayloadGetCommandTemplateNameAttributeType `json:"commandTemplateName"` + Parameters CreateCommandPayloadGetParametersAttributeType `json:"parameters,omitempty"` } type _CreateCommandPayload CreateCommandPayload @@ -30,9 +71,9 @@ type _CreateCommandPayload CreateCommandPayload // 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 NewCreateCommandPayload(commandTemplateName *string) *CreateCommandPayload { +func NewCreateCommandPayload(commandTemplateName CreateCommandPayloadGetCommandTemplateNameArgType) *CreateCommandPayload { this := CreateCommandPayload{} - this.CommandTemplateName = commandTemplateName + setCreateCommandPayloadGetCommandTemplateNameAttributeType(&this.CommandTemplateName, commandTemplateName) return &this } @@ -45,66 +86,52 @@ func NewCreateCommandPayloadWithDefaults() *CreateCommandPayload { } // GetCommandTemplateName returns the CommandTemplateName field value -func (o *CreateCommandPayload) GetCommandTemplateName() *string { - if o == nil || IsNil(o.CommandTemplateName) { - var ret *string - return ret - } - - return o.CommandTemplateName +func (o *CreateCommandPayload) GetCommandTemplateName() (ret CreateCommandPayloadGetCommandTemplateNameRetType) { + ret, _ = o.GetCommandTemplateNameOk() + return ret } // GetCommandTemplateNameOk returns a tuple with the CommandTemplateName field value // and a boolean to check if the value has been set. -func (o *CreateCommandPayload) GetCommandTemplateNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.CommandTemplateName, true +func (o *CreateCommandPayload) GetCommandTemplateNameOk() (ret CreateCommandPayloadGetCommandTemplateNameRetType, ok bool) { + return getCreateCommandPayloadGetCommandTemplateNameAttributeTypeOk(o.CommandTemplateName) } // SetCommandTemplateName sets field value -func (o *CreateCommandPayload) SetCommandTemplateName(v *string) { - o.CommandTemplateName = v +func (o *CreateCommandPayload) SetCommandTemplateName(v CreateCommandPayloadGetCommandTemplateNameRetType) { + setCreateCommandPayloadGetCommandTemplateNameAttributeType(&o.CommandTemplateName, v) } // GetParameters returns the Parameters field value if set, zero value otherwise. -func (o *CreateCommandPayload) GetParameters() *map[string]string { - if o == nil || IsNil(o.Parameters) { - var ret *map[string]string - return ret - } - return o.Parameters +func (o *CreateCommandPayload) GetParameters() (res CreateCommandPayloadGetParametersRetType) { + res, _ = o.GetParametersOk() + return } // GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCommandPayload) GetParametersOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Parameters) { - return nil, false - } - return o.Parameters, true +func (o *CreateCommandPayload) GetParametersOk() (ret CreateCommandPayloadGetParametersRetType, ok bool) { + return getCreateCommandPayloadGetParametersAttributeTypeOk(o.Parameters) } // HasParameters returns a boolean if a field has been set. func (o *CreateCommandPayload) HasParameters() bool { - if o != nil && !IsNil(o.Parameters) { - return true - } - - return false + _, ok := o.GetParametersOk() + return ok } // SetParameters gets a reference to the given map[string]string and assigns it to the Parameters field. -func (o *CreateCommandPayload) SetParameters(v *map[string]string) { - o.Parameters = v +func (o *CreateCommandPayload) SetParameters(v CreateCommandPayloadGetParametersRetType) { + setCreateCommandPayloadGetParametersAttributeType(&o.Parameters, v) } func (o CreateCommandPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["commandTemplateName"] = o.CommandTemplateName - if !IsNil(o.Parameters) { - toSerialize["parameters"] = o.Parameters + if val, ok := getCreateCommandPayloadGetCommandTemplateNameAttributeTypeOk(o.CommandTemplateName); ok { + toSerialize["CommandTemplateName"] = val + } + if val, ok := getCreateCommandPayloadGetParametersAttributeTypeOk(o.Parameters); ok { + toSerialize["Parameters"] = val } return toSerialize, nil } diff --git a/services/runcommand/model_error_response.go b/services/runcommand/model_error_response.go index 92ae87e8e..198e66eab 100644 --- a/services/runcommand/model_error_response.go +++ b/services/runcommand/model_error_response.go @@ -3,7 +3,7 @@ STACKIT Run Commands Service API API endpoints for the STACKIT Run Commands Service API -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,14 +17,56 @@ import ( // checks if the ErrorResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ErrorResponse{} +/* + types and functions for message +*/ + +// isNotNullableString +type ErrorResponseGetMessageAttributeType = *string + +func getErrorResponseGetMessageAttributeTypeOk(arg ErrorResponseGetMessageAttributeType) (ret ErrorResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorResponseGetMessageAttributeType(arg *ErrorResponseGetMessageAttributeType, val ErrorResponseGetMessageRetType) { + *arg = &val +} + +type ErrorResponseGetMessageArgType = string +type ErrorResponseGetMessageRetType = string + +/* + types and functions for status +*/ + +// isNotNullableString +type ErrorResponseGetStatusAttributeType = *string + +func getErrorResponseGetStatusAttributeTypeOk(arg ErrorResponseGetStatusAttributeType) (ret ErrorResponseGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorResponseGetStatusAttributeType(arg *ErrorResponseGetStatusAttributeType, val ErrorResponseGetStatusRetType) { + *arg = &val +} + +type ErrorResponseGetStatusArgType = string +type ErrorResponseGetStatusRetType = string + // ErrorResponse struct for ErrorResponse type ErrorResponse struct { // Details about the error // REQUIRED - Message *string `json:"message"` + Message ErrorResponseGetMessageAttributeType `json:"message"` // The string representation of the http status code (i.e. Not Found, Bad Request, etc) // REQUIRED - Status *string `json:"status"` + Status ErrorResponseGetStatusAttributeType `json:"status"` } type _ErrorResponse ErrorResponse @@ -33,10 +75,10 @@ type _ErrorResponse ErrorResponse // 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 NewErrorResponse(message *string, status *string) *ErrorResponse { +func NewErrorResponse(message ErrorResponseGetMessageArgType, status ErrorResponseGetStatusArgType) *ErrorResponse { this := ErrorResponse{} - this.Message = message - this.Status = status + setErrorResponseGetMessageAttributeType(&this.Message, message) + setErrorResponseGetStatusAttributeType(&this.Status, status) return &this } @@ -49,57 +91,47 @@ func NewErrorResponseWithDefaults() *ErrorResponse { } // GetMessage returns the Message field value -func (o *ErrorResponse) GetMessage() *string { - if o == nil || IsNil(o.Message) { - var ret *string - return ret - } - - return o.Message +func (o *ErrorResponse) GetMessage() (ret ErrorResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret } // GetMessageOk returns a tuple with the Message field value // and a boolean to check if the value has been set. -func (o *ErrorResponse) GetMessageOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Message, true +func (o *ErrorResponse) GetMessageOk() (ret ErrorResponseGetMessageRetType, ok bool) { + return getErrorResponseGetMessageAttributeTypeOk(o.Message) } // SetMessage sets field value -func (o *ErrorResponse) SetMessage(v *string) { - o.Message = v +func (o *ErrorResponse) SetMessage(v ErrorResponseGetMessageRetType) { + setErrorResponseGetMessageAttributeType(&o.Message, v) } // GetStatus returns the Status field value -func (o *ErrorResponse) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - - return o.Status +func (o *ErrorResponse) GetStatus() (ret ErrorResponseGetStatusRetType) { + ret, _ = o.GetStatusOk() + return ret } // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *ErrorResponse) GetStatusOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Status, true +func (o *ErrorResponse) GetStatusOk() (ret ErrorResponseGetStatusRetType, ok bool) { + return getErrorResponseGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value -func (o *ErrorResponse) SetStatus(v *string) { - o.Status = v +func (o *ErrorResponse) SetStatus(v ErrorResponseGetStatusRetType) { + setErrorResponseGetStatusAttributeType(&o.Status, v) } func (o ErrorResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["message"] = o.Message - toSerialize["status"] = o.Status + if val, ok := getErrorResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + if val, ok := getErrorResponseGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val + } return toSerialize, nil } diff --git a/services/runcommand/model_field.go b/services/runcommand/model_field.go index 91675b9ed..f00bcb096 100644 --- a/services/runcommand/model_field.go +++ b/services/runcommand/model_field.go @@ -3,7 +3,7 @@ STACKIT Run Commands Service API API endpoints for the STACKIT Run Commands Service API -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,17 +17,161 @@ import ( // checks if the Field type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Field{} +/* + types and functions for default +*/ + +// isNotNullableString +type FieldGetDefaultAttributeType = *string + +func getFieldGetDefaultAttributeTypeOk(arg FieldGetDefaultAttributeType) (ret FieldGetDefaultRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setFieldGetDefaultAttributeType(arg *FieldGetDefaultAttributeType, val FieldGetDefaultRetType) { + *arg = &val +} + +type FieldGetDefaultArgType = string +type FieldGetDefaultRetType = string + +/* + types and functions for description +*/ + +// isNotNullableString +type FieldGetDescriptionAttributeType = *string + +func getFieldGetDescriptionAttributeTypeOk(arg FieldGetDescriptionAttributeType) (ret FieldGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setFieldGetDescriptionAttributeType(arg *FieldGetDescriptionAttributeType, val FieldGetDescriptionRetType) { + *arg = &val +} + +type FieldGetDescriptionArgType = string +type FieldGetDescriptionRetType = string + +/* + types and functions for maxLen +*/ + +// isInteger +type FieldGetMaxLenAttributeType = *int64 +type FieldGetMaxLenArgType = int64 +type FieldGetMaxLenRetType = int64 + +func getFieldGetMaxLenAttributeTypeOk(arg FieldGetMaxLenAttributeType) (ret FieldGetMaxLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setFieldGetMaxLenAttributeType(arg *FieldGetMaxLenAttributeType, val FieldGetMaxLenRetType) { + *arg = &val +} + +/* + types and functions for minLen +*/ + +// isInteger +type FieldGetMinLenAttributeType = *int64 +type FieldGetMinLenArgType = int64 +type FieldGetMinLenRetType = int64 + +func getFieldGetMinLenAttributeTypeOk(arg FieldGetMinLenAttributeType) (ret FieldGetMinLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setFieldGetMinLenAttributeType(arg *FieldGetMinLenAttributeType, val FieldGetMinLenRetType) { + *arg = &val +} + +/* + types and functions for readOnly +*/ + +// isBoolean +type FieldgetReadOnlyAttributeType = *bool +type FieldgetReadOnlyArgType = bool +type FieldgetReadOnlyRetType = bool + +func getFieldgetReadOnlyAttributeTypeOk(arg FieldgetReadOnlyAttributeType) (ret FieldgetReadOnlyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setFieldgetReadOnlyAttributeType(arg *FieldgetReadOnlyAttributeType, val FieldgetReadOnlyRetType) { + *arg = &val +} + +/* + types and functions for title +*/ + +// isNotNullableString +type FieldGetTitleAttributeType = *string + +func getFieldGetTitleAttributeTypeOk(arg FieldGetTitleAttributeType) (ret FieldGetTitleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setFieldGetTitleAttributeType(arg *FieldGetTitleAttributeType, val FieldGetTitleRetType) { + *arg = &val +} + +type FieldGetTitleArgType = string +type FieldGetTitleRetType = string + +/* + types and functions for type +*/ + +// isNotNullableString +type FieldGetTypeAttributeType = *string + +func getFieldGetTypeAttributeTypeOk(arg FieldGetTypeAttributeType) (ret FieldGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setFieldGetTypeAttributeType(arg *FieldGetTypeAttributeType, val FieldGetTypeRetType) { + *arg = &val +} + +type FieldGetTypeArgType = string +type FieldGetTypeRetType = string + // Field struct for Field type Field struct { - Default *string `json:"default,omitempty"` - Description *string `json:"description,omitempty"` + Default FieldGetDefaultAttributeType `json:"default,omitempty"` + Description FieldGetDescriptionAttributeType `json:"description,omitempty"` // Can be cast to int32 without loss of precision. - MaxLen *int64 `json:"maxLen,omitempty"` + MaxLen FieldGetMaxLenAttributeType `json:"maxLen,omitempty"` // Can be cast to int32 without loss of precision. - MinLen *int64 `json:"minLen,omitempty"` - ReadOnly *bool `json:"readOnly,omitempty"` - Title *string `json:"title,omitempty"` - Type *string `json:"type,omitempty"` + MinLen FieldGetMinLenAttributeType `json:"minLen,omitempty"` + ReadOnly FieldgetReadOnlyAttributeType `json:"readOnly,omitempty"` + Title FieldGetTitleAttributeType `json:"title,omitempty"` + Type FieldGetTypeAttributeType `json:"type,omitempty"` } // NewField instantiates a new Field object @@ -48,251 +192,188 @@ func NewFieldWithDefaults() *Field { } // GetDefault returns the Default field value if set, zero value otherwise. -func (o *Field) GetDefault() *string { - if o == nil || IsNil(o.Default) { - var ret *string - return ret - } - return o.Default +func (o *Field) GetDefault() (res FieldGetDefaultRetType) { + res, _ = o.GetDefaultOk() + return } // GetDefaultOk returns a tuple with the Default field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Field) GetDefaultOk() (*string, bool) { - if o == nil || IsNil(o.Default) { - return nil, false - } - return o.Default, true +func (o *Field) GetDefaultOk() (ret FieldGetDefaultRetType, ok bool) { + return getFieldGetDefaultAttributeTypeOk(o.Default) } // HasDefault returns a boolean if a field has been set. func (o *Field) HasDefault() bool { - if o != nil && !IsNil(o.Default) { - return true - } - - return false + _, ok := o.GetDefaultOk() + return ok } // SetDefault gets a reference to the given string and assigns it to the Default field. -func (o *Field) SetDefault(v *string) { - o.Default = v +func (o *Field) SetDefault(v FieldGetDefaultRetType) { + setFieldGetDefaultAttributeType(&o.Default, v) } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *Field) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *Field) GetDescription() (res FieldGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return } // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Field) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *Field) GetDescriptionOk() (ret FieldGetDescriptionRetType, ok bool) { + return getFieldGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *Field) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false + _, ok := o.GetDescriptionOk() + return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *Field) SetDescription(v *string) { - o.Description = v +func (o *Field) SetDescription(v FieldGetDescriptionRetType) { + setFieldGetDescriptionAttributeType(&o.Description, v) } // GetMaxLen returns the MaxLen field value if set, zero value otherwise. -func (o *Field) GetMaxLen() *int64 { - if o == nil || IsNil(o.MaxLen) { - var ret *int64 - return ret - } - return o.MaxLen +func (o *Field) GetMaxLen() (res FieldGetMaxLenRetType) { + res, _ = o.GetMaxLenOk() + return } // GetMaxLenOk returns a tuple with the MaxLen field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Field) GetMaxLenOk() (*int64, bool) { - if o == nil || IsNil(o.MaxLen) { - return nil, false - } - return o.MaxLen, true +func (o *Field) GetMaxLenOk() (ret FieldGetMaxLenRetType, ok bool) { + return getFieldGetMaxLenAttributeTypeOk(o.MaxLen) } // HasMaxLen returns a boolean if a field has been set. func (o *Field) HasMaxLen() bool { - if o != nil && !IsNil(o.MaxLen) { - return true - } - - return false + _, ok := o.GetMaxLenOk() + return ok } // SetMaxLen gets a reference to the given int64 and assigns it to the MaxLen field. -func (o *Field) SetMaxLen(v *int64) { - o.MaxLen = v +func (o *Field) SetMaxLen(v FieldGetMaxLenRetType) { + setFieldGetMaxLenAttributeType(&o.MaxLen, v) } // GetMinLen returns the MinLen field value if set, zero value otherwise. -func (o *Field) GetMinLen() *int64 { - if o == nil || IsNil(o.MinLen) { - var ret *int64 - return ret - } - return o.MinLen +func (o *Field) GetMinLen() (res FieldGetMinLenRetType) { + res, _ = o.GetMinLenOk() + return } // GetMinLenOk returns a tuple with the MinLen field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Field) GetMinLenOk() (*int64, bool) { - if o == nil || IsNil(o.MinLen) { - return nil, false - } - return o.MinLen, true +func (o *Field) GetMinLenOk() (ret FieldGetMinLenRetType, ok bool) { + return getFieldGetMinLenAttributeTypeOk(o.MinLen) } // HasMinLen returns a boolean if a field has been set. func (o *Field) HasMinLen() bool { - if o != nil && !IsNil(o.MinLen) { - return true - } - - return false + _, ok := o.GetMinLenOk() + return ok } // SetMinLen gets a reference to the given int64 and assigns it to the MinLen field. -func (o *Field) SetMinLen(v *int64) { - o.MinLen = v +func (o *Field) SetMinLen(v FieldGetMinLenRetType) { + setFieldGetMinLenAttributeType(&o.MinLen, v) } // GetReadOnly returns the ReadOnly field value if set, zero value otherwise. -func (o *Field) GetReadOnly() *bool { - if o == nil || IsNil(o.ReadOnly) { - var ret *bool - return ret - } - return o.ReadOnly +func (o *Field) GetReadOnly() (res FieldgetReadOnlyRetType) { + res, _ = o.GetReadOnlyOk() + return } // GetReadOnlyOk returns a tuple with the ReadOnly field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Field) GetReadOnlyOk() (*bool, bool) { - if o == nil || IsNil(o.ReadOnly) { - return nil, false - } - return o.ReadOnly, true +func (o *Field) GetReadOnlyOk() (ret FieldgetReadOnlyRetType, ok bool) { + return getFieldgetReadOnlyAttributeTypeOk(o.ReadOnly) } // HasReadOnly returns a boolean if a field has been set. func (o *Field) HasReadOnly() bool { - if o != nil && !IsNil(o.ReadOnly) { - return true - } - - return false + _, ok := o.GetReadOnlyOk() + return ok } // SetReadOnly gets a reference to the given bool and assigns it to the ReadOnly field. -func (o *Field) SetReadOnly(v *bool) { - o.ReadOnly = v +func (o *Field) SetReadOnly(v FieldgetReadOnlyRetType) { + setFieldgetReadOnlyAttributeType(&o.ReadOnly, v) } // GetTitle returns the Title field value if set, zero value otherwise. -func (o *Field) GetTitle() *string { - if o == nil || IsNil(o.Title) { - var ret *string - return ret - } - return o.Title +func (o *Field) GetTitle() (res FieldGetTitleRetType) { + res, _ = o.GetTitleOk() + return } // GetTitleOk returns a tuple with the Title field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Field) GetTitleOk() (*string, bool) { - if o == nil || IsNil(o.Title) { - return nil, false - } - return o.Title, true +func (o *Field) GetTitleOk() (ret FieldGetTitleRetType, ok bool) { + return getFieldGetTitleAttributeTypeOk(o.Title) } // HasTitle returns a boolean if a field has been set. func (o *Field) HasTitle() bool { - if o != nil && !IsNil(o.Title) { - return true - } - - return false + _, ok := o.GetTitleOk() + return ok } // SetTitle gets a reference to the given string and assigns it to the Title field. -func (o *Field) SetTitle(v *string) { - o.Title = v +func (o *Field) SetTitle(v FieldGetTitleRetType) { + setFieldGetTitleAttributeType(&o.Title, v) } // GetType returns the Type field value if set, zero value otherwise. -func (o *Field) GetType() *string { - if o == nil || IsNil(o.Type) { - var ret *string - return ret - } - return o.Type +func (o *Field) GetType() (res FieldGetTypeRetType) { + res, _ = o.GetTypeOk() + return } // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Field) GetTypeOk() (*string, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return o.Type, true +func (o *Field) GetTypeOk() (ret FieldGetTypeRetType, ok bool) { + return getFieldGetTypeAttributeTypeOk(o.Type) } // HasType returns a boolean if a field has been set. func (o *Field) HasType() bool { - if o != nil && !IsNil(o.Type) { - return true - } - - return false + _, ok := o.GetTypeOk() + return ok } // SetType gets a reference to the given string and assigns it to the Type field. -func (o *Field) SetType(v *string) { - o.Type = v +func (o *Field) SetType(v FieldGetTypeRetType) { + setFieldGetTypeAttributeType(&o.Type, v) } func (o Field) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Default) { - toSerialize["default"] = o.Default + if val, ok := getFieldGetDefaultAttributeTypeOk(o.Default); ok { + toSerialize["Default"] = val } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getFieldGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val } - if !IsNil(o.MaxLen) { - toSerialize["maxLen"] = o.MaxLen + if val, ok := getFieldGetMaxLenAttributeTypeOk(o.MaxLen); ok { + toSerialize["MaxLen"] = val } - if !IsNil(o.MinLen) { - toSerialize["minLen"] = o.MinLen + if val, ok := getFieldGetMinLenAttributeTypeOk(o.MinLen); ok { + toSerialize["MinLen"] = val } - if !IsNil(o.ReadOnly) { - toSerialize["readOnly"] = o.ReadOnly + if val, ok := getFieldgetReadOnlyAttributeTypeOk(o.ReadOnly); ok { + toSerialize["ReadOnly"] = val } - if !IsNil(o.Title) { - toSerialize["title"] = o.Title + if val, ok := getFieldGetTitleAttributeTypeOk(o.Title); ok { + toSerialize["Title"] = val } - if !IsNil(o.Type) { - toSerialize["type"] = o.Type + if val, ok := getFieldGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val } return toSerialize, nil } diff --git a/services/runcommand/model_get_commands_response.go b/services/runcommand/model_get_commands_response.go index 3e1a85495..77d5ccb8a 100644 --- a/services/runcommand/model_get_commands_response.go +++ b/services/runcommand/model_get_commands_response.go @@ -3,7 +3,7 @@ STACKIT Run Commands Service API API endpoints for the STACKIT Run Commands Service API -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,9 +17,29 @@ import ( // checks if the GetCommandsResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetCommandsResponse{} +/* + types and functions for items +*/ + +// isArray +type GetCommandsResponseGetItemsAttributeType = *[]Commands +type GetCommandsResponseGetItemsArgType = []Commands +type GetCommandsResponseGetItemsRetType = []Commands + +func getGetCommandsResponseGetItemsAttributeTypeOk(arg GetCommandsResponseGetItemsAttributeType) (ret GetCommandsResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetCommandsResponseGetItemsAttributeType(arg *GetCommandsResponseGetItemsAttributeType, val GetCommandsResponseGetItemsRetType) { + *arg = &val +} + // GetCommandsResponse struct for GetCommandsResponse type GetCommandsResponse struct { - Items *[]Commands `json:"items,omitempty"` + Items GetCommandsResponseGetItemsAttributeType `json:"items,omitempty"` } // NewGetCommandsResponse instantiates a new GetCommandsResponse object @@ -40,41 +60,32 @@ func NewGetCommandsResponseWithDefaults() *GetCommandsResponse { } // GetItems returns the Items field value if set, zero value otherwise. -func (o *GetCommandsResponse) GetItems() *[]Commands { - if o == nil || IsNil(o.Items) { - var ret *[]Commands - return ret - } - return o.Items +func (o *GetCommandsResponse) GetItems() (res GetCommandsResponseGetItemsRetType) { + res, _ = o.GetItemsOk() + return } // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetCommandsResponse) GetItemsOk() (*[]Commands, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true +func (o *GetCommandsResponse) GetItemsOk() (ret GetCommandsResponseGetItemsRetType, ok bool) { + return getGetCommandsResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. func (o *GetCommandsResponse) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false + _, ok := o.GetItemsOk() + return ok } // SetItems gets a reference to the given []Commands and assigns it to the Items field. -func (o *GetCommandsResponse) SetItems(v *[]Commands) { - o.Items = v +func (o *GetCommandsResponse) SetItems(v GetCommandsResponseGetItemsRetType) { + setGetCommandsResponseGetItemsAttributeType(&o.Items, v) } func (o GetCommandsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Items) { - toSerialize["items"] = o.Items + if val, ok := getGetCommandsResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val } return toSerialize, nil } diff --git a/services/runcommand/model_new_command_response.go b/services/runcommand/model_new_command_response.go index 0474a642a..6ac4958bd 100644 --- a/services/runcommand/model_new_command_response.go +++ b/services/runcommand/model_new_command_response.go @@ -3,7 +3,7 @@ STACKIT Run Commands Service API API endpoints for the STACKIT Run Commands Service API -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,10 +17,30 @@ import ( // checks if the NewCommandResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &NewCommandResponse{} +/* + types and functions for id +*/ + +// isInteger +type NewCommandResponseGetIdAttributeType = *int64 +type NewCommandResponseGetIdArgType = int64 +type NewCommandResponseGetIdRetType = int64 + +func getNewCommandResponseGetIdAttributeTypeOk(arg NewCommandResponseGetIdAttributeType) (ret NewCommandResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNewCommandResponseGetIdAttributeType(arg *NewCommandResponseGetIdAttributeType, val NewCommandResponseGetIdRetType) { + *arg = &val +} + // NewCommandResponse struct for NewCommandResponse type NewCommandResponse struct { // Can be cast to int32 without loss of precision. - Id *int64 `json:"id,omitempty"` + Id NewCommandResponseGetIdAttributeType `json:"id,omitempty"` } // NewNewCommandResponse instantiates a new NewCommandResponse object @@ -41,41 +61,32 @@ func NewNewCommandResponseWithDefaults() *NewCommandResponse { } // GetId returns the Id field value if set, zero value otherwise. -func (o *NewCommandResponse) GetId() *int64 { - if o == nil || IsNil(o.Id) { - var ret *int64 - return ret - } - return o.Id +func (o *NewCommandResponse) GetId() (res NewCommandResponseGetIdRetType) { + 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. -func (o *NewCommandResponse) GetIdOk() (*int64, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *NewCommandResponse) GetIdOk() (ret NewCommandResponseGetIdRetType, ok bool) { + return getNewCommandResponseGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *NewCommandResponse) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given int64 and assigns it to the Id field. -func (o *NewCommandResponse) SetId(v *int64) { - o.Id = v +func (o *NewCommandResponse) SetId(v NewCommandResponseGetIdRetType) { + setNewCommandResponseGetIdAttributeType(&o.Id, v) } func (o NewCommandResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getNewCommandResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } return toSerialize, nil } diff --git a/services/runcommand/model_parameters_schema.go b/services/runcommand/model_parameters_schema.go index 18d94bf28..4709b939e 100644 --- a/services/runcommand/model_parameters_schema.go +++ b/services/runcommand/model_parameters_schema.go @@ -3,7 +3,7 @@ STACKIT Run Commands Service API API endpoints for the STACKIT Run Commands Service API -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,9 +17,29 @@ import ( // checks if the ParametersSchema type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ParametersSchema{} +/* + types and functions for properties +*/ + +// isModel +type ParametersSchemaGetPropertiesAttributeType = *Properties +type ParametersSchemaGetPropertiesArgType = Properties +type ParametersSchemaGetPropertiesRetType = Properties + +func getParametersSchemaGetPropertiesAttributeTypeOk(arg ParametersSchemaGetPropertiesAttributeType) (ret ParametersSchemaGetPropertiesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setParametersSchemaGetPropertiesAttributeType(arg *ParametersSchemaGetPropertiesAttributeType, val ParametersSchemaGetPropertiesRetType) { + *arg = &val +} + // ParametersSchema struct for ParametersSchema type ParametersSchema struct { - Properties *Properties `json:"properties,omitempty"` + Properties ParametersSchemaGetPropertiesAttributeType `json:"properties,omitempty"` } // NewParametersSchema instantiates a new ParametersSchema object @@ -40,41 +60,32 @@ func NewParametersSchemaWithDefaults() *ParametersSchema { } // GetProperties returns the Properties field value if set, zero value otherwise. -func (o *ParametersSchema) GetProperties() *Properties { - if o == nil || IsNil(o.Properties) { - var ret *Properties - return ret - } - return o.Properties +func (o *ParametersSchema) GetProperties() (res ParametersSchemaGetPropertiesRetType) { + res, _ = o.GetPropertiesOk() + return } // GetPropertiesOk returns a tuple with the Properties field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ParametersSchema) GetPropertiesOk() (*Properties, bool) { - if o == nil || IsNil(o.Properties) { - return nil, false - } - return o.Properties, true +func (o *ParametersSchema) GetPropertiesOk() (ret ParametersSchemaGetPropertiesRetType, ok bool) { + return getParametersSchemaGetPropertiesAttributeTypeOk(o.Properties) } // HasProperties returns a boolean if a field has been set. func (o *ParametersSchema) HasProperties() bool { - if o != nil && !IsNil(o.Properties) { - return true - } - - return false + _, ok := o.GetPropertiesOk() + return ok } // SetProperties gets a reference to the given Properties and assigns it to the Properties field. -func (o *ParametersSchema) SetProperties(v *Properties) { - o.Properties = v +func (o *ParametersSchema) SetProperties(v ParametersSchemaGetPropertiesRetType) { + setParametersSchemaGetPropertiesAttributeType(&o.Properties, v) } func (o ParametersSchema) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Properties) { - toSerialize["properties"] = o.Properties + if val, ok := getParametersSchemaGetPropertiesAttributeTypeOk(o.Properties); ok { + toSerialize["Properties"] = val } return toSerialize, nil } diff --git a/services/runcommand/model_properties.go b/services/runcommand/model_properties.go index 4df15d7de..c31e0375e 100644 --- a/services/runcommand/model_properties.go +++ b/services/runcommand/model_properties.go @@ -3,7 +3,7 @@ STACKIT Run Commands Service API API endpoints for the STACKIT Run Commands Service API -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,14 +17,135 @@ import ( // checks if the Properties type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Properties{} +/* + types and functions for ConfirmPassword +*/ + +// isModel +type PropertiesGetConfirmPasswordAttributeType = *Field +type PropertiesGetConfirmPasswordArgType = Field +type PropertiesGetConfirmPasswordRetType = Field + +func getPropertiesGetConfirmPasswordAttributeTypeOk(arg PropertiesGetConfirmPasswordAttributeType) (ret PropertiesGetConfirmPasswordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPropertiesGetConfirmPasswordAttributeType(arg *PropertiesGetConfirmPasswordAttributeType, val PropertiesGetConfirmPasswordRetType) { + *arg = &val +} + +/* + types and functions for Password +*/ + +// isModel +type PropertiesGetPasswordAttributeType = *Field +type PropertiesGetPasswordArgType = Field +type PropertiesGetPasswordRetType = Field + +func getPropertiesGetPasswordAttributeTypeOk(arg PropertiesGetPasswordAttributeType) (ret PropertiesGetPasswordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPropertiesGetPasswordAttributeType(arg *PropertiesGetPasswordAttributeType, val PropertiesGetPasswordRetType) { + *arg = &val +} + +/* + types and functions for Script +*/ + +// isModel +type PropertiesGetScriptAttributeType = *Field +type PropertiesGetScriptArgType = Field +type PropertiesGetScriptRetType = Field + +func getPropertiesGetScriptAttributeTypeOk(arg PropertiesGetScriptAttributeType) (ret PropertiesGetScriptRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPropertiesGetScriptAttributeType(arg *PropertiesGetScriptAttributeType, val PropertiesGetScriptRetType) { + *arg = &val +} + +/* + types and functions for Username +*/ + +// isModel +type PropertiesGetUsernameAttributeType = *Field +type PropertiesGetUsernameArgType = Field +type PropertiesGetUsernameRetType = Field + +func getPropertiesGetUsernameAttributeTypeOk(arg PropertiesGetUsernameAttributeType) (ret PropertiesGetUsernameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPropertiesGetUsernameAttributeType(arg *PropertiesGetUsernameAttributeType, val PropertiesGetUsernameRetType) { + *arg = &val +} + +/* + types and functions for required +*/ + +// isArray +type PropertiesGetRequiredAttributeType = *[]string +type PropertiesGetRequiredArgType = []string +type PropertiesGetRequiredRetType = []string + +func getPropertiesGetRequiredAttributeTypeOk(arg PropertiesGetRequiredAttributeType) (ret PropertiesGetRequiredRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPropertiesGetRequiredAttributeType(arg *PropertiesGetRequiredAttributeType, val PropertiesGetRequiredRetType) { + *arg = &val +} + +/* + types and functions for type +*/ + +// isNotNullableString +type PropertiesGetTypeAttributeType = *string + +func getPropertiesGetTypeAttributeTypeOk(arg PropertiesGetTypeAttributeType) (ret PropertiesGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPropertiesGetTypeAttributeType(arg *PropertiesGetTypeAttributeType, val PropertiesGetTypeRetType) { + *arg = &val +} + +type PropertiesGetTypeArgType = string +type PropertiesGetTypeRetType = string + // Properties struct for Properties type Properties struct { - ConfirmPassword *Field `json:"ConfirmPassword,omitempty"` - Password *Field `json:"Password,omitempty"` - Script *Field `json:"Script,omitempty"` - Username *Field `json:"Username,omitempty"` - Required *[]string `json:"required,omitempty"` - Type *string `json:"type,omitempty"` + ConfirmPassword PropertiesGetConfirmPasswordAttributeType `json:"ConfirmPassword,omitempty"` + Password PropertiesGetPasswordAttributeType `json:"Password,omitempty"` + Script PropertiesGetScriptAttributeType `json:"Script,omitempty"` + Username PropertiesGetUsernameAttributeType `json:"Username,omitempty"` + Required PropertiesGetRequiredAttributeType `json:"required,omitempty"` + Type PropertiesGetTypeAttributeType `json:"type,omitempty"` } // NewProperties instantiates a new Properties object @@ -45,216 +166,162 @@ func NewPropertiesWithDefaults() *Properties { } // GetConfirmPassword returns the ConfirmPassword field value if set, zero value otherwise. -func (o *Properties) GetConfirmPassword() *Field { - if o == nil || IsNil(o.ConfirmPassword) { - var ret *Field - return ret - } - return o.ConfirmPassword +func (o *Properties) GetConfirmPassword() (res PropertiesGetConfirmPasswordRetType) { + res, _ = o.GetConfirmPasswordOk() + return } // GetConfirmPasswordOk returns a tuple with the ConfirmPassword field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Properties) GetConfirmPasswordOk() (*Field, bool) { - if o == nil || IsNil(o.ConfirmPassword) { - return nil, false - } - return o.ConfirmPassword, true +func (o *Properties) GetConfirmPasswordOk() (ret PropertiesGetConfirmPasswordRetType, ok bool) { + return getPropertiesGetConfirmPasswordAttributeTypeOk(o.ConfirmPassword) } // HasConfirmPassword returns a boolean if a field has been set. func (o *Properties) HasConfirmPassword() bool { - if o != nil && !IsNil(o.ConfirmPassword) { - return true - } - - return false + _, ok := o.GetConfirmPasswordOk() + return ok } // SetConfirmPassword gets a reference to the given Field and assigns it to the ConfirmPassword field. -func (o *Properties) SetConfirmPassword(v *Field) { - o.ConfirmPassword = v +func (o *Properties) SetConfirmPassword(v PropertiesGetConfirmPasswordRetType) { + setPropertiesGetConfirmPasswordAttributeType(&o.ConfirmPassword, v) } // GetPassword returns the Password field value if set, zero value otherwise. -func (o *Properties) GetPassword() *Field { - if o == nil || IsNil(o.Password) { - var ret *Field - return ret - } - return o.Password +func (o *Properties) GetPassword() (res PropertiesGetPasswordRetType) { + 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. -func (o *Properties) GetPasswordOk() (*Field, bool) { - if o == nil || IsNil(o.Password) { - return nil, false - } - return o.Password, true +func (o *Properties) GetPasswordOk() (ret PropertiesGetPasswordRetType, ok bool) { + return getPropertiesGetPasswordAttributeTypeOk(o.Password) } // HasPassword returns a boolean if a field has been set. func (o *Properties) HasPassword() bool { - if o != nil && !IsNil(o.Password) { - return true - } - - return false + _, ok := o.GetPasswordOk() + return ok } // SetPassword gets a reference to the given Field and assigns it to the Password field. -func (o *Properties) SetPassword(v *Field) { - o.Password = v +func (o *Properties) SetPassword(v PropertiesGetPasswordRetType) { + setPropertiesGetPasswordAttributeType(&o.Password, v) } // GetScript returns the Script field value if set, zero value otherwise. -func (o *Properties) GetScript() *Field { - if o == nil || IsNil(o.Script) { - var ret *Field - return ret - } - return o.Script +func (o *Properties) GetScript() (res PropertiesGetScriptRetType) { + res, _ = o.GetScriptOk() + return } // GetScriptOk returns a tuple with the Script field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Properties) GetScriptOk() (*Field, bool) { - if o == nil || IsNil(o.Script) { - return nil, false - } - return o.Script, true +func (o *Properties) GetScriptOk() (ret PropertiesGetScriptRetType, ok bool) { + return getPropertiesGetScriptAttributeTypeOk(o.Script) } // HasScript returns a boolean if a field has been set. func (o *Properties) HasScript() bool { - if o != nil && !IsNil(o.Script) { - return true - } - - return false + _, ok := o.GetScriptOk() + return ok } // SetScript gets a reference to the given Field and assigns it to the Script field. -func (o *Properties) SetScript(v *Field) { - o.Script = v +func (o *Properties) SetScript(v PropertiesGetScriptRetType) { + setPropertiesGetScriptAttributeType(&o.Script, v) } // GetUsername returns the Username field value if set, zero value otherwise. -func (o *Properties) GetUsername() *Field { - if o == nil || IsNil(o.Username) { - var ret *Field - return ret - } - return o.Username +func (o *Properties) GetUsername() (res PropertiesGetUsernameRetType) { + res, _ = o.GetUsernameOk() + return } // GetUsernameOk returns a tuple with the Username field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Properties) GetUsernameOk() (*Field, bool) { - if o == nil || IsNil(o.Username) { - return nil, false - } - return o.Username, true +func (o *Properties) GetUsernameOk() (ret PropertiesGetUsernameRetType, ok bool) { + return getPropertiesGetUsernameAttributeTypeOk(o.Username) } // HasUsername returns a boolean if a field has been set. func (o *Properties) HasUsername() bool { - if o != nil && !IsNil(o.Username) { - return true - } - - return false + _, ok := o.GetUsernameOk() + return ok } // SetUsername gets a reference to the given Field and assigns it to the Username field. -func (o *Properties) SetUsername(v *Field) { - o.Username = v +func (o *Properties) SetUsername(v PropertiesGetUsernameRetType) { + setPropertiesGetUsernameAttributeType(&o.Username, v) } // GetRequired returns the Required field value if set, zero value otherwise. -func (o *Properties) GetRequired() *[]string { - if o == nil || IsNil(o.Required) { - var ret *[]string - return ret - } - return o.Required +func (o *Properties) GetRequired() (res PropertiesGetRequiredRetType) { + res, _ = o.GetRequiredOk() + return } // GetRequiredOk returns a tuple with the Required field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Properties) GetRequiredOk() (*[]string, bool) { - if o == nil || IsNil(o.Required) { - return nil, false - } - return o.Required, true +func (o *Properties) GetRequiredOk() (ret PropertiesGetRequiredRetType, ok bool) { + return getPropertiesGetRequiredAttributeTypeOk(o.Required) } // HasRequired returns a boolean if a field has been set. func (o *Properties) HasRequired() bool { - if o != nil && !IsNil(o.Required) { - return true - } - - return false + _, ok := o.GetRequiredOk() + return ok } // SetRequired gets a reference to the given []string and assigns it to the Required field. -func (o *Properties) SetRequired(v *[]string) { - o.Required = v +func (o *Properties) SetRequired(v PropertiesGetRequiredRetType) { + setPropertiesGetRequiredAttributeType(&o.Required, v) } // GetType returns the Type field value if set, zero value otherwise. -func (o *Properties) GetType() *string { - if o == nil || IsNil(o.Type) { - var ret *string - return ret - } - return o.Type +func (o *Properties) GetType() (res PropertiesGetTypeRetType) { + res, _ = o.GetTypeOk() + return } // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Properties) GetTypeOk() (*string, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return o.Type, true +func (o *Properties) GetTypeOk() (ret PropertiesGetTypeRetType, ok bool) { + return getPropertiesGetTypeAttributeTypeOk(o.Type) } // HasType returns a boolean if a field has been set. func (o *Properties) HasType() bool { - if o != nil && !IsNil(o.Type) { - return true - } - - return false + _, ok := o.GetTypeOk() + return ok } // SetType gets a reference to the given string and assigns it to the Type field. -func (o *Properties) SetType(v *string) { - o.Type = v +func (o *Properties) SetType(v PropertiesGetTypeRetType) { + setPropertiesGetTypeAttributeType(&o.Type, v) } func (o Properties) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.ConfirmPassword) { - toSerialize["ConfirmPassword"] = o.ConfirmPassword + if val, ok := getPropertiesGetConfirmPasswordAttributeTypeOk(o.ConfirmPassword); ok { + toSerialize["ConfirmPassword"] = val } - if !IsNil(o.Password) { - toSerialize["Password"] = o.Password + if val, ok := getPropertiesGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val } - if !IsNil(o.Script) { - toSerialize["Script"] = o.Script + if val, ok := getPropertiesGetScriptAttributeTypeOk(o.Script); ok { + toSerialize["Script"] = val } - if !IsNil(o.Username) { - toSerialize["Username"] = o.Username + if val, ok := getPropertiesGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val } - if !IsNil(o.Required) { - toSerialize["required"] = o.Required + if val, ok := getPropertiesGetRequiredAttributeTypeOk(o.Required); ok { + toSerialize["Required"] = val } - if !IsNil(o.Type) { - toSerialize["type"] = o.Type + if val, ok := getPropertiesGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val } return toSerialize, nil } diff --git a/services/runcommand/utils.go b/services/runcommand/utils.go index 7dcb6f7b0..fb4222fa9 100644 --- a/services/runcommand/utils.go +++ b/services/runcommand/utils.go @@ -3,7 +3,7 @@ STACKIT Run Commands Service API API endpoints for the STACKIT Run Commands Service API -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -40,6 +40,29 @@ func PtrString(v string) *string { return &v } // PtrTime is helper routine that returns a pointer to given Time value. func PtrTime(v time.Time) *time.Time { return &v } +type NullableValue[T any] struct { + value *T + isSet bool +} + +func (v NullableValue[T]) Get() *T { + return v.value +} + +func (v *NullableValue[T]) Set(val *T) { + v.value = val + v.isSet = true +} + +func (v NullableValue[T]) IsSet() bool { + return v.isSet +} + +func (v *NullableValue[T]) Unset() { + v.value = nil + v.isSet = false +} + type NullableBool struct { value *bool isSet bool @@ -333,6 +356,9 @@ func IsNil(i interface{}) bool { if i == nil { return true } + if t, ok := i.(interface{ IsSet() bool }); ok { + return !t.IsSet() + } switch reflect.TypeOf(i).Kind() { case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: return reflect.ValueOf(i).IsNil() From a2897405dc5ad57adcf4c42c9ebb12c49485048b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Schmitz?= <152157960+bahkauv70@users.noreply.github.com> Date: Mon, 17 Mar 2025 09:38:53 +0100 Subject: [PATCH 2/2] chore: updated changelog --- CHANGELOG.md | 2 ++ services/runcommand/CHANGELOG.md | 3 +++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 764e3c089..8674a8c08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ ## Release (2025-03-14) +- `runcommand`: [v1.0.0](services/runcommand/CHANGELOG.md#v100-2025-03-19) + - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. - `certificates`: [v1.0.0](services/certificates/CHANGELOG.md#v100-2025-03-14) - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. - `postgresflex`: [v1.0.1](services/postgresflex/CHANGELOG.md#v101-2025-03-12) diff --git a/services/runcommand/CHANGELOG.md b/services/runcommand/CHANGELOG.md index 7086aa797..3512a5f9c 100644 --- a/services/runcommand/CHANGELOG.md +++ b/services/runcommand/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.0.0 (2025-03-19) +- **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + ## v0.3.0 (2025-02-21) - **New:** Minimal go version is now Go 1.21