From d73892ce31191bc92dc3c5565d4e2fd57b781227 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Tue, 18 Mar 2025 08:08:37 +0000 Subject: [PATCH] Generate serviceaccount --- services/serviceaccount/api_default_test.go | 181 +++--- services/serviceaccount/go.mod | 6 +- services/serviceaccount/model_access_token.go | 249 +++++--- .../model_access_token_metadata.go | 199 ++++-- services/serviceaccount/model_auth_error.go | 51 +- .../serviceaccount/model_auth_error_error.go | 151 +++-- .../model_create_access_token_payload.go | 51 +- ...odel_create_service_account_key_payload.go | 107 ++-- ...del_create_service_account_key_response.go | 449 ++++++++----- ...ervice_account_key_response_credentials.go | 256 +++++--- .../model_create_service_account_payload.go | 52 +- ...reate_short_lived_access_token_response.go | 250 +++++--- services/serviceaccount/model_error.go | 250 +++++--- .../model_get_service_account_key_response.go | 453 +++++++++----- ...ervice_account_key_response_credentials.go | 202 ++++-- services/serviceaccount/model_jwk.go | 588 +++++++++++------- services/serviceaccount/model_jwks.go | 51 +- .../model_list_access_tokens_response.go | 53 +- ...odel_list_service_account_keys_response.go | 51 +- .../model_list_service_accounts_response.go | 51 +- ...tial_update_service_account_key_payload.go | 106 ++-- ...ial_update_service_account_key_response.go | 350 +++++++---- .../serviceaccount/model_service_account.go | 201 ++++-- ...model_service_account_key_list_response.go | 350 +++++++---- services/serviceaccount/utils.go | 26 + 25 files changed, 3030 insertions(+), 1704 deletions(-) diff --git a/services/serviceaccount/api_default_test.go b/services/serviceaccount/api_default_test.go index 12931a8d2..fda0100dd 100644 --- a/services/serviceaccount/api_default_test.go +++ b/services/serviceaccount/api_default_test.go @@ -18,20 +18,21 @@ import ( "strings" "testing" + "github.com/google/uuid" "github.com/stackitcloud/stackit-sdk-go/core/config" ) func Test_serviceaccount_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService CreateAccessToken", func(t *testing.T) { - path := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/access-tokens" + _apiUrlPath := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/access-tokens" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serviceAccountEmailValue := "serviceAccountEmail" - path = strings.Replace(path, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -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 := AccessToken{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -65,26 +66,26 @@ func Test_serviceaccount_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serviceAccountEmail := "serviceAccountEmail" + projectId := projectIdValue + serviceAccountEmail := serviceAccountEmailValue resp, reqErr := apiClient.CreateAccessToken(context.Background(), projectId, serviceAccountEmail).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 CreateServiceAccount", func(t *testing.T) { - path := "/v2/projects/{projectId}/service-accounts" + _apiUrlPath := "/v2/projects/{projectId}/service-accounts" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := ServiceAccount{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -118,27 +119,27 @@ func Test_serviceaccount_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.CreateServiceAccount(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") } }) t.Run("Test DefaultApiService CreateServiceAccountKey", func(t *testing.T) { - path := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/keys" + _apiUrlPath := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/keys" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serviceAccountEmailValue := "serviceAccountEmail" - path = strings.Replace(path, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -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 := CreateServiceAccountKeyResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -172,24 +173,24 @@ func Test_serviceaccount_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serviceAccountEmail := "serviceAccountEmail" + projectId := projectIdValue + serviceAccountEmail := serviceAccountEmailValue resp, reqErr := apiClient.CreateServiceAccountKey(context.Background(), projectId, serviceAccountEmail).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 CreateShortLivedAccessToken", func(t *testing.T) { - path := "/token" + _apiUrlPath := "/token" testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := CreateShortLivedAccessTokenResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -230,22 +231,22 @@ func Test_serviceaccount_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 DeleteAccessToken", func(t *testing.T) { - path := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/access-tokens/{accessTokenId}" + _apiUrlPath := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/access-tokens/{accessTokenId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serviceAccountEmailValue := "serviceAccountEmail" - path = strings.Replace(path, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -1) - accessTokenIdValue := "accessTokenId" - path = strings.Replace(path, "{"+"accessTokenId"+"}", url.PathEscape(ParameterValueToString(accessTokenIdValue, "accessTokenId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -1) + accessTokenIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"accessTokenId"+"}", url.PathEscape(ParameterValueToString(accessTokenIdValue, "accessTokenId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -276,9 +277,9 @@ func Test_serviceaccount_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serviceAccountEmail := "serviceAccountEmail" - accessTokenId := "accessTokenId" + projectId := projectIdValue + serviceAccountEmail := serviceAccountEmailValue + accessTokenId := accessTokenIdValue reqErr := apiClient.DeleteAccessToken(context.Background(), projectId, serviceAccountEmail, accessTokenId).Execute() @@ -288,14 +289,14 @@ func Test_serviceaccount_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteServiceAccount", func(t *testing.T) { - path := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}" + _apiUrlPath := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serviceAccountEmailValue := "serviceAccountEmail" - path = strings.Replace(path, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -326,8 +327,8 @@ func Test_serviceaccount_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serviceAccountEmail := "serviceAccountEmail" + projectId := projectIdValue + serviceAccountEmail := serviceAccountEmailValue reqErr := apiClient.DeleteServiceAccount(context.Background(), projectId, serviceAccountEmail).Execute() @@ -337,16 +338,16 @@ func Test_serviceaccount_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteServiceAccountKey", func(t *testing.T) { - path := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/keys/{keyId}" + _apiUrlPath := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/keys/{keyId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serviceAccountEmailValue := "serviceAccountEmail" - path = strings.Replace(path, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -1) - keyIdValue := "keyId" - path = strings.Replace(path, "{"+"keyId"+"}", url.PathEscape(ParameterValueToString(keyIdValue, "keyId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -1) + keyIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"keyId"+"}", url.PathEscape(ParameterValueToString(keyIdValue, "keyId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -377,9 +378,9 @@ func Test_serviceaccount_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serviceAccountEmail := "serviceAccountEmail" - keyId := "keyId" + projectId := projectIdValue + serviceAccountEmail := serviceAccountEmailValue + keyId := keyIdValue reqErr := apiClient.DeleteServiceAccountKey(context.Background(), projectId, serviceAccountEmail, keyId).Execute() @@ -389,12 +390,12 @@ func Test_serviceaccount_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetJWKS", func(t *testing.T) { - path := "/v2/service-accounts/public/jwk/{serviceAccountEmail}" + _apiUrlPath := "/v2/service-accounts/public/jwk/{serviceAccountEmail}" serviceAccountEmailValue := "serviceAccountEmail" - path = strings.Replace(path, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -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 := JWKS{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -428,29 +429,29 @@ func Test_serviceaccount_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - serviceAccountEmail := "serviceAccountEmail" + serviceAccountEmail := serviceAccountEmailValue resp, reqErr := apiClient.GetJWKS(context.Background(), serviceAccountEmail).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 GetServiceAccountKey", func(t *testing.T) { - path := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/keys/{keyId}" + _apiUrlPath := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/keys/{keyId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serviceAccountEmailValue := "serviceAccountEmail" - path = strings.Replace(path, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -1) - keyIdValue := "keyId" - path = strings.Replace(path, "{"+"keyId"+"}", url.PathEscape(ParameterValueToString(keyIdValue, "keyId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -1) + keyIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"keyId"+"}", url.PathEscape(ParameterValueToString(keyIdValue, "keyId")), -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 := GetServiceAccountKeyResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -484,29 +485,29 @@ func Test_serviceaccount_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serviceAccountEmail := "serviceAccountEmail" - keyId := "keyId" + projectId := projectIdValue + serviceAccountEmail := serviceAccountEmailValue + keyId := keyIdValue resp, reqErr := apiClient.GetServiceAccountKey(context.Background(), projectId, serviceAccountEmail, keyId).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 ListAccessTokens", func(t *testing.T) { - path := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/access-tokens" + _apiUrlPath := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/access-tokens" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serviceAccountEmailValue := "serviceAccountEmail" - path = strings.Replace(path, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -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 := ListAccessTokensResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -540,28 +541,28 @@ func Test_serviceaccount_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serviceAccountEmail := "serviceAccountEmail" + projectId := projectIdValue + serviceAccountEmail := serviceAccountEmailValue resp, reqErr := apiClient.ListAccessTokens(context.Background(), projectId, serviceAccountEmail).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 ListServiceAccountKeys", func(t *testing.T) { - path := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/keys" + _apiUrlPath := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/keys" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serviceAccountEmailValue := "serviceAccountEmail" - path = strings.Replace(path, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -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 := ListServiceAccountKeysResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -595,26 +596,26 @@ func Test_serviceaccount_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serviceAccountEmail := "serviceAccountEmail" + projectId := projectIdValue + serviceAccountEmail := serviceAccountEmailValue resp, reqErr := apiClient.ListServiceAccountKeys(context.Background(), projectId, serviceAccountEmail).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 ListServiceAccounts", func(t *testing.T) { - path := "/v2/projects/{projectId}/service-accounts" + _apiUrlPath := "/v2/projects/{projectId}/service-accounts" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := ListServiceAccountsResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -648,29 +649,29 @@ func Test_serviceaccount_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.ListServiceAccounts(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") } }) t.Run("Test DefaultApiService PartialUpdateServiceAccountKey", func(t *testing.T) { - path := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/keys/{keyId}" + _apiUrlPath := "/v2/projects/{projectId}/service-accounts/{serviceAccountEmail}/keys/{keyId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serviceAccountEmailValue := "serviceAccountEmail" - path = strings.Replace(path, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -1) - keyIdValue := "keyId" - path = strings.Replace(path, "{"+"keyId"+"}", url.PathEscape(ParameterValueToString(keyIdValue, "keyId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceAccountEmail"+"}", url.PathEscape(ParameterValueToString(serviceAccountEmailValue, "serviceAccountEmail")), -1) + keyIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"keyId"+"}", url.PathEscape(ParameterValueToString(keyIdValue, "keyId")), -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 := PartialUpdateServiceAccountKeyResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -704,16 +705,16 @@ func Test_serviceaccount_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serviceAccountEmail := "serviceAccountEmail" - keyId := "keyId" + projectId := projectIdValue + serviceAccountEmail := serviceAccountEmailValue + keyId := keyIdValue resp, reqErr := apiClient.PartialUpdateServiceAccountKey(context.Background(), projectId, serviceAccountEmail, keyId).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/serviceaccount/go.mod b/services/serviceaccount/go.mod index cda682f1e..5e4fd337e 100644 --- a/services/serviceaccount/go.mod +++ b/services/serviceaccount/go.mod @@ -2,10 +2,12 @@ module github.com/stackitcloud/stackit-sdk-go/services/serviceaccount go 1.21 -require github.com/stackitcloud/stackit-sdk-go/core v0.16.0 +require ( + github.com/google/uuid v1.6.0 + github.com/stackitcloud/stackit-sdk-go/core v0.16.0 +) require ( github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/google/go-cmp v0.7.0 // indirect - github.com/google/uuid v1.6.0 // indirect ) diff --git a/services/serviceaccount/model_access_token.go b/services/serviceaccount/model_access_token.go index 9907b2131..29ab98e1d 100644 --- a/services/serviceaccount/model_access_token.go +++ b/services/serviceaccount/model_access_token.go @@ -18,23 +18,125 @@ import ( // checks if the AccessToken type satisfies the MappedNullable interface at compile time var _ MappedNullable = &AccessToken{} +/* + types and functions for active +*/ + +// isBoolean +type AccessTokengetActiveAttributeType = *bool +type AccessTokengetActiveArgType = bool +type AccessTokengetActiveRetType = bool + +func getAccessTokengetActiveAttributeTypeOk(arg AccessTokengetActiveAttributeType) (ret AccessTokengetActiveRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAccessTokengetActiveAttributeType(arg *AccessTokengetActiveAttributeType, val AccessTokengetActiveRetType) { + *arg = &val +} + +/* + types and functions for createdAt +*/ + +// isDateTime +type AccessTokenGetCreatedAtAttributeType = *time.Time +type AccessTokenGetCreatedAtArgType = time.Time +type AccessTokenGetCreatedAtRetType = time.Time + +func getAccessTokenGetCreatedAtAttributeTypeOk(arg AccessTokenGetCreatedAtAttributeType) (ret AccessTokenGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAccessTokenGetCreatedAtAttributeType(arg *AccessTokenGetCreatedAtAttributeType, val AccessTokenGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type AccessTokenGetIdAttributeType = *string + +func getAccessTokenGetIdAttributeTypeOk(arg AccessTokenGetIdAttributeType) (ret AccessTokenGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAccessTokenGetIdAttributeType(arg *AccessTokenGetIdAttributeType, val AccessTokenGetIdRetType) { + *arg = &val +} + +type AccessTokenGetIdArgType = string +type AccessTokenGetIdRetType = string + +/* + types and functions for token +*/ + +// isNotNullableString +type AccessTokenGetTokenAttributeType = *string + +func getAccessTokenGetTokenAttributeTypeOk(arg AccessTokenGetTokenAttributeType) (ret AccessTokenGetTokenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAccessTokenGetTokenAttributeType(arg *AccessTokenGetTokenAttributeType, val AccessTokenGetTokenRetType) { + *arg = &val +} + +type AccessTokenGetTokenArgType = string +type AccessTokenGetTokenRetType = string + +/* + types and functions for validUntil +*/ + +// isDateTime +type AccessTokenGetValidUntilAttributeType = *time.Time +type AccessTokenGetValidUntilArgType = time.Time +type AccessTokenGetValidUntilRetType = time.Time + +func getAccessTokenGetValidUntilAttributeTypeOk(arg AccessTokenGetValidUntilAttributeType) (ret AccessTokenGetValidUntilRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAccessTokenGetValidUntilAttributeType(arg *AccessTokenGetValidUntilAttributeType, val AccessTokenGetValidUntilRetType) { + *arg = &val +} + // AccessToken Contains token metadata and actual token. type AccessToken struct { // Newly created access tokens are valid, and can be revoked if needed. // REQUIRED - Active *bool `json:"active"` + Active AccessTokengetActiveAttributeType `json:"active"` // Creation time of the access token. // REQUIRED - CreatedAt *time.Time `json:"createdAt"` + CreatedAt AccessTokenGetCreatedAtAttributeType `json:"createdAt"` // Unique ID of the access token. Also used as JTI field. // REQUIRED - Id *string `json:"id"` + Id AccessTokenGetIdAttributeType `json:"id"` // The access token in JWT format. Use this with `Bearer` prefix for API calls. Store it, as it is not recoverable later. // REQUIRED - Token *string `json:"token"` + Token AccessTokenGetTokenAttributeType `json:"token"` // Approximate expiration time of the access token. Check the JWT for actual validity date. // REQUIRED - ValidUntil *time.Time `json:"validUntil"` + ValidUntil AccessTokenGetValidUntilAttributeType `json:"validUntil"` } type _AccessToken AccessToken @@ -43,13 +145,13 @@ type _AccessToken AccessToken // 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 NewAccessToken(active *bool, createdAt *time.Time, id *string, token *string, validUntil *time.Time) *AccessToken { +func NewAccessToken(active AccessTokengetActiveArgType, createdAt AccessTokenGetCreatedAtArgType, id AccessTokenGetIdArgType, token AccessTokenGetTokenArgType, validUntil AccessTokenGetValidUntilArgType) *AccessToken { this := AccessToken{} - this.Active = active - this.CreatedAt = createdAt - this.Id = id - this.Token = token - this.ValidUntil = validUntil + setAccessTokengetActiveAttributeType(&this.Active, active) + setAccessTokenGetCreatedAtAttributeType(&this.CreatedAt, createdAt) + setAccessTokenGetIdAttributeType(&this.Id, id) + setAccessTokenGetTokenAttributeType(&this.Token, token) + setAccessTokenGetValidUntilAttributeType(&this.ValidUntil, validUntil) return &this } @@ -62,132 +164,107 @@ func NewAccessTokenWithDefaults() *AccessToken { } // GetActive returns the Active field value -func (o *AccessToken) GetActive() *bool { - if o == nil || IsNil(o.Active) { - var ret *bool - return ret - } - - return o.Active +func (o *AccessToken) GetActive() (ret AccessTokengetActiveRetType) { + ret, _ = o.GetActiveOk() + return ret } // GetActiveOk returns a tuple with the Active field value // and a boolean to check if the value has been set. -func (o *AccessToken) GetActiveOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.Active, true +func (o *AccessToken) GetActiveOk() (ret AccessTokengetActiveRetType, ok bool) { + return getAccessTokengetActiveAttributeTypeOk(o.Active) } // SetActive sets field value -func (o *AccessToken) SetActive(v *bool) { - o.Active = v +func (o *AccessToken) SetActive(v AccessTokengetActiveRetType) { + setAccessTokengetActiveAttributeType(&o.Active, v) } // GetCreatedAt returns the CreatedAt field value -func (o *AccessToken) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - - return o.CreatedAt +func (o *AccessToken) GetCreatedAt() (ret AccessTokenGetCreatedAtRetType) { + ret, _ = o.GetCreatedAtOk() + return ret } // GetCreatedAtOk returns a tuple with the CreatedAt field value // and a boolean to check if the value has been set. -func (o *AccessToken) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.CreatedAt, true +func (o *AccessToken) GetCreatedAtOk() (ret AccessTokenGetCreatedAtRetType, ok bool) { + return getAccessTokenGetCreatedAtAttributeTypeOk(o.CreatedAt) } // SetCreatedAt sets field value -func (o *AccessToken) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *AccessToken) SetCreatedAt(v AccessTokenGetCreatedAtRetType) { + setAccessTokenGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetId returns the Id field value -func (o *AccessToken) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - - return o.Id +func (o *AccessToken) GetId() (ret AccessTokenGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *AccessToken) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *AccessToken) GetIdOk() (ret AccessTokenGetIdRetType, ok bool) { + return getAccessTokenGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *AccessToken) SetId(v *string) { - o.Id = v +func (o *AccessToken) SetId(v AccessTokenGetIdRetType) { + setAccessTokenGetIdAttributeType(&o.Id, v) } // GetToken returns the Token field value -func (o *AccessToken) GetToken() *string { - if o == nil || IsNil(o.Token) { - var ret *string - return ret - } - - return o.Token +func (o *AccessToken) GetToken() (ret AccessTokenGetTokenRetType) { + ret, _ = o.GetTokenOk() + return ret } // GetTokenOk returns a tuple with the Token field value // and a boolean to check if the value has been set. -func (o *AccessToken) GetTokenOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Token, true +func (o *AccessToken) GetTokenOk() (ret AccessTokenGetTokenRetType, ok bool) { + return getAccessTokenGetTokenAttributeTypeOk(o.Token) } // SetToken sets field value -func (o *AccessToken) SetToken(v *string) { - o.Token = v +func (o *AccessToken) SetToken(v AccessTokenGetTokenRetType) { + setAccessTokenGetTokenAttributeType(&o.Token, v) } // GetValidUntil returns the ValidUntil field value -func (o *AccessToken) GetValidUntil() *time.Time { - if o == nil || IsNil(o.ValidUntil) { - var ret *time.Time - return ret - } - - return o.ValidUntil +func (o *AccessToken) GetValidUntil() (ret AccessTokenGetValidUntilRetType) { + ret, _ = o.GetValidUntilOk() + return ret } // GetValidUntilOk returns a tuple with the ValidUntil field value // and a boolean to check if the value has been set. -func (o *AccessToken) GetValidUntilOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.ValidUntil, true +func (o *AccessToken) GetValidUntilOk() (ret AccessTokenGetValidUntilRetType, ok bool) { + return getAccessTokenGetValidUntilAttributeTypeOk(o.ValidUntil) } // SetValidUntil sets field value -func (o *AccessToken) SetValidUntil(v *time.Time) { - o.ValidUntil = v +func (o *AccessToken) SetValidUntil(v AccessTokenGetValidUntilRetType) { + setAccessTokenGetValidUntilAttributeType(&o.ValidUntil, v) } func (o AccessToken) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["active"] = o.Active - toSerialize["createdAt"] = o.CreatedAt - toSerialize["id"] = o.Id - toSerialize["token"] = o.Token - toSerialize["validUntil"] = o.ValidUntil + if val, ok := getAccessTokengetActiveAttributeTypeOk(o.Active); ok { + toSerialize["Active"] = val + } + if val, ok := getAccessTokenGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getAccessTokenGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getAccessTokenGetTokenAttributeTypeOk(o.Token); ok { + toSerialize["Token"] = val + } + if val, ok := getAccessTokenGetValidUntilAttributeTypeOk(o.ValidUntil); ok { + toSerialize["ValidUntil"] = val + } return toSerialize, nil } diff --git a/services/serviceaccount/model_access_token_metadata.go b/services/serviceaccount/model_access_token_metadata.go index 9cd0c6926..cc04673ed 100644 --- a/services/serviceaccount/model_access_token_metadata.go +++ b/services/serviceaccount/model_access_token_metadata.go @@ -18,20 +18,101 @@ import ( // checks if the AccessTokenMetadata type satisfies the MappedNullable interface at compile time var _ MappedNullable = &AccessTokenMetadata{} +/* + types and functions for active +*/ + +// isBoolean +type AccessTokenMetadatagetActiveAttributeType = *bool +type AccessTokenMetadatagetActiveArgType = bool +type AccessTokenMetadatagetActiveRetType = bool + +func getAccessTokenMetadatagetActiveAttributeTypeOk(arg AccessTokenMetadatagetActiveAttributeType) (ret AccessTokenMetadatagetActiveRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAccessTokenMetadatagetActiveAttributeType(arg *AccessTokenMetadatagetActiveAttributeType, val AccessTokenMetadatagetActiveRetType) { + *arg = &val +} + +/* + types and functions for createdAt +*/ + +// isDateTime +type AccessTokenMetadataGetCreatedAtAttributeType = *time.Time +type AccessTokenMetadataGetCreatedAtArgType = time.Time +type AccessTokenMetadataGetCreatedAtRetType = time.Time + +func getAccessTokenMetadataGetCreatedAtAttributeTypeOk(arg AccessTokenMetadataGetCreatedAtAttributeType) (ret AccessTokenMetadataGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAccessTokenMetadataGetCreatedAtAttributeType(arg *AccessTokenMetadataGetCreatedAtAttributeType, val AccessTokenMetadataGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type AccessTokenMetadataGetIdAttributeType = *string + +func getAccessTokenMetadataGetIdAttributeTypeOk(arg AccessTokenMetadataGetIdAttributeType) (ret AccessTokenMetadataGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAccessTokenMetadataGetIdAttributeType(arg *AccessTokenMetadataGetIdAttributeType, val AccessTokenMetadataGetIdRetType) { + *arg = &val +} + +type AccessTokenMetadataGetIdArgType = string +type AccessTokenMetadataGetIdRetType = string + +/* + types and functions for validUntil +*/ + +// isDateTime +type AccessTokenMetadataGetValidUntilAttributeType = *time.Time +type AccessTokenMetadataGetValidUntilArgType = time.Time +type AccessTokenMetadataGetValidUntilRetType = time.Time + +func getAccessTokenMetadataGetValidUntilAttributeTypeOk(arg AccessTokenMetadataGetValidUntilAttributeType) (ret AccessTokenMetadataGetValidUntilRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAccessTokenMetadataGetValidUntilAttributeType(arg *AccessTokenMetadataGetValidUntilAttributeType, val AccessTokenMetadataGetValidUntilRetType) { + *arg = &val +} + // AccessTokenMetadata Does not contain the actual token. type AccessTokenMetadata struct { // If true, access token can be used for authorized API calls, if false, the token is not usable anymore. // REQUIRED - Active *bool `json:"active"` + Active AccessTokenMetadatagetActiveAttributeType `json:"active"` // Creation time of the access token. // REQUIRED - CreatedAt *time.Time `json:"createdAt"` + CreatedAt AccessTokenMetadataGetCreatedAtAttributeType `json:"createdAt"` // Unique ID of the access token. Also used as JTI field. // REQUIRED - Id *string `json:"id"` + Id AccessTokenMetadataGetIdAttributeType `json:"id"` // Approximate expiration time of the access token. Check the JWT for actual validity date. // REQUIRED - ValidUntil *time.Time `json:"validUntil"` + ValidUntil AccessTokenMetadataGetValidUntilAttributeType `json:"validUntil"` } type _AccessTokenMetadata AccessTokenMetadata @@ -40,12 +121,12 @@ type _AccessTokenMetadata AccessTokenMetadata // 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 NewAccessTokenMetadata(active *bool, createdAt *time.Time, id *string, validUntil *time.Time) *AccessTokenMetadata { +func NewAccessTokenMetadata(active AccessTokenMetadatagetActiveArgType, createdAt AccessTokenMetadataGetCreatedAtArgType, id AccessTokenMetadataGetIdArgType, validUntil AccessTokenMetadataGetValidUntilArgType) *AccessTokenMetadata { this := AccessTokenMetadata{} - this.Active = active - this.CreatedAt = createdAt - this.Id = id - this.ValidUntil = validUntil + setAccessTokenMetadatagetActiveAttributeType(&this.Active, active) + setAccessTokenMetadataGetCreatedAtAttributeType(&this.CreatedAt, createdAt) + setAccessTokenMetadataGetIdAttributeType(&this.Id, id) + setAccessTokenMetadataGetValidUntilAttributeType(&this.ValidUntil, validUntil) return &this } @@ -58,107 +139,87 @@ func NewAccessTokenMetadataWithDefaults() *AccessTokenMetadata { } // GetActive returns the Active field value -func (o *AccessTokenMetadata) GetActive() *bool { - if o == nil || IsNil(o.Active) { - var ret *bool - return ret - } - - return o.Active +func (o *AccessTokenMetadata) GetActive() (ret AccessTokenMetadatagetActiveRetType) { + ret, _ = o.GetActiveOk() + return ret } // GetActiveOk returns a tuple with the Active field value // and a boolean to check if the value has been set. -func (o *AccessTokenMetadata) GetActiveOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.Active, true +func (o *AccessTokenMetadata) GetActiveOk() (ret AccessTokenMetadatagetActiveRetType, ok bool) { + return getAccessTokenMetadatagetActiveAttributeTypeOk(o.Active) } // SetActive sets field value -func (o *AccessTokenMetadata) SetActive(v *bool) { - o.Active = v +func (o *AccessTokenMetadata) SetActive(v AccessTokenMetadatagetActiveRetType) { + setAccessTokenMetadatagetActiveAttributeType(&o.Active, v) } // GetCreatedAt returns the CreatedAt field value -func (o *AccessTokenMetadata) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - - return o.CreatedAt +func (o *AccessTokenMetadata) GetCreatedAt() (ret AccessTokenMetadataGetCreatedAtRetType) { + ret, _ = o.GetCreatedAtOk() + return ret } // GetCreatedAtOk returns a tuple with the CreatedAt field value // and a boolean to check if the value has been set. -func (o *AccessTokenMetadata) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.CreatedAt, true +func (o *AccessTokenMetadata) GetCreatedAtOk() (ret AccessTokenMetadataGetCreatedAtRetType, ok bool) { + return getAccessTokenMetadataGetCreatedAtAttributeTypeOk(o.CreatedAt) } // SetCreatedAt sets field value -func (o *AccessTokenMetadata) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *AccessTokenMetadata) SetCreatedAt(v AccessTokenMetadataGetCreatedAtRetType) { + setAccessTokenMetadataGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetId returns the Id field value -func (o *AccessTokenMetadata) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - - return o.Id +func (o *AccessTokenMetadata) GetId() (ret AccessTokenMetadataGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *AccessTokenMetadata) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *AccessTokenMetadata) GetIdOk() (ret AccessTokenMetadataGetIdRetType, ok bool) { + return getAccessTokenMetadataGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *AccessTokenMetadata) SetId(v *string) { - o.Id = v +func (o *AccessTokenMetadata) SetId(v AccessTokenMetadataGetIdRetType) { + setAccessTokenMetadataGetIdAttributeType(&o.Id, v) } // GetValidUntil returns the ValidUntil field value -func (o *AccessTokenMetadata) GetValidUntil() *time.Time { - if o == nil || IsNil(o.ValidUntil) { - var ret *time.Time - return ret - } - - return o.ValidUntil +func (o *AccessTokenMetadata) GetValidUntil() (ret AccessTokenMetadataGetValidUntilRetType) { + ret, _ = o.GetValidUntilOk() + return ret } // GetValidUntilOk returns a tuple with the ValidUntil field value // and a boolean to check if the value has been set. -func (o *AccessTokenMetadata) GetValidUntilOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.ValidUntil, true +func (o *AccessTokenMetadata) GetValidUntilOk() (ret AccessTokenMetadataGetValidUntilRetType, ok bool) { + return getAccessTokenMetadataGetValidUntilAttributeTypeOk(o.ValidUntil) } // SetValidUntil sets field value -func (o *AccessTokenMetadata) SetValidUntil(v *time.Time) { - o.ValidUntil = v +func (o *AccessTokenMetadata) SetValidUntil(v AccessTokenMetadataGetValidUntilRetType) { + setAccessTokenMetadataGetValidUntilAttributeType(&o.ValidUntil, v) } func (o AccessTokenMetadata) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["active"] = o.Active - toSerialize["createdAt"] = o.CreatedAt - toSerialize["id"] = o.Id - toSerialize["validUntil"] = o.ValidUntil + if val, ok := getAccessTokenMetadatagetActiveAttributeTypeOk(o.Active); ok { + toSerialize["Active"] = val + } + if val, ok := getAccessTokenMetadataGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getAccessTokenMetadataGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getAccessTokenMetadataGetValidUntilAttributeTypeOk(o.ValidUntil); ok { + toSerialize["ValidUntil"] = val + } return toSerialize, nil } diff --git a/services/serviceaccount/model_auth_error.go b/services/serviceaccount/model_auth_error.go index 0e54106b9..94f1c6761 100644 --- a/services/serviceaccount/model_auth_error.go +++ b/services/serviceaccount/model_auth_error.go @@ -17,10 +17,30 @@ import ( // checks if the AuthError type satisfies the MappedNullable interface at compile time var _ MappedNullable = &AuthError{} +/* + types and functions for error +*/ + +// isModel +type AuthErrorGetErrorAttributeType = *AuthErrorError +type AuthErrorGetErrorArgType = AuthErrorError +type AuthErrorGetErrorRetType = AuthErrorError + +func getAuthErrorGetErrorAttributeTypeOk(arg AuthErrorGetErrorAttributeType) (ret AuthErrorGetErrorRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAuthErrorGetErrorAttributeType(arg *AuthErrorGetErrorAttributeType, val AuthErrorGetErrorRetType) { + *arg = &val +} + // AuthError struct for AuthError type AuthError struct { // REQUIRED - Error *AuthErrorError `json:"error"` + Error AuthErrorGetErrorAttributeType `json:"error"` } type _AuthError AuthError @@ -29,9 +49,9 @@ type _AuthError AuthError // 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 NewAuthError(error_ *AuthErrorError) *AuthError { +func NewAuthError(error_ AuthErrorGetErrorArgType) *AuthError { this := AuthError{} - this.Error = error_ + setAuthErrorGetErrorAttributeType(&this.Error, error_) return &this } @@ -44,32 +64,27 @@ func NewAuthErrorWithDefaults() *AuthError { } // GetError returns the Error field value -func (o *AuthError) GetError() *AuthErrorError { - if o == nil || IsNil(o.Error) { - var ret *AuthErrorError - return ret - } - - return o.Error +func (o *AuthError) GetError() (ret AuthErrorGetErrorRetType) { + ret, _ = o.GetErrorOk() + return ret } // GetErrorOk returns a tuple with the Error field value // and a boolean to check if the value has been set. -func (o *AuthError) GetErrorOk() (*AuthErrorError, bool) { - if o == nil { - return nil, false - } - return o.Error, true +func (o *AuthError) GetErrorOk() (ret AuthErrorGetErrorRetType, ok bool) { + return getAuthErrorGetErrorAttributeTypeOk(o.Error) } // SetError sets field value -func (o *AuthError) SetError(v *AuthErrorError) { - o.Error = v +func (o *AuthError) SetError(v AuthErrorGetErrorRetType) { + setAuthErrorGetErrorAttributeType(&o.Error, v) } func (o AuthError) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["error"] = o.Error + if val, ok := getAuthErrorGetErrorAttributeTypeOk(o.Error); ok { + toSerialize["Error"] = val + } return toSerialize, nil } diff --git a/services/serviceaccount/model_auth_error_error.go b/services/serviceaccount/model_auth_error_error.go index d1a8768d6..aa414e3ab 100644 --- a/services/serviceaccount/model_auth_error_error.go +++ b/services/serviceaccount/model_auth_error_error.go @@ -17,14 +17,76 @@ import ( // checks if the AuthErrorError type satisfies the MappedNullable interface at compile time var _ MappedNullable = &AuthErrorError{} +/* + types and functions for code +*/ + +// isInteger +type AuthErrorErrorGetCodeAttributeType = *int64 +type AuthErrorErrorGetCodeArgType = int64 +type AuthErrorErrorGetCodeRetType = int64 + +func getAuthErrorErrorGetCodeAttributeTypeOk(arg AuthErrorErrorGetCodeAttributeType) (ret AuthErrorErrorGetCodeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAuthErrorErrorGetCodeAttributeType(arg *AuthErrorErrorGetCodeAttributeType, val AuthErrorErrorGetCodeRetType) { + *arg = &val +} + +/* + types and functions for message +*/ + +// isNotNullableString +type AuthErrorErrorGetMessageAttributeType = *string + +func getAuthErrorErrorGetMessageAttributeTypeOk(arg AuthErrorErrorGetMessageAttributeType) (ret AuthErrorErrorGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAuthErrorErrorGetMessageAttributeType(arg *AuthErrorErrorGetMessageAttributeType, val AuthErrorErrorGetMessageRetType) { + *arg = &val +} + +type AuthErrorErrorGetMessageArgType = string +type AuthErrorErrorGetMessageRetType = string + +/* + types and functions for status +*/ + +// isNotNullableString +type AuthErrorErrorGetStatusAttributeType = *string + +func getAuthErrorErrorGetStatusAttributeTypeOk(arg AuthErrorErrorGetStatusAttributeType) (ret AuthErrorErrorGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAuthErrorErrorGetStatusAttributeType(arg *AuthErrorErrorGetStatusAttributeType, val AuthErrorErrorGetStatusRetType) { + *arg = &val +} + +type AuthErrorErrorGetStatusArgType = string +type AuthErrorErrorGetStatusRetType = string + // AuthErrorError struct for AuthErrorError type AuthErrorError struct { // REQUIRED - Code *int64 `json:"code"` + Code AuthErrorErrorGetCodeAttributeType `json:"code"` // REQUIRED - Message *string `json:"message"` + Message AuthErrorErrorGetMessageAttributeType `json:"message"` // REQUIRED - Status *string `json:"status"` + Status AuthErrorErrorGetStatusAttributeType `json:"status"` } type _AuthErrorError AuthErrorError @@ -33,11 +95,11 @@ type _AuthErrorError AuthErrorError // 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 NewAuthErrorError(code *int64, message *string, status *string) *AuthErrorError { +func NewAuthErrorError(code AuthErrorErrorGetCodeArgType, message AuthErrorErrorGetMessageArgType, status AuthErrorErrorGetStatusArgType) *AuthErrorError { this := AuthErrorError{} - this.Code = code - this.Message = message - this.Status = status + setAuthErrorErrorGetCodeAttributeType(&this.Code, code) + setAuthErrorErrorGetMessageAttributeType(&this.Message, message) + setAuthErrorErrorGetStatusAttributeType(&this.Status, status) return &this } @@ -50,82 +112,67 @@ func NewAuthErrorErrorWithDefaults() *AuthErrorError { } // GetCode returns the Code field value -func (o *AuthErrorError) GetCode() *int64 { - if o == nil || IsNil(o.Code) { - var ret *int64 - return ret - } - - return o.Code +func (o *AuthErrorError) GetCode() (ret AuthErrorErrorGetCodeRetType) { + ret, _ = o.GetCodeOk() + return ret } // GetCodeOk returns a tuple with the Code field value // and a boolean to check if the value has been set. -func (o *AuthErrorError) GetCodeOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Code, true +func (o *AuthErrorError) GetCodeOk() (ret AuthErrorErrorGetCodeRetType, ok bool) { + return getAuthErrorErrorGetCodeAttributeTypeOk(o.Code) } // SetCode sets field value -func (o *AuthErrorError) SetCode(v *int64) { - o.Code = v +func (o *AuthErrorError) SetCode(v AuthErrorErrorGetCodeRetType) { + setAuthErrorErrorGetCodeAttributeType(&o.Code, v) } // GetMessage returns the Message field value -func (o *AuthErrorError) GetMessage() *string { - if o == nil || IsNil(o.Message) { - var ret *string - return ret - } - - return o.Message +func (o *AuthErrorError) GetMessage() (ret AuthErrorErrorGetMessageRetType) { + 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 *AuthErrorError) GetMessageOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Message, true +func (o *AuthErrorError) GetMessageOk() (ret AuthErrorErrorGetMessageRetType, ok bool) { + return getAuthErrorErrorGetMessageAttributeTypeOk(o.Message) } // SetMessage sets field value -func (o *AuthErrorError) SetMessage(v *string) { - o.Message = v +func (o *AuthErrorError) SetMessage(v AuthErrorErrorGetMessageRetType) { + setAuthErrorErrorGetMessageAttributeType(&o.Message, v) } // GetStatus returns the Status field value -func (o *AuthErrorError) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - - return o.Status +func (o *AuthErrorError) GetStatus() (ret AuthErrorErrorGetStatusRetType) { + 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 *AuthErrorError) GetStatusOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Status, true +func (o *AuthErrorError) GetStatusOk() (ret AuthErrorErrorGetStatusRetType, ok bool) { + return getAuthErrorErrorGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value -func (o *AuthErrorError) SetStatus(v *string) { - o.Status = v +func (o *AuthErrorError) SetStatus(v AuthErrorErrorGetStatusRetType) { + setAuthErrorErrorGetStatusAttributeType(&o.Status, v) } func (o AuthErrorError) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["code"] = o.Code - toSerialize["message"] = o.Message - toSerialize["status"] = o.Status + if val, ok := getAuthErrorErrorGetCodeAttributeTypeOk(o.Code); ok { + toSerialize["Code"] = val + } + if val, ok := getAuthErrorErrorGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + if val, ok := getAuthErrorErrorGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val + } return toSerialize, nil } diff --git a/services/serviceaccount/model_create_access_token_payload.go b/services/serviceaccount/model_create_access_token_payload.go index 4a5d0b3c3..a0db0b3f5 100644 --- a/services/serviceaccount/model_create_access_token_payload.go +++ b/services/serviceaccount/model_create_access_token_payload.go @@ -17,11 +17,31 @@ import ( // checks if the CreateAccessTokenPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateAccessTokenPayload{} +/* + types and functions for ttlDays +*/ + +// isInteger +type CreateAccessTokenPayloadGetTtlDaysAttributeType = *int64 +type CreateAccessTokenPayloadGetTtlDaysArgType = int64 +type CreateAccessTokenPayloadGetTtlDaysRetType = int64 + +func getCreateAccessTokenPayloadGetTtlDaysAttributeTypeOk(arg CreateAccessTokenPayloadGetTtlDaysAttributeType) (ret CreateAccessTokenPayloadGetTtlDaysRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateAccessTokenPayloadGetTtlDaysAttributeType(arg *CreateAccessTokenPayloadGetTtlDaysAttributeType, val CreateAccessTokenPayloadGetTtlDaysRetType) { + *arg = &val +} + // CreateAccessTokenPayload struct for CreateAccessTokenPayload type CreateAccessTokenPayload struct { // The duration in days for how long the new Access Token should be valid. // REQUIRED - TtlDays *int64 `json:"ttlDays"` + TtlDays CreateAccessTokenPayloadGetTtlDaysAttributeType `json:"ttlDays"` } type _CreateAccessTokenPayload CreateAccessTokenPayload @@ -30,9 +50,9 @@ type _CreateAccessTokenPayload CreateAccessTokenPayload // 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 NewCreateAccessTokenPayload(ttlDays *int64) *CreateAccessTokenPayload { +func NewCreateAccessTokenPayload(ttlDays CreateAccessTokenPayloadGetTtlDaysArgType) *CreateAccessTokenPayload { this := CreateAccessTokenPayload{} - this.TtlDays = ttlDays + setCreateAccessTokenPayloadGetTtlDaysAttributeType(&this.TtlDays, ttlDays) return &this } @@ -45,32 +65,27 @@ func NewCreateAccessTokenPayloadWithDefaults() *CreateAccessTokenPayload { } // GetTtlDays returns the TtlDays field value -func (o *CreateAccessTokenPayload) GetTtlDays() *int64 { - if o == nil || IsNil(o.TtlDays) { - var ret *int64 - return ret - } - - return o.TtlDays +func (o *CreateAccessTokenPayload) GetTtlDays() (ret CreateAccessTokenPayloadGetTtlDaysRetType) { + ret, _ = o.GetTtlDaysOk() + return ret } // GetTtlDaysOk returns a tuple with the TtlDays field value // and a boolean to check if the value has been set. -func (o *CreateAccessTokenPayload) GetTtlDaysOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.TtlDays, true +func (o *CreateAccessTokenPayload) GetTtlDaysOk() (ret CreateAccessTokenPayloadGetTtlDaysRetType, ok bool) { + return getCreateAccessTokenPayloadGetTtlDaysAttributeTypeOk(o.TtlDays) } // SetTtlDays sets field value -func (o *CreateAccessTokenPayload) SetTtlDays(v *int64) { - o.TtlDays = v +func (o *CreateAccessTokenPayload) SetTtlDays(v CreateAccessTokenPayloadGetTtlDaysRetType) { + setCreateAccessTokenPayloadGetTtlDaysAttributeType(&o.TtlDays, v) } func (o CreateAccessTokenPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["ttlDays"] = o.TtlDays + if val, ok := getCreateAccessTokenPayloadGetTtlDaysAttributeTypeOk(o.TtlDays); ok { + toSerialize["TtlDays"] = val + } return toSerialize, nil } diff --git a/services/serviceaccount/model_create_service_account_key_payload.go b/services/serviceaccount/model_create_service_account_key_payload.go index 8bdc5c10b..caf16f10b 100644 --- a/services/serviceaccount/model_create_service_account_key_payload.go +++ b/services/serviceaccount/model_create_service_account_key_payload.go @@ -18,12 +18,53 @@ import ( // checks if the CreateServiceAccountKeyPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateServiceAccountKeyPayload{} +/* + types and functions for publicKey +*/ + +// isNotNullableString +type CreateServiceAccountKeyPayloadGetPublicKeyAttributeType = *string + +func getCreateServiceAccountKeyPayloadGetPublicKeyAttributeTypeOk(arg CreateServiceAccountKeyPayloadGetPublicKeyAttributeType) (ret CreateServiceAccountKeyPayloadGetPublicKeyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServiceAccountKeyPayloadGetPublicKeyAttributeType(arg *CreateServiceAccountKeyPayloadGetPublicKeyAttributeType, val CreateServiceAccountKeyPayloadGetPublicKeyRetType) { + *arg = &val +} + +type CreateServiceAccountKeyPayloadGetPublicKeyArgType = string +type CreateServiceAccountKeyPayloadGetPublicKeyRetType = string + +/* + types and functions for validUntil +*/ + +// isDateTime +type CreateServiceAccountKeyPayloadGetValidUntilAttributeType = *time.Time +type CreateServiceAccountKeyPayloadGetValidUntilArgType = time.Time +type CreateServiceAccountKeyPayloadGetValidUntilRetType = time.Time + +func getCreateServiceAccountKeyPayloadGetValidUntilAttributeTypeOk(arg CreateServiceAccountKeyPayloadGetValidUntilAttributeType) (ret CreateServiceAccountKeyPayloadGetValidUntilRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServiceAccountKeyPayloadGetValidUntilAttributeType(arg *CreateServiceAccountKeyPayloadGetValidUntilAttributeType, val CreateServiceAccountKeyPayloadGetValidUntilRetType) { + *arg = &val +} + // CreateServiceAccountKeyPayload struct for CreateServiceAccountKeyPayload type CreateServiceAccountKeyPayload struct { // Optional, public key part of the user generated RSA key-pair wrapped in a [X.509 v3 certificate](https://www.rfc-editor.org/rfc/rfc5280) - PublicKey *string `json:"publicKey,omitempty"` + PublicKey CreateServiceAccountKeyPayloadGetPublicKeyAttributeType `json:"publicKey,omitempty"` // Optional, date of key expiration. When omitted, key is valid until deleted - ValidUntil *time.Time `json:"validUntil,omitempty"` + ValidUntil CreateServiceAccountKeyPayloadGetValidUntilAttributeType `json:"validUntil,omitempty"` } // NewCreateServiceAccountKeyPayload instantiates a new CreateServiceAccountKeyPayload object @@ -44,76 +85,58 @@ func NewCreateServiceAccountKeyPayloadWithDefaults() *CreateServiceAccountKeyPay } // GetPublicKey returns the PublicKey field value if set, zero value otherwise. -func (o *CreateServiceAccountKeyPayload) GetPublicKey() *string { - if o == nil || IsNil(o.PublicKey) { - var ret *string - return ret - } - return o.PublicKey +func (o *CreateServiceAccountKeyPayload) GetPublicKey() (res CreateServiceAccountKeyPayloadGetPublicKeyRetType) { + 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 *CreateServiceAccountKeyPayload) GetPublicKeyOk() (*string, bool) { - if o == nil || IsNil(o.PublicKey) { - return nil, false - } - return o.PublicKey, true +func (o *CreateServiceAccountKeyPayload) GetPublicKeyOk() (ret CreateServiceAccountKeyPayloadGetPublicKeyRetType, ok bool) { + return getCreateServiceAccountKeyPayloadGetPublicKeyAttributeTypeOk(o.PublicKey) } // HasPublicKey returns a boolean if a field has been set. func (o *CreateServiceAccountKeyPayload) 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 *CreateServiceAccountKeyPayload) SetPublicKey(v *string) { - o.PublicKey = v +func (o *CreateServiceAccountKeyPayload) SetPublicKey(v CreateServiceAccountKeyPayloadGetPublicKeyRetType) { + setCreateServiceAccountKeyPayloadGetPublicKeyAttributeType(&o.PublicKey, v) } // GetValidUntil returns the ValidUntil field value if set, zero value otherwise. -func (o *CreateServiceAccountKeyPayload) GetValidUntil() *time.Time { - if o == nil || IsNil(o.ValidUntil) { - var ret *time.Time - return ret - } - return o.ValidUntil +func (o *CreateServiceAccountKeyPayload) GetValidUntil() (res CreateServiceAccountKeyPayloadGetValidUntilRetType) { + res, _ = o.GetValidUntilOk() + return } // GetValidUntilOk returns a tuple with the ValidUntil field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyPayload) GetValidUntilOk() (*time.Time, bool) { - if o == nil || IsNil(o.ValidUntil) { - return nil, false - } - return o.ValidUntil, true +func (o *CreateServiceAccountKeyPayload) GetValidUntilOk() (ret CreateServiceAccountKeyPayloadGetValidUntilRetType, ok bool) { + return getCreateServiceAccountKeyPayloadGetValidUntilAttributeTypeOk(o.ValidUntil) } // HasValidUntil returns a boolean if a field has been set. func (o *CreateServiceAccountKeyPayload) HasValidUntil() bool { - if o != nil && !IsNil(o.ValidUntil) { - return true - } - - return false + _, ok := o.GetValidUntilOk() + return ok } // SetValidUntil gets a reference to the given time.Time and assigns it to the ValidUntil field. -func (o *CreateServiceAccountKeyPayload) SetValidUntil(v *time.Time) { - o.ValidUntil = v +func (o *CreateServiceAccountKeyPayload) SetValidUntil(v CreateServiceAccountKeyPayloadGetValidUntilRetType) { + setCreateServiceAccountKeyPayloadGetValidUntilAttributeType(&o.ValidUntil, v) } func (o CreateServiceAccountKeyPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.PublicKey) { - toSerialize["publicKey"] = o.PublicKey + if val, ok := getCreateServiceAccountKeyPayloadGetPublicKeyAttributeTypeOk(o.PublicKey); ok { + toSerialize["PublicKey"] = val } - if !IsNil(o.ValidUntil) { - toSerialize["validUntil"] = o.ValidUntil + if val, ok := getCreateServiceAccountKeyPayloadGetValidUntilAttributeTypeOk(o.ValidUntil); ok { + toSerialize["ValidUntil"] = val } return toSerialize, nil } diff --git a/services/serviceaccount/model_create_service_account_key_response.go b/services/serviceaccount/model_create_service_account_key_response.go index ce1e42eda..a4e1dc400 100644 --- a/services/serviceaccount/model_create_service_account_key_response.go +++ b/services/serviceaccount/model_create_service_account_key_response.go @@ -18,29 +18,211 @@ import ( // checks if the CreateServiceAccountKeyResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateServiceAccountKeyResponse{} +/* + types and functions for active +*/ + +// isBoolean +type CreateServiceAccountKeyResponsegetActiveAttributeType = *bool +type CreateServiceAccountKeyResponsegetActiveArgType = bool +type CreateServiceAccountKeyResponsegetActiveRetType = bool + +func getCreateServiceAccountKeyResponsegetActiveAttributeTypeOk(arg CreateServiceAccountKeyResponsegetActiveAttributeType) (ret CreateServiceAccountKeyResponsegetActiveRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServiceAccountKeyResponsegetActiveAttributeType(arg *CreateServiceAccountKeyResponsegetActiveAttributeType, val CreateServiceAccountKeyResponsegetActiveRetType) { + *arg = &val +} + +/* + types and functions for createdAt +*/ + +// isDateTime +type CreateServiceAccountKeyResponseGetCreatedAtAttributeType = *time.Time +type CreateServiceAccountKeyResponseGetCreatedAtArgType = time.Time +type CreateServiceAccountKeyResponseGetCreatedAtRetType = time.Time + +func getCreateServiceAccountKeyResponseGetCreatedAtAttributeTypeOk(arg CreateServiceAccountKeyResponseGetCreatedAtAttributeType) (ret CreateServiceAccountKeyResponseGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServiceAccountKeyResponseGetCreatedAtAttributeType(arg *CreateServiceAccountKeyResponseGetCreatedAtAttributeType, val CreateServiceAccountKeyResponseGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for credentials +*/ + +// isModel +type CreateServiceAccountKeyResponseGetCredentialsAttributeType = *CreateServiceAccountKeyResponseCredentials +type CreateServiceAccountKeyResponseGetCredentialsArgType = CreateServiceAccountKeyResponseCredentials +type CreateServiceAccountKeyResponseGetCredentialsRetType = CreateServiceAccountKeyResponseCredentials + +func getCreateServiceAccountKeyResponseGetCredentialsAttributeTypeOk(arg CreateServiceAccountKeyResponseGetCredentialsAttributeType) (ret CreateServiceAccountKeyResponseGetCredentialsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServiceAccountKeyResponseGetCredentialsAttributeType(arg *CreateServiceAccountKeyResponseGetCredentialsAttributeType, val CreateServiceAccountKeyResponseGetCredentialsRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type CreateServiceAccountKeyResponseGetIdAttributeType = *string + +func getCreateServiceAccountKeyResponseGetIdAttributeTypeOk(arg CreateServiceAccountKeyResponseGetIdAttributeType) (ret CreateServiceAccountKeyResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServiceAccountKeyResponseGetIdAttributeType(arg *CreateServiceAccountKeyResponseGetIdAttributeType, val CreateServiceAccountKeyResponseGetIdRetType) { + *arg = &val +} + +type CreateServiceAccountKeyResponseGetIdArgType = string +type CreateServiceAccountKeyResponseGetIdRetType = string + +/* + types and functions for keyAlgorithm +*/ + +// isEnumRef +type CreateServiceAccountKeyResponseGetKeyAlgorithmAttributeType = *string +type CreateServiceAccountKeyResponseGetKeyAlgorithmArgType = string +type CreateServiceAccountKeyResponseGetKeyAlgorithmRetType = string + +func getCreateServiceAccountKeyResponseGetKeyAlgorithmAttributeTypeOk(arg CreateServiceAccountKeyResponseGetKeyAlgorithmAttributeType) (ret CreateServiceAccountKeyResponseGetKeyAlgorithmRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServiceAccountKeyResponseGetKeyAlgorithmAttributeType(arg *CreateServiceAccountKeyResponseGetKeyAlgorithmAttributeType, val CreateServiceAccountKeyResponseGetKeyAlgorithmRetType) { + *arg = &val +} + +/* + types and functions for keyOrigin +*/ + +// isEnumRef +type CreateServiceAccountKeyResponseGetKeyOriginAttributeType = *string +type CreateServiceAccountKeyResponseGetKeyOriginArgType = string +type CreateServiceAccountKeyResponseGetKeyOriginRetType = string + +func getCreateServiceAccountKeyResponseGetKeyOriginAttributeTypeOk(arg CreateServiceAccountKeyResponseGetKeyOriginAttributeType) (ret CreateServiceAccountKeyResponseGetKeyOriginRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServiceAccountKeyResponseGetKeyOriginAttributeType(arg *CreateServiceAccountKeyResponseGetKeyOriginAttributeType, val CreateServiceAccountKeyResponseGetKeyOriginRetType) { + *arg = &val +} + +/* + types and functions for keyType +*/ + +// isEnumRef +type CreateServiceAccountKeyResponseGetKeyTypeAttributeType = *string +type CreateServiceAccountKeyResponseGetKeyTypeArgType = string +type CreateServiceAccountKeyResponseGetKeyTypeRetType = string + +func getCreateServiceAccountKeyResponseGetKeyTypeAttributeTypeOk(arg CreateServiceAccountKeyResponseGetKeyTypeAttributeType) (ret CreateServiceAccountKeyResponseGetKeyTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServiceAccountKeyResponseGetKeyTypeAttributeType(arg *CreateServiceAccountKeyResponseGetKeyTypeAttributeType, val CreateServiceAccountKeyResponseGetKeyTypeRetType) { + *arg = &val +} + +/* + types and functions for publicKey +*/ + +// isNotNullableString +type CreateServiceAccountKeyResponseGetPublicKeyAttributeType = *string + +func getCreateServiceAccountKeyResponseGetPublicKeyAttributeTypeOk(arg CreateServiceAccountKeyResponseGetPublicKeyAttributeType) (ret CreateServiceAccountKeyResponseGetPublicKeyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServiceAccountKeyResponseGetPublicKeyAttributeType(arg *CreateServiceAccountKeyResponseGetPublicKeyAttributeType, val CreateServiceAccountKeyResponseGetPublicKeyRetType) { + *arg = &val +} + +type CreateServiceAccountKeyResponseGetPublicKeyArgType = string +type CreateServiceAccountKeyResponseGetPublicKeyRetType = string + +/* + types and functions for validUntil +*/ + +// isDateTime +type CreateServiceAccountKeyResponseGetValidUntilAttributeType = *time.Time +type CreateServiceAccountKeyResponseGetValidUntilArgType = time.Time +type CreateServiceAccountKeyResponseGetValidUntilRetType = time.Time + +func getCreateServiceAccountKeyResponseGetValidUntilAttributeTypeOk(arg CreateServiceAccountKeyResponseGetValidUntilAttributeType) (ret CreateServiceAccountKeyResponseGetValidUntilRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServiceAccountKeyResponseGetValidUntilAttributeType(arg *CreateServiceAccountKeyResponseGetValidUntilAttributeType, val CreateServiceAccountKeyResponseGetValidUntilRetType) { + *arg = &val +} + // CreateServiceAccountKeyResponse struct for CreateServiceAccountKeyResponse type CreateServiceAccountKeyResponse struct { // REQUIRED - Active *bool `json:"active"` + Active CreateServiceAccountKeyResponsegetActiveAttributeType `json:"active"` // Creation time of the key // REQUIRED - CreatedAt *time.Time `json:"createdAt"` + CreatedAt CreateServiceAccountKeyResponseGetCreatedAtAttributeType `json:"createdAt"` // REQUIRED - Credentials *CreateServiceAccountKeyResponseCredentials `json:"credentials"` + Credentials CreateServiceAccountKeyResponseGetCredentialsAttributeType `json:"credentials"` // Unique ID of the key. // REQUIRED - Id *string `json:"id"` + Id CreateServiceAccountKeyResponseGetIdAttributeType `json:"id"` // REQUIRED - KeyAlgorithm *string `json:"keyAlgorithm"` + KeyAlgorithm CreateServiceAccountKeyResponseGetKeyAlgorithmAttributeType `json:"keyAlgorithm"` // REQUIRED - KeyOrigin *string `json:"keyOrigin"` + KeyOrigin CreateServiceAccountKeyResponseGetKeyOriginAttributeType `json:"keyOrigin"` // REQUIRED - KeyType *string `json:"keyType"` + KeyType CreateServiceAccountKeyResponseGetKeyTypeAttributeType `json:"keyType"` // Public key, that was provider, or was generated by the service account API // REQUIRED - PublicKey *string `json:"publicKey"` + PublicKey CreateServiceAccountKeyResponseGetPublicKeyAttributeType `json:"publicKey"` // If specified, the timestamp until the key is active. May be null - ValidUntil *time.Time `json:"validUntil,omitempty"` + ValidUntil CreateServiceAccountKeyResponseGetValidUntilAttributeType `json:"validUntil,omitempty"` } type _CreateServiceAccountKeyResponse CreateServiceAccountKeyResponse @@ -49,16 +231,16 @@ type _CreateServiceAccountKeyResponse CreateServiceAccountKeyResponse // 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 NewCreateServiceAccountKeyResponse(active *bool, createdAt *time.Time, credentials *CreateServiceAccountKeyResponseCredentials, id *string, keyAlgorithm *string, keyOrigin *string, keyType *string, publicKey *string) *CreateServiceAccountKeyResponse { +func NewCreateServiceAccountKeyResponse(active CreateServiceAccountKeyResponsegetActiveArgType, createdAt CreateServiceAccountKeyResponseGetCreatedAtArgType, credentials CreateServiceAccountKeyResponseGetCredentialsArgType, id CreateServiceAccountKeyResponseGetIdArgType, keyAlgorithm CreateServiceAccountKeyResponseGetKeyAlgorithmArgType, keyOrigin CreateServiceAccountKeyResponseGetKeyOriginArgType, keyType CreateServiceAccountKeyResponseGetKeyTypeArgType, publicKey CreateServiceAccountKeyResponseGetPublicKeyArgType) *CreateServiceAccountKeyResponse { this := CreateServiceAccountKeyResponse{} - this.Active = active - this.CreatedAt = createdAt - this.Credentials = credentials - this.Id = id - this.KeyAlgorithm = keyAlgorithm - this.KeyOrigin = keyOrigin - this.KeyType = keyType - this.PublicKey = publicKey + setCreateServiceAccountKeyResponsegetActiveAttributeType(&this.Active, active) + setCreateServiceAccountKeyResponseGetCreatedAtAttributeType(&this.CreatedAt, createdAt) + setCreateServiceAccountKeyResponseGetCredentialsAttributeType(&this.Credentials, credentials) + setCreateServiceAccountKeyResponseGetIdAttributeType(&this.Id, id) + setCreateServiceAccountKeyResponseGetKeyAlgorithmAttributeType(&this.KeyAlgorithm, keyAlgorithm) + setCreateServiceAccountKeyResponseGetKeyOriginAttributeType(&this.KeyOrigin, keyOrigin) + setCreateServiceAccountKeyResponseGetKeyTypeAttributeType(&this.KeyType, keyType) + setCreateServiceAccountKeyResponseGetPublicKeyAttributeType(&this.PublicKey, publicKey) return &this } @@ -71,241 +253,192 @@ func NewCreateServiceAccountKeyResponseWithDefaults() *CreateServiceAccountKeyRe } // GetActive returns the Active field value -func (o *CreateServiceAccountKeyResponse) GetActive() *bool { - if o == nil || IsNil(o.Active) { - var ret *bool - return ret - } - - return o.Active +func (o *CreateServiceAccountKeyResponse) GetActive() (ret CreateServiceAccountKeyResponsegetActiveRetType) { + ret, _ = o.GetActiveOk() + return ret } // GetActiveOk returns a tuple with the Active field value // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyResponse) GetActiveOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.Active, true +func (o *CreateServiceAccountKeyResponse) GetActiveOk() (ret CreateServiceAccountKeyResponsegetActiveRetType, ok bool) { + return getCreateServiceAccountKeyResponsegetActiveAttributeTypeOk(o.Active) } // SetActive sets field value -func (o *CreateServiceAccountKeyResponse) SetActive(v *bool) { - o.Active = v +func (o *CreateServiceAccountKeyResponse) SetActive(v CreateServiceAccountKeyResponsegetActiveRetType) { + setCreateServiceAccountKeyResponsegetActiveAttributeType(&o.Active, v) } // GetCreatedAt returns the CreatedAt field value -func (o *CreateServiceAccountKeyResponse) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - - return o.CreatedAt +func (o *CreateServiceAccountKeyResponse) GetCreatedAt() (ret CreateServiceAccountKeyResponseGetCreatedAtRetType) { + ret, _ = o.GetCreatedAtOk() + return ret } // GetCreatedAtOk returns a tuple with the CreatedAt field value // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyResponse) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.CreatedAt, true +func (o *CreateServiceAccountKeyResponse) GetCreatedAtOk() (ret CreateServiceAccountKeyResponseGetCreatedAtRetType, ok bool) { + return getCreateServiceAccountKeyResponseGetCreatedAtAttributeTypeOk(o.CreatedAt) } // SetCreatedAt sets field value -func (o *CreateServiceAccountKeyResponse) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *CreateServiceAccountKeyResponse) SetCreatedAt(v CreateServiceAccountKeyResponseGetCreatedAtRetType) { + setCreateServiceAccountKeyResponseGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetCredentials returns the Credentials field value -func (o *CreateServiceAccountKeyResponse) GetCredentials() *CreateServiceAccountKeyResponseCredentials { - if o == nil || IsNil(o.Credentials) { - var ret *CreateServiceAccountKeyResponseCredentials - return ret - } - - return o.Credentials +func (o *CreateServiceAccountKeyResponse) GetCredentials() (ret CreateServiceAccountKeyResponseGetCredentialsRetType) { + ret, _ = o.GetCredentialsOk() + return ret } // GetCredentialsOk returns a tuple with the Credentials field value // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyResponse) GetCredentialsOk() (*CreateServiceAccountKeyResponseCredentials, bool) { - if o == nil { - return nil, false - } - return o.Credentials, true +func (o *CreateServiceAccountKeyResponse) GetCredentialsOk() (ret CreateServiceAccountKeyResponseGetCredentialsRetType, ok bool) { + return getCreateServiceAccountKeyResponseGetCredentialsAttributeTypeOk(o.Credentials) } // SetCredentials sets field value -func (o *CreateServiceAccountKeyResponse) SetCredentials(v *CreateServiceAccountKeyResponseCredentials) { - o.Credentials = v +func (o *CreateServiceAccountKeyResponse) SetCredentials(v CreateServiceAccountKeyResponseGetCredentialsRetType) { + setCreateServiceAccountKeyResponseGetCredentialsAttributeType(&o.Credentials, v) } // GetId returns the Id field value -func (o *CreateServiceAccountKeyResponse) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - - return o.Id +func (o *CreateServiceAccountKeyResponse) GetId() (ret CreateServiceAccountKeyResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyResponse) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *CreateServiceAccountKeyResponse) GetIdOk() (ret CreateServiceAccountKeyResponseGetIdRetType, ok bool) { + return getCreateServiceAccountKeyResponseGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *CreateServiceAccountKeyResponse) SetId(v *string) { - o.Id = v +func (o *CreateServiceAccountKeyResponse) SetId(v CreateServiceAccountKeyResponseGetIdRetType) { + setCreateServiceAccountKeyResponseGetIdAttributeType(&o.Id, v) } // GetKeyAlgorithm returns the KeyAlgorithm field value -func (o *CreateServiceAccountKeyResponse) GetKeyAlgorithm() *string { - if o == nil || IsNil(o.KeyAlgorithm) { - var ret *string - return ret - } - - return o.KeyAlgorithm +func (o *CreateServiceAccountKeyResponse) GetKeyAlgorithm() (ret CreateServiceAccountKeyResponseGetKeyAlgorithmRetType) { + ret, _ = o.GetKeyAlgorithmOk() + return ret } // GetKeyAlgorithmOk returns a tuple with the KeyAlgorithm field value // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyResponse) GetKeyAlgorithmOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.KeyAlgorithm, true +func (o *CreateServiceAccountKeyResponse) GetKeyAlgorithmOk() (ret CreateServiceAccountKeyResponseGetKeyAlgorithmRetType, ok bool) { + return getCreateServiceAccountKeyResponseGetKeyAlgorithmAttributeTypeOk(o.KeyAlgorithm) } // SetKeyAlgorithm sets field value -func (o *CreateServiceAccountKeyResponse) SetKeyAlgorithm(v *string) { - o.KeyAlgorithm = v +func (o *CreateServiceAccountKeyResponse) SetKeyAlgorithm(v CreateServiceAccountKeyResponseGetKeyAlgorithmRetType) { + setCreateServiceAccountKeyResponseGetKeyAlgorithmAttributeType(&o.KeyAlgorithm, v) } // GetKeyOrigin returns the KeyOrigin field value -func (o *CreateServiceAccountKeyResponse) GetKeyOrigin() *string { - if o == nil || IsNil(o.KeyOrigin) { - var ret *string - return ret - } - - return o.KeyOrigin +func (o *CreateServiceAccountKeyResponse) GetKeyOrigin() (ret CreateServiceAccountKeyResponseGetKeyOriginRetType) { + ret, _ = o.GetKeyOriginOk() + return ret } // GetKeyOriginOk returns a tuple with the KeyOrigin field value // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyResponse) GetKeyOriginOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.KeyOrigin, true +func (o *CreateServiceAccountKeyResponse) GetKeyOriginOk() (ret CreateServiceAccountKeyResponseGetKeyOriginRetType, ok bool) { + return getCreateServiceAccountKeyResponseGetKeyOriginAttributeTypeOk(o.KeyOrigin) } // SetKeyOrigin sets field value -func (o *CreateServiceAccountKeyResponse) SetKeyOrigin(v *string) { - o.KeyOrigin = v +func (o *CreateServiceAccountKeyResponse) SetKeyOrigin(v CreateServiceAccountKeyResponseGetKeyOriginRetType) { + setCreateServiceAccountKeyResponseGetKeyOriginAttributeType(&o.KeyOrigin, v) } // GetKeyType returns the KeyType field value -func (o *CreateServiceAccountKeyResponse) GetKeyType() *string { - if o == nil || IsNil(o.KeyType) { - var ret *string - return ret - } - - return o.KeyType +func (o *CreateServiceAccountKeyResponse) GetKeyType() (ret CreateServiceAccountKeyResponseGetKeyTypeRetType) { + ret, _ = o.GetKeyTypeOk() + return ret } // GetKeyTypeOk returns a tuple with the KeyType field value // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyResponse) GetKeyTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.KeyType, true +func (o *CreateServiceAccountKeyResponse) GetKeyTypeOk() (ret CreateServiceAccountKeyResponseGetKeyTypeRetType, ok bool) { + return getCreateServiceAccountKeyResponseGetKeyTypeAttributeTypeOk(o.KeyType) } // SetKeyType sets field value -func (o *CreateServiceAccountKeyResponse) SetKeyType(v *string) { - o.KeyType = v +func (o *CreateServiceAccountKeyResponse) SetKeyType(v CreateServiceAccountKeyResponseGetKeyTypeRetType) { + setCreateServiceAccountKeyResponseGetKeyTypeAttributeType(&o.KeyType, v) } // GetPublicKey returns the PublicKey field value -func (o *CreateServiceAccountKeyResponse) GetPublicKey() *string { - if o == nil || IsNil(o.PublicKey) { - var ret *string - return ret - } - - return o.PublicKey +func (o *CreateServiceAccountKeyResponse) GetPublicKey() (ret CreateServiceAccountKeyResponseGetPublicKeyRetType) { + ret, _ = o.GetPublicKeyOk() + return ret } // GetPublicKeyOk returns a tuple with the PublicKey field value // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyResponse) GetPublicKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.PublicKey, true +func (o *CreateServiceAccountKeyResponse) GetPublicKeyOk() (ret CreateServiceAccountKeyResponseGetPublicKeyRetType, ok bool) { + return getCreateServiceAccountKeyResponseGetPublicKeyAttributeTypeOk(o.PublicKey) } // SetPublicKey sets field value -func (o *CreateServiceAccountKeyResponse) SetPublicKey(v *string) { - o.PublicKey = v +func (o *CreateServiceAccountKeyResponse) SetPublicKey(v CreateServiceAccountKeyResponseGetPublicKeyRetType) { + setCreateServiceAccountKeyResponseGetPublicKeyAttributeType(&o.PublicKey, v) } // GetValidUntil returns the ValidUntil field value if set, zero value otherwise. -func (o *CreateServiceAccountKeyResponse) GetValidUntil() *time.Time { - if o == nil || IsNil(o.ValidUntil) { - var ret *time.Time - return ret - } - return o.ValidUntil +func (o *CreateServiceAccountKeyResponse) GetValidUntil() (res CreateServiceAccountKeyResponseGetValidUntilRetType) { + res, _ = o.GetValidUntilOk() + return } // GetValidUntilOk returns a tuple with the ValidUntil field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyResponse) GetValidUntilOk() (*time.Time, bool) { - if o == nil || IsNil(o.ValidUntil) { - return nil, false - } - return o.ValidUntil, true +func (o *CreateServiceAccountKeyResponse) GetValidUntilOk() (ret CreateServiceAccountKeyResponseGetValidUntilRetType, ok bool) { + return getCreateServiceAccountKeyResponseGetValidUntilAttributeTypeOk(o.ValidUntil) } // HasValidUntil returns a boolean if a field has been set. func (o *CreateServiceAccountKeyResponse) HasValidUntil() bool { - if o != nil && !IsNil(o.ValidUntil) { - return true - } - - return false + _, ok := o.GetValidUntilOk() + return ok } // SetValidUntil gets a reference to the given time.Time and assigns it to the ValidUntil field. -func (o *CreateServiceAccountKeyResponse) SetValidUntil(v *time.Time) { - o.ValidUntil = v +func (o *CreateServiceAccountKeyResponse) SetValidUntil(v CreateServiceAccountKeyResponseGetValidUntilRetType) { + setCreateServiceAccountKeyResponseGetValidUntilAttributeType(&o.ValidUntil, v) } func (o CreateServiceAccountKeyResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["active"] = o.Active - toSerialize["createdAt"] = o.CreatedAt - toSerialize["credentials"] = o.Credentials - toSerialize["id"] = o.Id - toSerialize["keyAlgorithm"] = o.KeyAlgorithm - toSerialize["keyOrigin"] = o.KeyOrigin - toSerialize["keyType"] = o.KeyType - toSerialize["publicKey"] = o.PublicKey - if !IsNil(o.ValidUntil) { - toSerialize["validUntil"] = o.ValidUntil + if val, ok := getCreateServiceAccountKeyResponsegetActiveAttributeTypeOk(o.Active); ok { + toSerialize["Active"] = val + } + if val, ok := getCreateServiceAccountKeyResponseGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getCreateServiceAccountKeyResponseGetCredentialsAttributeTypeOk(o.Credentials); ok { + toSerialize["Credentials"] = val + } + if val, ok := getCreateServiceAccountKeyResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getCreateServiceAccountKeyResponseGetKeyAlgorithmAttributeTypeOk(o.KeyAlgorithm); ok { + toSerialize["KeyAlgorithm"] = val + } + if val, ok := getCreateServiceAccountKeyResponseGetKeyOriginAttributeTypeOk(o.KeyOrigin); ok { + toSerialize["KeyOrigin"] = val + } + if val, ok := getCreateServiceAccountKeyResponseGetKeyTypeAttributeTypeOk(o.KeyType); ok { + toSerialize["KeyType"] = val + } + if val, ok := getCreateServiceAccountKeyResponseGetPublicKeyAttributeTypeOk(o.PublicKey); ok { + toSerialize["PublicKey"] = val + } + if val, ok := getCreateServiceAccountKeyResponseGetValidUntilAttributeTypeOk(o.ValidUntil); ok { + toSerialize["ValidUntil"] = val } return toSerialize, nil } diff --git a/services/serviceaccount/model_create_service_account_key_response_credentials.go b/services/serviceaccount/model_create_service_account_key_response_credentials.go index a754f2185..786f8b183 100644 --- a/services/serviceaccount/model_create_service_account_key_response_credentials.go +++ b/services/serviceaccount/model_create_service_account_key_response_credentials.go @@ -17,22 +17,127 @@ import ( // checks if the CreateServiceAccountKeyResponseCredentials type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateServiceAccountKeyResponseCredentials{} +/* + types and functions for aud +*/ + +// isNotNullableString +type CreateServiceAccountKeyResponseCredentialsGetAudAttributeType = *string + +func getCreateServiceAccountKeyResponseCredentialsGetAudAttributeTypeOk(arg CreateServiceAccountKeyResponseCredentialsGetAudAttributeType) (ret CreateServiceAccountKeyResponseCredentialsGetAudRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServiceAccountKeyResponseCredentialsGetAudAttributeType(arg *CreateServiceAccountKeyResponseCredentialsGetAudAttributeType, val CreateServiceAccountKeyResponseCredentialsGetAudRetType) { + *arg = &val +} + +type CreateServiceAccountKeyResponseCredentialsGetAudArgType = string +type CreateServiceAccountKeyResponseCredentialsGetAudRetType = string + +/* + types and functions for iss +*/ + +// isNotNullableString +type CreateServiceAccountKeyResponseCredentialsGetIssAttributeType = *string + +func getCreateServiceAccountKeyResponseCredentialsGetIssAttributeTypeOk(arg CreateServiceAccountKeyResponseCredentialsGetIssAttributeType) (ret CreateServiceAccountKeyResponseCredentialsGetIssRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServiceAccountKeyResponseCredentialsGetIssAttributeType(arg *CreateServiceAccountKeyResponseCredentialsGetIssAttributeType, val CreateServiceAccountKeyResponseCredentialsGetIssRetType) { + *arg = &val +} + +type CreateServiceAccountKeyResponseCredentialsGetIssArgType = string +type CreateServiceAccountKeyResponseCredentialsGetIssRetType = string + +/* + types and functions for kid +*/ + +// isNotNullableString +type CreateServiceAccountKeyResponseCredentialsGetKidAttributeType = *string + +func getCreateServiceAccountKeyResponseCredentialsGetKidAttributeTypeOk(arg CreateServiceAccountKeyResponseCredentialsGetKidAttributeType) (ret CreateServiceAccountKeyResponseCredentialsGetKidRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServiceAccountKeyResponseCredentialsGetKidAttributeType(arg *CreateServiceAccountKeyResponseCredentialsGetKidAttributeType, val CreateServiceAccountKeyResponseCredentialsGetKidRetType) { + *arg = &val +} + +type CreateServiceAccountKeyResponseCredentialsGetKidArgType = string +type CreateServiceAccountKeyResponseCredentialsGetKidRetType = string + +/* + types and functions for privateKey +*/ + +// isNotNullableString +type CreateServiceAccountKeyResponseCredentialsGetPrivateKeyAttributeType = *string + +func getCreateServiceAccountKeyResponseCredentialsGetPrivateKeyAttributeTypeOk(arg CreateServiceAccountKeyResponseCredentialsGetPrivateKeyAttributeType) (ret CreateServiceAccountKeyResponseCredentialsGetPrivateKeyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServiceAccountKeyResponseCredentialsGetPrivateKeyAttributeType(arg *CreateServiceAccountKeyResponseCredentialsGetPrivateKeyAttributeType, val CreateServiceAccountKeyResponseCredentialsGetPrivateKeyRetType) { + *arg = &val +} + +type CreateServiceAccountKeyResponseCredentialsGetPrivateKeyArgType = string +type CreateServiceAccountKeyResponseCredentialsGetPrivateKeyRetType = string + +/* + types and functions for sub +*/ + +// isNotNullableString +type CreateServiceAccountKeyResponseCredentialsGetSubAttributeType = *string + +func getCreateServiceAccountKeyResponseCredentialsGetSubAttributeTypeOk(arg CreateServiceAccountKeyResponseCredentialsGetSubAttributeType) (ret CreateServiceAccountKeyResponseCredentialsGetSubRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServiceAccountKeyResponseCredentialsGetSubAttributeType(arg *CreateServiceAccountKeyResponseCredentialsGetSubAttributeType, val CreateServiceAccountKeyResponseCredentialsGetSubRetType) { + *arg = &val +} + +type CreateServiceAccountKeyResponseCredentialsGetSubArgType = string +type CreateServiceAccountKeyResponseCredentialsGetSubRetType = string + // CreateServiceAccountKeyResponseCredentials struct for CreateServiceAccountKeyResponseCredentials type CreateServiceAccountKeyResponseCredentials struct { // Audience - service account API URL // REQUIRED - Aud *string `json:"aud"` + Aud CreateServiceAccountKeyResponseCredentialsGetAudAttributeType `json:"aud"` // Service account email // REQUIRED - Iss *string `json:"iss"` + Iss CreateServiceAccountKeyResponseCredentialsGetIssAttributeType `json:"iss"` // Key id to use // REQUIRED - Kid *string `json:"kid"` + Kid CreateServiceAccountKeyResponseCredentialsGetKidAttributeType `json:"kid"` // Private key. Only present, if the service account API was generating the key. Not recoverable later. - PrivateKey *string `json:"privateKey,omitempty"` + PrivateKey CreateServiceAccountKeyResponseCredentialsGetPrivateKeyAttributeType `json:"privateKey,omitempty"` // Service account id // REQUIRED - Sub *string `json:"sub"` + Sub CreateServiceAccountKeyResponseCredentialsGetSubAttributeType `json:"sub"` } type _CreateServiceAccountKeyResponseCredentials CreateServiceAccountKeyResponseCredentials @@ -41,12 +146,12 @@ type _CreateServiceAccountKeyResponseCredentials CreateServiceAccountKeyResponse // 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 NewCreateServiceAccountKeyResponseCredentials(aud *string, iss *string, kid *string, sub *string) *CreateServiceAccountKeyResponseCredentials { +func NewCreateServiceAccountKeyResponseCredentials(aud CreateServiceAccountKeyResponseCredentialsGetAudArgType, iss CreateServiceAccountKeyResponseCredentialsGetIssArgType, kid CreateServiceAccountKeyResponseCredentialsGetKidArgType, sub CreateServiceAccountKeyResponseCredentialsGetSubArgType) *CreateServiceAccountKeyResponseCredentials { this := CreateServiceAccountKeyResponseCredentials{} - this.Aud = aud - this.Iss = iss - this.Kid = kid - this.Sub = sub + setCreateServiceAccountKeyResponseCredentialsGetAudAttributeType(&this.Aud, aud) + setCreateServiceAccountKeyResponseCredentialsGetIssAttributeType(&this.Iss, iss) + setCreateServiceAccountKeyResponseCredentialsGetKidAttributeType(&this.Kid, kid) + setCreateServiceAccountKeyResponseCredentialsGetSubAttributeType(&this.Sub, sub) return &this } @@ -59,142 +164,113 @@ func NewCreateServiceAccountKeyResponseCredentialsWithDefaults() *CreateServiceA } // GetAud returns the Aud field value -func (o *CreateServiceAccountKeyResponseCredentials) GetAud() *string { - if o == nil || IsNil(o.Aud) { - var ret *string - return ret - } - - return o.Aud +func (o *CreateServiceAccountKeyResponseCredentials) GetAud() (ret CreateServiceAccountKeyResponseCredentialsGetAudRetType) { + ret, _ = o.GetAudOk() + return ret } // GetAudOk returns a tuple with the Aud field value // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyResponseCredentials) GetAudOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Aud, true +func (o *CreateServiceAccountKeyResponseCredentials) GetAudOk() (ret CreateServiceAccountKeyResponseCredentialsGetAudRetType, ok bool) { + return getCreateServiceAccountKeyResponseCredentialsGetAudAttributeTypeOk(o.Aud) } // SetAud sets field value -func (o *CreateServiceAccountKeyResponseCredentials) SetAud(v *string) { - o.Aud = v +func (o *CreateServiceAccountKeyResponseCredentials) SetAud(v CreateServiceAccountKeyResponseCredentialsGetAudRetType) { + setCreateServiceAccountKeyResponseCredentialsGetAudAttributeType(&o.Aud, v) } // GetIss returns the Iss field value -func (o *CreateServiceAccountKeyResponseCredentials) GetIss() *string { - if o == nil || IsNil(o.Iss) { - var ret *string - return ret - } - - return o.Iss +func (o *CreateServiceAccountKeyResponseCredentials) GetIss() (ret CreateServiceAccountKeyResponseCredentialsGetIssRetType) { + ret, _ = o.GetIssOk() + return ret } // GetIssOk returns a tuple with the Iss field value // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyResponseCredentials) GetIssOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Iss, true +func (o *CreateServiceAccountKeyResponseCredentials) GetIssOk() (ret CreateServiceAccountKeyResponseCredentialsGetIssRetType, ok bool) { + return getCreateServiceAccountKeyResponseCredentialsGetIssAttributeTypeOk(o.Iss) } // SetIss sets field value -func (o *CreateServiceAccountKeyResponseCredentials) SetIss(v *string) { - o.Iss = v +func (o *CreateServiceAccountKeyResponseCredentials) SetIss(v CreateServiceAccountKeyResponseCredentialsGetIssRetType) { + setCreateServiceAccountKeyResponseCredentialsGetIssAttributeType(&o.Iss, v) } // GetKid returns the Kid field value -func (o *CreateServiceAccountKeyResponseCredentials) GetKid() *string { - if o == nil || IsNil(o.Kid) { - var ret *string - return ret - } - - return o.Kid +func (o *CreateServiceAccountKeyResponseCredentials) GetKid() (ret CreateServiceAccountKeyResponseCredentialsGetKidRetType) { + ret, _ = o.GetKidOk() + return ret } // GetKidOk returns a tuple with the Kid field value // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyResponseCredentials) GetKidOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Kid, true +func (o *CreateServiceAccountKeyResponseCredentials) GetKidOk() (ret CreateServiceAccountKeyResponseCredentialsGetKidRetType, ok bool) { + return getCreateServiceAccountKeyResponseCredentialsGetKidAttributeTypeOk(o.Kid) } // SetKid sets field value -func (o *CreateServiceAccountKeyResponseCredentials) SetKid(v *string) { - o.Kid = v +func (o *CreateServiceAccountKeyResponseCredentials) SetKid(v CreateServiceAccountKeyResponseCredentialsGetKidRetType) { + setCreateServiceAccountKeyResponseCredentialsGetKidAttributeType(&o.Kid, v) } // GetPrivateKey returns the PrivateKey field value if set, zero value otherwise. -func (o *CreateServiceAccountKeyResponseCredentials) GetPrivateKey() *string { - if o == nil || IsNil(o.PrivateKey) { - var ret *string - return ret - } - return o.PrivateKey +func (o *CreateServiceAccountKeyResponseCredentials) GetPrivateKey() (res CreateServiceAccountKeyResponseCredentialsGetPrivateKeyRetType) { + 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 *CreateServiceAccountKeyResponseCredentials) GetPrivateKeyOk() (*string, bool) { - if o == nil || IsNil(o.PrivateKey) { - return nil, false - } - return o.PrivateKey, true +func (o *CreateServiceAccountKeyResponseCredentials) GetPrivateKeyOk() (ret CreateServiceAccountKeyResponseCredentialsGetPrivateKeyRetType, ok bool) { + return getCreateServiceAccountKeyResponseCredentialsGetPrivateKeyAttributeTypeOk(o.PrivateKey) } // HasPrivateKey returns a boolean if a field has been set. func (o *CreateServiceAccountKeyResponseCredentials) 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 *CreateServiceAccountKeyResponseCredentials) SetPrivateKey(v *string) { - o.PrivateKey = v +func (o *CreateServiceAccountKeyResponseCredentials) SetPrivateKey(v CreateServiceAccountKeyResponseCredentialsGetPrivateKeyRetType) { + setCreateServiceAccountKeyResponseCredentialsGetPrivateKeyAttributeType(&o.PrivateKey, v) } // GetSub returns the Sub field value -func (o *CreateServiceAccountKeyResponseCredentials) GetSub() *string { - if o == nil || IsNil(o.Sub) { - var ret *string - return ret - } - - return o.Sub +func (o *CreateServiceAccountKeyResponseCredentials) GetSub() (ret CreateServiceAccountKeyResponseCredentialsGetSubRetType) { + ret, _ = o.GetSubOk() + return ret } // GetSubOk returns a tuple with the Sub field value // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyResponseCredentials) GetSubOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Sub, true +func (o *CreateServiceAccountKeyResponseCredentials) GetSubOk() (ret CreateServiceAccountKeyResponseCredentialsGetSubRetType, ok bool) { + return getCreateServiceAccountKeyResponseCredentialsGetSubAttributeTypeOk(o.Sub) } // SetSub sets field value -func (o *CreateServiceAccountKeyResponseCredentials) SetSub(v *string) { - o.Sub = v +func (o *CreateServiceAccountKeyResponseCredentials) SetSub(v CreateServiceAccountKeyResponseCredentialsGetSubRetType) { + setCreateServiceAccountKeyResponseCredentialsGetSubAttributeType(&o.Sub, v) } func (o CreateServiceAccountKeyResponseCredentials) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["aud"] = o.Aud - toSerialize["iss"] = o.Iss - toSerialize["kid"] = o.Kid - if !IsNil(o.PrivateKey) { - toSerialize["privateKey"] = o.PrivateKey + if val, ok := getCreateServiceAccountKeyResponseCredentialsGetAudAttributeTypeOk(o.Aud); ok { + toSerialize["Aud"] = val + } + if val, ok := getCreateServiceAccountKeyResponseCredentialsGetIssAttributeTypeOk(o.Iss); ok { + toSerialize["Iss"] = val + } + if val, ok := getCreateServiceAccountKeyResponseCredentialsGetKidAttributeTypeOk(o.Kid); ok { + toSerialize["Kid"] = val + } + if val, ok := getCreateServiceAccountKeyResponseCredentialsGetPrivateKeyAttributeTypeOk(o.PrivateKey); ok { + toSerialize["PrivateKey"] = val + } + if val, ok := getCreateServiceAccountKeyResponseCredentialsGetSubAttributeTypeOk(o.Sub); ok { + toSerialize["Sub"] = val } - toSerialize["sub"] = o.Sub return toSerialize, nil } diff --git a/services/serviceaccount/model_create_service_account_payload.go b/services/serviceaccount/model_create_service_account_payload.go index 8169451a1..fa4e54f3a 100644 --- a/services/serviceaccount/model_create_service_account_payload.go +++ b/services/serviceaccount/model_create_service_account_payload.go @@ -17,11 +17,32 @@ import ( // checks if the CreateServiceAccountPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateServiceAccountPayload{} +/* + types and functions for name +*/ + +// isNotNullableString +type CreateServiceAccountPayloadGetNameAttributeType = *string + +func getCreateServiceAccountPayloadGetNameAttributeTypeOk(arg CreateServiceAccountPayloadGetNameAttributeType) (ret CreateServiceAccountPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServiceAccountPayloadGetNameAttributeType(arg *CreateServiceAccountPayloadGetNameAttributeType, val CreateServiceAccountPayloadGetNameRetType) { + *arg = &val +} + +type CreateServiceAccountPayloadGetNameArgType = string +type CreateServiceAccountPayloadGetNameRetType = string + // CreateServiceAccountPayload struct for CreateServiceAccountPayload type CreateServiceAccountPayload struct { // The requested name of the service account. The service will generate a unique email from this name. // REQUIRED - Name *string `json:"name"` + Name CreateServiceAccountPayloadGetNameAttributeType `json:"name"` } type _CreateServiceAccountPayload CreateServiceAccountPayload @@ -30,9 +51,9 @@ type _CreateServiceAccountPayload CreateServiceAccountPayload // 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 NewCreateServiceAccountPayload(name *string) *CreateServiceAccountPayload { +func NewCreateServiceAccountPayload(name CreateServiceAccountPayloadGetNameArgType) *CreateServiceAccountPayload { this := CreateServiceAccountPayload{} - this.Name = name + setCreateServiceAccountPayloadGetNameAttributeType(&this.Name, name) return &this } @@ -45,32 +66,27 @@ func NewCreateServiceAccountPayloadWithDefaults() *CreateServiceAccountPayload { } // GetName returns the Name field value -func (o *CreateServiceAccountPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *CreateServiceAccountPayload) GetName() (ret CreateServiceAccountPayloadGetNameRetType) { + ret, _ = o.GetNameOk() + return ret } // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. -func (o *CreateServiceAccountPayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *CreateServiceAccountPayload) GetNameOk() (ret CreateServiceAccountPayloadGetNameRetType, ok bool) { + return getCreateServiceAccountPayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *CreateServiceAccountPayload) SetName(v *string) { - o.Name = v +func (o *CreateServiceAccountPayload) SetName(v CreateServiceAccountPayloadGetNameRetType) { + setCreateServiceAccountPayloadGetNameAttributeType(&o.Name, v) } func (o CreateServiceAccountPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["name"] = o.Name + if val, ok := getCreateServiceAccountPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } return toSerialize, nil } diff --git a/services/serviceaccount/model_create_short_lived_access_token_response.go b/services/serviceaccount/model_create_short_lived_access_token_response.go index 8e7457fd7..f1b7df46a 100644 --- a/services/serviceaccount/model_create_short_lived_access_token_response.go +++ b/services/serviceaccount/model_create_short_lived_access_token_response.go @@ -17,21 +17,124 @@ import ( // checks if the CreateShortLivedAccessTokenResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateShortLivedAccessTokenResponse{} +/* + types and functions for access_token +*/ + +// isNotNullableString +type CreateShortLivedAccessTokenResponseGetAccessTokenAttributeType = *string + +func getCreateShortLivedAccessTokenResponseGetAccessTokenAttributeTypeOk(arg CreateShortLivedAccessTokenResponseGetAccessTokenAttributeType) (ret CreateShortLivedAccessTokenResponseGetAccessTokenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShortLivedAccessTokenResponseGetAccessTokenAttributeType(arg *CreateShortLivedAccessTokenResponseGetAccessTokenAttributeType, val CreateShortLivedAccessTokenResponseGetAccessTokenRetType) { + *arg = &val +} + +type CreateShortLivedAccessTokenResponseGetAccessTokenArgType = string +type CreateShortLivedAccessTokenResponseGetAccessTokenRetType = string + +/* + types and functions for expires_in +*/ + +// isInteger +type CreateShortLivedAccessTokenResponseGetExpiresInAttributeType = *int64 +type CreateShortLivedAccessTokenResponseGetExpiresInArgType = int64 +type CreateShortLivedAccessTokenResponseGetExpiresInRetType = int64 + +func getCreateShortLivedAccessTokenResponseGetExpiresInAttributeTypeOk(arg CreateShortLivedAccessTokenResponseGetExpiresInAttributeType) (ret CreateShortLivedAccessTokenResponseGetExpiresInRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShortLivedAccessTokenResponseGetExpiresInAttributeType(arg *CreateShortLivedAccessTokenResponseGetExpiresInAttributeType, val CreateShortLivedAccessTokenResponseGetExpiresInRetType) { + *arg = &val +} + +/* + types and functions for refresh_token +*/ + +// isNotNullableString +type CreateShortLivedAccessTokenResponseGetRefreshTokenAttributeType = *string + +func getCreateShortLivedAccessTokenResponseGetRefreshTokenAttributeTypeOk(arg CreateShortLivedAccessTokenResponseGetRefreshTokenAttributeType) (ret CreateShortLivedAccessTokenResponseGetRefreshTokenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShortLivedAccessTokenResponseGetRefreshTokenAttributeType(arg *CreateShortLivedAccessTokenResponseGetRefreshTokenAttributeType, val CreateShortLivedAccessTokenResponseGetRefreshTokenRetType) { + *arg = &val +} + +type CreateShortLivedAccessTokenResponseGetRefreshTokenArgType = string +type CreateShortLivedAccessTokenResponseGetRefreshTokenRetType = string + +/* + types and functions for scope +*/ + +// isNotNullableString +type CreateShortLivedAccessTokenResponseGetScopeAttributeType = *string + +func getCreateShortLivedAccessTokenResponseGetScopeAttributeTypeOk(arg CreateShortLivedAccessTokenResponseGetScopeAttributeType) (ret CreateShortLivedAccessTokenResponseGetScopeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShortLivedAccessTokenResponseGetScopeAttributeType(arg *CreateShortLivedAccessTokenResponseGetScopeAttributeType, val CreateShortLivedAccessTokenResponseGetScopeRetType) { + *arg = &val +} + +type CreateShortLivedAccessTokenResponseGetScopeArgType = string +type CreateShortLivedAccessTokenResponseGetScopeRetType = string + +/* + types and functions for token_type +*/ + +// isEnumRef +type CreateShortLivedAccessTokenResponseGetTokenTypeAttributeType = *string +type CreateShortLivedAccessTokenResponseGetTokenTypeArgType = string +type CreateShortLivedAccessTokenResponseGetTokenTypeRetType = string + +func getCreateShortLivedAccessTokenResponseGetTokenTypeAttributeTypeOk(arg CreateShortLivedAccessTokenResponseGetTokenTypeAttributeType) (ret CreateShortLivedAccessTokenResponseGetTokenTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateShortLivedAccessTokenResponseGetTokenTypeAttributeType(arg *CreateShortLivedAccessTokenResponseGetTokenTypeAttributeType, val CreateShortLivedAccessTokenResponseGetTokenTypeRetType) { + *arg = &val +} + // CreateShortLivedAccessTokenResponse struct for CreateShortLivedAccessTokenResponse type CreateShortLivedAccessTokenResponse struct { // The short lived token that can be used for API access // REQUIRED - AccessToken *string `json:"access_token"` + AccessToken CreateShortLivedAccessTokenResponseGetAccessTokenAttributeType `json:"access_token"` // REQUIRED - ExpiresIn *int64 `json:"expires_in"` + ExpiresIn CreateShortLivedAccessTokenResponseGetExpiresInAttributeType `json:"expires_in"` // Refresh token that can be used to request a new access token when it expires (and before refresh token expires). Tokens are rotated. // REQUIRED - RefreshToken *string `json:"refresh_token"` + RefreshToken CreateShortLivedAccessTokenResponseGetRefreshTokenAttributeType `json:"refresh_token"` // scope field of the self signed token // REQUIRED - Scope *string `json:"scope"` + Scope CreateShortLivedAccessTokenResponseGetScopeAttributeType `json:"scope"` // REQUIRED - TokenType *string `json:"token_type"` + TokenType CreateShortLivedAccessTokenResponseGetTokenTypeAttributeType `json:"token_type"` } type _CreateShortLivedAccessTokenResponse CreateShortLivedAccessTokenResponse @@ -40,13 +143,13 @@ type _CreateShortLivedAccessTokenResponse CreateShortLivedAccessTokenResponse // 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 NewCreateShortLivedAccessTokenResponse(accessToken *string, expiresIn *int64, refreshToken *string, scope *string, tokenType *string) *CreateShortLivedAccessTokenResponse { +func NewCreateShortLivedAccessTokenResponse(accessToken CreateShortLivedAccessTokenResponseGetAccessTokenArgType, expiresIn CreateShortLivedAccessTokenResponseGetExpiresInArgType, refreshToken CreateShortLivedAccessTokenResponseGetRefreshTokenArgType, scope CreateShortLivedAccessTokenResponseGetScopeArgType, tokenType CreateShortLivedAccessTokenResponseGetTokenTypeArgType) *CreateShortLivedAccessTokenResponse { this := CreateShortLivedAccessTokenResponse{} - this.AccessToken = accessToken - this.ExpiresIn = expiresIn - this.RefreshToken = refreshToken - this.Scope = scope - this.TokenType = tokenType + setCreateShortLivedAccessTokenResponseGetAccessTokenAttributeType(&this.AccessToken, accessToken) + setCreateShortLivedAccessTokenResponseGetExpiresInAttributeType(&this.ExpiresIn, expiresIn) + setCreateShortLivedAccessTokenResponseGetRefreshTokenAttributeType(&this.RefreshToken, refreshToken) + setCreateShortLivedAccessTokenResponseGetScopeAttributeType(&this.Scope, scope) + setCreateShortLivedAccessTokenResponseGetTokenTypeAttributeType(&this.TokenType, tokenType) return &this } @@ -59,132 +162,107 @@ func NewCreateShortLivedAccessTokenResponseWithDefaults() *CreateShortLivedAcces } // GetAccessToken returns the AccessToken field value -func (o *CreateShortLivedAccessTokenResponse) GetAccessToken() *string { - if o == nil || IsNil(o.AccessToken) { - var ret *string - return ret - } - - return o.AccessToken +func (o *CreateShortLivedAccessTokenResponse) GetAccessToken() (ret CreateShortLivedAccessTokenResponseGetAccessTokenRetType) { + ret, _ = o.GetAccessTokenOk() + return ret } // GetAccessTokenOk returns a tuple with the AccessToken field value // and a boolean to check if the value has been set. -func (o *CreateShortLivedAccessTokenResponse) GetAccessTokenOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.AccessToken, true +func (o *CreateShortLivedAccessTokenResponse) GetAccessTokenOk() (ret CreateShortLivedAccessTokenResponseGetAccessTokenRetType, ok bool) { + return getCreateShortLivedAccessTokenResponseGetAccessTokenAttributeTypeOk(o.AccessToken) } // SetAccessToken sets field value -func (o *CreateShortLivedAccessTokenResponse) SetAccessToken(v *string) { - o.AccessToken = v +func (o *CreateShortLivedAccessTokenResponse) SetAccessToken(v CreateShortLivedAccessTokenResponseGetAccessTokenRetType) { + setCreateShortLivedAccessTokenResponseGetAccessTokenAttributeType(&o.AccessToken, v) } // GetExpiresIn returns the ExpiresIn field value -func (o *CreateShortLivedAccessTokenResponse) GetExpiresIn() *int64 { - if o == nil || IsNil(o.ExpiresIn) { - var ret *int64 - return ret - } - - return o.ExpiresIn +func (o *CreateShortLivedAccessTokenResponse) GetExpiresIn() (ret CreateShortLivedAccessTokenResponseGetExpiresInRetType) { + ret, _ = o.GetExpiresInOk() + return ret } // GetExpiresInOk returns a tuple with the ExpiresIn field value // and a boolean to check if the value has been set. -func (o *CreateShortLivedAccessTokenResponse) GetExpiresInOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.ExpiresIn, true +func (o *CreateShortLivedAccessTokenResponse) GetExpiresInOk() (ret CreateShortLivedAccessTokenResponseGetExpiresInRetType, ok bool) { + return getCreateShortLivedAccessTokenResponseGetExpiresInAttributeTypeOk(o.ExpiresIn) } // SetExpiresIn sets field value -func (o *CreateShortLivedAccessTokenResponse) SetExpiresIn(v *int64) { - o.ExpiresIn = v +func (o *CreateShortLivedAccessTokenResponse) SetExpiresIn(v CreateShortLivedAccessTokenResponseGetExpiresInRetType) { + setCreateShortLivedAccessTokenResponseGetExpiresInAttributeType(&o.ExpiresIn, v) } // GetRefreshToken returns the RefreshToken field value -func (o *CreateShortLivedAccessTokenResponse) GetRefreshToken() *string { - if o == nil || IsNil(o.RefreshToken) { - var ret *string - return ret - } - - return o.RefreshToken +func (o *CreateShortLivedAccessTokenResponse) GetRefreshToken() (ret CreateShortLivedAccessTokenResponseGetRefreshTokenRetType) { + ret, _ = o.GetRefreshTokenOk() + return ret } // GetRefreshTokenOk returns a tuple with the RefreshToken field value // and a boolean to check if the value has been set. -func (o *CreateShortLivedAccessTokenResponse) GetRefreshTokenOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.RefreshToken, true +func (o *CreateShortLivedAccessTokenResponse) GetRefreshTokenOk() (ret CreateShortLivedAccessTokenResponseGetRefreshTokenRetType, ok bool) { + return getCreateShortLivedAccessTokenResponseGetRefreshTokenAttributeTypeOk(o.RefreshToken) } // SetRefreshToken sets field value -func (o *CreateShortLivedAccessTokenResponse) SetRefreshToken(v *string) { - o.RefreshToken = v +func (o *CreateShortLivedAccessTokenResponse) SetRefreshToken(v CreateShortLivedAccessTokenResponseGetRefreshTokenRetType) { + setCreateShortLivedAccessTokenResponseGetRefreshTokenAttributeType(&o.RefreshToken, v) } // GetScope returns the Scope field value -func (o *CreateShortLivedAccessTokenResponse) GetScope() *string { - if o == nil || IsNil(o.Scope) { - var ret *string - return ret - } - - return o.Scope +func (o *CreateShortLivedAccessTokenResponse) GetScope() (ret CreateShortLivedAccessTokenResponseGetScopeRetType) { + ret, _ = o.GetScopeOk() + return ret } // GetScopeOk returns a tuple with the Scope field value // and a boolean to check if the value has been set. -func (o *CreateShortLivedAccessTokenResponse) GetScopeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Scope, true +func (o *CreateShortLivedAccessTokenResponse) GetScopeOk() (ret CreateShortLivedAccessTokenResponseGetScopeRetType, ok bool) { + return getCreateShortLivedAccessTokenResponseGetScopeAttributeTypeOk(o.Scope) } // SetScope sets field value -func (o *CreateShortLivedAccessTokenResponse) SetScope(v *string) { - o.Scope = v +func (o *CreateShortLivedAccessTokenResponse) SetScope(v CreateShortLivedAccessTokenResponseGetScopeRetType) { + setCreateShortLivedAccessTokenResponseGetScopeAttributeType(&o.Scope, v) } // GetTokenType returns the TokenType field value -func (o *CreateShortLivedAccessTokenResponse) GetTokenType() *string { - if o == nil || IsNil(o.TokenType) { - var ret *string - return ret - } - - return o.TokenType +func (o *CreateShortLivedAccessTokenResponse) GetTokenType() (ret CreateShortLivedAccessTokenResponseGetTokenTypeRetType) { + ret, _ = o.GetTokenTypeOk() + return ret } // GetTokenTypeOk returns a tuple with the TokenType field value // and a boolean to check if the value has been set. -func (o *CreateShortLivedAccessTokenResponse) GetTokenTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.TokenType, true +func (o *CreateShortLivedAccessTokenResponse) GetTokenTypeOk() (ret CreateShortLivedAccessTokenResponseGetTokenTypeRetType, ok bool) { + return getCreateShortLivedAccessTokenResponseGetTokenTypeAttributeTypeOk(o.TokenType) } // SetTokenType sets field value -func (o *CreateShortLivedAccessTokenResponse) SetTokenType(v *string) { - o.TokenType = v +func (o *CreateShortLivedAccessTokenResponse) SetTokenType(v CreateShortLivedAccessTokenResponseGetTokenTypeRetType) { + setCreateShortLivedAccessTokenResponseGetTokenTypeAttributeType(&o.TokenType, v) } func (o CreateShortLivedAccessTokenResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["access_token"] = o.AccessToken - toSerialize["expires_in"] = o.ExpiresIn - toSerialize["refresh_token"] = o.RefreshToken - toSerialize["scope"] = o.Scope - toSerialize["token_type"] = o.TokenType + if val, ok := getCreateShortLivedAccessTokenResponseGetAccessTokenAttributeTypeOk(o.AccessToken); ok { + toSerialize["AccessToken"] = val + } + if val, ok := getCreateShortLivedAccessTokenResponseGetExpiresInAttributeTypeOk(o.ExpiresIn); ok { + toSerialize["ExpiresIn"] = val + } + if val, ok := getCreateShortLivedAccessTokenResponseGetRefreshTokenAttributeTypeOk(o.RefreshToken); ok { + toSerialize["RefreshToken"] = val + } + if val, ok := getCreateShortLivedAccessTokenResponseGetScopeAttributeTypeOk(o.Scope); ok { + toSerialize["Scope"] = val + } + if val, ok := getCreateShortLivedAccessTokenResponseGetTokenTypeAttributeTypeOk(o.TokenType); ok { + toSerialize["TokenType"] = val + } return toSerialize, nil } diff --git a/services/serviceaccount/model_error.go b/services/serviceaccount/model_error.go index 1427ea170..3a846ec22 100644 --- a/services/serviceaccount/model_error.go +++ b/services/serviceaccount/model_error.go @@ -18,18 +18,121 @@ import ( // checks if the Error type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Error{} +/* + types and functions for error +*/ + +// isNotNullableString +type ErrorGetErrorAttributeType = *string + +func getErrorGetErrorAttributeTypeOk(arg ErrorGetErrorAttributeType) (ret ErrorGetErrorRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorGetErrorAttributeType(arg *ErrorGetErrorAttributeType, val ErrorGetErrorRetType) { + *arg = &val +} + +type ErrorGetErrorArgType = string +type ErrorGetErrorRetType = string + +/* + types and functions for message +*/ + +// isNotNullableString +type ErrorGetMessageAttributeType = *string + +func getErrorGetMessageAttributeTypeOk(arg ErrorGetMessageAttributeType) (ret ErrorGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorGetMessageAttributeType(arg *ErrorGetMessageAttributeType, val ErrorGetMessageRetType) { + *arg = &val +} + +type ErrorGetMessageArgType = string +type ErrorGetMessageRetType = string + +/* + types and functions for path +*/ + +// isNotNullableString +type ErrorGetPathAttributeType = *string + +func getErrorGetPathAttributeTypeOk(arg ErrorGetPathAttributeType) (ret ErrorGetPathRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorGetPathAttributeType(arg *ErrorGetPathAttributeType, val ErrorGetPathRetType) { + *arg = &val +} + +type ErrorGetPathArgType = string +type ErrorGetPathRetType = string + +/* + types and functions for status +*/ + +// isInteger +type ErrorGetStatusAttributeType = *int64 +type ErrorGetStatusArgType = int64 +type ErrorGetStatusRetType = int64 + +func getErrorGetStatusAttributeTypeOk(arg ErrorGetStatusAttributeType) (ret ErrorGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorGetStatusAttributeType(arg *ErrorGetStatusAttributeType, val ErrorGetStatusRetType) { + *arg = &val +} + +/* + types and functions for timeStamp +*/ + +// isDateTime +type ErrorGetTimeStampAttributeType = *time.Time +type ErrorGetTimeStampArgType = time.Time +type ErrorGetTimeStampRetType = time.Time + +func getErrorGetTimeStampAttributeTypeOk(arg ErrorGetTimeStampAttributeType) (ret ErrorGetTimeStampRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorGetTimeStampAttributeType(arg *ErrorGetTimeStampAttributeType, val ErrorGetTimeStampRetType) { + *arg = &val +} + // Error Contains error information. type Error struct { // REQUIRED - Error *string `json:"error"` + Error ErrorGetErrorAttributeType `json:"error"` // REQUIRED - Message *string `json:"message"` + Message ErrorGetMessageAttributeType `json:"message"` // REQUIRED - Path *string `json:"path"` + Path ErrorGetPathAttributeType `json:"path"` // REQUIRED - Status *int64 `json:"status"` + Status ErrorGetStatusAttributeType `json:"status"` // REQUIRED - TimeStamp *time.Time `json:"timeStamp"` + TimeStamp ErrorGetTimeStampAttributeType `json:"timeStamp"` } type _Error Error @@ -38,13 +141,13 @@ type _Error Error // 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 NewError(error_ *string, message *string, path *string, status *int64, timeStamp *time.Time) *Error { +func NewError(error_ ErrorGetErrorArgType, message ErrorGetMessageArgType, path ErrorGetPathArgType, status ErrorGetStatusArgType, timeStamp ErrorGetTimeStampArgType) *Error { this := Error{} - this.Error = error_ - this.Message = message - this.Path = path - this.Status = status - this.TimeStamp = timeStamp + setErrorGetErrorAttributeType(&this.Error, error_) + setErrorGetMessageAttributeType(&this.Message, message) + setErrorGetPathAttributeType(&this.Path, path) + setErrorGetStatusAttributeType(&this.Status, status) + setErrorGetTimeStampAttributeType(&this.TimeStamp, timeStamp) return &this } @@ -57,132 +160,107 @@ func NewErrorWithDefaults() *Error { } // GetError returns the Error field value -func (o *Error) GetError() *string { - if o == nil || IsNil(o.Error) { - var ret *string - return ret - } - - return o.Error +func (o *Error) GetError() (ret ErrorGetErrorRetType) { + ret, _ = o.GetErrorOk() + return ret } // GetErrorOk returns a tuple with the Error field value // and a boolean to check if the value has been set. -func (o *Error) GetErrorOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Error, true +func (o *Error) GetErrorOk() (ret ErrorGetErrorRetType, ok bool) { + return getErrorGetErrorAttributeTypeOk(o.Error) } // SetError sets field value -func (o *Error) SetError(v *string) { - o.Error = v +func (o *Error) SetError(v ErrorGetErrorRetType) { + setErrorGetErrorAttributeType(&o.Error, v) } // GetMessage returns the Message field value -func (o *Error) GetMessage() *string { - if o == nil || IsNil(o.Message) { - var ret *string - return ret - } - - return o.Message +func (o *Error) GetMessage() (ret ErrorGetMessageRetType) { + 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 *Error) GetMessageOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Message, true +func (o *Error) GetMessageOk() (ret ErrorGetMessageRetType, ok bool) { + return getErrorGetMessageAttributeTypeOk(o.Message) } // SetMessage sets field value -func (o *Error) SetMessage(v *string) { - o.Message = v +func (o *Error) SetMessage(v ErrorGetMessageRetType) { + setErrorGetMessageAttributeType(&o.Message, v) } // GetPath returns the Path field value -func (o *Error) GetPath() *string { - if o == nil || IsNil(o.Path) { - var ret *string - return ret - } - - return o.Path +func (o *Error) GetPath() (ret ErrorGetPathRetType) { + ret, _ = o.GetPathOk() + return ret } // GetPathOk returns a tuple with the Path field value // and a boolean to check if the value has been set. -func (o *Error) GetPathOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Path, true +func (o *Error) GetPathOk() (ret ErrorGetPathRetType, ok bool) { + return getErrorGetPathAttributeTypeOk(o.Path) } // SetPath sets field value -func (o *Error) SetPath(v *string) { - o.Path = v +func (o *Error) SetPath(v ErrorGetPathRetType) { + setErrorGetPathAttributeType(&o.Path, v) } // GetStatus returns the Status field value -func (o *Error) GetStatus() *int64 { - if o == nil || IsNil(o.Status) { - var ret *int64 - return ret - } - - return o.Status +func (o *Error) GetStatus() (ret ErrorGetStatusRetType) { + 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 *Error) GetStatusOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Status, true +func (o *Error) GetStatusOk() (ret ErrorGetStatusRetType, ok bool) { + return getErrorGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value -func (o *Error) SetStatus(v *int64) { - o.Status = v +func (o *Error) SetStatus(v ErrorGetStatusRetType) { + setErrorGetStatusAttributeType(&o.Status, v) } // GetTimeStamp returns the TimeStamp field value -func (o *Error) GetTimeStamp() *time.Time { - if o == nil || IsNil(o.TimeStamp) { - var ret *time.Time - return ret - } - - return o.TimeStamp +func (o *Error) GetTimeStamp() (ret ErrorGetTimeStampRetType) { + ret, _ = o.GetTimeStampOk() + return ret } // GetTimeStampOk returns a tuple with the TimeStamp field value // and a boolean to check if the value has been set. -func (o *Error) GetTimeStampOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.TimeStamp, true +func (o *Error) GetTimeStampOk() (ret ErrorGetTimeStampRetType, ok bool) { + return getErrorGetTimeStampAttributeTypeOk(o.TimeStamp) } // SetTimeStamp sets field value -func (o *Error) SetTimeStamp(v *time.Time) { - o.TimeStamp = v +func (o *Error) SetTimeStamp(v ErrorGetTimeStampRetType) { + setErrorGetTimeStampAttributeType(&o.TimeStamp, v) } func (o Error) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["error"] = o.Error - toSerialize["message"] = o.Message - toSerialize["path"] = o.Path - toSerialize["status"] = o.Status - toSerialize["timeStamp"] = o.TimeStamp + if val, ok := getErrorGetErrorAttributeTypeOk(o.Error); ok { + toSerialize["Error"] = val + } + if val, ok := getErrorGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + if val, ok := getErrorGetPathAttributeTypeOk(o.Path); ok { + toSerialize["Path"] = val + } + if val, ok := getErrorGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val + } + if val, ok := getErrorGetTimeStampAttributeTypeOk(o.TimeStamp); ok { + toSerialize["TimeStamp"] = val + } return toSerialize, nil } diff --git a/services/serviceaccount/model_get_service_account_key_response.go b/services/serviceaccount/model_get_service_account_key_response.go index 5b1f003c0..e61a8509e 100644 --- a/services/serviceaccount/model_get_service_account_key_response.go +++ b/services/serviceaccount/model_get_service_account_key_response.go @@ -18,28 +18,210 @@ import ( // checks if the GetServiceAccountKeyResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetServiceAccountKeyResponse{} +/* + types and functions for active +*/ + +// isBoolean +type GetServiceAccountKeyResponsegetActiveAttributeType = *bool +type GetServiceAccountKeyResponsegetActiveArgType = bool +type GetServiceAccountKeyResponsegetActiveRetType = bool + +func getGetServiceAccountKeyResponsegetActiveAttributeTypeOk(arg GetServiceAccountKeyResponsegetActiveAttributeType) (ret GetServiceAccountKeyResponsegetActiveRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetServiceAccountKeyResponsegetActiveAttributeType(arg *GetServiceAccountKeyResponsegetActiveAttributeType, val GetServiceAccountKeyResponsegetActiveRetType) { + *arg = &val +} + +/* + types and functions for createdAt +*/ + +// isDateTime +type GetServiceAccountKeyResponseGetCreatedAtAttributeType = *time.Time +type GetServiceAccountKeyResponseGetCreatedAtArgType = time.Time +type GetServiceAccountKeyResponseGetCreatedAtRetType = time.Time + +func getGetServiceAccountKeyResponseGetCreatedAtAttributeTypeOk(arg GetServiceAccountKeyResponseGetCreatedAtAttributeType) (ret GetServiceAccountKeyResponseGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetServiceAccountKeyResponseGetCreatedAtAttributeType(arg *GetServiceAccountKeyResponseGetCreatedAtAttributeType, val GetServiceAccountKeyResponseGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for credentials +*/ + +// isModel +type GetServiceAccountKeyResponseGetCredentialsAttributeType = *GetServiceAccountKeyResponseCredentials +type GetServiceAccountKeyResponseGetCredentialsArgType = GetServiceAccountKeyResponseCredentials +type GetServiceAccountKeyResponseGetCredentialsRetType = GetServiceAccountKeyResponseCredentials + +func getGetServiceAccountKeyResponseGetCredentialsAttributeTypeOk(arg GetServiceAccountKeyResponseGetCredentialsAttributeType) (ret GetServiceAccountKeyResponseGetCredentialsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetServiceAccountKeyResponseGetCredentialsAttributeType(arg *GetServiceAccountKeyResponseGetCredentialsAttributeType, val GetServiceAccountKeyResponseGetCredentialsRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type GetServiceAccountKeyResponseGetIdAttributeType = *string + +func getGetServiceAccountKeyResponseGetIdAttributeTypeOk(arg GetServiceAccountKeyResponseGetIdAttributeType) (ret GetServiceAccountKeyResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetServiceAccountKeyResponseGetIdAttributeType(arg *GetServiceAccountKeyResponseGetIdAttributeType, val GetServiceAccountKeyResponseGetIdRetType) { + *arg = &val +} + +type GetServiceAccountKeyResponseGetIdArgType = string +type GetServiceAccountKeyResponseGetIdRetType = string + +/* + types and functions for keyAlgorithm +*/ + +// isEnumRef +type GetServiceAccountKeyResponseGetKeyAlgorithmAttributeType = *string +type GetServiceAccountKeyResponseGetKeyAlgorithmArgType = string +type GetServiceAccountKeyResponseGetKeyAlgorithmRetType = string + +func getGetServiceAccountKeyResponseGetKeyAlgorithmAttributeTypeOk(arg GetServiceAccountKeyResponseGetKeyAlgorithmAttributeType) (ret GetServiceAccountKeyResponseGetKeyAlgorithmRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetServiceAccountKeyResponseGetKeyAlgorithmAttributeType(arg *GetServiceAccountKeyResponseGetKeyAlgorithmAttributeType, val GetServiceAccountKeyResponseGetKeyAlgorithmRetType) { + *arg = &val +} + +/* + types and functions for keyOrigin +*/ + +// isEnumRef +type GetServiceAccountKeyResponseGetKeyOriginAttributeType = *string +type GetServiceAccountKeyResponseGetKeyOriginArgType = string +type GetServiceAccountKeyResponseGetKeyOriginRetType = string + +func getGetServiceAccountKeyResponseGetKeyOriginAttributeTypeOk(arg GetServiceAccountKeyResponseGetKeyOriginAttributeType) (ret GetServiceAccountKeyResponseGetKeyOriginRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetServiceAccountKeyResponseGetKeyOriginAttributeType(arg *GetServiceAccountKeyResponseGetKeyOriginAttributeType, val GetServiceAccountKeyResponseGetKeyOriginRetType) { + *arg = &val +} + +/* + types and functions for keyType +*/ + +// isEnumRef +type GetServiceAccountKeyResponseGetKeyTypeAttributeType = *string +type GetServiceAccountKeyResponseGetKeyTypeArgType = string +type GetServiceAccountKeyResponseGetKeyTypeRetType = string + +func getGetServiceAccountKeyResponseGetKeyTypeAttributeTypeOk(arg GetServiceAccountKeyResponseGetKeyTypeAttributeType) (ret GetServiceAccountKeyResponseGetKeyTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetServiceAccountKeyResponseGetKeyTypeAttributeType(arg *GetServiceAccountKeyResponseGetKeyTypeAttributeType, val GetServiceAccountKeyResponseGetKeyTypeRetType) { + *arg = &val +} + +/* + types and functions for publicKey +*/ + +// isNotNullableString +type GetServiceAccountKeyResponseGetPublicKeyAttributeType = *string + +func getGetServiceAccountKeyResponseGetPublicKeyAttributeTypeOk(arg GetServiceAccountKeyResponseGetPublicKeyAttributeType) (ret GetServiceAccountKeyResponseGetPublicKeyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetServiceAccountKeyResponseGetPublicKeyAttributeType(arg *GetServiceAccountKeyResponseGetPublicKeyAttributeType, val GetServiceAccountKeyResponseGetPublicKeyRetType) { + *arg = &val +} + +type GetServiceAccountKeyResponseGetPublicKeyArgType = string +type GetServiceAccountKeyResponseGetPublicKeyRetType = string + +/* + types and functions for validUntil +*/ + +// isDateTime +type GetServiceAccountKeyResponseGetValidUntilAttributeType = *time.Time +type GetServiceAccountKeyResponseGetValidUntilArgType = time.Time +type GetServiceAccountKeyResponseGetValidUntilRetType = time.Time + +func getGetServiceAccountKeyResponseGetValidUntilAttributeTypeOk(arg GetServiceAccountKeyResponseGetValidUntilAttributeType) (ret GetServiceAccountKeyResponseGetValidUntilRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetServiceAccountKeyResponseGetValidUntilAttributeType(arg *GetServiceAccountKeyResponseGetValidUntilAttributeType, val GetServiceAccountKeyResponseGetValidUntilRetType) { + *arg = &val +} + // GetServiceAccountKeyResponse struct for GetServiceAccountKeyResponse type GetServiceAccountKeyResponse struct { // REQUIRED - Active *bool `json:"active"` + Active GetServiceAccountKeyResponsegetActiveAttributeType `json:"active"` // Creation time of the key // REQUIRED - CreatedAt *time.Time `json:"createdAt"` + CreatedAt GetServiceAccountKeyResponseGetCreatedAtAttributeType `json:"createdAt"` // REQUIRED - Credentials *GetServiceAccountKeyResponseCredentials `json:"credentials"` + Credentials GetServiceAccountKeyResponseGetCredentialsAttributeType `json:"credentials"` // Unique ID of the key. // REQUIRED - Id *string `json:"id"` + Id GetServiceAccountKeyResponseGetIdAttributeType `json:"id"` // REQUIRED - KeyAlgorithm *string `json:"keyAlgorithm"` + KeyAlgorithm GetServiceAccountKeyResponseGetKeyAlgorithmAttributeType `json:"keyAlgorithm"` // REQUIRED - KeyOrigin *string `json:"keyOrigin"` + KeyOrigin GetServiceAccountKeyResponseGetKeyOriginAttributeType `json:"keyOrigin"` // REQUIRED - KeyType *string `json:"keyType"` + KeyType GetServiceAccountKeyResponseGetKeyTypeAttributeType `json:"keyType"` // Public key, in the requested format - PublicKey *string `json:"publicKey,omitempty"` + PublicKey GetServiceAccountKeyResponseGetPublicKeyAttributeType `json:"publicKey,omitempty"` // If specified, the timestamp until the key is active. May be null - ValidUntil *time.Time `json:"validUntil,omitempty"` + ValidUntil GetServiceAccountKeyResponseGetValidUntilAttributeType `json:"validUntil,omitempty"` } type _GetServiceAccountKeyResponse GetServiceAccountKeyResponse @@ -48,15 +230,15 @@ type _GetServiceAccountKeyResponse GetServiceAccountKeyResponse // 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 NewGetServiceAccountKeyResponse(active *bool, createdAt *time.Time, credentials *GetServiceAccountKeyResponseCredentials, id *string, keyAlgorithm *string, keyOrigin *string, keyType *string) *GetServiceAccountKeyResponse { +func NewGetServiceAccountKeyResponse(active GetServiceAccountKeyResponsegetActiveArgType, createdAt GetServiceAccountKeyResponseGetCreatedAtArgType, credentials GetServiceAccountKeyResponseGetCredentialsArgType, id GetServiceAccountKeyResponseGetIdArgType, keyAlgorithm GetServiceAccountKeyResponseGetKeyAlgorithmArgType, keyOrigin GetServiceAccountKeyResponseGetKeyOriginArgType, keyType GetServiceAccountKeyResponseGetKeyTypeArgType) *GetServiceAccountKeyResponse { this := GetServiceAccountKeyResponse{} - this.Active = active - this.CreatedAt = createdAt - this.Credentials = credentials - this.Id = id - this.KeyAlgorithm = keyAlgorithm - this.KeyOrigin = keyOrigin - this.KeyType = keyType + setGetServiceAccountKeyResponsegetActiveAttributeType(&this.Active, active) + setGetServiceAccountKeyResponseGetCreatedAtAttributeType(&this.CreatedAt, createdAt) + setGetServiceAccountKeyResponseGetCredentialsAttributeType(&this.Credentials, credentials) + setGetServiceAccountKeyResponseGetIdAttributeType(&this.Id, id) + setGetServiceAccountKeyResponseGetKeyAlgorithmAttributeType(&this.KeyAlgorithm, keyAlgorithm) + setGetServiceAccountKeyResponseGetKeyOriginAttributeType(&this.KeyOrigin, keyOrigin) + setGetServiceAccountKeyResponseGetKeyTypeAttributeType(&this.KeyType, keyType) return &this } @@ -69,251 +251,198 @@ func NewGetServiceAccountKeyResponseWithDefaults() *GetServiceAccountKeyResponse } // GetActive returns the Active field value -func (o *GetServiceAccountKeyResponse) GetActive() *bool { - if o == nil || IsNil(o.Active) { - var ret *bool - return ret - } - - return o.Active +func (o *GetServiceAccountKeyResponse) GetActive() (ret GetServiceAccountKeyResponsegetActiveRetType) { + ret, _ = o.GetActiveOk() + return ret } // GetActiveOk returns a tuple with the Active field value // and a boolean to check if the value has been set. -func (o *GetServiceAccountKeyResponse) GetActiveOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.Active, true +func (o *GetServiceAccountKeyResponse) GetActiveOk() (ret GetServiceAccountKeyResponsegetActiveRetType, ok bool) { + return getGetServiceAccountKeyResponsegetActiveAttributeTypeOk(o.Active) } // SetActive sets field value -func (o *GetServiceAccountKeyResponse) SetActive(v *bool) { - o.Active = v +func (o *GetServiceAccountKeyResponse) SetActive(v GetServiceAccountKeyResponsegetActiveRetType) { + setGetServiceAccountKeyResponsegetActiveAttributeType(&o.Active, v) } // GetCreatedAt returns the CreatedAt field value -func (o *GetServiceAccountKeyResponse) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - - return o.CreatedAt +func (o *GetServiceAccountKeyResponse) GetCreatedAt() (ret GetServiceAccountKeyResponseGetCreatedAtRetType) { + ret, _ = o.GetCreatedAtOk() + return ret } // GetCreatedAtOk returns a tuple with the CreatedAt field value // and a boolean to check if the value has been set. -func (o *GetServiceAccountKeyResponse) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.CreatedAt, true +func (o *GetServiceAccountKeyResponse) GetCreatedAtOk() (ret GetServiceAccountKeyResponseGetCreatedAtRetType, ok bool) { + return getGetServiceAccountKeyResponseGetCreatedAtAttributeTypeOk(o.CreatedAt) } // SetCreatedAt sets field value -func (o *GetServiceAccountKeyResponse) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *GetServiceAccountKeyResponse) SetCreatedAt(v GetServiceAccountKeyResponseGetCreatedAtRetType) { + setGetServiceAccountKeyResponseGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetCredentials returns the Credentials field value -func (o *GetServiceAccountKeyResponse) GetCredentials() *GetServiceAccountKeyResponseCredentials { - if o == nil || IsNil(o.Credentials) { - var ret *GetServiceAccountKeyResponseCredentials - return ret - } - - return o.Credentials +func (o *GetServiceAccountKeyResponse) GetCredentials() (ret GetServiceAccountKeyResponseGetCredentialsRetType) { + ret, _ = o.GetCredentialsOk() + return ret } // GetCredentialsOk returns a tuple with the Credentials field value // and a boolean to check if the value has been set. -func (o *GetServiceAccountKeyResponse) GetCredentialsOk() (*GetServiceAccountKeyResponseCredentials, bool) { - if o == nil { - return nil, false - } - return o.Credentials, true +func (o *GetServiceAccountKeyResponse) GetCredentialsOk() (ret GetServiceAccountKeyResponseGetCredentialsRetType, ok bool) { + return getGetServiceAccountKeyResponseGetCredentialsAttributeTypeOk(o.Credentials) } // SetCredentials sets field value -func (o *GetServiceAccountKeyResponse) SetCredentials(v *GetServiceAccountKeyResponseCredentials) { - o.Credentials = v +func (o *GetServiceAccountKeyResponse) SetCredentials(v GetServiceAccountKeyResponseGetCredentialsRetType) { + setGetServiceAccountKeyResponseGetCredentialsAttributeType(&o.Credentials, v) } // GetId returns the Id field value -func (o *GetServiceAccountKeyResponse) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - - return o.Id +func (o *GetServiceAccountKeyResponse) GetId() (ret GetServiceAccountKeyResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *GetServiceAccountKeyResponse) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *GetServiceAccountKeyResponse) GetIdOk() (ret GetServiceAccountKeyResponseGetIdRetType, ok bool) { + return getGetServiceAccountKeyResponseGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *GetServiceAccountKeyResponse) SetId(v *string) { - o.Id = v +func (o *GetServiceAccountKeyResponse) SetId(v GetServiceAccountKeyResponseGetIdRetType) { + setGetServiceAccountKeyResponseGetIdAttributeType(&o.Id, v) } // GetKeyAlgorithm returns the KeyAlgorithm field value -func (o *GetServiceAccountKeyResponse) GetKeyAlgorithm() *string { - if o == nil || IsNil(o.KeyAlgorithm) { - var ret *string - return ret - } - - return o.KeyAlgorithm +func (o *GetServiceAccountKeyResponse) GetKeyAlgorithm() (ret GetServiceAccountKeyResponseGetKeyAlgorithmRetType) { + ret, _ = o.GetKeyAlgorithmOk() + return ret } // GetKeyAlgorithmOk returns a tuple with the KeyAlgorithm field value // and a boolean to check if the value has been set. -func (o *GetServiceAccountKeyResponse) GetKeyAlgorithmOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.KeyAlgorithm, true +func (o *GetServiceAccountKeyResponse) GetKeyAlgorithmOk() (ret GetServiceAccountKeyResponseGetKeyAlgorithmRetType, ok bool) { + return getGetServiceAccountKeyResponseGetKeyAlgorithmAttributeTypeOk(o.KeyAlgorithm) } // SetKeyAlgorithm sets field value -func (o *GetServiceAccountKeyResponse) SetKeyAlgorithm(v *string) { - o.KeyAlgorithm = v +func (o *GetServiceAccountKeyResponse) SetKeyAlgorithm(v GetServiceAccountKeyResponseGetKeyAlgorithmRetType) { + setGetServiceAccountKeyResponseGetKeyAlgorithmAttributeType(&o.KeyAlgorithm, v) } // GetKeyOrigin returns the KeyOrigin field value -func (o *GetServiceAccountKeyResponse) GetKeyOrigin() *string { - if o == nil || IsNil(o.KeyOrigin) { - var ret *string - return ret - } - - return o.KeyOrigin +func (o *GetServiceAccountKeyResponse) GetKeyOrigin() (ret GetServiceAccountKeyResponseGetKeyOriginRetType) { + ret, _ = o.GetKeyOriginOk() + return ret } // GetKeyOriginOk returns a tuple with the KeyOrigin field value // and a boolean to check if the value has been set. -func (o *GetServiceAccountKeyResponse) GetKeyOriginOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.KeyOrigin, true +func (o *GetServiceAccountKeyResponse) GetKeyOriginOk() (ret GetServiceAccountKeyResponseGetKeyOriginRetType, ok bool) { + return getGetServiceAccountKeyResponseGetKeyOriginAttributeTypeOk(o.KeyOrigin) } // SetKeyOrigin sets field value -func (o *GetServiceAccountKeyResponse) SetKeyOrigin(v *string) { - o.KeyOrigin = v +func (o *GetServiceAccountKeyResponse) SetKeyOrigin(v GetServiceAccountKeyResponseGetKeyOriginRetType) { + setGetServiceAccountKeyResponseGetKeyOriginAttributeType(&o.KeyOrigin, v) } // GetKeyType returns the KeyType field value -func (o *GetServiceAccountKeyResponse) GetKeyType() *string { - if o == nil || IsNil(o.KeyType) { - var ret *string - return ret - } - - return o.KeyType +func (o *GetServiceAccountKeyResponse) GetKeyType() (ret GetServiceAccountKeyResponseGetKeyTypeRetType) { + ret, _ = o.GetKeyTypeOk() + return ret } // GetKeyTypeOk returns a tuple with the KeyType field value // and a boolean to check if the value has been set. -func (o *GetServiceAccountKeyResponse) GetKeyTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.KeyType, true +func (o *GetServiceAccountKeyResponse) GetKeyTypeOk() (ret GetServiceAccountKeyResponseGetKeyTypeRetType, ok bool) { + return getGetServiceAccountKeyResponseGetKeyTypeAttributeTypeOk(o.KeyType) } // SetKeyType sets field value -func (o *GetServiceAccountKeyResponse) SetKeyType(v *string) { - o.KeyType = v +func (o *GetServiceAccountKeyResponse) SetKeyType(v GetServiceAccountKeyResponseGetKeyTypeRetType) { + setGetServiceAccountKeyResponseGetKeyTypeAttributeType(&o.KeyType, v) } // GetPublicKey returns the PublicKey field value if set, zero value otherwise. -func (o *GetServiceAccountKeyResponse) GetPublicKey() *string { - if o == nil || IsNil(o.PublicKey) { - var ret *string - return ret - } - return o.PublicKey +func (o *GetServiceAccountKeyResponse) GetPublicKey() (res GetServiceAccountKeyResponseGetPublicKeyRetType) { + 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 *GetServiceAccountKeyResponse) GetPublicKeyOk() (*string, bool) { - if o == nil || IsNil(o.PublicKey) { - return nil, false - } - return o.PublicKey, true +func (o *GetServiceAccountKeyResponse) GetPublicKeyOk() (ret GetServiceAccountKeyResponseGetPublicKeyRetType, ok bool) { + return getGetServiceAccountKeyResponseGetPublicKeyAttributeTypeOk(o.PublicKey) } // HasPublicKey returns a boolean if a field has been set. func (o *GetServiceAccountKeyResponse) 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 *GetServiceAccountKeyResponse) SetPublicKey(v *string) { - o.PublicKey = v +func (o *GetServiceAccountKeyResponse) SetPublicKey(v GetServiceAccountKeyResponseGetPublicKeyRetType) { + setGetServiceAccountKeyResponseGetPublicKeyAttributeType(&o.PublicKey, v) } // GetValidUntil returns the ValidUntil field value if set, zero value otherwise. -func (o *GetServiceAccountKeyResponse) GetValidUntil() *time.Time { - if o == nil || IsNil(o.ValidUntil) { - var ret *time.Time - return ret - } - return o.ValidUntil +func (o *GetServiceAccountKeyResponse) GetValidUntil() (res GetServiceAccountKeyResponseGetValidUntilRetType) { + res, _ = o.GetValidUntilOk() + return } // GetValidUntilOk returns a tuple with the ValidUntil field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetServiceAccountKeyResponse) GetValidUntilOk() (*time.Time, bool) { - if o == nil || IsNil(o.ValidUntil) { - return nil, false - } - return o.ValidUntil, true +func (o *GetServiceAccountKeyResponse) GetValidUntilOk() (ret GetServiceAccountKeyResponseGetValidUntilRetType, ok bool) { + return getGetServiceAccountKeyResponseGetValidUntilAttributeTypeOk(o.ValidUntil) } // HasValidUntil returns a boolean if a field has been set. func (o *GetServiceAccountKeyResponse) HasValidUntil() bool { - if o != nil && !IsNil(o.ValidUntil) { - return true - } - - return false + _, ok := o.GetValidUntilOk() + return ok } // SetValidUntil gets a reference to the given time.Time and assigns it to the ValidUntil field. -func (o *GetServiceAccountKeyResponse) SetValidUntil(v *time.Time) { - o.ValidUntil = v +func (o *GetServiceAccountKeyResponse) SetValidUntil(v GetServiceAccountKeyResponseGetValidUntilRetType) { + setGetServiceAccountKeyResponseGetValidUntilAttributeType(&o.ValidUntil, v) } func (o GetServiceAccountKeyResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["active"] = o.Active - toSerialize["createdAt"] = o.CreatedAt - toSerialize["credentials"] = o.Credentials - toSerialize["id"] = o.Id - toSerialize["keyAlgorithm"] = o.KeyAlgorithm - toSerialize["keyOrigin"] = o.KeyOrigin - toSerialize["keyType"] = o.KeyType - if !IsNil(o.PublicKey) { - toSerialize["publicKey"] = o.PublicKey + if val, ok := getGetServiceAccountKeyResponsegetActiveAttributeTypeOk(o.Active); ok { + toSerialize["Active"] = val + } + if val, ok := getGetServiceAccountKeyResponseGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getGetServiceAccountKeyResponseGetCredentialsAttributeTypeOk(o.Credentials); ok { + toSerialize["Credentials"] = val + } + if val, ok := getGetServiceAccountKeyResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getGetServiceAccountKeyResponseGetKeyAlgorithmAttributeTypeOk(o.KeyAlgorithm); ok { + toSerialize["KeyAlgorithm"] = val + } + if val, ok := getGetServiceAccountKeyResponseGetKeyOriginAttributeTypeOk(o.KeyOrigin); ok { + toSerialize["KeyOrigin"] = val + } + if val, ok := getGetServiceAccountKeyResponseGetKeyTypeAttributeTypeOk(o.KeyType); ok { + toSerialize["KeyType"] = val + } + if val, ok := getGetServiceAccountKeyResponseGetPublicKeyAttributeTypeOk(o.PublicKey); ok { + toSerialize["PublicKey"] = val } - if !IsNil(o.ValidUntil) { - toSerialize["validUntil"] = o.ValidUntil + if val, ok := getGetServiceAccountKeyResponseGetValidUntilAttributeTypeOk(o.ValidUntil); ok { + toSerialize["ValidUntil"] = val } return toSerialize, nil } diff --git a/services/serviceaccount/model_get_service_account_key_response_credentials.go b/services/serviceaccount/model_get_service_account_key_response_credentials.go index d841182a0..87c8e210a 100644 --- a/services/serviceaccount/model_get_service_account_key_response_credentials.go +++ b/services/serviceaccount/model_get_service_account_key_response_credentials.go @@ -17,20 +17,104 @@ import ( // checks if the GetServiceAccountKeyResponseCredentials type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetServiceAccountKeyResponseCredentials{} +/* + types and functions for aud +*/ + +// isNotNullableString +type GetServiceAccountKeyResponseCredentialsGetAudAttributeType = *string + +func getGetServiceAccountKeyResponseCredentialsGetAudAttributeTypeOk(arg GetServiceAccountKeyResponseCredentialsGetAudAttributeType) (ret GetServiceAccountKeyResponseCredentialsGetAudRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetServiceAccountKeyResponseCredentialsGetAudAttributeType(arg *GetServiceAccountKeyResponseCredentialsGetAudAttributeType, val GetServiceAccountKeyResponseCredentialsGetAudRetType) { + *arg = &val +} + +type GetServiceAccountKeyResponseCredentialsGetAudArgType = string +type GetServiceAccountKeyResponseCredentialsGetAudRetType = string + +/* + types and functions for iss +*/ + +// isNotNullableString +type GetServiceAccountKeyResponseCredentialsGetIssAttributeType = *string + +func getGetServiceAccountKeyResponseCredentialsGetIssAttributeTypeOk(arg GetServiceAccountKeyResponseCredentialsGetIssAttributeType) (ret GetServiceAccountKeyResponseCredentialsGetIssRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetServiceAccountKeyResponseCredentialsGetIssAttributeType(arg *GetServiceAccountKeyResponseCredentialsGetIssAttributeType, val GetServiceAccountKeyResponseCredentialsGetIssRetType) { + *arg = &val +} + +type GetServiceAccountKeyResponseCredentialsGetIssArgType = string +type GetServiceAccountKeyResponseCredentialsGetIssRetType = string + +/* + types and functions for kid +*/ + +// isNotNullableString +type GetServiceAccountKeyResponseCredentialsGetKidAttributeType = *string + +func getGetServiceAccountKeyResponseCredentialsGetKidAttributeTypeOk(arg GetServiceAccountKeyResponseCredentialsGetKidAttributeType) (ret GetServiceAccountKeyResponseCredentialsGetKidRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetServiceAccountKeyResponseCredentialsGetKidAttributeType(arg *GetServiceAccountKeyResponseCredentialsGetKidAttributeType, val GetServiceAccountKeyResponseCredentialsGetKidRetType) { + *arg = &val +} + +type GetServiceAccountKeyResponseCredentialsGetKidArgType = string +type GetServiceAccountKeyResponseCredentialsGetKidRetType = string + +/* + types and functions for sub +*/ + +// isNotNullableString +type GetServiceAccountKeyResponseCredentialsGetSubAttributeType = *string + +func getGetServiceAccountKeyResponseCredentialsGetSubAttributeTypeOk(arg GetServiceAccountKeyResponseCredentialsGetSubAttributeType) (ret GetServiceAccountKeyResponseCredentialsGetSubRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetServiceAccountKeyResponseCredentialsGetSubAttributeType(arg *GetServiceAccountKeyResponseCredentialsGetSubAttributeType, val GetServiceAccountKeyResponseCredentialsGetSubRetType) { + *arg = &val +} + +type GetServiceAccountKeyResponseCredentialsGetSubArgType = string +type GetServiceAccountKeyResponseCredentialsGetSubRetType = string + // GetServiceAccountKeyResponseCredentials struct for GetServiceAccountKeyResponseCredentials type GetServiceAccountKeyResponseCredentials struct { // Audience - service account API URL // REQUIRED - Aud *string `json:"aud"` + Aud GetServiceAccountKeyResponseCredentialsGetAudAttributeType `json:"aud"` // Service account email // REQUIRED - Iss *string `json:"iss"` + Iss GetServiceAccountKeyResponseCredentialsGetIssAttributeType `json:"iss"` // Key id to use // REQUIRED - Kid *string `json:"kid"` + Kid GetServiceAccountKeyResponseCredentialsGetKidAttributeType `json:"kid"` // Service account id // REQUIRED - Sub *string `json:"sub"` + Sub GetServiceAccountKeyResponseCredentialsGetSubAttributeType `json:"sub"` } type _GetServiceAccountKeyResponseCredentials GetServiceAccountKeyResponseCredentials @@ -39,12 +123,12 @@ type _GetServiceAccountKeyResponseCredentials GetServiceAccountKeyResponseCreden // 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 NewGetServiceAccountKeyResponseCredentials(aud *string, iss *string, kid *string, sub *string) *GetServiceAccountKeyResponseCredentials { +func NewGetServiceAccountKeyResponseCredentials(aud GetServiceAccountKeyResponseCredentialsGetAudArgType, iss GetServiceAccountKeyResponseCredentialsGetIssArgType, kid GetServiceAccountKeyResponseCredentialsGetKidArgType, sub GetServiceAccountKeyResponseCredentialsGetSubArgType) *GetServiceAccountKeyResponseCredentials { this := GetServiceAccountKeyResponseCredentials{} - this.Aud = aud - this.Iss = iss - this.Kid = kid - this.Sub = sub + setGetServiceAccountKeyResponseCredentialsGetAudAttributeType(&this.Aud, aud) + setGetServiceAccountKeyResponseCredentialsGetIssAttributeType(&this.Iss, iss) + setGetServiceAccountKeyResponseCredentialsGetKidAttributeType(&this.Kid, kid) + setGetServiceAccountKeyResponseCredentialsGetSubAttributeType(&this.Sub, sub) return &this } @@ -57,107 +141,87 @@ func NewGetServiceAccountKeyResponseCredentialsWithDefaults() *GetServiceAccount } // GetAud returns the Aud field value -func (o *GetServiceAccountKeyResponseCredentials) GetAud() *string { - if o == nil || IsNil(o.Aud) { - var ret *string - return ret - } - - return o.Aud +func (o *GetServiceAccountKeyResponseCredentials) GetAud() (ret GetServiceAccountKeyResponseCredentialsGetAudRetType) { + ret, _ = o.GetAudOk() + return ret } // GetAudOk returns a tuple with the Aud field value // and a boolean to check if the value has been set. -func (o *GetServiceAccountKeyResponseCredentials) GetAudOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Aud, true +func (o *GetServiceAccountKeyResponseCredentials) GetAudOk() (ret GetServiceAccountKeyResponseCredentialsGetAudRetType, ok bool) { + return getGetServiceAccountKeyResponseCredentialsGetAudAttributeTypeOk(o.Aud) } // SetAud sets field value -func (o *GetServiceAccountKeyResponseCredentials) SetAud(v *string) { - o.Aud = v +func (o *GetServiceAccountKeyResponseCredentials) SetAud(v GetServiceAccountKeyResponseCredentialsGetAudRetType) { + setGetServiceAccountKeyResponseCredentialsGetAudAttributeType(&o.Aud, v) } // GetIss returns the Iss field value -func (o *GetServiceAccountKeyResponseCredentials) GetIss() *string { - if o == nil || IsNil(o.Iss) { - var ret *string - return ret - } - - return o.Iss +func (o *GetServiceAccountKeyResponseCredentials) GetIss() (ret GetServiceAccountKeyResponseCredentialsGetIssRetType) { + ret, _ = o.GetIssOk() + return ret } // GetIssOk returns a tuple with the Iss field value // and a boolean to check if the value has been set. -func (o *GetServiceAccountKeyResponseCredentials) GetIssOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Iss, true +func (o *GetServiceAccountKeyResponseCredentials) GetIssOk() (ret GetServiceAccountKeyResponseCredentialsGetIssRetType, ok bool) { + return getGetServiceAccountKeyResponseCredentialsGetIssAttributeTypeOk(o.Iss) } // SetIss sets field value -func (o *GetServiceAccountKeyResponseCredentials) SetIss(v *string) { - o.Iss = v +func (o *GetServiceAccountKeyResponseCredentials) SetIss(v GetServiceAccountKeyResponseCredentialsGetIssRetType) { + setGetServiceAccountKeyResponseCredentialsGetIssAttributeType(&o.Iss, v) } // GetKid returns the Kid field value -func (o *GetServiceAccountKeyResponseCredentials) GetKid() *string { - if o == nil || IsNil(o.Kid) { - var ret *string - return ret - } - - return o.Kid +func (o *GetServiceAccountKeyResponseCredentials) GetKid() (ret GetServiceAccountKeyResponseCredentialsGetKidRetType) { + ret, _ = o.GetKidOk() + return ret } // GetKidOk returns a tuple with the Kid field value // and a boolean to check if the value has been set. -func (o *GetServiceAccountKeyResponseCredentials) GetKidOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Kid, true +func (o *GetServiceAccountKeyResponseCredentials) GetKidOk() (ret GetServiceAccountKeyResponseCredentialsGetKidRetType, ok bool) { + return getGetServiceAccountKeyResponseCredentialsGetKidAttributeTypeOk(o.Kid) } // SetKid sets field value -func (o *GetServiceAccountKeyResponseCredentials) SetKid(v *string) { - o.Kid = v +func (o *GetServiceAccountKeyResponseCredentials) SetKid(v GetServiceAccountKeyResponseCredentialsGetKidRetType) { + setGetServiceAccountKeyResponseCredentialsGetKidAttributeType(&o.Kid, v) } // GetSub returns the Sub field value -func (o *GetServiceAccountKeyResponseCredentials) GetSub() *string { - if o == nil || IsNil(o.Sub) { - var ret *string - return ret - } - - return o.Sub +func (o *GetServiceAccountKeyResponseCredentials) GetSub() (ret GetServiceAccountKeyResponseCredentialsGetSubRetType) { + ret, _ = o.GetSubOk() + return ret } // GetSubOk returns a tuple with the Sub field value // and a boolean to check if the value has been set. -func (o *GetServiceAccountKeyResponseCredentials) GetSubOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Sub, true +func (o *GetServiceAccountKeyResponseCredentials) GetSubOk() (ret GetServiceAccountKeyResponseCredentialsGetSubRetType, ok bool) { + return getGetServiceAccountKeyResponseCredentialsGetSubAttributeTypeOk(o.Sub) } // SetSub sets field value -func (o *GetServiceAccountKeyResponseCredentials) SetSub(v *string) { - o.Sub = v +func (o *GetServiceAccountKeyResponseCredentials) SetSub(v GetServiceAccountKeyResponseCredentialsGetSubRetType) { + setGetServiceAccountKeyResponseCredentialsGetSubAttributeType(&o.Sub, v) } func (o GetServiceAccountKeyResponseCredentials) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["aud"] = o.Aud - toSerialize["iss"] = o.Iss - toSerialize["kid"] = o.Kid - toSerialize["sub"] = o.Sub + if val, ok := getGetServiceAccountKeyResponseCredentialsGetAudAttributeTypeOk(o.Aud); ok { + toSerialize["Aud"] = val + } + if val, ok := getGetServiceAccountKeyResponseCredentialsGetIssAttributeTypeOk(o.Iss); ok { + toSerialize["Iss"] = val + } + if val, ok := getGetServiceAccountKeyResponseCredentialsGetKidAttributeTypeOk(o.Kid); ok { + toSerialize["Kid"] = val + } + if val, ok := getGetServiceAccountKeyResponseCredentialsGetSubAttributeTypeOk(o.Sub); ok { + toSerialize["Sub"] = val + } return toSerialize, nil } diff --git a/services/serviceaccount/model_jwk.go b/services/serviceaccount/model_jwk.go index ced812b87..cb83a306d 100644 --- a/services/serviceaccount/model_jwk.go +++ b/services/serviceaccount/model_jwk.go @@ -17,21 +17,252 @@ import ( // checks if the JWK type satisfies the MappedNullable interface at compile time var _ MappedNullable = &JWK{} +/* + types and functions for alg +*/ + +// isNotNullableString +type JWKGetAlgAttributeType = *string + +func getJWKGetAlgAttributeTypeOk(arg JWKGetAlgAttributeType) (ret JWKGetAlgRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setJWKGetAlgAttributeType(arg *JWKGetAlgAttributeType, val JWKGetAlgRetType) { + *arg = &val +} + +type JWKGetAlgArgType = string +type JWKGetAlgRetType = string + +/* + types and functions for e +*/ + +// isNotNullableString +type JWKGetEAttributeType = *string + +func getJWKGetEAttributeTypeOk(arg JWKGetEAttributeType) (ret JWKGetERetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setJWKGetEAttributeType(arg *JWKGetEAttributeType, val JWKGetERetType) { + *arg = &val +} + +type JWKGetEArgType = string +type JWKGetERetType = string + +/* + types and functions for kid +*/ + +// isNotNullableString +type JWKGetKidAttributeType = *string + +func getJWKGetKidAttributeTypeOk(arg JWKGetKidAttributeType) (ret JWKGetKidRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setJWKGetKidAttributeType(arg *JWKGetKidAttributeType, val JWKGetKidRetType) { + *arg = &val +} + +type JWKGetKidArgType = string +type JWKGetKidRetType = string + +/* + types and functions for ks +*/ + +// isNotNullableString +type JWKGetKsAttributeType = *string + +func getJWKGetKsAttributeTypeOk(arg JWKGetKsAttributeType) (ret JWKGetKsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setJWKGetKsAttributeType(arg *JWKGetKsAttributeType, val JWKGetKsRetType) { + *arg = &val +} + +type JWKGetKsArgType = string +type JWKGetKsRetType = string + +/* + types and functions for n +*/ + +// isNotNullableString +type JWKGetNAttributeType = *string + +func getJWKGetNAttributeTypeOk(arg JWKGetNAttributeType) (ret JWKGetNRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setJWKGetNAttributeType(arg *JWKGetNAttributeType, val JWKGetNRetType) { + *arg = &val +} + +type JWKGetNArgType = string +type JWKGetNRetType = string + +/* + types and functions for ops +*/ + +// isNotNullableString +type JWKGetOpsAttributeType = *string + +func getJWKGetOpsAttributeTypeOk(arg JWKGetOpsAttributeType) (ret JWKGetOpsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setJWKGetOpsAttributeType(arg *JWKGetOpsAttributeType, val JWKGetOpsRetType) { + *arg = &val +} + +type JWKGetOpsArgType = string +type JWKGetOpsRetType = string + +/* + types and functions for use +*/ + +// isNotNullableString +type JWKGetUseAttributeType = *string + +func getJWKGetUseAttributeTypeOk(arg JWKGetUseAttributeType) (ret JWKGetUseRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setJWKGetUseAttributeType(arg *JWKGetUseAttributeType, val JWKGetUseRetType) { + *arg = &val +} + +type JWKGetUseArgType = string +type JWKGetUseRetType = string + +/* + types and functions for x5c +*/ + +// isNotNullableString +type JWKGetX5cAttributeType = *string + +func getJWKGetX5cAttributeTypeOk(arg JWKGetX5cAttributeType) (ret JWKGetX5cRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setJWKGetX5cAttributeType(arg *JWKGetX5cAttributeType, val JWKGetX5cRetType) { + *arg = &val +} + +type JWKGetX5cArgType = string +type JWKGetX5cRetType = string + +/* + types and functions for x5t +*/ + +// isNotNullableString +type JWKGetX5tAttributeType = *string + +func getJWKGetX5tAttributeTypeOk(arg JWKGetX5tAttributeType) (ret JWKGetX5tRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setJWKGetX5tAttributeType(arg *JWKGetX5tAttributeType, val JWKGetX5tRetType) { + *arg = &val +} + +type JWKGetX5tArgType = string +type JWKGetX5tRetType = string + +/* + types and functions for x5t256 +*/ + +// isNotNullableString +type JWKGetX5t256AttributeType = *string + +func getJWKGetX5t256AttributeTypeOk(arg JWKGetX5t256AttributeType) (ret JWKGetX5t256RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setJWKGetX5t256AttributeType(arg *JWKGetX5t256AttributeType, val JWKGetX5t256RetType) { + *arg = &val +} + +type JWKGetX5t256ArgType = string +type JWKGetX5t256RetType = string + +/* + types and functions for x5u +*/ + +// isNotNullableString +type JWKGetX5uAttributeType = *string + +func getJWKGetX5uAttributeTypeOk(arg JWKGetX5uAttributeType) (ret JWKGetX5uRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setJWKGetX5uAttributeType(arg *JWKGetX5uAttributeType, val JWKGetX5uRetType) { + *arg = &val +} + +type JWKGetX5uArgType = string +type JWKGetX5uRetType = string + // JWK JSON Web Key according to https://datatracker.ietf.org/doc/html/rfc7517#section-4 type JWK struct { - Alg *string `json:"alg,omitempty"` + Alg JWKGetAlgAttributeType `json:"alg,omitempty"` // REQUIRED - E *string `json:"e"` - Kid *string `json:"kid,omitempty"` - Ks *string `json:"ks,omitempty"` + E JWKGetEAttributeType `json:"e"` + Kid JWKGetKidAttributeType `json:"kid,omitempty"` + Ks JWKGetKsAttributeType `json:"ks,omitempty"` // REQUIRED - N *string `json:"n"` - Ops *string `json:"ops,omitempty"` - Use *string `json:"use,omitempty"` - X5c *string `json:"x5c,omitempty"` - X5t *string `json:"x5t,omitempty"` - X5t256 *string `json:"x5t256,omitempty"` - X5u *string `json:"x5u,omitempty"` + N JWKGetNAttributeType `json:"n"` + Ops JWKGetOpsAttributeType `json:"ops,omitempty"` + Use JWKGetUseAttributeType `json:"use,omitempty"` + X5c JWKGetX5cAttributeType `json:"x5c,omitempty"` + X5t JWKGetX5tAttributeType `json:"x5t,omitempty"` + X5t256 JWKGetX5t256AttributeType `json:"x5t256,omitempty"` + X5u JWKGetX5uAttributeType `json:"x5u,omitempty"` } type _JWK JWK @@ -40,10 +271,10 @@ type _JWK JWK // 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 NewJWK(e *string, n *string) *JWK { +func NewJWK(e JWKGetEArgType, n JWKGetNArgType) *JWK { this := JWK{} - this.E = e - this.N = n + setJWKGetEAttributeType(&this.E, e) + setJWKGetNAttributeType(&this.N, n) return &this } @@ -56,371 +287,280 @@ func NewJWKWithDefaults() *JWK { } // GetAlg returns the Alg field value if set, zero value otherwise. -func (o *JWK) GetAlg() *string { - if o == nil || IsNil(o.Alg) { - var ret *string - return ret - } - return o.Alg +func (o *JWK) GetAlg() (res JWKGetAlgRetType) { + res, _ = o.GetAlgOk() + return } // GetAlgOk returns a tuple with the Alg field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *JWK) GetAlgOk() (*string, bool) { - if o == nil || IsNil(o.Alg) { - return nil, false - } - return o.Alg, true +func (o *JWK) GetAlgOk() (ret JWKGetAlgRetType, ok bool) { + return getJWKGetAlgAttributeTypeOk(o.Alg) } // HasAlg returns a boolean if a field has been set. func (o *JWK) HasAlg() bool { - if o != nil && !IsNil(o.Alg) { - return true - } - - return false + _, ok := o.GetAlgOk() + return ok } // SetAlg gets a reference to the given string and assigns it to the Alg field. -func (o *JWK) SetAlg(v *string) { - o.Alg = v +func (o *JWK) SetAlg(v JWKGetAlgRetType) { + setJWKGetAlgAttributeType(&o.Alg, v) } // GetE returns the E field value -func (o *JWK) GetE() *string { - if o == nil || IsNil(o.E) { - var ret *string - return ret - } - - return o.E +func (o *JWK) GetE() (ret JWKGetERetType) { + ret, _ = o.GetEOk() + return ret } // GetEOk returns a tuple with the E field value // and a boolean to check if the value has been set. -func (o *JWK) GetEOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.E, true +func (o *JWK) GetEOk() (ret JWKGetERetType, ok bool) { + return getJWKGetEAttributeTypeOk(o.E) } // SetE sets field value -func (o *JWK) SetE(v *string) { - o.E = v +func (o *JWK) SetE(v JWKGetERetType) { + setJWKGetEAttributeType(&o.E, v) } // GetKid returns the Kid field value if set, zero value otherwise. -func (o *JWK) GetKid() *string { - if o == nil || IsNil(o.Kid) { - var ret *string - return ret - } - return o.Kid +func (o *JWK) GetKid() (res JWKGetKidRetType) { + res, _ = o.GetKidOk() + return } // GetKidOk returns a tuple with the Kid field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *JWK) GetKidOk() (*string, bool) { - if o == nil || IsNil(o.Kid) { - return nil, false - } - return o.Kid, true +func (o *JWK) GetKidOk() (ret JWKGetKidRetType, ok bool) { + return getJWKGetKidAttributeTypeOk(o.Kid) } // HasKid returns a boolean if a field has been set. func (o *JWK) HasKid() bool { - if o != nil && !IsNil(o.Kid) { - return true - } - - return false + _, ok := o.GetKidOk() + return ok } // SetKid gets a reference to the given string and assigns it to the Kid field. -func (o *JWK) SetKid(v *string) { - o.Kid = v +func (o *JWK) SetKid(v JWKGetKidRetType) { + setJWKGetKidAttributeType(&o.Kid, v) } // GetKs returns the Ks field value if set, zero value otherwise. -func (o *JWK) GetKs() *string { - if o == nil || IsNil(o.Ks) { - var ret *string - return ret - } - return o.Ks +func (o *JWK) GetKs() (res JWKGetKsRetType) { + res, _ = o.GetKsOk() + return } // GetKsOk returns a tuple with the Ks field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *JWK) GetKsOk() (*string, bool) { - if o == nil || IsNil(o.Ks) { - return nil, false - } - return o.Ks, true +func (o *JWK) GetKsOk() (ret JWKGetKsRetType, ok bool) { + return getJWKGetKsAttributeTypeOk(o.Ks) } // HasKs returns a boolean if a field has been set. func (o *JWK) HasKs() bool { - if o != nil && !IsNil(o.Ks) { - return true - } - - return false + _, ok := o.GetKsOk() + return ok } // SetKs gets a reference to the given string and assigns it to the Ks field. -func (o *JWK) SetKs(v *string) { - o.Ks = v +func (o *JWK) SetKs(v JWKGetKsRetType) { + setJWKGetKsAttributeType(&o.Ks, v) } // GetN returns the N field value -func (o *JWK) GetN() *string { - if o == nil || IsNil(o.N) { - var ret *string - return ret - } - - return o.N +func (o *JWK) GetN() (ret JWKGetNRetType) { + ret, _ = o.GetNOk() + return ret } // GetNOk returns a tuple with the N field value // and a boolean to check if the value has been set. -func (o *JWK) GetNOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.N, true +func (o *JWK) GetNOk() (ret JWKGetNRetType, ok bool) { + return getJWKGetNAttributeTypeOk(o.N) } // SetN sets field value -func (o *JWK) SetN(v *string) { - o.N = v +func (o *JWK) SetN(v JWKGetNRetType) { + setJWKGetNAttributeType(&o.N, v) } // GetOps returns the Ops field value if set, zero value otherwise. -func (o *JWK) GetOps() *string { - if o == nil || IsNil(o.Ops) { - var ret *string - return ret - } - return o.Ops +func (o *JWK) GetOps() (res JWKGetOpsRetType) { + res, _ = o.GetOpsOk() + return } // GetOpsOk returns a tuple with the Ops field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *JWK) GetOpsOk() (*string, bool) { - if o == nil || IsNil(o.Ops) { - return nil, false - } - return o.Ops, true +func (o *JWK) GetOpsOk() (ret JWKGetOpsRetType, ok bool) { + return getJWKGetOpsAttributeTypeOk(o.Ops) } // HasOps returns a boolean if a field has been set. func (o *JWK) HasOps() bool { - if o != nil && !IsNil(o.Ops) { - return true - } - - return false + _, ok := o.GetOpsOk() + return ok } // SetOps gets a reference to the given string and assigns it to the Ops field. -func (o *JWK) SetOps(v *string) { - o.Ops = v +func (o *JWK) SetOps(v JWKGetOpsRetType) { + setJWKGetOpsAttributeType(&o.Ops, v) } // GetUse returns the Use field value if set, zero value otherwise. -func (o *JWK) GetUse() *string { - if o == nil || IsNil(o.Use) { - var ret *string - return ret - } - return o.Use +func (o *JWK) GetUse() (res JWKGetUseRetType) { + res, _ = o.GetUseOk() + return } // GetUseOk returns a tuple with the Use field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *JWK) GetUseOk() (*string, bool) { - if o == nil || IsNil(o.Use) { - return nil, false - } - return o.Use, true +func (o *JWK) GetUseOk() (ret JWKGetUseRetType, ok bool) { + return getJWKGetUseAttributeTypeOk(o.Use) } // HasUse returns a boolean if a field has been set. func (o *JWK) HasUse() bool { - if o != nil && !IsNil(o.Use) { - return true - } - - return false + _, ok := o.GetUseOk() + return ok } // SetUse gets a reference to the given string and assigns it to the Use field. -func (o *JWK) SetUse(v *string) { - o.Use = v +func (o *JWK) SetUse(v JWKGetUseRetType) { + setJWKGetUseAttributeType(&o.Use, v) } // GetX5c returns the X5c field value if set, zero value otherwise. -func (o *JWK) GetX5c() *string { - if o == nil || IsNil(o.X5c) { - var ret *string - return ret - } - return o.X5c +func (o *JWK) GetX5c() (res JWKGetX5cRetType) { + res, _ = o.GetX5cOk() + return } // GetX5cOk returns a tuple with the X5c field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *JWK) GetX5cOk() (*string, bool) { - if o == nil || IsNil(o.X5c) { - return nil, false - } - return o.X5c, true +func (o *JWK) GetX5cOk() (ret JWKGetX5cRetType, ok bool) { + return getJWKGetX5cAttributeTypeOk(o.X5c) } // HasX5c returns a boolean if a field has been set. func (o *JWK) HasX5c() bool { - if o != nil && !IsNil(o.X5c) { - return true - } - - return false + _, ok := o.GetX5cOk() + return ok } // SetX5c gets a reference to the given string and assigns it to the X5c field. -func (o *JWK) SetX5c(v *string) { - o.X5c = v +func (o *JWK) SetX5c(v JWKGetX5cRetType) { + setJWKGetX5cAttributeType(&o.X5c, v) } // GetX5t returns the X5t field value if set, zero value otherwise. -func (o *JWK) GetX5t() *string { - if o == nil || IsNil(o.X5t) { - var ret *string - return ret - } - return o.X5t +func (o *JWK) GetX5t() (res JWKGetX5tRetType) { + res, _ = o.GetX5tOk() + return } // GetX5tOk returns a tuple with the X5t field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *JWK) GetX5tOk() (*string, bool) { - if o == nil || IsNil(o.X5t) { - return nil, false - } - return o.X5t, true +func (o *JWK) GetX5tOk() (ret JWKGetX5tRetType, ok bool) { + return getJWKGetX5tAttributeTypeOk(o.X5t) } // HasX5t returns a boolean if a field has been set. func (o *JWK) HasX5t() bool { - if o != nil && !IsNil(o.X5t) { - return true - } - - return false + _, ok := o.GetX5tOk() + return ok } // SetX5t gets a reference to the given string and assigns it to the X5t field. -func (o *JWK) SetX5t(v *string) { - o.X5t = v +func (o *JWK) SetX5t(v JWKGetX5tRetType) { + setJWKGetX5tAttributeType(&o.X5t, v) } // GetX5t256 returns the X5t256 field value if set, zero value otherwise. -func (o *JWK) GetX5t256() *string { - if o == nil || IsNil(o.X5t256) { - var ret *string - return ret - } - return o.X5t256 +func (o *JWK) GetX5t256() (res JWKGetX5t256RetType) { + res, _ = o.GetX5t256Ok() + return } // GetX5t256Ok returns a tuple with the X5t256 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *JWK) GetX5t256Ok() (*string, bool) { - if o == nil || IsNil(o.X5t256) { - return nil, false - } - return o.X5t256, true +func (o *JWK) GetX5t256Ok() (ret JWKGetX5t256RetType, ok bool) { + return getJWKGetX5t256AttributeTypeOk(o.X5t256) } // HasX5t256 returns a boolean if a field has been set. func (o *JWK) HasX5t256() bool { - if o != nil && !IsNil(o.X5t256) { - return true - } - - return false + _, ok := o.GetX5t256Ok() + return ok } // SetX5t256 gets a reference to the given string and assigns it to the X5t256 field. -func (o *JWK) SetX5t256(v *string) { - o.X5t256 = v +func (o *JWK) SetX5t256(v JWKGetX5t256RetType) { + setJWKGetX5t256AttributeType(&o.X5t256, v) } // GetX5u returns the X5u field value if set, zero value otherwise. -func (o *JWK) GetX5u() *string { - if o == nil || IsNil(o.X5u) { - var ret *string - return ret - } - return o.X5u +func (o *JWK) GetX5u() (res JWKGetX5uRetType) { + res, _ = o.GetX5uOk() + return } // GetX5uOk returns a tuple with the X5u field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *JWK) GetX5uOk() (*string, bool) { - if o == nil || IsNil(o.X5u) { - return nil, false - } - return o.X5u, true +func (o *JWK) GetX5uOk() (ret JWKGetX5uRetType, ok bool) { + return getJWKGetX5uAttributeTypeOk(o.X5u) } // HasX5u returns a boolean if a field has been set. func (o *JWK) HasX5u() bool { - if o != nil && !IsNil(o.X5u) { - return true - } - - return false + _, ok := o.GetX5uOk() + return ok } // SetX5u gets a reference to the given string and assigns it to the X5u field. -func (o *JWK) SetX5u(v *string) { - o.X5u = v +func (o *JWK) SetX5u(v JWKGetX5uRetType) { + setJWKGetX5uAttributeType(&o.X5u, v) } func (o JWK) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Alg) { - toSerialize["alg"] = o.Alg + if val, ok := getJWKGetAlgAttributeTypeOk(o.Alg); ok { + toSerialize["Alg"] = val + } + if val, ok := getJWKGetEAttributeTypeOk(o.E); ok { + toSerialize["E"] = val + } + if val, ok := getJWKGetKidAttributeTypeOk(o.Kid); ok { + toSerialize["Kid"] = val } - toSerialize["e"] = o.E - if !IsNil(o.Kid) { - toSerialize["kid"] = o.Kid + if val, ok := getJWKGetKsAttributeTypeOk(o.Ks); ok { + toSerialize["Ks"] = val } - if !IsNil(o.Ks) { - toSerialize["ks"] = o.Ks + if val, ok := getJWKGetNAttributeTypeOk(o.N); ok { + toSerialize["N"] = val } - toSerialize["n"] = o.N - if !IsNil(o.Ops) { - toSerialize["ops"] = o.Ops + if val, ok := getJWKGetOpsAttributeTypeOk(o.Ops); ok { + toSerialize["Ops"] = val } - if !IsNil(o.Use) { - toSerialize["use"] = o.Use + if val, ok := getJWKGetUseAttributeTypeOk(o.Use); ok { + toSerialize["Use"] = val } - if !IsNil(o.X5c) { - toSerialize["x5c"] = o.X5c + if val, ok := getJWKGetX5cAttributeTypeOk(o.X5c); ok { + toSerialize["X5c"] = val } - if !IsNil(o.X5t) { - toSerialize["x5t"] = o.X5t + if val, ok := getJWKGetX5tAttributeTypeOk(o.X5t); ok { + toSerialize["X5t"] = val } - if !IsNil(o.X5t256) { - toSerialize["x5t256"] = o.X5t256 + if val, ok := getJWKGetX5t256AttributeTypeOk(o.X5t256); ok { + toSerialize["X5t256"] = val } - if !IsNil(o.X5u) { - toSerialize["x5u"] = o.X5u + if val, ok := getJWKGetX5uAttributeTypeOk(o.X5u); ok { + toSerialize["X5u"] = val } return toSerialize, nil } diff --git a/services/serviceaccount/model_jwks.go b/services/serviceaccount/model_jwks.go index e6ee232ab..e312eef41 100644 --- a/services/serviceaccount/model_jwks.go +++ b/services/serviceaccount/model_jwks.go @@ -17,10 +17,30 @@ import ( // checks if the JWKS type satisfies the MappedNullable interface at compile time var _ MappedNullable = &JWKS{} +/* + types and functions for keys +*/ + +// isArray +type JWKSGetKeysAttributeType = *[]JWK +type JWKSGetKeysArgType = []JWK +type JWKSGetKeysRetType = []JWK + +func getJWKSGetKeysAttributeTypeOk(arg JWKSGetKeysAttributeType) (ret JWKSGetKeysRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setJWKSGetKeysAttributeType(arg *JWKSGetKeysAttributeType, val JWKSGetKeysRetType) { + *arg = &val +} + // JWKS struct for JWKS type JWKS struct { // REQUIRED - Keys *[]JWK `json:"keys"` + Keys JWKSGetKeysAttributeType `json:"keys"` } type _JWKS JWKS @@ -29,9 +49,9 @@ type _JWKS JWKS // 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 NewJWKS(keys *[]JWK) *JWKS { +func NewJWKS(keys JWKSGetKeysArgType) *JWKS { this := JWKS{} - this.Keys = keys + setJWKSGetKeysAttributeType(&this.Keys, keys) return &this } @@ -44,32 +64,27 @@ func NewJWKSWithDefaults() *JWKS { } // GetKeys returns the Keys field value -func (o *JWKS) GetKeys() *[]JWK { - if o == nil || IsNil(o.Keys) { - var ret *[]JWK - return ret - } - - return o.Keys +func (o *JWKS) GetKeys() (ret JWKSGetKeysRetType) { + ret, _ = o.GetKeysOk() + return ret } // GetKeysOk returns a tuple with the Keys field value // and a boolean to check if the value has been set. -func (o *JWKS) GetKeysOk() (*[]JWK, bool) { - if o == nil { - return nil, false - } - return o.Keys, true +func (o *JWKS) GetKeysOk() (ret JWKSGetKeysRetType, ok bool) { + return getJWKSGetKeysAttributeTypeOk(o.Keys) } // SetKeys sets field value -func (o *JWKS) SetKeys(v *[]JWK) { - o.Keys = v +func (o *JWKS) SetKeys(v JWKSGetKeysRetType) { + setJWKSGetKeysAttributeType(&o.Keys, v) } func (o JWKS) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["keys"] = o.Keys + if val, ok := getJWKSGetKeysAttributeTypeOk(o.Keys); ok { + toSerialize["Keys"] = val + } return toSerialize, nil } diff --git a/services/serviceaccount/model_list_access_tokens_response.go b/services/serviceaccount/model_list_access_tokens_response.go index 7d889b665..498b91bae 100644 --- a/services/serviceaccount/model_list_access_tokens_response.go +++ b/services/serviceaccount/model_list_access_tokens_response.go @@ -17,9 +17,29 @@ import ( // checks if the ListAccessTokensResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListAccessTokensResponse{} +/* + types and functions for items +*/ + +// isArray +type ListAccessTokensResponseGetItemsAttributeType = *[]AccessTokenMetadata +type ListAccessTokensResponseGetItemsArgType = []AccessTokenMetadata +type ListAccessTokensResponseGetItemsRetType = []AccessTokenMetadata + +func getListAccessTokensResponseGetItemsAttributeTypeOk(arg ListAccessTokensResponseGetItemsAttributeType) (ret ListAccessTokensResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListAccessTokensResponseGetItemsAttributeType(arg *ListAccessTokensResponseGetItemsAttributeType, val ListAccessTokensResponseGetItemsRetType) { + *arg = &val +} + // ListAccessTokensResponse struct for ListAccessTokensResponse type ListAccessTokensResponse struct { - Items *[]AccessTokenMetadata `json:"items,omitempty"` + Items ListAccessTokensResponseGetItemsAttributeType `json:"items,omitempty"` } // NewListAccessTokensResponse instantiates a new ListAccessTokensResponse object @@ -40,41 +60,32 @@ func NewListAccessTokensResponseWithDefaults() *ListAccessTokensResponse { } // GetItems returns the Items field value if set, zero value otherwise. -func (o *ListAccessTokensResponse) GetItems() *[]AccessTokenMetadata { - if o == nil || IsNil(o.Items) { - var ret *[]AccessTokenMetadata - return ret - } - return o.Items +func (o *ListAccessTokensResponse) GetItems() (res ListAccessTokensResponseGetItemsRetType) { + 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 *ListAccessTokensResponse) GetItemsOk() (*[]AccessTokenMetadata, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true +func (o *ListAccessTokensResponse) GetItemsOk() (ret ListAccessTokensResponseGetItemsRetType, ok bool) { + return getListAccessTokensResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. func (o *ListAccessTokensResponse) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false + _, ok := o.GetItemsOk() + return ok } // SetItems gets a reference to the given []AccessTokenMetadata and assigns it to the Items field. -func (o *ListAccessTokensResponse) SetItems(v *[]AccessTokenMetadata) { - o.Items = v +func (o *ListAccessTokensResponse) SetItems(v ListAccessTokensResponseGetItemsRetType) { + setListAccessTokensResponseGetItemsAttributeType(&o.Items, v) } func (o ListAccessTokensResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Items) { - toSerialize["items"] = o.Items + if val, ok := getListAccessTokensResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val } return toSerialize, nil } diff --git a/services/serviceaccount/model_list_service_account_keys_response.go b/services/serviceaccount/model_list_service_account_keys_response.go index 688382be7..a3129d025 100644 --- a/services/serviceaccount/model_list_service_account_keys_response.go +++ b/services/serviceaccount/model_list_service_account_keys_response.go @@ -17,10 +17,30 @@ import ( // checks if the ListServiceAccountKeysResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListServiceAccountKeysResponse{} +/* + types and functions for items +*/ + +// isArray +type ListServiceAccountKeysResponseGetItemsAttributeType = *[]ServiceAccountKeyListResponse +type ListServiceAccountKeysResponseGetItemsArgType = []ServiceAccountKeyListResponse +type ListServiceAccountKeysResponseGetItemsRetType = []ServiceAccountKeyListResponse + +func getListServiceAccountKeysResponseGetItemsAttributeTypeOk(arg ListServiceAccountKeysResponseGetItemsAttributeType) (ret ListServiceAccountKeysResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListServiceAccountKeysResponseGetItemsAttributeType(arg *ListServiceAccountKeysResponseGetItemsAttributeType, val ListServiceAccountKeysResponseGetItemsRetType) { + *arg = &val +} + // ListServiceAccountKeysResponse struct for ListServiceAccountKeysResponse type ListServiceAccountKeysResponse struct { // REQUIRED - Items *[]ServiceAccountKeyListResponse `json:"items"` + Items ListServiceAccountKeysResponseGetItemsAttributeType `json:"items"` } type _ListServiceAccountKeysResponse ListServiceAccountKeysResponse @@ -29,9 +49,9 @@ type _ListServiceAccountKeysResponse ListServiceAccountKeysResponse // 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 NewListServiceAccountKeysResponse(items *[]ServiceAccountKeyListResponse) *ListServiceAccountKeysResponse { +func NewListServiceAccountKeysResponse(items ListServiceAccountKeysResponseGetItemsArgType) *ListServiceAccountKeysResponse { this := ListServiceAccountKeysResponse{} - this.Items = items + setListServiceAccountKeysResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -44,32 +64,27 @@ func NewListServiceAccountKeysResponseWithDefaults() *ListServiceAccountKeysResp } // GetItems returns the Items field value -func (o *ListServiceAccountKeysResponse) GetItems() *[]ServiceAccountKeyListResponse { - if o == nil || IsNil(o.Items) { - var ret *[]ServiceAccountKeyListResponse - return ret - } - - return o.Items +func (o *ListServiceAccountKeysResponse) GetItems() (ret ListServiceAccountKeysResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *ListServiceAccountKeysResponse) GetItemsOk() (*[]ServiceAccountKeyListResponse, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *ListServiceAccountKeysResponse) GetItemsOk() (ret ListServiceAccountKeysResponseGetItemsRetType, ok bool) { + return getListServiceAccountKeysResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *ListServiceAccountKeysResponse) SetItems(v *[]ServiceAccountKeyListResponse) { - o.Items = v +func (o *ListServiceAccountKeysResponse) SetItems(v ListServiceAccountKeysResponseGetItemsRetType) { + setListServiceAccountKeysResponseGetItemsAttributeType(&o.Items, v) } func (o ListServiceAccountKeysResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getListServiceAccountKeysResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/serviceaccount/model_list_service_accounts_response.go b/services/serviceaccount/model_list_service_accounts_response.go index 821951249..76e37b9e0 100644 --- a/services/serviceaccount/model_list_service_accounts_response.go +++ b/services/serviceaccount/model_list_service_accounts_response.go @@ -17,10 +17,30 @@ import ( // checks if the ListServiceAccountsResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListServiceAccountsResponse{} +/* + types and functions for items +*/ + +// isArray +type ListServiceAccountsResponseGetItemsAttributeType = *[]ServiceAccount +type ListServiceAccountsResponseGetItemsArgType = []ServiceAccount +type ListServiceAccountsResponseGetItemsRetType = []ServiceAccount + +func getListServiceAccountsResponseGetItemsAttributeTypeOk(arg ListServiceAccountsResponseGetItemsAttributeType) (ret ListServiceAccountsResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListServiceAccountsResponseGetItemsAttributeType(arg *ListServiceAccountsResponseGetItemsAttributeType, val ListServiceAccountsResponseGetItemsRetType) { + *arg = &val +} + // ListServiceAccountsResponse struct for ListServiceAccountsResponse type ListServiceAccountsResponse struct { // REQUIRED - Items *[]ServiceAccount `json:"items"` + Items ListServiceAccountsResponseGetItemsAttributeType `json:"items"` } type _ListServiceAccountsResponse ListServiceAccountsResponse @@ -29,9 +49,9 @@ type _ListServiceAccountsResponse ListServiceAccountsResponse // 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 NewListServiceAccountsResponse(items *[]ServiceAccount) *ListServiceAccountsResponse { +func NewListServiceAccountsResponse(items ListServiceAccountsResponseGetItemsArgType) *ListServiceAccountsResponse { this := ListServiceAccountsResponse{} - this.Items = items + setListServiceAccountsResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -44,32 +64,27 @@ func NewListServiceAccountsResponseWithDefaults() *ListServiceAccountsResponse { } // GetItems returns the Items field value -func (o *ListServiceAccountsResponse) GetItems() *[]ServiceAccount { - if o == nil || IsNil(o.Items) { - var ret *[]ServiceAccount - return ret - } - - return o.Items +func (o *ListServiceAccountsResponse) GetItems() (ret ListServiceAccountsResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *ListServiceAccountsResponse) GetItemsOk() (*[]ServiceAccount, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *ListServiceAccountsResponse) GetItemsOk() (ret ListServiceAccountsResponseGetItemsRetType, ok bool) { + return getListServiceAccountsResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *ListServiceAccountsResponse) SetItems(v *[]ServiceAccount) { - o.Items = v +func (o *ListServiceAccountsResponse) SetItems(v ListServiceAccountsResponseGetItemsRetType) { + setListServiceAccountsResponseGetItemsAttributeType(&o.Items, v) } func (o ListServiceAccountsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getListServiceAccountsResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/serviceaccount/model_partial_update_service_account_key_payload.go b/services/serviceaccount/model_partial_update_service_account_key_payload.go index cb93b7cfd..bbd6e2966 100644 --- a/services/serviceaccount/model_partial_update_service_account_key_payload.go +++ b/services/serviceaccount/model_partial_update_service_account_key_payload.go @@ -18,12 +18,52 @@ import ( // checks if the PartialUpdateServiceAccountKeyPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PartialUpdateServiceAccountKeyPayload{} +/* + types and functions for active +*/ + +// isBoolean +type PartialUpdateServiceAccountKeyPayloadgetActiveAttributeType = *bool +type PartialUpdateServiceAccountKeyPayloadgetActiveArgType = bool +type PartialUpdateServiceAccountKeyPayloadgetActiveRetType = bool + +func getPartialUpdateServiceAccountKeyPayloadgetActiveAttributeTypeOk(arg PartialUpdateServiceAccountKeyPayloadgetActiveAttributeType) (ret PartialUpdateServiceAccountKeyPayloadgetActiveRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateServiceAccountKeyPayloadgetActiveAttributeType(arg *PartialUpdateServiceAccountKeyPayloadgetActiveAttributeType, val PartialUpdateServiceAccountKeyPayloadgetActiveRetType) { + *arg = &val +} + +/* + types and functions for validUntil +*/ + +// isDateTime +type PartialUpdateServiceAccountKeyPayloadGetValidUntilAttributeType = *time.Time +type PartialUpdateServiceAccountKeyPayloadGetValidUntilArgType = time.Time +type PartialUpdateServiceAccountKeyPayloadGetValidUntilRetType = time.Time + +func getPartialUpdateServiceAccountKeyPayloadGetValidUntilAttributeTypeOk(arg PartialUpdateServiceAccountKeyPayloadGetValidUntilAttributeType) (ret PartialUpdateServiceAccountKeyPayloadGetValidUntilRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateServiceAccountKeyPayloadGetValidUntilAttributeType(arg *PartialUpdateServiceAccountKeyPayloadGetValidUntilAttributeType, val PartialUpdateServiceAccountKeyPayloadGetValidUntilRetType) { + *arg = &val +} + // PartialUpdateServiceAccountKeyPayload struct for PartialUpdateServiceAccountKeyPayload type PartialUpdateServiceAccountKeyPayload struct { // Active keys are valid, while inactive keys are temporarily deactivated. - Active *bool `json:"active,omitempty"` + Active PartialUpdateServiceAccountKeyPayloadgetActiveAttributeType `json:"active,omitempty"` // Optional, date of key expiration. To disable, set time to \"9999-01-01T01:01:01Z\" - ValidUntil *time.Time `json:"validUntil,omitempty"` + ValidUntil PartialUpdateServiceAccountKeyPayloadGetValidUntilAttributeType `json:"validUntil,omitempty"` } // NewPartialUpdateServiceAccountKeyPayload instantiates a new PartialUpdateServiceAccountKeyPayload object @@ -44,76 +84,58 @@ func NewPartialUpdateServiceAccountKeyPayloadWithDefaults() *PartialUpdateServic } // GetActive returns the Active field value if set, zero value otherwise. -func (o *PartialUpdateServiceAccountKeyPayload) GetActive() *bool { - if o == nil || IsNil(o.Active) { - var ret *bool - return ret - } - return o.Active +func (o *PartialUpdateServiceAccountKeyPayload) GetActive() (res PartialUpdateServiceAccountKeyPayloadgetActiveRetType) { + res, _ = o.GetActiveOk() + return } // GetActiveOk returns a tuple with the Active field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateServiceAccountKeyPayload) GetActiveOk() (*bool, bool) { - if o == nil || IsNil(o.Active) { - return nil, false - } - return o.Active, true +func (o *PartialUpdateServiceAccountKeyPayload) GetActiveOk() (ret PartialUpdateServiceAccountKeyPayloadgetActiveRetType, ok bool) { + return getPartialUpdateServiceAccountKeyPayloadgetActiveAttributeTypeOk(o.Active) } // HasActive returns a boolean if a field has been set. func (o *PartialUpdateServiceAccountKeyPayload) HasActive() bool { - if o != nil && !IsNil(o.Active) { - return true - } - - return false + _, ok := o.GetActiveOk() + return ok } // SetActive gets a reference to the given bool and assigns it to the Active field. -func (o *PartialUpdateServiceAccountKeyPayload) SetActive(v *bool) { - o.Active = v +func (o *PartialUpdateServiceAccountKeyPayload) SetActive(v PartialUpdateServiceAccountKeyPayloadgetActiveRetType) { + setPartialUpdateServiceAccountKeyPayloadgetActiveAttributeType(&o.Active, v) } // GetValidUntil returns the ValidUntil field value if set, zero value otherwise. -func (o *PartialUpdateServiceAccountKeyPayload) GetValidUntil() *time.Time { - if o == nil || IsNil(o.ValidUntil) { - var ret *time.Time - return ret - } - return o.ValidUntil +func (o *PartialUpdateServiceAccountKeyPayload) GetValidUntil() (res PartialUpdateServiceAccountKeyPayloadGetValidUntilRetType) { + res, _ = o.GetValidUntilOk() + return } // GetValidUntilOk returns a tuple with the ValidUntil field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateServiceAccountKeyPayload) GetValidUntilOk() (*time.Time, bool) { - if o == nil || IsNil(o.ValidUntil) { - return nil, false - } - return o.ValidUntil, true +func (o *PartialUpdateServiceAccountKeyPayload) GetValidUntilOk() (ret PartialUpdateServiceAccountKeyPayloadGetValidUntilRetType, ok bool) { + return getPartialUpdateServiceAccountKeyPayloadGetValidUntilAttributeTypeOk(o.ValidUntil) } // HasValidUntil returns a boolean if a field has been set. func (o *PartialUpdateServiceAccountKeyPayload) HasValidUntil() bool { - if o != nil && !IsNil(o.ValidUntil) { - return true - } - - return false + _, ok := o.GetValidUntilOk() + return ok } // SetValidUntil gets a reference to the given time.Time and assigns it to the ValidUntil field. -func (o *PartialUpdateServiceAccountKeyPayload) SetValidUntil(v *time.Time) { - o.ValidUntil = v +func (o *PartialUpdateServiceAccountKeyPayload) SetValidUntil(v PartialUpdateServiceAccountKeyPayloadGetValidUntilRetType) { + setPartialUpdateServiceAccountKeyPayloadGetValidUntilAttributeType(&o.ValidUntil, v) } func (o PartialUpdateServiceAccountKeyPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Active) { - toSerialize["active"] = o.Active + if val, ok := getPartialUpdateServiceAccountKeyPayloadgetActiveAttributeTypeOk(o.Active); ok { + toSerialize["Active"] = val } - if !IsNil(o.ValidUntil) { - toSerialize["validUntil"] = o.ValidUntil + if val, ok := getPartialUpdateServiceAccountKeyPayloadGetValidUntilAttributeTypeOk(o.ValidUntil); ok { + toSerialize["ValidUntil"] = val } return toSerialize, nil } diff --git a/services/serviceaccount/model_partial_update_service_account_key_response.go b/services/serviceaccount/model_partial_update_service_account_key_response.go index 034a97924..f44d39f8c 100644 --- a/services/serviceaccount/model_partial_update_service_account_key_response.go +++ b/services/serviceaccount/model_partial_update_service_account_key_response.go @@ -18,24 +18,165 @@ import ( // checks if the PartialUpdateServiceAccountKeyResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PartialUpdateServiceAccountKeyResponse{} +/* + types and functions for active +*/ + +// isBoolean +type PartialUpdateServiceAccountKeyResponsegetActiveAttributeType = *bool +type PartialUpdateServiceAccountKeyResponsegetActiveArgType = bool +type PartialUpdateServiceAccountKeyResponsegetActiveRetType = bool + +func getPartialUpdateServiceAccountKeyResponsegetActiveAttributeTypeOk(arg PartialUpdateServiceAccountKeyResponsegetActiveAttributeType) (ret PartialUpdateServiceAccountKeyResponsegetActiveRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateServiceAccountKeyResponsegetActiveAttributeType(arg *PartialUpdateServiceAccountKeyResponsegetActiveAttributeType, val PartialUpdateServiceAccountKeyResponsegetActiveRetType) { + *arg = &val +} + +/* + types and functions for createdAt +*/ + +// isDateTime +type PartialUpdateServiceAccountKeyResponseGetCreatedAtAttributeType = *time.Time +type PartialUpdateServiceAccountKeyResponseGetCreatedAtArgType = time.Time +type PartialUpdateServiceAccountKeyResponseGetCreatedAtRetType = time.Time + +func getPartialUpdateServiceAccountKeyResponseGetCreatedAtAttributeTypeOk(arg PartialUpdateServiceAccountKeyResponseGetCreatedAtAttributeType) (ret PartialUpdateServiceAccountKeyResponseGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateServiceAccountKeyResponseGetCreatedAtAttributeType(arg *PartialUpdateServiceAccountKeyResponseGetCreatedAtAttributeType, val PartialUpdateServiceAccountKeyResponseGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type PartialUpdateServiceAccountKeyResponseGetIdAttributeType = *string + +func getPartialUpdateServiceAccountKeyResponseGetIdAttributeTypeOk(arg PartialUpdateServiceAccountKeyResponseGetIdAttributeType) (ret PartialUpdateServiceAccountKeyResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateServiceAccountKeyResponseGetIdAttributeType(arg *PartialUpdateServiceAccountKeyResponseGetIdAttributeType, val PartialUpdateServiceAccountKeyResponseGetIdRetType) { + *arg = &val +} + +type PartialUpdateServiceAccountKeyResponseGetIdArgType = string +type PartialUpdateServiceAccountKeyResponseGetIdRetType = string + +/* + types and functions for keyAlgorithm +*/ + +// isEnumRef +type PartialUpdateServiceAccountKeyResponseGetKeyAlgorithmAttributeType = *string +type PartialUpdateServiceAccountKeyResponseGetKeyAlgorithmArgType = string +type PartialUpdateServiceAccountKeyResponseGetKeyAlgorithmRetType = string + +func getPartialUpdateServiceAccountKeyResponseGetKeyAlgorithmAttributeTypeOk(arg PartialUpdateServiceAccountKeyResponseGetKeyAlgorithmAttributeType) (ret PartialUpdateServiceAccountKeyResponseGetKeyAlgorithmRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateServiceAccountKeyResponseGetKeyAlgorithmAttributeType(arg *PartialUpdateServiceAccountKeyResponseGetKeyAlgorithmAttributeType, val PartialUpdateServiceAccountKeyResponseGetKeyAlgorithmRetType) { + *arg = &val +} + +/* + types and functions for keyOrigin +*/ + +// isEnumRef +type PartialUpdateServiceAccountKeyResponseGetKeyOriginAttributeType = *string +type PartialUpdateServiceAccountKeyResponseGetKeyOriginArgType = string +type PartialUpdateServiceAccountKeyResponseGetKeyOriginRetType = string + +func getPartialUpdateServiceAccountKeyResponseGetKeyOriginAttributeTypeOk(arg PartialUpdateServiceAccountKeyResponseGetKeyOriginAttributeType) (ret PartialUpdateServiceAccountKeyResponseGetKeyOriginRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateServiceAccountKeyResponseGetKeyOriginAttributeType(arg *PartialUpdateServiceAccountKeyResponseGetKeyOriginAttributeType, val PartialUpdateServiceAccountKeyResponseGetKeyOriginRetType) { + *arg = &val +} + +/* + types and functions for keyType +*/ + +// isEnumRef +type PartialUpdateServiceAccountKeyResponseGetKeyTypeAttributeType = *string +type PartialUpdateServiceAccountKeyResponseGetKeyTypeArgType = string +type PartialUpdateServiceAccountKeyResponseGetKeyTypeRetType = string + +func getPartialUpdateServiceAccountKeyResponseGetKeyTypeAttributeTypeOk(arg PartialUpdateServiceAccountKeyResponseGetKeyTypeAttributeType) (ret PartialUpdateServiceAccountKeyResponseGetKeyTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateServiceAccountKeyResponseGetKeyTypeAttributeType(arg *PartialUpdateServiceAccountKeyResponseGetKeyTypeAttributeType, val PartialUpdateServiceAccountKeyResponseGetKeyTypeRetType) { + *arg = &val +} + +/* + types and functions for validUntil +*/ + +// isDateTime +type PartialUpdateServiceAccountKeyResponseGetValidUntilAttributeType = *time.Time +type PartialUpdateServiceAccountKeyResponseGetValidUntilArgType = time.Time +type PartialUpdateServiceAccountKeyResponseGetValidUntilRetType = time.Time + +func getPartialUpdateServiceAccountKeyResponseGetValidUntilAttributeTypeOk(arg PartialUpdateServiceAccountKeyResponseGetValidUntilAttributeType) (ret PartialUpdateServiceAccountKeyResponseGetValidUntilRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateServiceAccountKeyResponseGetValidUntilAttributeType(arg *PartialUpdateServiceAccountKeyResponseGetValidUntilAttributeType, val PartialUpdateServiceAccountKeyResponseGetValidUntilRetType) { + *arg = &val +} + // PartialUpdateServiceAccountKeyResponse struct for PartialUpdateServiceAccountKeyResponse type PartialUpdateServiceAccountKeyResponse struct { // REQUIRED - Active *bool `json:"active"` + Active PartialUpdateServiceAccountKeyResponsegetActiveAttributeType `json:"active"` // Creation time of the key // REQUIRED - CreatedAt *time.Time `json:"createdAt"` + CreatedAt PartialUpdateServiceAccountKeyResponseGetCreatedAtAttributeType `json:"createdAt"` // Unique ID of the key. // REQUIRED - Id *string `json:"id"` + Id PartialUpdateServiceAccountKeyResponseGetIdAttributeType `json:"id"` // REQUIRED - KeyAlgorithm *string `json:"keyAlgorithm"` + KeyAlgorithm PartialUpdateServiceAccountKeyResponseGetKeyAlgorithmAttributeType `json:"keyAlgorithm"` // REQUIRED - KeyOrigin *string `json:"keyOrigin"` + KeyOrigin PartialUpdateServiceAccountKeyResponseGetKeyOriginAttributeType `json:"keyOrigin"` // REQUIRED - KeyType *string `json:"keyType"` + KeyType PartialUpdateServiceAccountKeyResponseGetKeyTypeAttributeType `json:"keyType"` // If specified, the timestamp until the key is active. May be null - ValidUntil *time.Time `json:"validUntil,omitempty"` + ValidUntil PartialUpdateServiceAccountKeyResponseGetValidUntilAttributeType `json:"validUntil,omitempty"` } type _PartialUpdateServiceAccountKeyResponse PartialUpdateServiceAccountKeyResponse @@ -44,14 +185,14 @@ type _PartialUpdateServiceAccountKeyResponse PartialUpdateServiceAccountKeyRespo // 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 NewPartialUpdateServiceAccountKeyResponse(active *bool, createdAt *time.Time, id *string, keyAlgorithm *string, keyOrigin *string, keyType *string) *PartialUpdateServiceAccountKeyResponse { +func NewPartialUpdateServiceAccountKeyResponse(active PartialUpdateServiceAccountKeyResponsegetActiveArgType, createdAt PartialUpdateServiceAccountKeyResponseGetCreatedAtArgType, id PartialUpdateServiceAccountKeyResponseGetIdArgType, keyAlgorithm PartialUpdateServiceAccountKeyResponseGetKeyAlgorithmArgType, keyOrigin PartialUpdateServiceAccountKeyResponseGetKeyOriginArgType, keyType PartialUpdateServiceAccountKeyResponseGetKeyTypeArgType) *PartialUpdateServiceAccountKeyResponse { this := PartialUpdateServiceAccountKeyResponse{} - this.Active = active - this.CreatedAt = createdAt - this.Id = id - this.KeyAlgorithm = keyAlgorithm - this.KeyOrigin = keyOrigin - this.KeyType = keyType + setPartialUpdateServiceAccountKeyResponsegetActiveAttributeType(&this.Active, active) + setPartialUpdateServiceAccountKeyResponseGetCreatedAtAttributeType(&this.CreatedAt, createdAt) + setPartialUpdateServiceAccountKeyResponseGetIdAttributeType(&this.Id, id) + setPartialUpdateServiceAccountKeyResponseGetKeyAlgorithmAttributeType(&this.KeyAlgorithm, keyAlgorithm) + setPartialUpdateServiceAccountKeyResponseGetKeyOriginAttributeType(&this.KeyOrigin, keyOrigin) + setPartialUpdateServiceAccountKeyResponseGetKeyTypeAttributeType(&this.KeyType, keyType) return &this } @@ -64,191 +205,152 @@ func NewPartialUpdateServiceAccountKeyResponseWithDefaults() *PartialUpdateServi } // GetActive returns the Active field value -func (o *PartialUpdateServiceAccountKeyResponse) GetActive() *bool { - if o == nil || IsNil(o.Active) { - var ret *bool - return ret - } - - return o.Active +func (o *PartialUpdateServiceAccountKeyResponse) GetActive() (ret PartialUpdateServiceAccountKeyResponsegetActiveRetType) { + ret, _ = o.GetActiveOk() + return ret } // GetActiveOk returns a tuple with the Active field value // and a boolean to check if the value has been set. -func (o *PartialUpdateServiceAccountKeyResponse) GetActiveOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.Active, true +func (o *PartialUpdateServiceAccountKeyResponse) GetActiveOk() (ret PartialUpdateServiceAccountKeyResponsegetActiveRetType, ok bool) { + return getPartialUpdateServiceAccountKeyResponsegetActiveAttributeTypeOk(o.Active) } // SetActive sets field value -func (o *PartialUpdateServiceAccountKeyResponse) SetActive(v *bool) { - o.Active = v +func (o *PartialUpdateServiceAccountKeyResponse) SetActive(v PartialUpdateServiceAccountKeyResponsegetActiveRetType) { + setPartialUpdateServiceAccountKeyResponsegetActiveAttributeType(&o.Active, v) } // GetCreatedAt returns the CreatedAt field value -func (o *PartialUpdateServiceAccountKeyResponse) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - - return o.CreatedAt +func (o *PartialUpdateServiceAccountKeyResponse) GetCreatedAt() (ret PartialUpdateServiceAccountKeyResponseGetCreatedAtRetType) { + ret, _ = o.GetCreatedAtOk() + return ret } // GetCreatedAtOk returns a tuple with the CreatedAt field value // and a boolean to check if the value has been set. -func (o *PartialUpdateServiceAccountKeyResponse) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.CreatedAt, true +func (o *PartialUpdateServiceAccountKeyResponse) GetCreatedAtOk() (ret PartialUpdateServiceAccountKeyResponseGetCreatedAtRetType, ok bool) { + return getPartialUpdateServiceAccountKeyResponseGetCreatedAtAttributeTypeOk(o.CreatedAt) } // SetCreatedAt sets field value -func (o *PartialUpdateServiceAccountKeyResponse) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *PartialUpdateServiceAccountKeyResponse) SetCreatedAt(v PartialUpdateServiceAccountKeyResponseGetCreatedAtRetType) { + setPartialUpdateServiceAccountKeyResponseGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetId returns the Id field value -func (o *PartialUpdateServiceAccountKeyResponse) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - - return o.Id +func (o *PartialUpdateServiceAccountKeyResponse) GetId() (ret PartialUpdateServiceAccountKeyResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *PartialUpdateServiceAccountKeyResponse) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *PartialUpdateServiceAccountKeyResponse) GetIdOk() (ret PartialUpdateServiceAccountKeyResponseGetIdRetType, ok bool) { + return getPartialUpdateServiceAccountKeyResponseGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *PartialUpdateServiceAccountKeyResponse) SetId(v *string) { - o.Id = v +func (o *PartialUpdateServiceAccountKeyResponse) SetId(v PartialUpdateServiceAccountKeyResponseGetIdRetType) { + setPartialUpdateServiceAccountKeyResponseGetIdAttributeType(&o.Id, v) } // GetKeyAlgorithm returns the KeyAlgorithm field value -func (o *PartialUpdateServiceAccountKeyResponse) GetKeyAlgorithm() *string { - if o == nil || IsNil(o.KeyAlgorithm) { - var ret *string - return ret - } - - return o.KeyAlgorithm +func (o *PartialUpdateServiceAccountKeyResponse) GetKeyAlgorithm() (ret PartialUpdateServiceAccountKeyResponseGetKeyAlgorithmRetType) { + ret, _ = o.GetKeyAlgorithmOk() + return ret } // GetKeyAlgorithmOk returns a tuple with the KeyAlgorithm field value // and a boolean to check if the value has been set. -func (o *PartialUpdateServiceAccountKeyResponse) GetKeyAlgorithmOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.KeyAlgorithm, true +func (o *PartialUpdateServiceAccountKeyResponse) GetKeyAlgorithmOk() (ret PartialUpdateServiceAccountKeyResponseGetKeyAlgorithmRetType, ok bool) { + return getPartialUpdateServiceAccountKeyResponseGetKeyAlgorithmAttributeTypeOk(o.KeyAlgorithm) } // SetKeyAlgorithm sets field value -func (o *PartialUpdateServiceAccountKeyResponse) SetKeyAlgorithm(v *string) { - o.KeyAlgorithm = v +func (o *PartialUpdateServiceAccountKeyResponse) SetKeyAlgorithm(v PartialUpdateServiceAccountKeyResponseGetKeyAlgorithmRetType) { + setPartialUpdateServiceAccountKeyResponseGetKeyAlgorithmAttributeType(&o.KeyAlgorithm, v) } // GetKeyOrigin returns the KeyOrigin field value -func (o *PartialUpdateServiceAccountKeyResponse) GetKeyOrigin() *string { - if o == nil || IsNil(o.KeyOrigin) { - var ret *string - return ret - } - - return o.KeyOrigin +func (o *PartialUpdateServiceAccountKeyResponse) GetKeyOrigin() (ret PartialUpdateServiceAccountKeyResponseGetKeyOriginRetType) { + ret, _ = o.GetKeyOriginOk() + return ret } // GetKeyOriginOk returns a tuple with the KeyOrigin field value // and a boolean to check if the value has been set. -func (o *PartialUpdateServiceAccountKeyResponse) GetKeyOriginOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.KeyOrigin, true +func (o *PartialUpdateServiceAccountKeyResponse) GetKeyOriginOk() (ret PartialUpdateServiceAccountKeyResponseGetKeyOriginRetType, ok bool) { + return getPartialUpdateServiceAccountKeyResponseGetKeyOriginAttributeTypeOk(o.KeyOrigin) } // SetKeyOrigin sets field value -func (o *PartialUpdateServiceAccountKeyResponse) SetKeyOrigin(v *string) { - o.KeyOrigin = v +func (o *PartialUpdateServiceAccountKeyResponse) SetKeyOrigin(v PartialUpdateServiceAccountKeyResponseGetKeyOriginRetType) { + setPartialUpdateServiceAccountKeyResponseGetKeyOriginAttributeType(&o.KeyOrigin, v) } // GetKeyType returns the KeyType field value -func (o *PartialUpdateServiceAccountKeyResponse) GetKeyType() *string { - if o == nil || IsNil(o.KeyType) { - var ret *string - return ret - } - - return o.KeyType +func (o *PartialUpdateServiceAccountKeyResponse) GetKeyType() (ret PartialUpdateServiceAccountKeyResponseGetKeyTypeRetType) { + ret, _ = o.GetKeyTypeOk() + return ret } // GetKeyTypeOk returns a tuple with the KeyType field value // and a boolean to check if the value has been set. -func (o *PartialUpdateServiceAccountKeyResponse) GetKeyTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.KeyType, true +func (o *PartialUpdateServiceAccountKeyResponse) GetKeyTypeOk() (ret PartialUpdateServiceAccountKeyResponseGetKeyTypeRetType, ok bool) { + return getPartialUpdateServiceAccountKeyResponseGetKeyTypeAttributeTypeOk(o.KeyType) } // SetKeyType sets field value -func (o *PartialUpdateServiceAccountKeyResponse) SetKeyType(v *string) { - o.KeyType = v +func (o *PartialUpdateServiceAccountKeyResponse) SetKeyType(v PartialUpdateServiceAccountKeyResponseGetKeyTypeRetType) { + setPartialUpdateServiceAccountKeyResponseGetKeyTypeAttributeType(&o.KeyType, v) } // GetValidUntil returns the ValidUntil field value if set, zero value otherwise. -func (o *PartialUpdateServiceAccountKeyResponse) GetValidUntil() *time.Time { - if o == nil || IsNil(o.ValidUntil) { - var ret *time.Time - return ret - } - return o.ValidUntil +func (o *PartialUpdateServiceAccountKeyResponse) GetValidUntil() (res PartialUpdateServiceAccountKeyResponseGetValidUntilRetType) { + res, _ = o.GetValidUntilOk() + return } // GetValidUntilOk returns a tuple with the ValidUntil field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateServiceAccountKeyResponse) GetValidUntilOk() (*time.Time, bool) { - if o == nil || IsNil(o.ValidUntil) { - return nil, false - } - return o.ValidUntil, true +func (o *PartialUpdateServiceAccountKeyResponse) GetValidUntilOk() (ret PartialUpdateServiceAccountKeyResponseGetValidUntilRetType, ok bool) { + return getPartialUpdateServiceAccountKeyResponseGetValidUntilAttributeTypeOk(o.ValidUntil) } // HasValidUntil returns a boolean if a field has been set. func (o *PartialUpdateServiceAccountKeyResponse) HasValidUntil() bool { - if o != nil && !IsNil(o.ValidUntil) { - return true - } - - return false + _, ok := o.GetValidUntilOk() + return ok } // SetValidUntil gets a reference to the given time.Time and assigns it to the ValidUntil field. -func (o *PartialUpdateServiceAccountKeyResponse) SetValidUntil(v *time.Time) { - o.ValidUntil = v +func (o *PartialUpdateServiceAccountKeyResponse) SetValidUntil(v PartialUpdateServiceAccountKeyResponseGetValidUntilRetType) { + setPartialUpdateServiceAccountKeyResponseGetValidUntilAttributeType(&o.ValidUntil, v) } func (o PartialUpdateServiceAccountKeyResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["active"] = o.Active - toSerialize["createdAt"] = o.CreatedAt - toSerialize["id"] = o.Id - toSerialize["keyAlgorithm"] = o.KeyAlgorithm - toSerialize["keyOrigin"] = o.KeyOrigin - toSerialize["keyType"] = o.KeyType - if !IsNil(o.ValidUntil) { - toSerialize["validUntil"] = o.ValidUntil + if val, ok := getPartialUpdateServiceAccountKeyResponsegetActiveAttributeTypeOk(o.Active); ok { + toSerialize["Active"] = val + } + if val, ok := getPartialUpdateServiceAccountKeyResponseGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getPartialUpdateServiceAccountKeyResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getPartialUpdateServiceAccountKeyResponseGetKeyAlgorithmAttributeTypeOk(o.KeyAlgorithm); ok { + toSerialize["KeyAlgorithm"] = val + } + if val, ok := getPartialUpdateServiceAccountKeyResponseGetKeyOriginAttributeTypeOk(o.KeyOrigin); ok { + toSerialize["KeyOrigin"] = val + } + if val, ok := getPartialUpdateServiceAccountKeyResponseGetKeyTypeAttributeTypeOk(o.KeyType); ok { + toSerialize["KeyType"] = val + } + if val, ok := getPartialUpdateServiceAccountKeyResponseGetValidUntilAttributeTypeOk(o.ValidUntil); ok { + toSerialize["ValidUntil"] = val } return toSerialize, nil } diff --git a/services/serviceaccount/model_service_account.go b/services/serviceaccount/model_service_account.go index d26cc03d1..a58f18af3 100644 --- a/services/serviceaccount/model_service_account.go +++ b/services/serviceaccount/model_service_account.go @@ -17,20 +17,103 @@ import ( // checks if the ServiceAccount type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ServiceAccount{} +/* + types and functions for email +*/ + +// isNotNullableString +type ServiceAccountGetEmailAttributeType = *string + +func getServiceAccountGetEmailAttributeTypeOk(arg ServiceAccountGetEmailAttributeType) (ret ServiceAccountGetEmailRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceAccountGetEmailAttributeType(arg *ServiceAccountGetEmailAttributeType, val ServiceAccountGetEmailRetType) { + *arg = &val +} + +type ServiceAccountGetEmailArgType = string +type ServiceAccountGetEmailRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type ServiceAccountGetIdAttributeType = *string + +func getServiceAccountGetIdAttributeTypeOk(arg ServiceAccountGetIdAttributeType) (ret ServiceAccountGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceAccountGetIdAttributeType(arg *ServiceAccountGetIdAttributeType, val ServiceAccountGetIdRetType) { + *arg = &val +} + +type ServiceAccountGetIdArgType = string +type ServiceAccountGetIdRetType = string + +/* + types and functions for internal +*/ + +// isBoolean +type ServiceAccountgetInternalAttributeType = *bool +type ServiceAccountgetInternalArgType = bool +type ServiceAccountgetInternalRetType = bool + +func getServiceAccountgetInternalAttributeTypeOk(arg ServiceAccountgetInternalAttributeType) (ret ServiceAccountgetInternalRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceAccountgetInternalAttributeType(arg *ServiceAccountgetInternalAttributeType, val ServiceAccountgetInternalRetType) { + *arg = &val +} + +/* + types and functions for projectId +*/ + +// isNotNullableString +type ServiceAccountGetProjectIdAttributeType = *string + +func getServiceAccountGetProjectIdAttributeTypeOk(arg ServiceAccountGetProjectIdAttributeType) (ret ServiceAccountGetProjectIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceAccountGetProjectIdAttributeType(arg *ServiceAccountGetProjectIdAttributeType, val ServiceAccountGetProjectIdRetType) { + *arg = &val +} + +type ServiceAccountGetProjectIdArgType = string +type ServiceAccountGetProjectIdRetType = string + // ServiceAccount struct for ServiceAccount type ServiceAccount struct { // Unique identifier of the service account in format of an email address generated by the service containing the prefix provided by the user during creation. // REQUIRED - Email *string `json:"email"` + Email ServiceAccountGetEmailAttributeType `json:"email"` // Unique ID of the service account. It is also used in the 'sub' field of the service accounts access tokens. // REQUIRED - Id *string `json:"id"` + Id ServiceAccountGetIdAttributeType `json:"id"` // Flag indicating internal service accounts // REQUIRED - Internal *bool `json:"internal"` + Internal ServiceAccountgetInternalAttributeType `json:"internal"` // ID of the related project // REQUIRED - ProjectId *string `json:"projectId"` + ProjectId ServiceAccountGetProjectIdAttributeType `json:"projectId"` } type _ServiceAccount ServiceAccount @@ -39,12 +122,12 @@ type _ServiceAccount ServiceAccount // 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 NewServiceAccount(email *string, id *string, internal *bool, projectId *string) *ServiceAccount { +func NewServiceAccount(email ServiceAccountGetEmailArgType, id ServiceAccountGetIdArgType, internal ServiceAccountgetInternalArgType, projectId ServiceAccountGetProjectIdArgType) *ServiceAccount { this := ServiceAccount{} - this.Email = email - this.Id = id - this.Internal = internal - this.ProjectId = projectId + setServiceAccountGetEmailAttributeType(&this.Email, email) + setServiceAccountGetIdAttributeType(&this.Id, id) + setServiceAccountgetInternalAttributeType(&this.Internal, internal) + setServiceAccountGetProjectIdAttributeType(&this.ProjectId, projectId) return &this } @@ -57,107 +140,87 @@ func NewServiceAccountWithDefaults() *ServiceAccount { } // GetEmail returns the Email field value -func (o *ServiceAccount) GetEmail() *string { - if o == nil || IsNil(o.Email) { - var ret *string - return ret - } - - return o.Email +func (o *ServiceAccount) GetEmail() (ret ServiceAccountGetEmailRetType) { + ret, _ = o.GetEmailOk() + return ret } // GetEmailOk returns a tuple with the Email field value // and a boolean to check if the value has been set. -func (o *ServiceAccount) GetEmailOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Email, true +func (o *ServiceAccount) GetEmailOk() (ret ServiceAccountGetEmailRetType, ok bool) { + return getServiceAccountGetEmailAttributeTypeOk(o.Email) } // SetEmail sets field value -func (o *ServiceAccount) SetEmail(v *string) { - o.Email = v +func (o *ServiceAccount) SetEmail(v ServiceAccountGetEmailRetType) { + setServiceAccountGetEmailAttributeType(&o.Email, v) } // GetId returns the Id field value -func (o *ServiceAccount) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - - return o.Id +func (o *ServiceAccount) GetId() (ret ServiceAccountGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *ServiceAccount) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *ServiceAccount) GetIdOk() (ret ServiceAccountGetIdRetType, ok bool) { + return getServiceAccountGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *ServiceAccount) SetId(v *string) { - o.Id = v +func (o *ServiceAccount) SetId(v ServiceAccountGetIdRetType) { + setServiceAccountGetIdAttributeType(&o.Id, v) } // GetInternal returns the Internal field value -func (o *ServiceAccount) GetInternal() *bool { - if o == nil || IsNil(o.Internal) { - var ret *bool - return ret - } - - return o.Internal +func (o *ServiceAccount) GetInternal() (ret ServiceAccountgetInternalRetType) { + ret, _ = o.GetInternalOk() + return ret } // GetInternalOk returns a tuple with the Internal field value // and a boolean to check if the value has been set. -func (o *ServiceAccount) GetInternalOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.Internal, true +func (o *ServiceAccount) GetInternalOk() (ret ServiceAccountgetInternalRetType, ok bool) { + return getServiceAccountgetInternalAttributeTypeOk(o.Internal) } // SetInternal sets field value -func (o *ServiceAccount) SetInternal(v *bool) { - o.Internal = v +func (o *ServiceAccount) SetInternal(v ServiceAccountgetInternalRetType) { + setServiceAccountgetInternalAttributeType(&o.Internal, v) } // GetProjectId returns the ProjectId field value -func (o *ServiceAccount) GetProjectId() *string { - if o == nil || IsNil(o.ProjectId) { - var ret *string - return ret - } - - return o.ProjectId +func (o *ServiceAccount) GetProjectId() (ret ServiceAccountGetProjectIdRetType) { + ret, _ = o.GetProjectIdOk() + return ret } // GetProjectIdOk returns a tuple with the ProjectId field value // and a boolean to check if the value has been set. -func (o *ServiceAccount) GetProjectIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ProjectId, true +func (o *ServiceAccount) GetProjectIdOk() (ret ServiceAccountGetProjectIdRetType, ok bool) { + return getServiceAccountGetProjectIdAttributeTypeOk(o.ProjectId) } // SetProjectId sets field value -func (o *ServiceAccount) SetProjectId(v *string) { - o.ProjectId = v +func (o *ServiceAccount) SetProjectId(v ServiceAccountGetProjectIdRetType) { + setServiceAccountGetProjectIdAttributeType(&o.ProjectId, v) } func (o ServiceAccount) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["email"] = o.Email - toSerialize["id"] = o.Id - toSerialize["internal"] = o.Internal - toSerialize["projectId"] = o.ProjectId + if val, ok := getServiceAccountGetEmailAttributeTypeOk(o.Email); ok { + toSerialize["Email"] = val + } + if val, ok := getServiceAccountGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getServiceAccountgetInternalAttributeTypeOk(o.Internal); ok { + toSerialize["Internal"] = val + } + if val, ok := getServiceAccountGetProjectIdAttributeTypeOk(o.ProjectId); ok { + toSerialize["ProjectId"] = val + } return toSerialize, nil } diff --git a/services/serviceaccount/model_service_account_key_list_response.go b/services/serviceaccount/model_service_account_key_list_response.go index eaf2460d0..32711bd51 100644 --- a/services/serviceaccount/model_service_account_key_list_response.go +++ b/services/serviceaccount/model_service_account_key_list_response.go @@ -18,24 +18,165 @@ import ( // checks if the ServiceAccountKeyListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ServiceAccountKeyListResponse{} +/* + types and functions for active +*/ + +// isBoolean +type ServiceAccountKeyListResponsegetActiveAttributeType = *bool +type ServiceAccountKeyListResponsegetActiveArgType = bool +type ServiceAccountKeyListResponsegetActiveRetType = bool + +func getServiceAccountKeyListResponsegetActiveAttributeTypeOk(arg ServiceAccountKeyListResponsegetActiveAttributeType) (ret ServiceAccountKeyListResponsegetActiveRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceAccountKeyListResponsegetActiveAttributeType(arg *ServiceAccountKeyListResponsegetActiveAttributeType, val ServiceAccountKeyListResponsegetActiveRetType) { + *arg = &val +} + +/* + types and functions for createdAt +*/ + +// isDateTime +type ServiceAccountKeyListResponseGetCreatedAtAttributeType = *time.Time +type ServiceAccountKeyListResponseGetCreatedAtArgType = time.Time +type ServiceAccountKeyListResponseGetCreatedAtRetType = time.Time + +func getServiceAccountKeyListResponseGetCreatedAtAttributeTypeOk(arg ServiceAccountKeyListResponseGetCreatedAtAttributeType) (ret ServiceAccountKeyListResponseGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceAccountKeyListResponseGetCreatedAtAttributeType(arg *ServiceAccountKeyListResponseGetCreatedAtAttributeType, val ServiceAccountKeyListResponseGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type ServiceAccountKeyListResponseGetIdAttributeType = *string + +func getServiceAccountKeyListResponseGetIdAttributeTypeOk(arg ServiceAccountKeyListResponseGetIdAttributeType) (ret ServiceAccountKeyListResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceAccountKeyListResponseGetIdAttributeType(arg *ServiceAccountKeyListResponseGetIdAttributeType, val ServiceAccountKeyListResponseGetIdRetType) { + *arg = &val +} + +type ServiceAccountKeyListResponseGetIdArgType = string +type ServiceAccountKeyListResponseGetIdRetType = string + +/* + types and functions for keyAlgorithm +*/ + +// isEnumRef +type ServiceAccountKeyListResponseGetKeyAlgorithmAttributeType = *string +type ServiceAccountKeyListResponseGetKeyAlgorithmArgType = string +type ServiceAccountKeyListResponseGetKeyAlgorithmRetType = string + +func getServiceAccountKeyListResponseGetKeyAlgorithmAttributeTypeOk(arg ServiceAccountKeyListResponseGetKeyAlgorithmAttributeType) (ret ServiceAccountKeyListResponseGetKeyAlgorithmRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceAccountKeyListResponseGetKeyAlgorithmAttributeType(arg *ServiceAccountKeyListResponseGetKeyAlgorithmAttributeType, val ServiceAccountKeyListResponseGetKeyAlgorithmRetType) { + *arg = &val +} + +/* + types and functions for keyOrigin +*/ + +// isEnumRef +type ServiceAccountKeyListResponseGetKeyOriginAttributeType = *string +type ServiceAccountKeyListResponseGetKeyOriginArgType = string +type ServiceAccountKeyListResponseGetKeyOriginRetType = string + +func getServiceAccountKeyListResponseGetKeyOriginAttributeTypeOk(arg ServiceAccountKeyListResponseGetKeyOriginAttributeType) (ret ServiceAccountKeyListResponseGetKeyOriginRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceAccountKeyListResponseGetKeyOriginAttributeType(arg *ServiceAccountKeyListResponseGetKeyOriginAttributeType, val ServiceAccountKeyListResponseGetKeyOriginRetType) { + *arg = &val +} + +/* + types and functions for keyType +*/ + +// isEnumRef +type ServiceAccountKeyListResponseGetKeyTypeAttributeType = *string +type ServiceAccountKeyListResponseGetKeyTypeArgType = string +type ServiceAccountKeyListResponseGetKeyTypeRetType = string + +func getServiceAccountKeyListResponseGetKeyTypeAttributeTypeOk(arg ServiceAccountKeyListResponseGetKeyTypeAttributeType) (ret ServiceAccountKeyListResponseGetKeyTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceAccountKeyListResponseGetKeyTypeAttributeType(arg *ServiceAccountKeyListResponseGetKeyTypeAttributeType, val ServiceAccountKeyListResponseGetKeyTypeRetType) { + *arg = &val +} + +/* + types and functions for validUntil +*/ + +// isDateTime +type ServiceAccountKeyListResponseGetValidUntilAttributeType = *time.Time +type ServiceAccountKeyListResponseGetValidUntilArgType = time.Time +type ServiceAccountKeyListResponseGetValidUntilRetType = time.Time + +func getServiceAccountKeyListResponseGetValidUntilAttributeTypeOk(arg ServiceAccountKeyListResponseGetValidUntilAttributeType) (ret ServiceAccountKeyListResponseGetValidUntilRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceAccountKeyListResponseGetValidUntilAttributeType(arg *ServiceAccountKeyListResponseGetValidUntilAttributeType, val ServiceAccountKeyListResponseGetValidUntilRetType) { + *arg = &val +} + // ServiceAccountKeyListResponse struct for ServiceAccountKeyListResponse type ServiceAccountKeyListResponse struct { // REQUIRED - Active *bool `json:"active"` + Active ServiceAccountKeyListResponsegetActiveAttributeType `json:"active"` // Creation time of the key // REQUIRED - CreatedAt *time.Time `json:"createdAt"` + CreatedAt ServiceAccountKeyListResponseGetCreatedAtAttributeType `json:"createdAt"` // Unique ID of the key. // REQUIRED - Id *string `json:"id"` + Id ServiceAccountKeyListResponseGetIdAttributeType `json:"id"` // REQUIRED - KeyAlgorithm *string `json:"keyAlgorithm"` + KeyAlgorithm ServiceAccountKeyListResponseGetKeyAlgorithmAttributeType `json:"keyAlgorithm"` // REQUIRED - KeyOrigin *string `json:"keyOrigin"` + KeyOrigin ServiceAccountKeyListResponseGetKeyOriginAttributeType `json:"keyOrigin"` // REQUIRED - KeyType *string `json:"keyType"` + KeyType ServiceAccountKeyListResponseGetKeyTypeAttributeType `json:"keyType"` // If specified, the timestamp until the key is active. May be null - ValidUntil *time.Time `json:"validUntil,omitempty"` + ValidUntil ServiceAccountKeyListResponseGetValidUntilAttributeType `json:"validUntil,omitempty"` } type _ServiceAccountKeyListResponse ServiceAccountKeyListResponse @@ -44,14 +185,14 @@ type _ServiceAccountKeyListResponse ServiceAccountKeyListResponse // 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 NewServiceAccountKeyListResponse(active *bool, createdAt *time.Time, id *string, keyAlgorithm *string, keyOrigin *string, keyType *string) *ServiceAccountKeyListResponse { +func NewServiceAccountKeyListResponse(active ServiceAccountKeyListResponsegetActiveArgType, createdAt ServiceAccountKeyListResponseGetCreatedAtArgType, id ServiceAccountKeyListResponseGetIdArgType, keyAlgorithm ServiceAccountKeyListResponseGetKeyAlgorithmArgType, keyOrigin ServiceAccountKeyListResponseGetKeyOriginArgType, keyType ServiceAccountKeyListResponseGetKeyTypeArgType) *ServiceAccountKeyListResponse { this := ServiceAccountKeyListResponse{} - this.Active = active - this.CreatedAt = createdAt - this.Id = id - this.KeyAlgorithm = keyAlgorithm - this.KeyOrigin = keyOrigin - this.KeyType = keyType + setServiceAccountKeyListResponsegetActiveAttributeType(&this.Active, active) + setServiceAccountKeyListResponseGetCreatedAtAttributeType(&this.CreatedAt, createdAt) + setServiceAccountKeyListResponseGetIdAttributeType(&this.Id, id) + setServiceAccountKeyListResponseGetKeyAlgorithmAttributeType(&this.KeyAlgorithm, keyAlgorithm) + setServiceAccountKeyListResponseGetKeyOriginAttributeType(&this.KeyOrigin, keyOrigin) + setServiceAccountKeyListResponseGetKeyTypeAttributeType(&this.KeyType, keyType) return &this } @@ -64,191 +205,152 @@ func NewServiceAccountKeyListResponseWithDefaults() *ServiceAccountKeyListRespon } // GetActive returns the Active field value -func (o *ServiceAccountKeyListResponse) GetActive() *bool { - if o == nil || IsNil(o.Active) { - var ret *bool - return ret - } - - return o.Active +func (o *ServiceAccountKeyListResponse) GetActive() (ret ServiceAccountKeyListResponsegetActiveRetType) { + ret, _ = o.GetActiveOk() + return ret } // GetActiveOk returns a tuple with the Active field value // and a boolean to check if the value has been set. -func (o *ServiceAccountKeyListResponse) GetActiveOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.Active, true +func (o *ServiceAccountKeyListResponse) GetActiveOk() (ret ServiceAccountKeyListResponsegetActiveRetType, ok bool) { + return getServiceAccountKeyListResponsegetActiveAttributeTypeOk(o.Active) } // SetActive sets field value -func (o *ServiceAccountKeyListResponse) SetActive(v *bool) { - o.Active = v +func (o *ServiceAccountKeyListResponse) SetActive(v ServiceAccountKeyListResponsegetActiveRetType) { + setServiceAccountKeyListResponsegetActiveAttributeType(&o.Active, v) } // GetCreatedAt returns the CreatedAt field value -func (o *ServiceAccountKeyListResponse) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - - return o.CreatedAt +func (o *ServiceAccountKeyListResponse) GetCreatedAt() (ret ServiceAccountKeyListResponseGetCreatedAtRetType) { + ret, _ = o.GetCreatedAtOk() + return ret } // GetCreatedAtOk returns a tuple with the CreatedAt field value // and a boolean to check if the value has been set. -func (o *ServiceAccountKeyListResponse) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.CreatedAt, true +func (o *ServiceAccountKeyListResponse) GetCreatedAtOk() (ret ServiceAccountKeyListResponseGetCreatedAtRetType, ok bool) { + return getServiceAccountKeyListResponseGetCreatedAtAttributeTypeOk(o.CreatedAt) } // SetCreatedAt sets field value -func (o *ServiceAccountKeyListResponse) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *ServiceAccountKeyListResponse) SetCreatedAt(v ServiceAccountKeyListResponseGetCreatedAtRetType) { + setServiceAccountKeyListResponseGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetId returns the Id field value -func (o *ServiceAccountKeyListResponse) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - - return o.Id +func (o *ServiceAccountKeyListResponse) GetId() (ret ServiceAccountKeyListResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *ServiceAccountKeyListResponse) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *ServiceAccountKeyListResponse) GetIdOk() (ret ServiceAccountKeyListResponseGetIdRetType, ok bool) { + return getServiceAccountKeyListResponseGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *ServiceAccountKeyListResponse) SetId(v *string) { - o.Id = v +func (o *ServiceAccountKeyListResponse) SetId(v ServiceAccountKeyListResponseGetIdRetType) { + setServiceAccountKeyListResponseGetIdAttributeType(&o.Id, v) } // GetKeyAlgorithm returns the KeyAlgorithm field value -func (o *ServiceAccountKeyListResponse) GetKeyAlgorithm() *string { - if o == nil || IsNil(o.KeyAlgorithm) { - var ret *string - return ret - } - - return o.KeyAlgorithm +func (o *ServiceAccountKeyListResponse) GetKeyAlgorithm() (ret ServiceAccountKeyListResponseGetKeyAlgorithmRetType) { + ret, _ = o.GetKeyAlgorithmOk() + return ret } // GetKeyAlgorithmOk returns a tuple with the KeyAlgorithm field value // and a boolean to check if the value has been set. -func (o *ServiceAccountKeyListResponse) GetKeyAlgorithmOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.KeyAlgorithm, true +func (o *ServiceAccountKeyListResponse) GetKeyAlgorithmOk() (ret ServiceAccountKeyListResponseGetKeyAlgorithmRetType, ok bool) { + return getServiceAccountKeyListResponseGetKeyAlgorithmAttributeTypeOk(o.KeyAlgorithm) } // SetKeyAlgorithm sets field value -func (o *ServiceAccountKeyListResponse) SetKeyAlgorithm(v *string) { - o.KeyAlgorithm = v +func (o *ServiceAccountKeyListResponse) SetKeyAlgorithm(v ServiceAccountKeyListResponseGetKeyAlgorithmRetType) { + setServiceAccountKeyListResponseGetKeyAlgorithmAttributeType(&o.KeyAlgorithm, v) } // GetKeyOrigin returns the KeyOrigin field value -func (o *ServiceAccountKeyListResponse) GetKeyOrigin() *string { - if o == nil || IsNil(o.KeyOrigin) { - var ret *string - return ret - } - - return o.KeyOrigin +func (o *ServiceAccountKeyListResponse) GetKeyOrigin() (ret ServiceAccountKeyListResponseGetKeyOriginRetType) { + ret, _ = o.GetKeyOriginOk() + return ret } // GetKeyOriginOk returns a tuple with the KeyOrigin field value // and a boolean to check if the value has been set. -func (o *ServiceAccountKeyListResponse) GetKeyOriginOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.KeyOrigin, true +func (o *ServiceAccountKeyListResponse) GetKeyOriginOk() (ret ServiceAccountKeyListResponseGetKeyOriginRetType, ok bool) { + return getServiceAccountKeyListResponseGetKeyOriginAttributeTypeOk(o.KeyOrigin) } // SetKeyOrigin sets field value -func (o *ServiceAccountKeyListResponse) SetKeyOrigin(v *string) { - o.KeyOrigin = v +func (o *ServiceAccountKeyListResponse) SetKeyOrigin(v ServiceAccountKeyListResponseGetKeyOriginRetType) { + setServiceAccountKeyListResponseGetKeyOriginAttributeType(&o.KeyOrigin, v) } // GetKeyType returns the KeyType field value -func (o *ServiceAccountKeyListResponse) GetKeyType() *string { - if o == nil || IsNil(o.KeyType) { - var ret *string - return ret - } - - return o.KeyType +func (o *ServiceAccountKeyListResponse) GetKeyType() (ret ServiceAccountKeyListResponseGetKeyTypeRetType) { + ret, _ = o.GetKeyTypeOk() + return ret } // GetKeyTypeOk returns a tuple with the KeyType field value // and a boolean to check if the value has been set. -func (o *ServiceAccountKeyListResponse) GetKeyTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.KeyType, true +func (o *ServiceAccountKeyListResponse) GetKeyTypeOk() (ret ServiceAccountKeyListResponseGetKeyTypeRetType, ok bool) { + return getServiceAccountKeyListResponseGetKeyTypeAttributeTypeOk(o.KeyType) } // SetKeyType sets field value -func (o *ServiceAccountKeyListResponse) SetKeyType(v *string) { - o.KeyType = v +func (o *ServiceAccountKeyListResponse) SetKeyType(v ServiceAccountKeyListResponseGetKeyTypeRetType) { + setServiceAccountKeyListResponseGetKeyTypeAttributeType(&o.KeyType, v) } // GetValidUntil returns the ValidUntil field value if set, zero value otherwise. -func (o *ServiceAccountKeyListResponse) GetValidUntil() *time.Time { - if o == nil || IsNil(o.ValidUntil) { - var ret *time.Time - return ret - } - return o.ValidUntil +func (o *ServiceAccountKeyListResponse) GetValidUntil() (res ServiceAccountKeyListResponseGetValidUntilRetType) { + res, _ = o.GetValidUntilOk() + return } // GetValidUntilOk returns a tuple with the ValidUntil field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceAccountKeyListResponse) GetValidUntilOk() (*time.Time, bool) { - if o == nil || IsNil(o.ValidUntil) { - return nil, false - } - return o.ValidUntil, true +func (o *ServiceAccountKeyListResponse) GetValidUntilOk() (ret ServiceAccountKeyListResponseGetValidUntilRetType, ok bool) { + return getServiceAccountKeyListResponseGetValidUntilAttributeTypeOk(o.ValidUntil) } // HasValidUntil returns a boolean if a field has been set. func (o *ServiceAccountKeyListResponse) HasValidUntil() bool { - if o != nil && !IsNil(o.ValidUntil) { - return true - } - - return false + _, ok := o.GetValidUntilOk() + return ok } // SetValidUntil gets a reference to the given time.Time and assigns it to the ValidUntil field. -func (o *ServiceAccountKeyListResponse) SetValidUntil(v *time.Time) { - o.ValidUntil = v +func (o *ServiceAccountKeyListResponse) SetValidUntil(v ServiceAccountKeyListResponseGetValidUntilRetType) { + setServiceAccountKeyListResponseGetValidUntilAttributeType(&o.ValidUntil, v) } func (o ServiceAccountKeyListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["active"] = o.Active - toSerialize["createdAt"] = o.CreatedAt - toSerialize["id"] = o.Id - toSerialize["keyAlgorithm"] = o.KeyAlgorithm - toSerialize["keyOrigin"] = o.KeyOrigin - toSerialize["keyType"] = o.KeyType - if !IsNil(o.ValidUntil) { - toSerialize["validUntil"] = o.ValidUntil + if val, ok := getServiceAccountKeyListResponsegetActiveAttributeTypeOk(o.Active); ok { + toSerialize["Active"] = val + } + if val, ok := getServiceAccountKeyListResponseGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getServiceAccountKeyListResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getServiceAccountKeyListResponseGetKeyAlgorithmAttributeTypeOk(o.KeyAlgorithm); ok { + toSerialize["KeyAlgorithm"] = val + } + if val, ok := getServiceAccountKeyListResponseGetKeyOriginAttributeTypeOk(o.KeyOrigin); ok { + toSerialize["KeyOrigin"] = val + } + if val, ok := getServiceAccountKeyListResponseGetKeyTypeAttributeTypeOk(o.KeyType); ok { + toSerialize["KeyType"] = val + } + if val, ok := getServiceAccountKeyListResponseGetValidUntilAttributeTypeOk(o.ValidUntil); ok { + toSerialize["ValidUntil"] = val } return toSerialize, nil } diff --git a/services/serviceaccount/utils.go b/services/serviceaccount/utils.go index 2d044a043..e53599efe 100644 --- a/services/serviceaccount/utils.go +++ b/services/serviceaccount/utils.go @@ -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()