From 221a4f864dd84141c30b226d5e260e3faa93c6f0 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Fri, 14 Mar 2025 16:12:37 +0000 Subject: [PATCH 1/2] Generate certificates --- services/certificates/api_default.go | 46 +--- services/certificates/api_default_test.go | 68 ++--- services/certificates/client.go | 4 +- services/certificates/configuration.go | 9 +- .../model_create_certificate_payload.go | 255 +++++++++--------- .../model_create_certificate_response.go | 93 +++---- .../model_get_certificate_response.go | 201 +++++++------- .../certificates/model_google_protobuf_any.go | 56 ++-- .../model_list_certificates_response.go | 109 +++++--- services/certificates/model_status.go | 162 ++++++----- services/certificates/utils.go | 28 +- 11 files changed, 541 insertions(+), 490 deletions(-) diff --git a/services/certificates/api_default.go b/services/certificates/api_default.go index 125a0e279..3e58e0a1e 100644 --- a/services/certificates/api_default.go +++ b/services/certificates/api_default.go @@ -3,7 +3,7 @@ Load Balancer Certificates API This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. -API version: 2beta.0.0 +API version: 1beta.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -30,7 +30,6 @@ type ApiCreateCertificateRequest struct { ctx context.Context apiService *DefaultApiService projectId string - region string createCertificatePayload *CreateCertificatePayload } @@ -52,9 +51,8 @@ func (r ApiCreateCertificateRequest) Execute() (*CreateCertificateResponse, erro return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2beta/projects/{projectId}/regions/{region}/certificates" + localVarPath := localBasePath + "/v1beta/projects/{projectId}/certificates" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -156,24 +154,21 @@ CreateCertificate will store a TLS certificate in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId - @param region @return ApiCreateCertificateRequest */ -func (a *APIClient) CreateCertificate(ctx context.Context, projectId string, region string) ApiCreateCertificateRequest { +func (a *APIClient) CreateCertificate(ctx context.Context, projectId string) ApiCreateCertificateRequest { return ApiCreateCertificateRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - region: region, } } -func (a *APIClient) CreateCertificateExecute(ctx context.Context, projectId string, region string) (*CreateCertificateResponse, error) { +func (a *APIClient) CreateCertificateExecute(ctx context.Context, projectId string) (*CreateCertificateResponse, error) { r := ApiCreateCertificateRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - region: region, } return r.Execute() } @@ -182,7 +177,6 @@ type ApiDeleteCertificateRequest struct { ctx context.Context apiService *DefaultApiService projectId string - region string id string } @@ -199,9 +193,8 @@ func (r ApiDeleteCertificateRequest) Execute() (map[string]interface{}, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2beta/projects/{projectId}/regions/{region}/certificates/{id}" + localVarPath := localBasePath + "/v1beta/projects/{projectId}/certificates/{id}" 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, "{"+"id"+"}", url.PathEscape(ParameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -299,26 +292,23 @@ DeleteCertificate will delete the stored TLS certificate. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId - @param region @param id @return ApiDeleteCertificateRequest */ -func (a *APIClient) DeleteCertificate(ctx context.Context, projectId string, region string, id string) ApiDeleteCertificateRequest { +func (a *APIClient) DeleteCertificate(ctx context.Context, projectId string, id string) ApiDeleteCertificateRequest { return ApiDeleteCertificateRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - region: region, id: id, } } -func (a *APIClient) DeleteCertificateExecute(ctx context.Context, projectId string, region string, id string) (map[string]interface{}, error) { +func (a *APIClient) DeleteCertificateExecute(ctx context.Context, projectId string, id string) (map[string]interface{}, error) { r := ApiDeleteCertificateRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - region: region, id: id, } return r.Execute() @@ -328,7 +318,6 @@ type ApiGetCertificateRequest struct { ctx context.Context apiService *DefaultApiService projectId string - region string id string } @@ -345,9 +334,8 @@ func (r ApiGetCertificateRequest) Execute() (*GetCertificateResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2beta/projects/{projectId}/regions/{region}/certificates/{id}" + localVarPath := localBasePath + "/v1beta/projects/{projectId}/certificates/{id}" 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, "{"+"id"+"}", url.PathEscape(ParameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) @@ -445,26 +433,23 @@ GetCertificate will return the public parts of a stored TLS certificate. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId - @param region @param id @return ApiGetCertificateRequest */ -func (a *APIClient) GetCertificate(ctx context.Context, projectId string, region string, id string) ApiGetCertificateRequest { +func (a *APIClient) GetCertificate(ctx context.Context, projectId string, id string) ApiGetCertificateRequest { return ApiGetCertificateRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - region: region, id: id, } } -func (a *APIClient) GetCertificateExecute(ctx context.Context, projectId string, region string, id string) (*GetCertificateResponse, error) { +func (a *APIClient) GetCertificateExecute(ctx context.Context, projectId string, id string) (*GetCertificateResponse, error) { r := ApiGetCertificateRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - region: region, id: id, } return r.Execute() @@ -474,7 +459,6 @@ type ApiListCertificatesRequest struct { ctx context.Context apiService *DefaultApiService projectId string - region string pageSize *string pageId *string } @@ -506,9 +490,8 @@ func (r ApiListCertificatesRequest) Execute() (*ListCertificatesResponse, error) return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2beta/projects/{projectId}/regions/{region}/certificates" + localVarPath := localBasePath + "/v1beta/projects/{projectId}/certificates" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -611,24 +594,21 @@ ListCertificates will return the list of TLS certificates in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId - @param region @return ApiListCertificatesRequest */ -func (a *APIClient) ListCertificates(ctx context.Context, projectId string, region string) ApiListCertificatesRequest { +func (a *APIClient) ListCertificates(ctx context.Context, projectId string) ApiListCertificatesRequest { return ApiListCertificatesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - region: region, } } -func (a *APIClient) ListCertificatesExecute(ctx context.Context, projectId string, region string) (*ListCertificatesResponse, error) { +func (a *APIClient) ListCertificatesExecute(ctx context.Context, projectId string) (*ListCertificatesResponse, error) { r := ApiListCertificatesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - region: region, } return r.Execute() } diff --git a/services/certificates/api_default_test.go b/services/certificates/api_default_test.go index 024c12f19..c2bef7ad8 100644 --- a/services/certificates/api_default_test.go +++ b/services/certificates/api_default_test.go @@ -24,14 +24,12 @@ import ( func Test_certificates_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService CreateCertificate", func(t *testing.T) { - path := "/v2beta/projects/{projectId}/regions/{region}/certificates" + _apiUrlPath := "/v1beta/projects/{projectId}/certificates" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := CreateCertificateResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -65,31 +63,28 @@ func Test_certificates_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" + projectId := projectIdValue createCertificatePayload := CreateCertificatePayload{} - resp, reqErr := apiClient.CreateCertificate(context.Background(), projectId, region).CreateCertificatePayload(createCertificatePayload).Execute() + resp, reqErr := apiClient.CreateCertificate(context.Background(), projectId).CreateCertificatePayload(createCertificatePayload).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 DeleteCertificate", func(t *testing.T) { - path := "/v2beta/projects/{projectId}/regions/{region}/certificates/{id}" + _apiUrlPath := "/v1beta/projects/{projectId}/certificates/{id}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) idValue := "id" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -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 := map[string]interface{}{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -123,31 +118,28 @@ func Test_certificates_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - id := "id" + projectId := projectIdValue + id := idValue - resp, reqErr := apiClient.DeleteCertificate(context.Background(), projectId, region, id).Execute() + resp, reqErr := apiClient.DeleteCertificate(context.Background(), projectId, id).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 GetCertificate", func(t *testing.T) { - path := "/v2beta/projects/{projectId}/regions/{region}/certificates/{id}" + _apiUrlPath := "/v1beta/projects/{projectId}/certificates/{id}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) idValue := "id" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -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 := GetCertificateResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -181,29 +173,26 @@ func Test_certificates_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - id := "id" + projectId := projectIdValue + id := idValue - resp, reqErr := apiClient.GetCertificate(context.Background(), projectId, region, id).Execute() + resp, reqErr := apiClient.GetCertificate(context.Background(), projectId, id).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 ListCertificates", func(t *testing.T) { - path := "/v2beta/projects/{projectId}/regions/{region}/certificates" + _apiUrlPath := "/v1beta/projects/{projectId}/certificates" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := ListCertificatesResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -237,15 +226,14 @@ func Test_certificates_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" + projectId := projectIdValue - resp, reqErr := apiClient.ListCertificates(context.Background(), projectId, region).Execute() + resp, reqErr := apiClient.ListCertificates(context.Background(), projectId).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/certificates/client.go b/services/certificates/client.go index 4c33a2186..04b4b3f3b 100644 --- a/services/certificates/client.go +++ b/services/certificates/client.go @@ -3,7 +3,7 @@ Load Balancer Certificates API This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. -API version: 2beta.0.0 +API version: 1beta.0.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 Load Balancer Certificates API API v2beta.0.0 +// APIClient manages communication with the Load Balancer Certificates API API v1beta.0.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *config.Configuration diff --git a/services/certificates/configuration.go b/services/certificates/configuration.go index 4bbd6ee4b..609422d22 100644 --- a/services/certificates/configuration.go +++ b/services/certificates/configuration.go @@ -3,7 +3,7 @@ Load Balancer Certificates API This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. -API version: 2beta.0.0 +API version: 1beta.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,12 +22,15 @@ func NewConfiguration() *config.Configuration { Debug: false, Servers: config.ServerConfigurations{ { - URL: "https://certificates.api.stackit.cloud", + URL: "https://certificates.api.{region}stackit.cloud", Description: "No description provided", Variables: map[string]config.ServerVariable{ "region": { Description: "No description provided", - DefaultValue: "global", + DefaultValue: "eu01.", + EnumValues: []string{ + "eu01.", + }, }, }, }, diff --git a/services/certificates/model_create_certificate_payload.go b/services/certificates/model_create_certificate_payload.go index c9e4f87eb..df0f31c74 100644 --- a/services/certificates/model_create_certificate_payload.go +++ b/services/certificates/model_create_certificate_payload.go @@ -3,7 +3,7 @@ Load Balancer Certificates API This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. -API version: 2beta.0.0 +API version: 1beta.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,18 +17,100 @@ import ( // checks if the CreateCertificatePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateCertificatePayload{} +/* + types and functions for name +*/ + +// isNotNullableString +type CreateCertificatePayloadGetNameAttributeType = *string + +func getCreateCertificatePayloadGetNameAttributeTypeOk(arg CreateCertificatePayloadGetNameAttributeType) (ret CreateCertificatePayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateCertificatePayloadGetNameAttributeType(arg *CreateCertificatePayloadGetNameAttributeType, val CreateCertificatePayloadGetNameRetType) { + *arg = &val +} + +type CreateCertificatePayloadGetNameArgType = string +type CreateCertificatePayloadGetNameRetType = string + +/* + types and functions for privateKey +*/ + +// isNotNullableString +type CreateCertificatePayloadGetPrivateKeyAttributeType = *string + +func getCreateCertificatePayloadGetPrivateKeyAttributeTypeOk(arg CreateCertificatePayloadGetPrivateKeyAttributeType) (ret CreateCertificatePayloadGetPrivateKeyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateCertificatePayloadGetPrivateKeyAttributeType(arg *CreateCertificatePayloadGetPrivateKeyAttributeType, val CreateCertificatePayloadGetPrivateKeyRetType) { + *arg = &val +} + +type CreateCertificatePayloadGetPrivateKeyArgType = string +type CreateCertificatePayloadGetPrivateKeyRetType = string + +/* + types and functions for projectId +*/ + +// isNotNullableString +type CreateCertificatePayloadGetProjectIdAttributeType = *string + +func getCreateCertificatePayloadGetProjectIdAttributeTypeOk(arg CreateCertificatePayloadGetProjectIdAttributeType) (ret CreateCertificatePayloadGetProjectIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateCertificatePayloadGetProjectIdAttributeType(arg *CreateCertificatePayloadGetProjectIdAttributeType, val CreateCertificatePayloadGetProjectIdRetType) { + *arg = &val +} + +type CreateCertificatePayloadGetProjectIdArgType = string +type CreateCertificatePayloadGetProjectIdRetType = string + +/* + types and functions for publicKey +*/ + +// isNotNullableString +type CreateCertificatePayloadGetPublicKeyAttributeType = *string + +func getCreateCertificatePayloadGetPublicKeyAttributeTypeOk(arg CreateCertificatePayloadGetPublicKeyAttributeType) (ret CreateCertificatePayloadGetPublicKeyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateCertificatePayloadGetPublicKeyAttributeType(arg *CreateCertificatePayloadGetPublicKeyAttributeType, val CreateCertificatePayloadGetPublicKeyRetType) { + *arg = &val +} + +type CreateCertificatePayloadGetPublicKeyArgType = string +type CreateCertificatePayloadGetPublicKeyRetType = string + // CreateCertificatePayload Uploads a PEM encoded X509 public/private key pair type CreateCertificatePayload struct { // TLS certificate name - Name *string `json:"name,omitempty"` + Name CreateCertificatePayloadGetNameAttributeType `json:"name,omitempty"` // The PEM encoded private key part - PrivateKey *string `json:"privateKey,omitempty"` + PrivateKey CreateCertificatePayloadGetPrivateKeyAttributeType `json:"privateKey,omitempty"` // Project identifier - ProjectId *string `json:"projectId,omitempty"` + ProjectId CreateCertificatePayloadGetProjectIdAttributeType `json:"projectId,omitempty"` // The PEM encoded public key part - PublicKey *string `json:"publicKey,omitempty"` - // Region - Region *string `json:"region,omitempty"` + PublicKey CreateCertificatePayloadGetPublicKeyAttributeType `json:"publicKey,omitempty"` } // NewCreateCertificatePayload instantiates a new CreateCertificatePayload object @@ -49,181 +131,110 @@ func NewCreateCertificatePayloadWithDefaults() *CreateCertificatePayload { } // GetName returns the Name field value if set, zero value otherwise. -func (o *CreateCertificatePayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *CreateCertificatePayload) GetName() (res CreateCertificatePayloadGetNameRetType) { + 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 *CreateCertificatePayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *CreateCertificatePayload) GetNameOk() (ret CreateCertificatePayloadGetNameRetType, ok bool) { + return getCreateCertificatePayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *CreateCertificatePayload) 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 *CreateCertificatePayload) SetName(v *string) { - o.Name = v +func (o *CreateCertificatePayload) SetName(v CreateCertificatePayloadGetNameRetType) { + setCreateCertificatePayloadGetNameAttributeType(&o.Name, v) } // GetPrivateKey returns the PrivateKey field value if set, zero value otherwise. -func (o *CreateCertificatePayload) GetPrivateKey() *string { - if o == nil || IsNil(o.PrivateKey) { - var ret *string - return ret - } - return o.PrivateKey +func (o *CreateCertificatePayload) GetPrivateKey() (res CreateCertificatePayloadGetPrivateKeyRetType) { + res, _ = o.GetPrivateKeyOk() + return } // GetPrivateKeyOk returns a tuple with the PrivateKey field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCertificatePayload) GetPrivateKeyOk() (*string, bool) { - if o == nil || IsNil(o.PrivateKey) { - return nil, false - } - return o.PrivateKey, true +func (o *CreateCertificatePayload) GetPrivateKeyOk() (ret CreateCertificatePayloadGetPrivateKeyRetType, ok bool) { + return getCreateCertificatePayloadGetPrivateKeyAttributeTypeOk(o.PrivateKey) } // HasPrivateKey returns a boolean if a field has been set. func (o *CreateCertificatePayload) HasPrivateKey() bool { - if o != nil && !IsNil(o.PrivateKey) { - return true - } - - return false + _, ok := o.GetPrivateKeyOk() + return ok } // SetPrivateKey gets a reference to the given string and assigns it to the PrivateKey field. -func (o *CreateCertificatePayload) SetPrivateKey(v *string) { - o.PrivateKey = v +func (o *CreateCertificatePayload) SetPrivateKey(v CreateCertificatePayloadGetPrivateKeyRetType) { + setCreateCertificatePayloadGetPrivateKeyAttributeType(&o.PrivateKey, v) } // GetProjectId returns the ProjectId field value if set, zero value otherwise. -func (o *CreateCertificatePayload) GetProjectId() *string { - if o == nil || IsNil(o.ProjectId) { - var ret *string - return ret - } - return o.ProjectId +func (o *CreateCertificatePayload) GetProjectId() (res CreateCertificatePayloadGetProjectIdRetType) { + res, _ = o.GetProjectIdOk() + return } // GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCertificatePayload) GetProjectIdOk() (*string, bool) { - if o == nil || IsNil(o.ProjectId) { - return nil, false - } - return o.ProjectId, true +func (o *CreateCertificatePayload) GetProjectIdOk() (ret CreateCertificatePayloadGetProjectIdRetType, ok bool) { + return getCreateCertificatePayloadGetProjectIdAttributeTypeOk(o.ProjectId) } // HasProjectId returns a boolean if a field has been set. func (o *CreateCertificatePayload) HasProjectId() bool { - if o != nil && !IsNil(o.ProjectId) { - return true - } - - return false + _, ok := o.GetProjectIdOk() + return ok } // SetProjectId gets a reference to the given string and assigns it to the ProjectId field. -func (o *CreateCertificatePayload) SetProjectId(v *string) { - o.ProjectId = v +func (o *CreateCertificatePayload) SetProjectId(v CreateCertificatePayloadGetProjectIdRetType) { + setCreateCertificatePayloadGetProjectIdAttributeType(&o.ProjectId, v) } // GetPublicKey returns the PublicKey field value if set, zero value otherwise. -func (o *CreateCertificatePayload) GetPublicKey() *string { - if o == nil || IsNil(o.PublicKey) { - var ret *string - return ret - } - return o.PublicKey +func (o *CreateCertificatePayload) GetPublicKey() (res CreateCertificatePayloadGetPublicKeyRetType) { + res, _ = o.GetPublicKeyOk() + return } // GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCertificatePayload) GetPublicKeyOk() (*string, bool) { - if o == nil || IsNil(o.PublicKey) { - return nil, false - } - return o.PublicKey, true +func (o *CreateCertificatePayload) GetPublicKeyOk() (ret CreateCertificatePayloadGetPublicKeyRetType, ok bool) { + return getCreateCertificatePayloadGetPublicKeyAttributeTypeOk(o.PublicKey) } // HasPublicKey returns a boolean if a field has been set. func (o *CreateCertificatePayload) HasPublicKey() bool { - if o != nil && !IsNil(o.PublicKey) { - return true - } - - return false + _, ok := o.GetPublicKeyOk() + return ok } // SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. -func (o *CreateCertificatePayload) SetPublicKey(v *string) { - o.PublicKey = v -} - -// GetRegion returns the Region field value if set, zero value otherwise. -func (o *CreateCertificatePayload) GetRegion() *string { - if o == nil || IsNil(o.Region) { - var ret *string - return ret - } - return o.Region -} - -// GetRegionOk returns a tuple with the Region field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateCertificatePayload) GetRegionOk() (*string, bool) { - if o == nil || IsNil(o.Region) { - return nil, false - } - return o.Region, true -} - -// HasRegion returns a boolean if a field has been set. -func (o *CreateCertificatePayload) HasRegion() bool { - if o != nil && !IsNil(o.Region) { - return true - } - - return false -} - -// SetRegion gets a reference to the given string and assigns it to the Region field. -func (o *CreateCertificatePayload) SetRegion(v *string) { - o.Region = v +func (o *CreateCertificatePayload) SetPublicKey(v CreateCertificatePayloadGetPublicKeyRetType) { + setCreateCertificatePayloadGetPublicKeyAttributeType(&o.PublicKey, v) } func (o CreateCertificatePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.PrivateKey) { - toSerialize["privateKey"] = o.PrivateKey + if val, ok := getCreateCertificatePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.ProjectId) { - toSerialize["projectId"] = o.ProjectId + if val, ok := getCreateCertificatePayloadGetPrivateKeyAttributeTypeOk(o.PrivateKey); ok { + toSerialize["PrivateKey"] = val } - if !IsNil(o.PublicKey) { - toSerialize["publicKey"] = o.PublicKey + if val, ok := getCreateCertificatePayloadGetProjectIdAttributeTypeOk(o.ProjectId); ok { + toSerialize["ProjectId"] = val } - if !IsNil(o.Region) { - toSerialize["region"] = o.Region + if val, ok := getCreateCertificatePayloadGetPublicKeyAttributeTypeOk(o.PublicKey); ok { + toSerialize["PublicKey"] = val } return toSerialize, nil } diff --git a/services/certificates/model_create_certificate_response.go b/services/certificates/model_create_certificate_response.go index a2a756778..3e6680024 100644 --- a/services/certificates/model_create_certificate_response.go +++ b/services/certificates/model_create_certificate_response.go @@ -3,7 +3,7 @@ Load Balancer Certificates API This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. -API version: 2beta.0.0 +API version: 1beta.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,12 +17,31 @@ import ( // checks if the CreateCertificateResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateCertificateResponse{} +/* + types and functions for id +*/ + +// isNotNullableString +type CreateCertificateResponseGetIdAttributeType = *string + +func getCreateCertificateResponseGetIdAttributeTypeOk(arg CreateCertificateResponseGetIdAttributeType) (ret CreateCertificateResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateCertificateResponseGetIdAttributeType(arg *CreateCertificateResponseGetIdAttributeType, val CreateCertificateResponseGetIdRetType) { + *arg = &val +} + +type CreateCertificateResponseGetIdArgType = string +type CreateCertificateResponseGetIdRetType = string + // CreateCertificateResponse CreateCertificateResponse returns unique resource id type CreateCertificateResponse struct { // The certificates resource id - Id *string `json:"id,omitempty"` - // Region - Region *string `json:"region,omitempty"` + Id CreateCertificateResponseGetIdAttributeType `json:"id,omitempty"` } // NewCreateCertificateResponse instantiates a new CreateCertificateResponse object @@ -43,76 +62,32 @@ func NewCreateCertificateResponseWithDefaults() *CreateCertificateResponse { } // GetId returns the Id field value if set, zero value otherwise. -func (o *CreateCertificateResponse) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *CreateCertificateResponse) GetId() (res CreateCertificateResponseGetIdRetType) { + 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 *CreateCertificateResponse) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *CreateCertificateResponse) GetIdOk() (ret CreateCertificateResponseGetIdRetType, ok bool) { + return getCreateCertificateResponseGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *CreateCertificateResponse) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *CreateCertificateResponse) SetId(v *string) { - o.Id = v -} - -// GetRegion returns the Region field value if set, zero value otherwise. -func (o *CreateCertificateResponse) GetRegion() *string { - if o == nil || IsNil(o.Region) { - var ret *string - return ret - } - return o.Region -} - -// GetRegionOk returns a tuple with the Region field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateCertificateResponse) GetRegionOk() (*string, bool) { - if o == nil || IsNil(o.Region) { - return nil, false - } - return o.Region, true -} - -// HasRegion returns a boolean if a field has been set. -func (o *CreateCertificateResponse) HasRegion() bool { - if o != nil && !IsNil(o.Region) { - return true - } - - return false -} - -// SetRegion gets a reference to the given string and assigns it to the Region field. -func (o *CreateCertificateResponse) SetRegion(v *string) { - o.Region = v +func (o *CreateCertificateResponse) SetId(v CreateCertificateResponseGetIdRetType) { + setCreateCertificateResponseGetIdAttributeType(&o.Id, v) } func (o CreateCertificateResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Region) { - toSerialize["region"] = o.Region + if val, ok := getCreateCertificateResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } return toSerialize, nil } diff --git a/services/certificates/model_get_certificate_response.go b/services/certificates/model_get_certificate_response.go index 85499b11d..57695ed54 100644 --- a/services/certificates/model_get_certificate_response.go +++ b/services/certificates/model_get_certificate_response.go @@ -3,7 +3,7 @@ Load Balancer Certificates API This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. -API version: 2beta.0.0 +API version: 1beta.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,16 +17,77 @@ import ( // checks if the GetCertificateResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetCertificateResponse{} +/* + types and functions for id +*/ + +// isNotNullableString +type GetCertificateResponseGetIdAttributeType = *string + +func getGetCertificateResponseGetIdAttributeTypeOk(arg GetCertificateResponseGetIdAttributeType) (ret GetCertificateResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetCertificateResponseGetIdAttributeType(arg *GetCertificateResponseGetIdAttributeType, val GetCertificateResponseGetIdRetType) { + *arg = &val +} + +type GetCertificateResponseGetIdArgType = string +type GetCertificateResponseGetIdRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type GetCertificateResponseGetNameAttributeType = *string + +func getGetCertificateResponseGetNameAttributeTypeOk(arg GetCertificateResponseGetNameAttributeType) (ret GetCertificateResponseGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetCertificateResponseGetNameAttributeType(arg *GetCertificateResponseGetNameAttributeType, val GetCertificateResponseGetNameRetType) { + *arg = &val +} + +type GetCertificateResponseGetNameArgType = string +type GetCertificateResponseGetNameRetType = string + +/* + types and functions for publicKey +*/ + +// isNotNullableString +type GetCertificateResponseGetPublicKeyAttributeType = *string + +func getGetCertificateResponseGetPublicKeyAttributeTypeOk(arg GetCertificateResponseGetPublicKeyAttributeType) (ret GetCertificateResponseGetPublicKeyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetCertificateResponseGetPublicKeyAttributeType(arg *GetCertificateResponseGetPublicKeyAttributeType, val GetCertificateResponseGetPublicKeyRetType) { + *arg = &val +} + +type GetCertificateResponseGetPublicKeyArgType = string +type GetCertificateResponseGetPublicKeyRetType = string + // GetCertificateResponse GetCertificateResponse returns name, id and public key type GetCertificateResponse struct { // The certificates resource id - Id *string `json:"id,omitempty"` + Id GetCertificateResponseGetIdAttributeType `json:"id,omitempty"` // TLS certificate name - Name *string `json:"name,omitempty"` + Name GetCertificateResponseGetNameAttributeType `json:"name,omitempty"` // The PEM encoded public key part - PublicKey *string `json:"publicKey,omitempty"` - // Region of the LoadBalancer - Region *string `json:"region,omitempty"` + PublicKey GetCertificateResponseGetPublicKeyAttributeType `json:"publicKey,omitempty"` } // NewGetCertificateResponse instantiates a new GetCertificateResponse object @@ -47,146 +108,84 @@ func NewGetCertificateResponseWithDefaults() *GetCertificateResponse { } // GetId returns the Id field value if set, zero value otherwise. -func (o *GetCertificateResponse) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *GetCertificateResponse) GetId() (res GetCertificateResponseGetIdRetType) { + 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 *GetCertificateResponse) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *GetCertificateResponse) GetIdOk() (ret GetCertificateResponseGetIdRetType, ok bool) { + return getGetCertificateResponseGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *GetCertificateResponse) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *GetCertificateResponse) SetId(v *string) { - o.Id = v +func (o *GetCertificateResponse) SetId(v GetCertificateResponseGetIdRetType) { + setGetCertificateResponseGetIdAttributeType(&o.Id, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *GetCertificateResponse) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *GetCertificateResponse) GetName() (res GetCertificateResponseGetNameRetType) { + 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 *GetCertificateResponse) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *GetCertificateResponse) GetNameOk() (ret GetCertificateResponseGetNameRetType, ok bool) { + return getGetCertificateResponseGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *GetCertificateResponse) 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 *GetCertificateResponse) SetName(v *string) { - o.Name = v +func (o *GetCertificateResponse) SetName(v GetCertificateResponseGetNameRetType) { + setGetCertificateResponseGetNameAttributeType(&o.Name, v) } // GetPublicKey returns the PublicKey field value if set, zero value otherwise. -func (o *GetCertificateResponse) GetPublicKey() *string { - if o == nil || IsNil(o.PublicKey) { - var ret *string - return ret - } - return o.PublicKey +func (o *GetCertificateResponse) GetPublicKey() (res GetCertificateResponseGetPublicKeyRetType) { + res, _ = o.GetPublicKeyOk() + return } // GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetCertificateResponse) GetPublicKeyOk() (*string, bool) { - if o == nil || IsNil(o.PublicKey) { - return nil, false - } - return o.PublicKey, true +func (o *GetCertificateResponse) GetPublicKeyOk() (ret GetCertificateResponseGetPublicKeyRetType, ok bool) { + return getGetCertificateResponseGetPublicKeyAttributeTypeOk(o.PublicKey) } // HasPublicKey returns a boolean if a field has been set. func (o *GetCertificateResponse) HasPublicKey() bool { - if o != nil && !IsNil(o.PublicKey) { - return true - } - - return false + _, ok := o.GetPublicKeyOk() + return ok } // SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. -func (o *GetCertificateResponse) SetPublicKey(v *string) { - o.PublicKey = v -} - -// GetRegion returns the Region field value if set, zero value otherwise. -func (o *GetCertificateResponse) GetRegion() *string { - if o == nil || IsNil(o.Region) { - var ret *string - return ret - } - return o.Region -} - -// GetRegionOk returns a tuple with the Region field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetCertificateResponse) GetRegionOk() (*string, bool) { - if o == nil || IsNil(o.Region) { - return nil, false - } - return o.Region, true -} - -// HasRegion returns a boolean if a field has been set. -func (o *GetCertificateResponse) HasRegion() bool { - if o != nil && !IsNil(o.Region) { - return true - } - - return false -} - -// SetRegion gets a reference to the given string and assigns it to the Region field. -func (o *GetCertificateResponse) SetRegion(v *string) { - o.Region = v +func (o *GetCertificateResponse) SetPublicKey(v GetCertificateResponseGetPublicKeyRetType) { + setGetCertificateResponseGetPublicKeyAttributeType(&o.PublicKey, v) } func (o GetCertificateResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getGetCertificateResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.PublicKey) { - toSerialize["publicKey"] = o.PublicKey + if val, ok := getGetCertificateResponseGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Region) { - toSerialize["region"] = o.Region + if val, ok := getGetCertificateResponseGetPublicKeyAttributeTypeOk(o.PublicKey); ok { + toSerialize["PublicKey"] = val } return toSerialize, nil } diff --git a/services/certificates/model_google_protobuf_any.go b/services/certificates/model_google_protobuf_any.go index 704db5d2c..718dd5134 100644 --- a/services/certificates/model_google_protobuf_any.go +++ b/services/certificates/model_google_protobuf_any.go @@ -3,7 +3,7 @@ Load Balancer Certificates API This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. -API version: 2beta.0.0 +API version: 1beta.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,10 +17,31 @@ import ( // checks if the GoogleProtobufAny type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GoogleProtobufAny{} +/* + types and functions for @type +*/ + +// isNotNullableString +type GoogleProtobufAnyGetTypeAttributeType = *string + +func getGoogleProtobufAnyGetTypeAttributeTypeOk(arg GoogleProtobufAnyGetTypeAttributeType) (ret GoogleProtobufAnyGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGoogleProtobufAnyGetTypeAttributeType(arg *GoogleProtobufAnyGetTypeAttributeType, val GoogleProtobufAnyGetTypeRetType) { + *arg = &val +} + +type GoogleProtobufAnyGetTypeArgType = string +type GoogleProtobufAnyGetTypeRetType = string + // GoogleProtobufAny Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. type GoogleProtobufAny struct { // The type of the serialized message. - Type *string `json:"@type,omitempty"` + Type GoogleProtobufAnyGetTypeAttributeType `json:"@type,omitempty"` AdditionalProperties map[string]interface{} } @@ -44,41 +65,32 @@ func NewGoogleProtobufAnyWithDefaults() *GoogleProtobufAny { } // GetType returns the Type field value if set, zero value otherwise. -func (o *GoogleProtobufAny) GetType() *string { - if o == nil || IsNil(o.Type) { - var ret *string - return ret - } - return o.Type +func (o *GoogleProtobufAny) GetType() (res GoogleProtobufAnyGetTypeRetType) { + 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 *GoogleProtobufAny) GetTypeOk() (*string, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return o.Type, true +func (o *GoogleProtobufAny) GetTypeOk() (ret GoogleProtobufAnyGetTypeRetType, ok bool) { + return getGoogleProtobufAnyGetTypeAttributeTypeOk(o.Type) } // HasType returns a boolean if a field has been set. func (o *GoogleProtobufAny) 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 *GoogleProtobufAny) SetType(v *string) { - o.Type = v +func (o *GoogleProtobufAny) SetType(v GoogleProtobufAnyGetTypeRetType) { + setGoogleProtobufAnyGetTypeAttributeType(&o.Type, v) } func (o GoogleProtobufAny) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Type) { - toSerialize["@type"] = o.Type + if val, ok := getGoogleProtobufAnyGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val } for key, value := range o.AdditionalProperties { diff --git a/services/certificates/model_list_certificates_response.go b/services/certificates/model_list_certificates_response.go index 3cc6e6138..483df8c71 100644 --- a/services/certificates/model_list_certificates_response.go +++ b/services/certificates/model_list_certificates_response.go @@ -3,7 +3,7 @@ Load Balancer Certificates API This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. -API version: 2beta.0.0 +API version: 1beta.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,11 +17,52 @@ import ( // checks if the ListCertificatesResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListCertificatesResponse{} +/* + types and functions for items +*/ + +// isArray +type ListCertificatesResponseGetItemsAttributeType = *[]GetCertificateResponse +type ListCertificatesResponseGetItemsArgType = []GetCertificateResponse +type ListCertificatesResponseGetItemsRetType = []GetCertificateResponse + +func getListCertificatesResponseGetItemsAttributeTypeOk(arg ListCertificatesResponseGetItemsAttributeType) (ret ListCertificatesResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListCertificatesResponseGetItemsAttributeType(arg *ListCertificatesResponseGetItemsAttributeType, val ListCertificatesResponseGetItemsRetType) { + *arg = &val +} + +/* + types and functions for nextPageId +*/ + +// isNotNullableString +type ListCertificatesResponseGetNextPageIdAttributeType = *string + +func getListCertificatesResponseGetNextPageIdAttributeTypeOk(arg ListCertificatesResponseGetNextPageIdAttributeType) (ret ListCertificatesResponseGetNextPageIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListCertificatesResponseGetNextPageIdAttributeType(arg *ListCertificatesResponseGetNextPageIdAttributeType, val ListCertificatesResponseGetNextPageIdRetType) { + *arg = &val +} + +type ListCertificatesResponseGetNextPageIdArgType = string +type ListCertificatesResponseGetNextPageIdRetType = string + // ListCertificatesResponse ListCertificateResponse returns a list of certificate responses type ListCertificatesResponse struct { - Items *[]GetCertificateResponse `json:"items,omitempty"` + Items ListCertificatesResponseGetItemsAttributeType `json:"items,omitempty"` // Continue token from the ListCertificatesResponse with Limit option - NextPageId *string `json:"nextPageId,omitempty"` + NextPageId ListCertificatesResponseGetNextPageIdAttributeType `json:"nextPageId,omitempty"` } // NewListCertificatesResponse instantiates a new ListCertificatesResponse object @@ -42,76 +83,58 @@ func NewListCertificatesResponseWithDefaults() *ListCertificatesResponse { } // GetItems returns the Items field value if set, zero value otherwise. -func (o *ListCertificatesResponse) GetItems() *[]GetCertificateResponse { - if o == nil || IsNil(o.Items) { - var ret *[]GetCertificateResponse - return ret - } - return o.Items +func (o *ListCertificatesResponse) GetItems() (res ListCertificatesResponseGetItemsRetType) { + 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 *ListCertificatesResponse) GetItemsOk() (*[]GetCertificateResponse, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true +func (o *ListCertificatesResponse) GetItemsOk() (ret ListCertificatesResponseGetItemsRetType, ok bool) { + return getListCertificatesResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. func (o *ListCertificatesResponse) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false + _, ok := o.GetItemsOk() + return ok } // SetItems gets a reference to the given []GetCertificateResponse and assigns it to the Items field. -func (o *ListCertificatesResponse) SetItems(v *[]GetCertificateResponse) { - o.Items = v +func (o *ListCertificatesResponse) SetItems(v ListCertificatesResponseGetItemsRetType) { + setListCertificatesResponseGetItemsAttributeType(&o.Items, v) } // GetNextPageId returns the NextPageId field value if set, zero value otherwise. -func (o *ListCertificatesResponse) GetNextPageId() *string { - if o == nil || IsNil(o.NextPageId) { - var ret *string - return ret - } - return o.NextPageId +func (o *ListCertificatesResponse) GetNextPageId() (res ListCertificatesResponseGetNextPageIdRetType) { + res, _ = o.GetNextPageIdOk() + return } // GetNextPageIdOk returns a tuple with the NextPageId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListCertificatesResponse) GetNextPageIdOk() (*string, bool) { - if o == nil || IsNil(o.NextPageId) { - return nil, false - } - return o.NextPageId, true +func (o *ListCertificatesResponse) GetNextPageIdOk() (ret ListCertificatesResponseGetNextPageIdRetType, ok bool) { + return getListCertificatesResponseGetNextPageIdAttributeTypeOk(o.NextPageId) } // HasNextPageId returns a boolean if a field has been set. func (o *ListCertificatesResponse) HasNextPageId() bool { - if o != nil && !IsNil(o.NextPageId) { - return true - } - - return false + _, ok := o.GetNextPageIdOk() + return ok } // SetNextPageId gets a reference to the given string and assigns it to the NextPageId field. -func (o *ListCertificatesResponse) SetNextPageId(v *string) { - o.NextPageId = v +func (o *ListCertificatesResponse) SetNextPageId(v ListCertificatesResponseGetNextPageIdRetType) { + setListCertificatesResponseGetNextPageIdAttributeType(&o.NextPageId, v) } func (o ListCertificatesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Items) { - toSerialize["items"] = o.Items + if val, ok := getListCertificatesResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val } - if !IsNil(o.NextPageId) { - toSerialize["nextPageId"] = o.NextPageId + if val, ok := getListCertificatesResponseGetNextPageIdAttributeTypeOk(o.NextPageId); ok { + toSerialize["NextPageId"] = val } return toSerialize, nil } diff --git a/services/certificates/model_status.go b/services/certificates/model_status.go index a6849bf48..a11f159d0 100644 --- a/services/certificates/model_status.go +++ b/services/certificates/model_status.go @@ -3,7 +3,7 @@ Load Balancer Certificates API This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. -API version: 2beta.0.0 +API version: 1beta.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,15 +17,76 @@ import ( // checks if the Status type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Status{} +/* + types and functions for code +*/ + +// isInteger +type StatusGetCodeAttributeType = *int64 +type StatusGetCodeArgType = int64 +type StatusGetCodeRetType = int64 + +func getStatusGetCodeAttributeTypeOk(arg StatusGetCodeAttributeType) (ret StatusGetCodeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setStatusGetCodeAttributeType(arg *StatusGetCodeAttributeType, val StatusGetCodeRetType) { + *arg = &val +} + +/* + types and functions for details +*/ + +// isArray +type StatusGetDetailsAttributeType = *[]GoogleProtobufAny +type StatusGetDetailsArgType = []GoogleProtobufAny +type StatusGetDetailsRetType = []GoogleProtobufAny + +func getStatusGetDetailsAttributeTypeOk(arg StatusGetDetailsAttributeType) (ret StatusGetDetailsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setStatusGetDetailsAttributeType(arg *StatusGetDetailsAttributeType, val StatusGetDetailsRetType) { + *arg = &val +} + +/* + types and functions for message +*/ + +// isNotNullableString +type StatusGetMessageAttributeType = *string + +func getStatusGetMessageAttributeTypeOk(arg StatusGetMessageAttributeType) (ret StatusGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setStatusGetMessageAttributeType(arg *StatusGetMessageAttributeType, val StatusGetMessageRetType) { + *arg = &val +} + +type StatusGetMessageArgType = string +type StatusGetMessageRetType = string + // Status The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). type Status struct { // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. // Can be cast to int32 without loss of precision. - Code *int64 `json:"code,omitempty"` + Code StatusGetCodeAttributeType `json:"code,omitempty"` // A list of messages that carry the error details. There is a common set of message types for APIs to use. - Details *[]GoogleProtobufAny `json:"details,omitempty"` + Details StatusGetDetailsAttributeType `json:"details,omitempty"` // A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - Message *string `json:"message,omitempty"` + Message StatusGetMessageAttributeType `json:"message,omitempty"` } // NewStatus instantiates a new Status object @@ -46,111 +107,84 @@ func NewStatusWithDefaults() *Status { } // GetCode returns the Code field value if set, zero value otherwise. -func (o *Status) GetCode() *int64 { - if o == nil || IsNil(o.Code) { - var ret *int64 - return ret - } - return o.Code +func (o *Status) GetCode() (res StatusGetCodeRetType) { + res, _ = o.GetCodeOk() + return } // GetCodeOk returns a tuple with the Code field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Status) GetCodeOk() (*int64, bool) { - if o == nil || IsNil(o.Code) { - return nil, false - } - return o.Code, true +func (o *Status) GetCodeOk() (ret StatusGetCodeRetType, ok bool) { + return getStatusGetCodeAttributeTypeOk(o.Code) } // HasCode returns a boolean if a field has been set. func (o *Status) HasCode() bool { - if o != nil && !IsNil(o.Code) { - return true - } - - return false + _, ok := o.GetCodeOk() + return ok } // SetCode gets a reference to the given int64 and assigns it to the Code field. -func (o *Status) SetCode(v *int64) { - o.Code = v +func (o *Status) SetCode(v StatusGetCodeRetType) { + setStatusGetCodeAttributeType(&o.Code, v) } // GetDetails returns the Details field value if set, zero value otherwise. -func (o *Status) GetDetails() *[]GoogleProtobufAny { - if o == nil || IsNil(o.Details) { - var ret *[]GoogleProtobufAny - return ret - } - return o.Details +func (o *Status) GetDetails() (res StatusGetDetailsRetType) { + res, _ = o.GetDetailsOk() + return } // GetDetailsOk returns a tuple with the Details field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Status) GetDetailsOk() (*[]GoogleProtobufAny, bool) { - if o == nil || IsNil(o.Details) { - return nil, false - } - return o.Details, true +func (o *Status) GetDetailsOk() (ret StatusGetDetailsRetType, ok bool) { + return getStatusGetDetailsAttributeTypeOk(o.Details) } // HasDetails returns a boolean if a field has been set. func (o *Status) HasDetails() bool { - if o != nil && !IsNil(o.Details) { - return true - } - - return false + _, ok := o.GetDetailsOk() + return ok } // SetDetails gets a reference to the given []GoogleProtobufAny and assigns it to the Details field. -func (o *Status) SetDetails(v *[]GoogleProtobufAny) { - o.Details = v +func (o *Status) SetDetails(v StatusGetDetailsRetType) { + setStatusGetDetailsAttributeType(&o.Details, v) } // GetMessage returns the Message field value if set, zero value otherwise. -func (o *Status) GetMessage() *string { - if o == nil || IsNil(o.Message) { - var ret *string - return ret - } - return o.Message +func (o *Status) GetMessage() (res StatusGetMessageRetType) { + res, _ = o.GetMessageOk() + return } // GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Status) GetMessageOk() (*string, bool) { - if o == nil || IsNil(o.Message) { - return nil, false - } - return o.Message, true +func (o *Status) GetMessageOk() (ret StatusGetMessageRetType, ok bool) { + return getStatusGetMessageAttributeTypeOk(o.Message) } // HasMessage returns a boolean if a field has been set. func (o *Status) HasMessage() bool { - if o != nil && !IsNil(o.Message) { - return true - } - - return false + _, ok := o.GetMessageOk() + return ok } // SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *Status) SetMessage(v *string) { - o.Message = v +func (o *Status) SetMessage(v StatusGetMessageRetType) { + setStatusGetMessageAttributeType(&o.Message, v) } func (o Status) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Code) { - toSerialize["code"] = o.Code + if val, ok := getStatusGetCodeAttributeTypeOk(o.Code); ok { + toSerialize["Code"] = val } - if !IsNil(o.Details) { - toSerialize["details"] = o.Details + if val, ok := getStatusGetDetailsAttributeTypeOk(o.Details); ok { + toSerialize["Details"] = val } - if !IsNil(o.Message) { - toSerialize["message"] = o.Message + if val, ok := getStatusGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val } return toSerialize, nil } diff --git a/services/certificates/utils.go b/services/certificates/utils.go index 585f513e3..4b713b203 100644 --- a/services/certificates/utils.go +++ b/services/certificates/utils.go @@ -3,7 +3,7 @@ Load Balancer Certificates API This API offers the ability to store TLS certificates, which can be used by load balancing servers in STACKIT. They can be between consumer and load balancing server and/or between load balancing server and endpoint server. -API version: 2beta.0.0 +API version: 1beta.0.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 d8ffac562d09e54af98b11818e8ed9a7d4e2d084 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:09:51 +0100 Subject: [PATCH 2/2] chore: revert changelog to synchronize with reverted certificate service --- CHANGELOG.md | 2 -- services/certificates/CHANGELOG.md | 3 --- 2 files changed, 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 764e3c089..b1cbb360e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,4 @@ ## Release (2025-03-14) -- `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) - **Bugfix:** `DeleteUserWaitHandler` is now also using the region as parameter. - `modelserving`: [v0.2.0](services/modelserving/CHANGELOG.md#v020-2025-03-14) diff --git a/services/certificates/CHANGELOG.md b/services/certificates/CHANGELOG.md index c6bc5fa03..263070171 100644 --- a/services/certificates/CHANGELOG.md +++ b/services/certificates/CHANGELOG.md @@ -1,6 +1,3 @@ -## v1.0.0 (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. - ## v0.2.0 (2025-02-21) - **New:** Minimal go version is now Go 1.21