diff --git a/services/secretsmanager/api_default_test.go b/services/secretsmanager/api_default_test.go index ddd54ccc7..74cd7fe9c 100644 --- a/services/secretsmanager/api_default_test.go +++ b/services/secretsmanager/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_secretsmanager_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService CreateACL", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/acls" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/acls" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + instanceIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -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 := ACL{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -65,8 +66,8 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" + projectId := projectIdValue + instanceId := instanceIdValue createACLPayload := CreateACLPayload{} resp, reqErr := apiClient.CreateACL(context.Background(), projectId, instanceId).CreateACLPayload(createACLPayload).Execute() @@ -74,18 +75,18 @@ func Test_secretsmanager_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 CreateInstance", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1/projects/{projectId}/instances" + projectIdValue := uuid.NewString() + _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 := Instance{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -119,7 +120,7 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue createInstancePayload := CreateInstancePayload{} resp, reqErr := apiClient.CreateInstance(context.Background(), projectId).CreateInstancePayload(createInstancePayload).Execute() @@ -127,20 +128,20 @@ func Test_secretsmanager_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 CreateUser", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/users" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/users" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + instanceIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -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 := User{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -174,8 +175,8 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" + projectId := projectIdValue + instanceId := instanceIdValue createUserPayload := CreateUserPayload{} resp, reqErr := apiClient.CreateUser(context.Background(), projectId, instanceId).CreateUserPayload(createUserPayload).Execute() @@ -183,22 +184,22 @@ func Test_secretsmanager_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 DeleteACL", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/acls/{aclId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - aclIdValue := "aclId" - path = strings.Replace(path, "{"+"aclId"+"}", url.PathEscape(ParameterValueToString(aclIdValue, "aclId")), -1) + _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/acls/{aclId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + instanceIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + aclIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"aclId"+"}", url.PathEscape(ParameterValueToString(aclIdValue, "aclId")), -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() @@ -229,9 +230,9 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - aclId := "aclId" + projectId := projectIdValue + instanceId := instanceIdValue + aclId := aclIdValue reqErr := apiClient.DeleteACL(context.Background(), projectId, instanceId, aclId).Execute() @@ -241,14 +242,14 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteInstance", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + instanceIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -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() @@ -279,8 +280,8 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" + projectId := projectIdValue + instanceId := instanceIdValue reqErr := apiClient.DeleteInstance(context.Background(), projectId, instanceId).Execute() @@ -290,16 +291,16 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteUser", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - userIdValue := "userId" - path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -1) + _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + instanceIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + userIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -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() @@ -330,9 +331,9 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - userId := "userId" + projectId := projectIdValue + instanceId := instanceIdValue + userId := userIdValue reqErr := apiClient.DeleteUser(context.Background(), projectId, instanceId, userId).Execute() @@ -342,16 +343,16 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetACL", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/acls/{aclId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - aclIdValue := "aclId" - path = strings.Replace(path, "{"+"aclId"+"}", url.PathEscape(ParameterValueToString(aclIdValue, "aclId")), -1) + _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/acls/{aclId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + instanceIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + aclIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"aclId"+"}", url.PathEscape(ParameterValueToString(aclIdValue, "aclId")), -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 := ACL{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -385,29 +386,29 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - aclId := "aclId" + projectId := projectIdValue + instanceId := instanceIdValue + aclId := aclIdValue resp, reqErr := apiClient.GetACL(context.Background(), projectId, instanceId, aclId).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 GetInstance", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + instanceIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -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 := Instance{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -441,30 +442,30 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" + projectId := projectIdValue + instanceId := instanceIdValue resp, reqErr := apiClient.GetInstance(context.Background(), projectId, instanceId).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 GetUser", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - userIdValue := "userId" - path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -1) + _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + instanceIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + userIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -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 := User{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -498,29 +499,29 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - userId := "userId" + projectId := projectIdValue + instanceId := instanceIdValue + userId := userIdValue resp, reqErr := apiClient.GetUser(context.Background(), projectId, instanceId, userId).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 ListACLs", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/acls" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/acls" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + instanceIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -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 := ListACLsResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -554,26 +555,26 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" + projectId := projectIdValue + instanceId := instanceIdValue resp, reqErr := apiClient.ListACLs(context.Background(), projectId, instanceId).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 ListInstances", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1/projects/{projectId}/instances" + projectIdValue := uuid.NewString() + _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 := ListInstancesResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -607,27 +608,27 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.ListInstances(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 ListUsers", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/users" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/users" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + instanceIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -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 := ListUsersResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -661,30 +662,30 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" + projectId := projectIdValue + instanceId := instanceIdValue resp, reqErr := apiClient.ListUsers(context.Background(), projectId, instanceId).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 UpdateACL", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/acls/{aclId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - aclIdValue := "aclId" - path = strings.Replace(path, "{"+"aclId"+"}", url.PathEscape(ParameterValueToString(aclIdValue, "aclId")), -1) + _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/acls/{aclId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + instanceIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + aclIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"aclId"+"}", url.PathEscape(ParameterValueToString(aclIdValue, "aclId")), -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() @@ -715,9 +716,9 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - aclId := "aclId" + projectId := projectIdValue + instanceId := instanceIdValue + aclId := aclIdValue updateACLPayload := UpdateACLPayload{} reqErr := apiClient.UpdateACL(context.Background(), projectId, instanceId, aclId).UpdateACLPayload(updateACLPayload).Execute() @@ -728,14 +729,14 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService UpdateACLs", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/acls" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/acls" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + instanceIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -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() @@ -766,8 +767,8 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" + projectId := projectIdValue + instanceId := instanceIdValue updateACLsPayload := UpdateACLsPayload{} reqErr := apiClient.UpdateACLs(context.Background(), projectId, instanceId).UpdateACLsPayload(updateACLsPayload).Execute() @@ -778,14 +779,14 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService UpdateInstance", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + instanceIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -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() @@ -816,8 +817,8 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" + projectId := projectIdValue + instanceId := instanceIdValue updateInstancePayload := UpdateInstancePayload{} reqErr := apiClient.UpdateInstance(context.Background(), projectId, instanceId).UpdateInstancePayload(updateInstancePayload).Execute() @@ -828,16 +829,16 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService UpdateUser", func(t *testing.T) { - path := "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - instanceIdValue := "instanceId" - path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - userIdValue := "userId" - path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -1) + _apiUrlPath := "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + instanceIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + userIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(userIdValue, "userId")), -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() @@ -868,9 +869,9 @@ func Test_secretsmanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - instanceId := "instanceId" - userId := "userId" + projectId := projectIdValue + instanceId := instanceIdValue + userId := userIdValue updateUserPayload := UpdateUserPayload{} reqErr := apiClient.UpdateUser(context.Background(), projectId, instanceId, userId).UpdateUserPayload(updateUserPayload).Execute() diff --git a/services/secretsmanager/go.mod b/services/secretsmanager/go.mod index 1f3db5d25..183f2d96f 100644 --- a/services/secretsmanager/go.mod +++ b/services/secretsmanager/go.mod @@ -2,10 +2,12 @@ module github.com/stackitcloud/stackit-sdk-go/services/secretsmanager 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/secretsmanager/model_acl.go b/services/secretsmanager/model_acl.go index aff317579..91c9b7d4e 100644 --- a/services/secretsmanager/model_acl.go +++ b/services/secretsmanager/model_acl.go @@ -17,14 +17,56 @@ import ( // checks if the ACL type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ACL{} +/* + types and functions for cidr +*/ + +// isNotNullableString +type ACLGetCidrAttributeType = *string + +func getACLGetCidrAttributeTypeOk(arg ACLGetCidrAttributeType) (ret ACLGetCidrRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setACLGetCidrAttributeType(arg *ACLGetCidrAttributeType, val ACLGetCidrRetType) { + *arg = &val +} + +type ACLGetCidrArgType = string +type ACLGetCidrRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type ACLGetIdAttributeType = *string + +func getACLGetIdAttributeTypeOk(arg ACLGetIdAttributeType) (ret ACLGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setACLGetIdAttributeType(arg *ACLGetIdAttributeType, val ACLGetIdRetType) { + *arg = &val +} + +type ACLGetIdArgType = string +type ACLGetIdRetType = string + // ACL struct for ACL type ACL struct { // The given IP/IP Range that is permitted to access. // REQUIRED - Cidr *string `json:"cidr"` + Cidr ACLGetCidrAttributeType `json:"cidr"` // A auto generated unique id which identifies the acl. // REQUIRED - Id *string `json:"id"` + Id ACLGetIdAttributeType `json:"id"` } type _ACL ACL @@ -33,10 +75,10 @@ type _ACL ACL // 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 NewACL(cidr *string, id *string) *ACL { +func NewACL(cidr ACLGetCidrArgType, id ACLGetIdArgType) *ACL { this := ACL{} - this.Cidr = cidr - this.Id = id + setACLGetCidrAttributeType(&this.Cidr, cidr) + setACLGetIdAttributeType(&this.Id, id) return &this } @@ -49,57 +91,47 @@ func NewACLWithDefaults() *ACL { } // GetCidr returns the Cidr field value -func (o *ACL) GetCidr() *string { - if o == nil || IsNil(o.Cidr) { - var ret *string - return ret - } - - return o.Cidr +func (o *ACL) GetCidr() (ret ACLGetCidrRetType) { + ret, _ = o.GetCidrOk() + return ret } // GetCidrOk returns a tuple with the Cidr field value // and a boolean to check if the value has been set. -func (o *ACL) GetCidrOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Cidr, true +func (o *ACL) GetCidrOk() (ret ACLGetCidrRetType, ok bool) { + return getACLGetCidrAttributeTypeOk(o.Cidr) } // SetCidr sets field value -func (o *ACL) SetCidr(v *string) { - o.Cidr = v +func (o *ACL) SetCidr(v ACLGetCidrRetType) { + setACLGetCidrAttributeType(&o.Cidr, v) } // GetId returns the Id field value -func (o *ACL) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - - return o.Id +func (o *ACL) GetId() (ret ACLGetIdRetType) { + 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 *ACL) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *ACL) GetIdOk() (ret ACLGetIdRetType, ok bool) { + return getACLGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *ACL) SetId(v *string) { - o.Id = v +func (o *ACL) SetId(v ACLGetIdRetType) { + setACLGetIdAttributeType(&o.Id, v) } func (o ACL) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["cidr"] = o.Cidr - toSerialize["id"] = o.Id + if val, ok := getACLGetCidrAttributeTypeOk(o.Cidr); ok { + toSerialize["Cidr"] = val + } + if val, ok := getACLGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } return toSerialize, nil } diff --git a/services/secretsmanager/model_create_acl_payload.go b/services/secretsmanager/model_create_acl_payload.go index 297ded3d5..0d8963766 100644 --- a/services/secretsmanager/model_create_acl_payload.go +++ b/services/secretsmanager/model_create_acl_payload.go @@ -17,11 +17,32 @@ import ( // checks if the CreateACLPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateACLPayload{} +/* + types and functions for cidr +*/ + +// isNotNullableString +type CreateACLPayloadGetCidrAttributeType = *string + +func getCreateACLPayloadGetCidrAttributeTypeOk(arg CreateACLPayloadGetCidrAttributeType) (ret CreateACLPayloadGetCidrRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateACLPayloadGetCidrAttributeType(arg *CreateACLPayloadGetCidrAttributeType, val CreateACLPayloadGetCidrRetType) { + *arg = &val +} + +type CreateACLPayloadGetCidrArgType = string +type CreateACLPayloadGetCidrRetType = string + // CreateACLPayload struct for CreateACLPayload type CreateACLPayload struct { // The given IP/IP Range that is permitted to access. // REQUIRED - Cidr *string `json:"cidr"` + Cidr CreateACLPayloadGetCidrAttributeType `json:"cidr"` } type _CreateACLPayload CreateACLPayload @@ -30,9 +51,9 @@ type _CreateACLPayload CreateACLPayload // 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 NewCreateACLPayload(cidr *string) *CreateACLPayload { +func NewCreateACLPayload(cidr CreateACLPayloadGetCidrArgType) *CreateACLPayload { this := CreateACLPayload{} - this.Cidr = cidr + setCreateACLPayloadGetCidrAttributeType(&this.Cidr, cidr) return &this } @@ -45,32 +66,27 @@ func NewCreateACLPayloadWithDefaults() *CreateACLPayload { } // GetCidr returns the Cidr field value -func (o *CreateACLPayload) GetCidr() *string { - if o == nil || IsNil(o.Cidr) { - var ret *string - return ret - } - - return o.Cidr +func (o *CreateACLPayload) GetCidr() (ret CreateACLPayloadGetCidrRetType) { + ret, _ = o.GetCidrOk() + return ret } // GetCidrOk returns a tuple with the Cidr field value // and a boolean to check if the value has been set. -func (o *CreateACLPayload) GetCidrOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Cidr, true +func (o *CreateACLPayload) GetCidrOk() (ret CreateACLPayloadGetCidrRetType, ok bool) { + return getCreateACLPayloadGetCidrAttributeTypeOk(o.Cidr) } // SetCidr sets field value -func (o *CreateACLPayload) SetCidr(v *string) { - o.Cidr = v +func (o *CreateACLPayload) SetCidr(v CreateACLPayloadGetCidrRetType) { + setCreateACLPayloadGetCidrAttributeType(&o.Cidr, v) } func (o CreateACLPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["cidr"] = o.Cidr + if val, ok := getCreateACLPayloadGetCidrAttributeTypeOk(o.Cidr); ok { + toSerialize["Cidr"] = val + } return toSerialize, nil } diff --git a/services/secretsmanager/model_create_instance_payload.go b/services/secretsmanager/model_create_instance_payload.go index 63ecb309f..a4f0affcc 100644 --- a/services/secretsmanager/model_create_instance_payload.go +++ b/services/secretsmanager/model_create_instance_payload.go @@ -17,11 +17,32 @@ import ( // checks if the CreateInstancePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateInstancePayload{} +/* + types and functions for name +*/ + +// isNotNullableString +type CreateInstancePayloadGetNameAttributeType = *string + +func getCreateInstancePayloadGetNameAttributeTypeOk(arg CreateInstancePayloadGetNameAttributeType) (ret CreateInstancePayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateInstancePayloadGetNameAttributeType(arg *CreateInstancePayloadGetNameAttributeType, val CreateInstancePayloadGetNameRetType) { + *arg = &val +} + +type CreateInstancePayloadGetNameArgType = string +type CreateInstancePayloadGetNameRetType = string + // CreateInstancePayload struct for CreateInstancePayload type CreateInstancePayload struct { // A user chosen name to distinguish multiple secrets manager instances. // REQUIRED - Name *string `json:"name"` + Name CreateInstancePayloadGetNameAttributeType `json:"name"` } type _CreateInstancePayload CreateInstancePayload @@ -30,9 +51,9 @@ type _CreateInstancePayload CreateInstancePayload // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCreateInstancePayload(name *string) *CreateInstancePayload { +func NewCreateInstancePayload(name CreateInstancePayloadGetNameArgType) *CreateInstancePayload { this := CreateInstancePayload{} - this.Name = name + setCreateInstancePayloadGetNameAttributeType(&this.Name, name) return &this } @@ -45,32 +66,27 @@ func NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { } // GetName returns the Name field value -func (o *CreateInstancePayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *CreateInstancePayload) GetName() (ret CreateInstancePayloadGetNameRetType) { + 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 *CreateInstancePayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *CreateInstancePayload) GetNameOk() (ret CreateInstancePayloadGetNameRetType, ok bool) { + return getCreateInstancePayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *CreateInstancePayload) SetName(v *string) { - o.Name = v +func (o *CreateInstancePayload) SetName(v CreateInstancePayloadGetNameRetType) { + setCreateInstancePayloadGetNameAttributeType(&o.Name, v) } func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["name"] = o.Name + if val, ok := getCreateInstancePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } return toSerialize, nil } diff --git a/services/secretsmanager/model_create_user_payload.go b/services/secretsmanager/model_create_user_payload.go index 2ea4f5b46..4bc9b53e3 100644 --- a/services/secretsmanager/model_create_user_payload.go +++ b/services/secretsmanager/model_create_user_payload.go @@ -17,14 +17,55 @@ import ( // checks if the CreateUserPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateUserPayload{} +/* + types and functions for description +*/ + +// isNotNullableString +type CreateUserPayloadGetDescriptionAttributeType = *string + +func getCreateUserPayloadGetDescriptionAttributeTypeOk(arg CreateUserPayloadGetDescriptionAttributeType) (ret CreateUserPayloadGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateUserPayloadGetDescriptionAttributeType(arg *CreateUserPayloadGetDescriptionAttributeType, val CreateUserPayloadGetDescriptionRetType) { + *arg = &val +} + +type CreateUserPayloadGetDescriptionArgType = string +type CreateUserPayloadGetDescriptionRetType = string + +/* + types and functions for write +*/ + +// isBoolean +type CreateUserPayloadgetWriteAttributeType = *bool +type CreateUserPayloadgetWriteArgType = bool +type CreateUserPayloadgetWriteRetType = bool + +func getCreateUserPayloadgetWriteAttributeTypeOk(arg CreateUserPayloadgetWriteAttributeType) (ret CreateUserPayloadgetWriteRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateUserPayloadgetWriteAttributeType(arg *CreateUserPayloadgetWriteAttributeType, val CreateUserPayloadgetWriteRetType) { + *arg = &val +} + // CreateUserPayload struct for CreateUserPayload type CreateUserPayload struct { // A user chosen description to differentiate between multiple users. // REQUIRED - Description *string `json:"description"` + Description CreateUserPayloadGetDescriptionAttributeType `json:"description"` // Is true if the user has write access to the secrets engine. Is false for a read-only user. // REQUIRED - Write *bool `json:"write"` + Write CreateUserPayloadgetWriteAttributeType `json:"write"` } type _CreateUserPayload CreateUserPayload @@ -33,10 +74,10 @@ type _CreateUserPayload CreateUserPayload // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCreateUserPayload(description *string, write *bool) *CreateUserPayload { +func NewCreateUserPayload(description CreateUserPayloadGetDescriptionArgType, write CreateUserPayloadgetWriteArgType) *CreateUserPayload { this := CreateUserPayload{} - this.Description = description - this.Write = write + setCreateUserPayloadGetDescriptionAttributeType(&this.Description, description) + setCreateUserPayloadgetWriteAttributeType(&this.Write, write) return &this } @@ -49,57 +90,47 @@ func NewCreateUserPayloadWithDefaults() *CreateUserPayload { } // GetDescription returns the Description field value -func (o *CreateUserPayload) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - - return o.Description +func (o *CreateUserPayload) GetDescription() (ret CreateUserPayloadGetDescriptionRetType) { + ret, _ = o.GetDescriptionOk() + return ret } // GetDescriptionOk returns a tuple with the Description field value // and a boolean to check if the value has been set. -func (o *CreateUserPayload) GetDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Description, true +func (o *CreateUserPayload) GetDescriptionOk() (ret CreateUserPayloadGetDescriptionRetType, ok bool) { + return getCreateUserPayloadGetDescriptionAttributeTypeOk(o.Description) } // SetDescription sets field value -func (o *CreateUserPayload) SetDescription(v *string) { - o.Description = v +func (o *CreateUserPayload) SetDescription(v CreateUserPayloadGetDescriptionRetType) { + setCreateUserPayloadGetDescriptionAttributeType(&o.Description, v) } // GetWrite returns the Write field value -func (o *CreateUserPayload) GetWrite() *bool { - if o == nil || IsNil(o.Write) { - var ret *bool - return ret - } - - return o.Write +func (o *CreateUserPayload) GetWrite() (ret CreateUserPayloadgetWriteRetType) { + ret, _ = o.GetWriteOk() + return ret } // GetWriteOk returns a tuple with the Write field value // and a boolean to check if the value has been set. -func (o *CreateUserPayload) GetWriteOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.Write, true +func (o *CreateUserPayload) GetWriteOk() (ret CreateUserPayloadgetWriteRetType, ok bool) { + return getCreateUserPayloadgetWriteAttributeTypeOk(o.Write) } // SetWrite sets field value -func (o *CreateUserPayload) SetWrite(v *bool) { - o.Write = v +func (o *CreateUserPayload) SetWrite(v CreateUserPayloadgetWriteRetType) { + setCreateUserPayloadgetWriteAttributeType(&o.Write, v) } func (o CreateUserPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["description"] = o.Description - toSerialize["write"] = o.Write + if val, ok := getCreateUserPayloadGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getCreateUserPayloadgetWriteAttributeTypeOk(o.Write); ok { + toSerialize["Write"] = val + } return toSerialize, nil } diff --git a/services/secretsmanager/model_instance.go b/services/secretsmanager/model_instance.go index 18c8912e6..c97fc505a 100644 --- a/services/secretsmanager/model_instance.go +++ b/services/secretsmanager/model_instance.go @@ -17,33 +17,242 @@ import ( // checks if the Instance type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Instance{} +/* + types and functions for apiUrl +*/ + +// isNotNullableString +type InstanceGetApiUrlAttributeType = *string + +func getInstanceGetApiUrlAttributeTypeOk(arg InstanceGetApiUrlAttributeType) (ret InstanceGetApiUrlRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetApiUrlAttributeType(arg *InstanceGetApiUrlAttributeType, val InstanceGetApiUrlRetType) { + *arg = &val +} + +type InstanceGetApiUrlArgType = string +type InstanceGetApiUrlRetType = string + +/* + types and functions for creationFinishedDate +*/ + +// isNotNullableString +type InstanceGetCreationFinishedDateAttributeType = *string + +func getInstanceGetCreationFinishedDateAttributeTypeOk(arg InstanceGetCreationFinishedDateAttributeType) (ret InstanceGetCreationFinishedDateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetCreationFinishedDateAttributeType(arg *InstanceGetCreationFinishedDateAttributeType, val InstanceGetCreationFinishedDateRetType) { + *arg = &val +} + +type InstanceGetCreationFinishedDateArgType = string +type InstanceGetCreationFinishedDateRetType = string + +/* + types and functions for creationStartDate +*/ + +// isNotNullableString +type InstanceGetCreationStartDateAttributeType = *string + +func getInstanceGetCreationStartDateAttributeTypeOk(arg InstanceGetCreationStartDateAttributeType) (ret InstanceGetCreationStartDateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetCreationStartDateAttributeType(arg *InstanceGetCreationStartDateAttributeType, val InstanceGetCreationStartDateRetType) { + *arg = &val +} + +type InstanceGetCreationStartDateArgType = string +type InstanceGetCreationStartDateRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type InstanceGetIdAttributeType = *string + +func getInstanceGetIdAttributeTypeOk(arg InstanceGetIdAttributeType) (ret InstanceGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetIdAttributeType(arg *InstanceGetIdAttributeType, val InstanceGetIdRetType) { + *arg = &val +} + +type InstanceGetIdArgType = string +type InstanceGetIdRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type InstanceGetNameAttributeType = *string + +func getInstanceGetNameAttributeTypeOk(arg InstanceGetNameAttributeType) (ret InstanceGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetNameAttributeType(arg *InstanceGetNameAttributeType, val InstanceGetNameRetType) { + *arg = &val +} + +type InstanceGetNameArgType = string +type InstanceGetNameRetType = string + +/* + types and functions for secretCount +*/ + +// isInteger +type InstanceGetSecretCountAttributeType = *int64 +type InstanceGetSecretCountArgType = int64 +type InstanceGetSecretCountRetType = int64 + +func getInstanceGetSecretCountAttributeTypeOk(arg InstanceGetSecretCountAttributeType) (ret InstanceGetSecretCountRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetSecretCountAttributeType(arg *InstanceGetSecretCountAttributeType, val InstanceGetSecretCountRetType) { + *arg = &val +} + +/* + types and functions for secretsEngine +*/ + +// isNotNullableString +type InstanceGetSecretsEngineAttributeType = *string + +func getInstanceGetSecretsEngineAttributeTypeOk(arg InstanceGetSecretsEngineAttributeType) (ret InstanceGetSecretsEngineRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetSecretsEngineAttributeType(arg *InstanceGetSecretsEngineAttributeType, val InstanceGetSecretsEngineRetType) { + *arg = &val +} + +type InstanceGetSecretsEngineArgType = string +type InstanceGetSecretsEngineRetType = string + +/* + types and functions for state +*/ + +// isNotNullableString +type InstanceGetStateAttributeType = *string + +func getInstanceGetStateAttributeTypeOk(arg InstanceGetStateAttributeType) (ret InstanceGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetStateAttributeType(arg *InstanceGetStateAttributeType, val InstanceGetStateRetType) { + *arg = &val +} + +type InstanceGetStateArgType = string +type InstanceGetStateRetType = string + +/* + types and functions for updateFinishedDate +*/ + +// isNotNullableString +type InstanceGetUpdateFinishedDateAttributeType = *string + +func getInstanceGetUpdateFinishedDateAttributeTypeOk(arg InstanceGetUpdateFinishedDateAttributeType) (ret InstanceGetUpdateFinishedDateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetUpdateFinishedDateAttributeType(arg *InstanceGetUpdateFinishedDateAttributeType, val InstanceGetUpdateFinishedDateRetType) { + *arg = &val +} + +type InstanceGetUpdateFinishedDateArgType = string +type InstanceGetUpdateFinishedDateRetType = string + +/* + types and functions for updateStartDate +*/ + +// isNotNullableString +type InstanceGetUpdateStartDateAttributeType = *string + +func getInstanceGetUpdateStartDateAttributeTypeOk(arg InstanceGetUpdateStartDateAttributeType) (ret InstanceGetUpdateStartDateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceGetUpdateStartDateAttributeType(arg *InstanceGetUpdateStartDateAttributeType, val InstanceGetUpdateStartDateRetType) { + *arg = &val +} + +type InstanceGetUpdateStartDateArgType = string +type InstanceGetUpdateStartDateRetType = string + // Instance struct for Instance type Instance struct { // The API endpoint for connecting to the secrets engine. // REQUIRED - ApiUrl *string `json:"apiUrl"` + ApiUrl InstanceGetApiUrlAttributeType `json:"apiUrl"` // The date and time the creation of the Secrets Manager instance was finished. - CreationFinishedDate *string `json:"creationFinishedDate,omitempty"` + CreationFinishedDate InstanceGetCreationFinishedDateAttributeType `json:"creationFinishedDate,omitempty"` // The date and time the creation of the Secrets Manager instance was triggered. // REQUIRED - CreationStartDate *string `json:"creationStartDate"` + CreationStartDate InstanceGetCreationStartDateAttributeType `json:"creationStartDate"` // A auto generated unique id which identifies the secrets manager instances. // REQUIRED - Id *string `json:"id"` + Id InstanceGetIdAttributeType `json:"id"` // A user chosen name to distinguish multiple secrets manager instances. // REQUIRED - Name *string `json:"name"` + Name InstanceGetNameAttributeType `json:"name"` // The number of secrets currently stored inside of the instance. This value will be updated once per hour. // REQUIRED - SecretCount *int64 `json:"secretCount"` + SecretCount InstanceGetSecretCountAttributeType `json:"secretCount"` // The name of the secrets engine. // REQUIRED - SecretsEngine *string `json:"secretsEngine"` + SecretsEngine InstanceGetSecretsEngineAttributeType `json:"secretsEngine"` // The current state of the Secrets Manager instance. // REQUIRED - State *string `json:"state"` - UpdateFinishedDate *string `json:"updateFinishedDate,omitempty"` - UpdateStartDate *string `json:"updateStartDate,omitempty"` + State InstanceGetStateAttributeType `json:"state"` + UpdateFinishedDate InstanceGetUpdateFinishedDateAttributeType `json:"updateFinishedDate,omitempty"` + UpdateStartDate InstanceGetUpdateStartDateAttributeType `json:"updateStartDate,omitempty"` } type _Instance Instance @@ -52,15 +261,15 @@ type _Instance Instance // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInstance(apiUrl *string, creationStartDate *string, id *string, name *string, secretCount *int64, secretsEngine *string, state *string) *Instance { +func NewInstance(apiUrl InstanceGetApiUrlArgType, creationStartDate InstanceGetCreationStartDateArgType, id InstanceGetIdArgType, name InstanceGetNameArgType, secretCount InstanceGetSecretCountArgType, secretsEngine InstanceGetSecretsEngineArgType, state InstanceGetStateArgType) *Instance { this := Instance{} - this.ApiUrl = apiUrl - this.CreationStartDate = creationStartDate - this.Id = id - this.Name = name - this.SecretCount = secretCount - this.SecretsEngine = secretsEngine - this.State = state + setInstanceGetApiUrlAttributeType(&this.ApiUrl, apiUrl) + setInstanceGetCreationStartDateAttributeType(&this.CreationStartDate, creationStartDate) + setInstanceGetIdAttributeType(&this.Id, id) + setInstanceGetNameAttributeType(&this.Name, name) + setInstanceGetSecretCountAttributeType(&this.SecretCount, secretCount) + setInstanceGetSecretsEngineAttributeType(&this.SecretsEngine, secretsEngine) + setInstanceGetStateAttributeType(&this.State, state) return &this } @@ -73,286 +282,224 @@ func NewInstanceWithDefaults() *Instance { } // GetApiUrl returns the ApiUrl field value -func (o *Instance) GetApiUrl() *string { - if o == nil || IsNil(o.ApiUrl) { - var ret *string - return ret - } - - return o.ApiUrl +func (o *Instance) GetApiUrl() (ret InstanceGetApiUrlRetType) { + ret, _ = o.GetApiUrlOk() + return ret } // GetApiUrlOk returns a tuple with the ApiUrl field value // and a boolean to check if the value has been set. -func (o *Instance) GetApiUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ApiUrl, true +func (o *Instance) GetApiUrlOk() (ret InstanceGetApiUrlRetType, ok bool) { + return getInstanceGetApiUrlAttributeTypeOk(o.ApiUrl) } // SetApiUrl sets field value -func (o *Instance) SetApiUrl(v *string) { - o.ApiUrl = v +func (o *Instance) SetApiUrl(v InstanceGetApiUrlRetType) { + setInstanceGetApiUrlAttributeType(&o.ApiUrl, v) } // GetCreationFinishedDate returns the CreationFinishedDate field value if set, zero value otherwise. -func (o *Instance) GetCreationFinishedDate() *string { - if o == nil || IsNil(o.CreationFinishedDate) { - var ret *string - return ret - } - return o.CreationFinishedDate +func (o *Instance) GetCreationFinishedDate() (res InstanceGetCreationFinishedDateRetType) { + res, _ = o.GetCreationFinishedDateOk() + return } // GetCreationFinishedDateOk returns a tuple with the CreationFinishedDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetCreationFinishedDateOk() (*string, bool) { - if o == nil || IsNil(o.CreationFinishedDate) { - return nil, false - } - return o.CreationFinishedDate, true +func (o *Instance) GetCreationFinishedDateOk() (ret InstanceGetCreationFinishedDateRetType, ok bool) { + return getInstanceGetCreationFinishedDateAttributeTypeOk(o.CreationFinishedDate) } // HasCreationFinishedDate returns a boolean if a field has been set. func (o *Instance) HasCreationFinishedDate() bool { - if o != nil && !IsNil(o.CreationFinishedDate) { - return true - } - - return false + _, ok := o.GetCreationFinishedDateOk() + return ok } // SetCreationFinishedDate gets a reference to the given string and assigns it to the CreationFinishedDate field. -func (o *Instance) SetCreationFinishedDate(v *string) { - o.CreationFinishedDate = v +func (o *Instance) SetCreationFinishedDate(v InstanceGetCreationFinishedDateRetType) { + setInstanceGetCreationFinishedDateAttributeType(&o.CreationFinishedDate, v) } // GetCreationStartDate returns the CreationStartDate field value -func (o *Instance) GetCreationStartDate() *string { - if o == nil || IsNil(o.CreationStartDate) { - var ret *string - return ret - } - - return o.CreationStartDate +func (o *Instance) GetCreationStartDate() (ret InstanceGetCreationStartDateRetType) { + ret, _ = o.GetCreationStartDateOk() + return ret } // GetCreationStartDateOk returns a tuple with the CreationStartDate field value // and a boolean to check if the value has been set. -func (o *Instance) GetCreationStartDateOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.CreationStartDate, true +func (o *Instance) GetCreationStartDateOk() (ret InstanceGetCreationStartDateRetType, ok bool) { + return getInstanceGetCreationStartDateAttributeTypeOk(o.CreationStartDate) } // SetCreationStartDate sets field value -func (o *Instance) SetCreationStartDate(v *string) { - o.CreationStartDate = v +func (o *Instance) SetCreationStartDate(v InstanceGetCreationStartDateRetType) { + setInstanceGetCreationStartDateAttributeType(&o.CreationStartDate, v) } // GetId returns the Id field value -func (o *Instance) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - - return o.Id +func (o *Instance) GetId() (ret InstanceGetIdRetType) { + 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 *Instance) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *Instance) GetIdOk() (ret InstanceGetIdRetType, ok bool) { + return getInstanceGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *Instance) SetId(v *string) { - o.Id = v +func (o *Instance) SetId(v InstanceGetIdRetType) { + setInstanceGetIdAttributeType(&o.Id, v) } // GetName returns the Name field value -func (o *Instance) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *Instance) GetName() (ret InstanceGetNameRetType) { + 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 *Instance) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *Instance) GetNameOk() (ret InstanceGetNameRetType, ok bool) { + return getInstanceGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *Instance) SetName(v *string) { - o.Name = v +func (o *Instance) SetName(v InstanceGetNameRetType) { + setInstanceGetNameAttributeType(&o.Name, v) } // GetSecretCount returns the SecretCount field value -func (o *Instance) GetSecretCount() *int64 { - if o == nil || IsNil(o.SecretCount) { - var ret *int64 - return ret - } - - return o.SecretCount +func (o *Instance) GetSecretCount() (ret InstanceGetSecretCountRetType) { + ret, _ = o.GetSecretCountOk() + return ret } // GetSecretCountOk returns a tuple with the SecretCount field value // and a boolean to check if the value has been set. -func (o *Instance) GetSecretCountOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.SecretCount, true +func (o *Instance) GetSecretCountOk() (ret InstanceGetSecretCountRetType, ok bool) { + return getInstanceGetSecretCountAttributeTypeOk(o.SecretCount) } // SetSecretCount sets field value -func (o *Instance) SetSecretCount(v *int64) { - o.SecretCount = v +func (o *Instance) SetSecretCount(v InstanceGetSecretCountRetType) { + setInstanceGetSecretCountAttributeType(&o.SecretCount, v) } // GetSecretsEngine returns the SecretsEngine field value -func (o *Instance) GetSecretsEngine() *string { - if o == nil || IsNil(o.SecretsEngine) { - var ret *string - return ret - } - - return o.SecretsEngine +func (o *Instance) GetSecretsEngine() (ret InstanceGetSecretsEngineRetType) { + ret, _ = o.GetSecretsEngineOk() + return ret } // GetSecretsEngineOk returns a tuple with the SecretsEngine field value // and a boolean to check if the value has been set. -func (o *Instance) GetSecretsEngineOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.SecretsEngine, true +func (o *Instance) GetSecretsEngineOk() (ret InstanceGetSecretsEngineRetType, ok bool) { + return getInstanceGetSecretsEngineAttributeTypeOk(o.SecretsEngine) } // SetSecretsEngine sets field value -func (o *Instance) SetSecretsEngine(v *string) { - o.SecretsEngine = v +func (o *Instance) SetSecretsEngine(v InstanceGetSecretsEngineRetType) { + setInstanceGetSecretsEngineAttributeType(&o.SecretsEngine, v) } // GetState returns the State field value -func (o *Instance) GetState() *string { - if o == nil || IsNil(o.State) { - var ret *string - return ret - } - - return o.State +func (o *Instance) GetState() (ret InstanceGetStateRetType) { + ret, _ = o.GetStateOk() + return ret } // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *Instance) GetStateOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.State, true +func (o *Instance) GetStateOk() (ret InstanceGetStateRetType, ok bool) { + return getInstanceGetStateAttributeTypeOk(o.State) } // SetState sets field value -func (o *Instance) SetState(v *string) { - o.State = v +func (o *Instance) SetState(v InstanceGetStateRetType) { + setInstanceGetStateAttributeType(&o.State, v) } // GetUpdateFinishedDate returns the UpdateFinishedDate field value if set, zero value otherwise. -func (o *Instance) GetUpdateFinishedDate() *string { - if o == nil || IsNil(o.UpdateFinishedDate) { - var ret *string - return ret - } - return o.UpdateFinishedDate +func (o *Instance) GetUpdateFinishedDate() (res InstanceGetUpdateFinishedDateRetType) { + res, _ = o.GetUpdateFinishedDateOk() + return } // GetUpdateFinishedDateOk returns a tuple with the UpdateFinishedDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetUpdateFinishedDateOk() (*string, bool) { - if o == nil || IsNil(o.UpdateFinishedDate) { - return nil, false - } - return o.UpdateFinishedDate, true +func (o *Instance) GetUpdateFinishedDateOk() (ret InstanceGetUpdateFinishedDateRetType, ok bool) { + return getInstanceGetUpdateFinishedDateAttributeTypeOk(o.UpdateFinishedDate) } // HasUpdateFinishedDate returns a boolean if a field has been set. func (o *Instance) HasUpdateFinishedDate() bool { - if o != nil && !IsNil(o.UpdateFinishedDate) { - return true - } - - return false + _, ok := o.GetUpdateFinishedDateOk() + return ok } // SetUpdateFinishedDate gets a reference to the given string and assigns it to the UpdateFinishedDate field. -func (o *Instance) SetUpdateFinishedDate(v *string) { - o.UpdateFinishedDate = v +func (o *Instance) SetUpdateFinishedDate(v InstanceGetUpdateFinishedDateRetType) { + setInstanceGetUpdateFinishedDateAttributeType(&o.UpdateFinishedDate, v) } // GetUpdateStartDate returns the UpdateStartDate field value if set, zero value otherwise. -func (o *Instance) GetUpdateStartDate() *string { - if o == nil || IsNil(o.UpdateStartDate) { - var ret *string - return ret - } - return o.UpdateStartDate +func (o *Instance) GetUpdateStartDate() (res InstanceGetUpdateStartDateRetType) { + res, _ = o.GetUpdateStartDateOk() + return } // GetUpdateStartDateOk returns a tuple with the UpdateStartDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetUpdateStartDateOk() (*string, bool) { - if o == nil || IsNil(o.UpdateStartDate) { - return nil, false - } - return o.UpdateStartDate, true +func (o *Instance) GetUpdateStartDateOk() (ret InstanceGetUpdateStartDateRetType, ok bool) { + return getInstanceGetUpdateStartDateAttributeTypeOk(o.UpdateStartDate) } // HasUpdateStartDate returns a boolean if a field has been set. func (o *Instance) HasUpdateStartDate() bool { - if o != nil && !IsNil(o.UpdateStartDate) { - return true - } - - return false + _, ok := o.GetUpdateStartDateOk() + return ok } // SetUpdateStartDate gets a reference to the given string and assigns it to the UpdateStartDate field. -func (o *Instance) SetUpdateStartDate(v *string) { - o.UpdateStartDate = v +func (o *Instance) SetUpdateStartDate(v InstanceGetUpdateStartDateRetType) { + setInstanceGetUpdateStartDateAttributeType(&o.UpdateStartDate, v) } func (o Instance) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["apiUrl"] = o.ApiUrl - if !IsNil(o.CreationFinishedDate) { - toSerialize["creationFinishedDate"] = o.CreationFinishedDate + if val, ok := getInstanceGetApiUrlAttributeTypeOk(o.ApiUrl); ok { + toSerialize["ApiUrl"] = val + } + if val, ok := getInstanceGetCreationFinishedDateAttributeTypeOk(o.CreationFinishedDate); ok { + toSerialize["CreationFinishedDate"] = val + } + if val, ok := getInstanceGetCreationStartDateAttributeTypeOk(o.CreationStartDate); ok { + toSerialize["CreationStartDate"] = val + } + if val, ok := getInstanceGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getInstanceGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getInstanceGetSecretCountAttributeTypeOk(o.SecretCount); ok { + toSerialize["SecretCount"] = val + } + if val, ok := getInstanceGetSecretsEngineAttributeTypeOk(o.SecretsEngine); ok { + toSerialize["SecretsEngine"] = val + } + if val, ok := getInstanceGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val } - toSerialize["creationStartDate"] = o.CreationStartDate - toSerialize["id"] = o.Id - toSerialize["name"] = o.Name - toSerialize["secretCount"] = o.SecretCount - toSerialize["secretsEngine"] = o.SecretsEngine - toSerialize["state"] = o.State - if !IsNil(o.UpdateFinishedDate) { - toSerialize["updateFinishedDate"] = o.UpdateFinishedDate + if val, ok := getInstanceGetUpdateFinishedDateAttributeTypeOk(o.UpdateFinishedDate); ok { + toSerialize["UpdateFinishedDate"] = val } - if !IsNil(o.UpdateStartDate) { - toSerialize["updateStartDate"] = o.UpdateStartDate + if val, ok := getInstanceGetUpdateStartDateAttributeTypeOk(o.UpdateStartDate); ok { + toSerialize["UpdateStartDate"] = val } return toSerialize, nil } diff --git a/services/secretsmanager/model_list_acls_response.go b/services/secretsmanager/model_list_acls_response.go index 2fd3fb340..d67456b7a 100644 --- a/services/secretsmanager/model_list_acls_response.go +++ b/services/secretsmanager/model_list_acls_response.go @@ -17,10 +17,30 @@ import ( // checks if the ListACLsResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListACLsResponse{} +/* + types and functions for acls +*/ + +// isArray +type ListACLsResponseGetAclsAttributeType = *[]ACL +type ListACLsResponseGetAclsArgType = []ACL +type ListACLsResponseGetAclsRetType = []ACL + +func getListACLsResponseGetAclsAttributeTypeOk(arg ListACLsResponseGetAclsAttributeType) (ret ListACLsResponseGetAclsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListACLsResponseGetAclsAttributeType(arg *ListACLsResponseGetAclsAttributeType, val ListACLsResponseGetAclsRetType) { + *arg = &val +} + // ListACLsResponse struct for ListACLsResponse type ListACLsResponse struct { // REQUIRED - Acls *[]ACL `json:"acls"` + Acls ListACLsResponseGetAclsAttributeType `json:"acls"` } type _ListACLsResponse ListACLsResponse @@ -29,9 +49,9 @@ type _ListACLsResponse ListACLsResponse // 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 NewListACLsResponse(acls *[]ACL) *ListACLsResponse { +func NewListACLsResponse(acls ListACLsResponseGetAclsArgType) *ListACLsResponse { this := ListACLsResponse{} - this.Acls = acls + setListACLsResponseGetAclsAttributeType(&this.Acls, acls) return &this } @@ -44,32 +64,27 @@ func NewListACLsResponseWithDefaults() *ListACLsResponse { } // GetAcls returns the Acls field value -func (o *ListACLsResponse) GetAcls() *[]ACL { - if o == nil || IsNil(o.Acls) { - var ret *[]ACL - return ret - } - - return o.Acls +func (o *ListACLsResponse) GetAcls() (ret ListACLsResponseGetAclsRetType) { + ret, _ = o.GetAclsOk() + return ret } // GetAclsOk returns a tuple with the Acls field value // and a boolean to check if the value has been set. -func (o *ListACLsResponse) GetAclsOk() (*[]ACL, bool) { - if o == nil { - return nil, false - } - return o.Acls, true +func (o *ListACLsResponse) GetAclsOk() (ret ListACLsResponseGetAclsRetType, ok bool) { + return getListACLsResponseGetAclsAttributeTypeOk(o.Acls) } // SetAcls sets field value -func (o *ListACLsResponse) SetAcls(v *[]ACL) { - o.Acls = v +func (o *ListACLsResponse) SetAcls(v ListACLsResponseGetAclsRetType) { + setListACLsResponseGetAclsAttributeType(&o.Acls, v) } func (o ListACLsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["acls"] = o.Acls + if val, ok := getListACLsResponseGetAclsAttributeTypeOk(o.Acls); ok { + toSerialize["Acls"] = val + } return toSerialize, nil } diff --git a/services/secretsmanager/model_list_instances_response.go b/services/secretsmanager/model_list_instances_response.go index d4052304a..a4584b247 100644 --- a/services/secretsmanager/model_list_instances_response.go +++ b/services/secretsmanager/model_list_instances_response.go @@ -17,10 +17,30 @@ import ( // checks if the ListInstancesResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListInstancesResponse{} +/* + types and functions for instances +*/ + +// isArray +type ListInstancesResponseGetInstancesAttributeType = *[]Instance +type ListInstancesResponseGetInstancesArgType = []Instance +type ListInstancesResponseGetInstancesRetType = []Instance + +func getListInstancesResponseGetInstancesAttributeTypeOk(arg ListInstancesResponseGetInstancesAttributeType) (ret ListInstancesResponseGetInstancesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListInstancesResponseGetInstancesAttributeType(arg *ListInstancesResponseGetInstancesAttributeType, val ListInstancesResponseGetInstancesRetType) { + *arg = &val +} + // ListInstancesResponse struct for ListInstancesResponse type ListInstancesResponse struct { // REQUIRED - Instances *[]Instance `json:"instances"` + Instances ListInstancesResponseGetInstancesAttributeType `json:"instances"` } type _ListInstancesResponse ListInstancesResponse @@ -29,9 +49,9 @@ type _ListInstancesResponse ListInstancesResponse // 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 NewListInstancesResponse(instances *[]Instance) *ListInstancesResponse { +func NewListInstancesResponse(instances ListInstancesResponseGetInstancesArgType) *ListInstancesResponse { this := ListInstancesResponse{} - this.Instances = instances + setListInstancesResponseGetInstancesAttributeType(&this.Instances, instances) return &this } @@ -44,32 +64,27 @@ func NewListInstancesResponseWithDefaults() *ListInstancesResponse { } // GetInstances returns the Instances field value -func (o *ListInstancesResponse) GetInstances() *[]Instance { - if o == nil || IsNil(o.Instances) { - var ret *[]Instance - return ret - } - - return o.Instances +func (o *ListInstancesResponse) GetInstances() (ret ListInstancesResponseGetInstancesRetType) { + ret, _ = o.GetInstancesOk() + return ret } // GetInstancesOk returns a tuple with the Instances field value // and a boolean to check if the value has been set. -func (o *ListInstancesResponse) GetInstancesOk() (*[]Instance, bool) { - if o == nil { - return nil, false - } - return o.Instances, true +func (o *ListInstancesResponse) GetInstancesOk() (ret ListInstancesResponseGetInstancesRetType, ok bool) { + return getListInstancesResponseGetInstancesAttributeTypeOk(o.Instances) } // SetInstances sets field value -func (o *ListInstancesResponse) SetInstances(v *[]Instance) { - o.Instances = v +func (o *ListInstancesResponse) SetInstances(v ListInstancesResponseGetInstancesRetType) { + setListInstancesResponseGetInstancesAttributeType(&o.Instances, v) } func (o ListInstancesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["instances"] = o.Instances + if val, ok := getListInstancesResponseGetInstancesAttributeTypeOk(o.Instances); ok { + toSerialize["Instances"] = val + } return toSerialize, nil } diff --git a/services/secretsmanager/model_list_users_response.go b/services/secretsmanager/model_list_users_response.go index e022ee912..8537518f0 100644 --- a/services/secretsmanager/model_list_users_response.go +++ b/services/secretsmanager/model_list_users_response.go @@ -17,10 +17,30 @@ import ( // checks if the ListUsersResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListUsersResponse{} +/* + types and functions for users +*/ + +// isArray +type ListUsersResponseGetUsersAttributeType = *[]User +type ListUsersResponseGetUsersArgType = []User +type ListUsersResponseGetUsersRetType = []User + +func getListUsersResponseGetUsersAttributeTypeOk(arg ListUsersResponseGetUsersAttributeType) (ret ListUsersResponseGetUsersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListUsersResponseGetUsersAttributeType(arg *ListUsersResponseGetUsersAttributeType, val ListUsersResponseGetUsersRetType) { + *arg = &val +} + // ListUsersResponse struct for ListUsersResponse type ListUsersResponse struct { // REQUIRED - Users *[]User `json:"users"` + Users ListUsersResponseGetUsersAttributeType `json:"users"` } type _ListUsersResponse ListUsersResponse @@ -29,9 +49,9 @@ type _ListUsersResponse ListUsersResponse // 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 NewListUsersResponse(users *[]User) *ListUsersResponse { +func NewListUsersResponse(users ListUsersResponseGetUsersArgType) *ListUsersResponse { this := ListUsersResponse{} - this.Users = users + setListUsersResponseGetUsersAttributeType(&this.Users, users) return &this } @@ -44,32 +64,27 @@ func NewListUsersResponseWithDefaults() *ListUsersResponse { } // GetUsers returns the Users field value -func (o *ListUsersResponse) GetUsers() *[]User { - if o == nil || IsNil(o.Users) { - var ret *[]User - return ret - } - - return o.Users +func (o *ListUsersResponse) GetUsers() (ret ListUsersResponseGetUsersRetType) { + ret, _ = o.GetUsersOk() + return ret } // GetUsersOk returns a tuple with the Users field value // and a boolean to check if the value has been set. -func (o *ListUsersResponse) GetUsersOk() (*[]User, bool) { - if o == nil { - return nil, false - } - return o.Users, true +func (o *ListUsersResponse) GetUsersOk() (ret ListUsersResponseGetUsersRetType, ok bool) { + return getListUsersResponseGetUsersAttributeTypeOk(o.Users) } // SetUsers sets field value -func (o *ListUsersResponse) SetUsers(v *[]User) { - o.Users = v +func (o *ListUsersResponse) SetUsers(v ListUsersResponseGetUsersRetType) { + setListUsersResponseGetUsersAttributeType(&o.Users, v) } func (o ListUsersResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["users"] = o.Users + if val, ok := getListUsersResponseGetUsersAttributeTypeOk(o.Users); ok { + toSerialize["Users"] = val + } return toSerialize, nil } diff --git a/services/secretsmanager/model_update_acl_payload.go b/services/secretsmanager/model_update_acl_payload.go index e98d8c8ec..55feefc5f 100644 --- a/services/secretsmanager/model_update_acl_payload.go +++ b/services/secretsmanager/model_update_acl_payload.go @@ -17,11 +17,32 @@ import ( // checks if the UpdateACLPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateACLPayload{} +/* + types and functions for cidr +*/ + +// isNotNullableString +type UpdateACLPayloadGetCidrAttributeType = *string + +func getUpdateACLPayloadGetCidrAttributeTypeOk(arg UpdateACLPayloadGetCidrAttributeType) (ret UpdateACLPayloadGetCidrRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateACLPayloadGetCidrAttributeType(arg *UpdateACLPayloadGetCidrAttributeType, val UpdateACLPayloadGetCidrRetType) { + *arg = &val +} + +type UpdateACLPayloadGetCidrArgType = string +type UpdateACLPayloadGetCidrRetType = string + // UpdateACLPayload struct for UpdateACLPayload type UpdateACLPayload struct { // The given IP/IP Range that is permitted to access. // REQUIRED - Cidr *string `json:"cidr"` + Cidr UpdateACLPayloadGetCidrAttributeType `json:"cidr"` } type _UpdateACLPayload UpdateACLPayload @@ -30,9 +51,9 @@ type _UpdateACLPayload UpdateACLPayload // 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 NewUpdateACLPayload(cidr *string) *UpdateACLPayload { +func NewUpdateACLPayload(cidr UpdateACLPayloadGetCidrArgType) *UpdateACLPayload { this := UpdateACLPayload{} - this.Cidr = cidr + setUpdateACLPayloadGetCidrAttributeType(&this.Cidr, cidr) return &this } @@ -45,32 +66,27 @@ func NewUpdateACLPayloadWithDefaults() *UpdateACLPayload { } // GetCidr returns the Cidr field value -func (o *UpdateACLPayload) GetCidr() *string { - if o == nil || IsNil(o.Cidr) { - var ret *string - return ret - } - - return o.Cidr +func (o *UpdateACLPayload) GetCidr() (ret UpdateACLPayloadGetCidrRetType) { + ret, _ = o.GetCidrOk() + return ret } // GetCidrOk returns a tuple with the Cidr field value // and a boolean to check if the value has been set. -func (o *UpdateACLPayload) GetCidrOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Cidr, true +func (o *UpdateACLPayload) GetCidrOk() (ret UpdateACLPayloadGetCidrRetType, ok bool) { + return getUpdateACLPayloadGetCidrAttributeTypeOk(o.Cidr) } // SetCidr sets field value -func (o *UpdateACLPayload) SetCidr(v *string) { - o.Cidr = v +func (o *UpdateACLPayload) SetCidr(v UpdateACLPayloadGetCidrRetType) { + setUpdateACLPayloadGetCidrAttributeType(&o.Cidr, v) } func (o UpdateACLPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["cidr"] = o.Cidr + if val, ok := getUpdateACLPayloadGetCidrAttributeTypeOk(o.Cidr); ok { + toSerialize["Cidr"] = val + } return toSerialize, nil } diff --git a/services/secretsmanager/model_update_acls_payload.go b/services/secretsmanager/model_update_acls_payload.go index 75a4ecb7e..8fba9279f 100644 --- a/services/secretsmanager/model_update_acls_payload.go +++ b/services/secretsmanager/model_update_acls_payload.go @@ -17,9 +17,29 @@ import ( // checks if the UpdateACLsPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateACLsPayload{} +/* + types and functions for cidrs +*/ + +// isArray +type UpdateACLsPayloadGetCidrsAttributeType = *[]UpdateACLPayload +type UpdateACLsPayloadGetCidrsArgType = []UpdateACLPayload +type UpdateACLsPayloadGetCidrsRetType = []UpdateACLPayload + +func getUpdateACLsPayloadGetCidrsAttributeTypeOk(arg UpdateACLsPayloadGetCidrsAttributeType) (ret UpdateACLsPayloadGetCidrsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateACLsPayloadGetCidrsAttributeType(arg *UpdateACLsPayloadGetCidrsAttributeType, val UpdateACLsPayloadGetCidrsRetType) { + *arg = &val +} + // UpdateACLsPayload struct for UpdateACLsPayload type UpdateACLsPayload struct { - Cidrs *[]UpdateACLPayload `json:"cidrs,omitempty"` + Cidrs UpdateACLsPayloadGetCidrsAttributeType `json:"cidrs,omitempty"` } // NewUpdateACLsPayload instantiates a new UpdateACLsPayload object @@ -40,41 +60,32 @@ func NewUpdateACLsPayloadWithDefaults() *UpdateACLsPayload { } // GetCidrs returns the Cidrs field value if set, zero value otherwise. -func (o *UpdateACLsPayload) GetCidrs() *[]UpdateACLPayload { - if o == nil || IsNil(o.Cidrs) { - var ret *[]UpdateACLPayload - return ret - } - return o.Cidrs +func (o *UpdateACLsPayload) GetCidrs() (res UpdateACLsPayloadGetCidrsRetType) { + res, _ = o.GetCidrsOk() + return } // GetCidrsOk returns a tuple with the Cidrs field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateACLsPayload) GetCidrsOk() (*[]UpdateACLPayload, bool) { - if o == nil || IsNil(o.Cidrs) { - return nil, false - } - return o.Cidrs, true +func (o *UpdateACLsPayload) GetCidrsOk() (ret UpdateACLsPayloadGetCidrsRetType, ok bool) { + return getUpdateACLsPayloadGetCidrsAttributeTypeOk(o.Cidrs) } // HasCidrs returns a boolean if a field has been set. func (o *UpdateACLsPayload) HasCidrs() bool { - if o != nil && !IsNil(o.Cidrs) { - return true - } - - return false + _, ok := o.GetCidrsOk() + return ok } // SetCidrs gets a reference to the given []UpdateACLPayload and assigns it to the Cidrs field. -func (o *UpdateACLsPayload) SetCidrs(v *[]UpdateACLPayload) { - o.Cidrs = v +func (o *UpdateACLsPayload) SetCidrs(v UpdateACLsPayloadGetCidrsRetType) { + setUpdateACLsPayloadGetCidrsAttributeType(&o.Cidrs, v) } func (o UpdateACLsPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Cidrs) { - toSerialize["cidrs"] = o.Cidrs + if val, ok := getUpdateACLsPayloadGetCidrsAttributeTypeOk(o.Cidrs); ok { + toSerialize["Cidrs"] = val } return toSerialize, nil } diff --git a/services/secretsmanager/model_update_instance_payload.go b/services/secretsmanager/model_update_instance_payload.go index 8308eeb10..097ca3aac 100644 --- a/services/secretsmanager/model_update_instance_payload.go +++ b/services/secretsmanager/model_update_instance_payload.go @@ -17,11 +17,32 @@ import ( // checks if the UpdateInstancePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateInstancePayload{} +/* + types and functions for name +*/ + +// isNotNullableString +type UpdateInstancePayloadGetNameAttributeType = *string + +func getUpdateInstancePayloadGetNameAttributeTypeOk(arg UpdateInstancePayloadGetNameAttributeType) (ret UpdateInstancePayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateInstancePayloadGetNameAttributeType(arg *UpdateInstancePayloadGetNameAttributeType, val UpdateInstancePayloadGetNameRetType) { + *arg = &val +} + +type UpdateInstancePayloadGetNameArgType = string +type UpdateInstancePayloadGetNameRetType = string + // UpdateInstancePayload struct for UpdateInstancePayload type UpdateInstancePayload struct { // A user chosen name to distinguish multiple secrets manager instances. // REQUIRED - Name *string `json:"name"` + Name UpdateInstancePayloadGetNameAttributeType `json:"name"` } type _UpdateInstancePayload UpdateInstancePayload @@ -30,9 +51,9 @@ type _UpdateInstancePayload UpdateInstancePayload // 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 NewUpdateInstancePayload(name *string) *UpdateInstancePayload { +func NewUpdateInstancePayload(name UpdateInstancePayloadGetNameArgType) *UpdateInstancePayload { this := UpdateInstancePayload{} - this.Name = name + setUpdateInstancePayloadGetNameAttributeType(&this.Name, name) return &this } @@ -45,32 +66,27 @@ func NewUpdateInstancePayloadWithDefaults() *UpdateInstancePayload { } // GetName returns the Name field value -func (o *UpdateInstancePayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *UpdateInstancePayload) GetName() (ret UpdateInstancePayloadGetNameRetType) { + 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 *UpdateInstancePayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *UpdateInstancePayload) GetNameOk() (ret UpdateInstancePayloadGetNameRetType, ok bool) { + return getUpdateInstancePayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *UpdateInstancePayload) SetName(v *string) { - o.Name = v +func (o *UpdateInstancePayload) SetName(v UpdateInstancePayloadGetNameRetType) { + setUpdateInstancePayloadGetNameAttributeType(&o.Name, v) } func (o UpdateInstancePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["name"] = o.Name + if val, ok := getUpdateInstancePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } return toSerialize, nil } diff --git a/services/secretsmanager/model_update_user_payload.go b/services/secretsmanager/model_update_user_payload.go index 4028bfa17..e386efe8c 100644 --- a/services/secretsmanager/model_update_user_payload.go +++ b/services/secretsmanager/model_update_user_payload.go @@ -17,10 +17,30 @@ import ( // checks if the UpdateUserPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateUserPayload{} +/* + types and functions for write +*/ + +// isBoolean +type UpdateUserPayloadgetWriteAttributeType = *bool +type UpdateUserPayloadgetWriteArgType = bool +type UpdateUserPayloadgetWriteRetType = bool + +func getUpdateUserPayloadgetWriteAttributeTypeOk(arg UpdateUserPayloadgetWriteAttributeType) (ret UpdateUserPayloadgetWriteRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateUserPayloadgetWriteAttributeType(arg *UpdateUserPayloadgetWriteAttributeType, val UpdateUserPayloadgetWriteRetType) { + *arg = &val +} + // UpdateUserPayload struct for UpdateUserPayload type UpdateUserPayload struct { // Is true if the user has write access to the secrets engine. Is false for a read-only user. - Write *bool `json:"write,omitempty"` + Write UpdateUserPayloadgetWriteAttributeType `json:"write,omitempty"` } // NewUpdateUserPayload instantiates a new UpdateUserPayload object @@ -41,41 +61,32 @@ func NewUpdateUserPayloadWithDefaults() *UpdateUserPayload { } // GetWrite returns the Write field value if set, zero value otherwise. -func (o *UpdateUserPayload) GetWrite() *bool { - if o == nil || IsNil(o.Write) { - var ret *bool - return ret - } - return o.Write +func (o *UpdateUserPayload) GetWrite() (res UpdateUserPayloadgetWriteRetType) { + res, _ = o.GetWriteOk() + return } // GetWriteOk returns a tuple with the Write field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateUserPayload) GetWriteOk() (*bool, bool) { - if o == nil || IsNil(o.Write) { - return nil, false - } - return o.Write, true +func (o *UpdateUserPayload) GetWriteOk() (ret UpdateUserPayloadgetWriteRetType, ok bool) { + return getUpdateUserPayloadgetWriteAttributeTypeOk(o.Write) } // HasWrite returns a boolean if a field has been set. func (o *UpdateUserPayload) HasWrite() bool { - if o != nil && !IsNil(o.Write) { - return true - } - - return false + _, ok := o.GetWriteOk() + return ok } // SetWrite gets a reference to the given bool and assigns it to the Write field. -func (o *UpdateUserPayload) SetWrite(v *bool) { - o.Write = v +func (o *UpdateUserPayload) SetWrite(v UpdateUserPayloadgetWriteRetType) { + setUpdateUserPayloadgetWriteAttributeType(&o.Write, v) } func (o UpdateUserPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Write) { - toSerialize["write"] = o.Write + if val, ok := getUpdateUserPayloadgetWriteAttributeTypeOk(o.Write); ok { + toSerialize["Write"] = val } return toSerialize, nil } diff --git a/services/secretsmanager/model_user.go b/services/secretsmanager/model_user.go index 2c1d00413..4257015de 100644 --- a/services/secretsmanager/model_user.go +++ b/services/secretsmanager/model_user.go @@ -17,23 +17,127 @@ import ( // checks if the User type satisfies the MappedNullable interface at compile time var _ MappedNullable = &User{} +/* + types and functions for description +*/ + +// isNotNullableString +type UserGetDescriptionAttributeType = *string + +func getUserGetDescriptionAttributeTypeOk(arg UserGetDescriptionAttributeType) (ret UserGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserGetDescriptionAttributeType(arg *UserGetDescriptionAttributeType, val UserGetDescriptionRetType) { + *arg = &val +} + +type UserGetDescriptionArgType = string +type UserGetDescriptionRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type UserGetIdAttributeType = *string + +func getUserGetIdAttributeTypeOk(arg UserGetIdAttributeType) (ret UserGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserGetIdAttributeType(arg *UserGetIdAttributeType, val UserGetIdRetType) { + *arg = &val +} + +type UserGetIdArgType = string +type UserGetIdRetType = string + +/* + types and functions for password +*/ + +// isNotNullableString +type UserGetPasswordAttributeType = *string + +func getUserGetPasswordAttributeTypeOk(arg UserGetPasswordAttributeType) (ret UserGetPasswordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserGetPasswordAttributeType(arg *UserGetPasswordAttributeType, val UserGetPasswordRetType) { + *arg = &val +} + +type UserGetPasswordArgType = string +type UserGetPasswordRetType = string + +/* + types and functions for username +*/ + +// isNotNullableString +type UserGetUsernameAttributeType = *string + +func getUserGetUsernameAttributeTypeOk(arg UserGetUsernameAttributeType) (ret UserGetUsernameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUserGetUsernameAttributeType(arg *UserGetUsernameAttributeType, val UserGetUsernameRetType) { + *arg = &val +} + +type UserGetUsernameArgType = string +type UserGetUsernameRetType = string + +/* + types and functions for write +*/ + +// isBoolean +type UsergetWriteAttributeType = *bool +type UsergetWriteArgType = bool +type UsergetWriteRetType = bool + +func getUsergetWriteAttributeTypeOk(arg UsergetWriteAttributeType) (ret UsergetWriteRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUsergetWriteAttributeType(arg *UsergetWriteAttributeType, val UsergetWriteRetType) { + *arg = &val +} + // User struct for User type User struct { // A user chosen description to differentiate between multiple users. // REQUIRED - Description *string `json:"description"` + Description UserGetDescriptionAttributeType `json:"description"` // A auto generated unique id which identifies the users. // REQUIRED - Id *string `json:"id"` + Id UserGetIdAttributeType `json:"id"` // A auto generated password for logging in with the user. // REQUIRED - Password *string `json:"password"` + Password UserGetPasswordAttributeType `json:"password"` // A auto generated username for logging in with the user. // REQUIRED - Username *string `json:"username"` + Username UserGetUsernameAttributeType `json:"username"` // Is true if the user has write access to the secrets engine. Is false for a read-only user. // REQUIRED - Write *bool `json:"write"` + Write UsergetWriteAttributeType `json:"write"` } type _User User @@ -42,13 +146,13 @@ type _User User // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewUser(description *string, id *string, password *string, username *string, write *bool) *User { +func NewUser(description UserGetDescriptionArgType, id UserGetIdArgType, password UserGetPasswordArgType, username UserGetUsernameArgType, write UsergetWriteArgType) *User { this := User{} - this.Description = description - this.Id = id - this.Password = password - this.Username = username - this.Write = write + setUserGetDescriptionAttributeType(&this.Description, description) + setUserGetIdAttributeType(&this.Id, id) + setUserGetPasswordAttributeType(&this.Password, password) + setUserGetUsernameAttributeType(&this.Username, username) + setUsergetWriteAttributeType(&this.Write, write) return &this } @@ -61,132 +165,107 @@ func NewUserWithDefaults() *User { } // GetDescription returns the Description field value -func (o *User) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - - return o.Description +func (o *User) GetDescription() (ret UserGetDescriptionRetType) { + ret, _ = o.GetDescriptionOk() + return ret } // GetDescriptionOk returns a tuple with the Description field value // and a boolean to check if the value has been set. -func (o *User) GetDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Description, true +func (o *User) GetDescriptionOk() (ret UserGetDescriptionRetType, ok bool) { + return getUserGetDescriptionAttributeTypeOk(o.Description) } // SetDescription sets field value -func (o *User) SetDescription(v *string) { - o.Description = v +func (o *User) SetDescription(v UserGetDescriptionRetType) { + setUserGetDescriptionAttributeType(&o.Description, v) } // GetId returns the Id field value -func (o *User) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - - return o.Id +func (o *User) GetId() (ret UserGetIdRetType) { + 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 *User) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *User) GetIdOk() (ret UserGetIdRetType, ok bool) { + return getUserGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *User) SetId(v *string) { - o.Id = v +func (o *User) SetId(v UserGetIdRetType) { + setUserGetIdAttributeType(&o.Id, v) } // GetPassword returns the Password field value -func (o *User) GetPassword() *string { - if o == nil || IsNil(o.Password) { - var ret *string - return ret - } - - return o.Password +func (o *User) GetPassword() (ret UserGetPasswordRetType) { + ret, _ = o.GetPasswordOk() + return ret } // GetPasswordOk returns a tuple with the Password field value // and a boolean to check if the value has been set. -func (o *User) GetPasswordOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Password, true +func (o *User) GetPasswordOk() (ret UserGetPasswordRetType, ok bool) { + return getUserGetPasswordAttributeTypeOk(o.Password) } // SetPassword sets field value -func (o *User) SetPassword(v *string) { - o.Password = v +func (o *User) SetPassword(v UserGetPasswordRetType) { + setUserGetPasswordAttributeType(&o.Password, v) } // GetUsername returns the Username field value -func (o *User) GetUsername() *string { - if o == nil || IsNil(o.Username) { - var ret *string - return ret - } - - return o.Username +func (o *User) GetUsername() (ret UserGetUsernameRetType) { + ret, _ = o.GetUsernameOk() + return ret } // GetUsernameOk returns a tuple with the Username field value // and a boolean to check if the value has been set. -func (o *User) GetUsernameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Username, true +func (o *User) GetUsernameOk() (ret UserGetUsernameRetType, ok bool) { + return getUserGetUsernameAttributeTypeOk(o.Username) } // SetUsername sets field value -func (o *User) SetUsername(v *string) { - o.Username = v +func (o *User) SetUsername(v UserGetUsernameRetType) { + setUserGetUsernameAttributeType(&o.Username, v) } // GetWrite returns the Write field value -func (o *User) GetWrite() *bool { - if o == nil || IsNil(o.Write) { - var ret *bool - return ret - } - - return o.Write +func (o *User) GetWrite() (ret UsergetWriteRetType) { + ret, _ = o.GetWriteOk() + return ret } // GetWriteOk returns a tuple with the Write field value // and a boolean to check if the value has been set. -func (o *User) GetWriteOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.Write, true +func (o *User) GetWriteOk() (ret UsergetWriteRetType, ok bool) { + return getUsergetWriteAttributeTypeOk(o.Write) } // SetWrite sets field value -func (o *User) SetWrite(v *bool) { - o.Write = v +func (o *User) SetWrite(v UsergetWriteRetType) { + setUsergetWriteAttributeType(&o.Write, v) } func (o User) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["description"] = o.Description - toSerialize["id"] = o.Id - toSerialize["password"] = o.Password - toSerialize["username"] = o.Username - toSerialize["write"] = o.Write + if val, ok := getUserGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getUserGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getUserGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val + } + if val, ok := getUserGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val + } + if val, ok := getUsergetWriteAttributeTypeOk(o.Write); ok { + toSerialize["Write"] = val + } return toSerialize, nil } diff --git a/services/secretsmanager/utils.go b/services/secretsmanager/utils.go index 16e62e555..278cb1405 100644 --- a/services/secretsmanager/utils.go +++ b/services/secretsmanager/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()