diff --git a/services/secretsmanager/api_default_test.go b/services/secretsmanager/api_default_test.go deleted file mode 100644 index 74cd7fe9c..000000000 --- a/services/secretsmanager/api_default_test.go +++ /dev/null @@ -1,884 +0,0 @@ -/* -STACKIT Secrets Manager API - -Testing DefaultApiService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package secretsmanager - -import ( - "context" - "encoding/json" - "net/http" - "net/http/httptest" - "net/url" - "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) { - _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(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ACL{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for secretsmanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - instanceId := instanceIdValue - createACLPayload := CreateACLPayload{} - - resp, reqErr := apiClient.CreateACL(context.Background(), projectId, instanceId).CreateACLPayload(createACLPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateInstance", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances" - projectIdValue := uuid.NewString() - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Instance{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for secretsmanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - createInstancePayload := CreateInstancePayload{} - - resp, reqErr := apiClient.CreateInstance(context.Background(), projectId).CreateInstancePayload(createInstancePayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService CreateUser", func(t *testing.T) { - _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(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := User{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for secretsmanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - instanceId := instanceIdValue - createUserPayload := CreateUserPayload{} - - resp, reqErr := apiClient.CreateUser(context.Background(), projectId, instanceId).CreateUserPayload(createUserPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService DeleteACL", func(t *testing.T) { - _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(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for secretsmanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - instanceId := instanceIdValue - aclId := aclIdValue - - reqErr := apiClient.DeleteACL(context.Background(), projectId, instanceId, aclId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteInstance", func(t *testing.T) { - _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(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for secretsmanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - instanceId := instanceIdValue - - reqErr := apiClient.DeleteInstance(context.Background(), projectId, instanceId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DeleteUser", func(t *testing.T) { - _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(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for secretsmanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - instanceId := instanceIdValue - userId := userIdValue - - reqErr := apiClient.DeleteUser(context.Background(), projectId, instanceId, userId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService GetACL", func(t *testing.T) { - _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(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ACL{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for secretsmanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - 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 IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetInstance", func(t *testing.T) { - _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(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Instance{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for secretsmanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - instanceId := instanceIdValue - - resp, reqErr := apiClient.GetInstance(context.Background(), projectId, instanceId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService GetUser", func(t *testing.T) { - _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(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := User{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for secretsmanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - 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 IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListACLs", func(t *testing.T) { - _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(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ListACLsResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for secretsmanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - instanceId := instanceIdValue - - resp, reqErr := apiClient.ListACLs(context.Background(), projectId, instanceId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListInstances", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/instances" - projectIdValue := uuid.NewString() - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ListInstancesResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for secretsmanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - - resp, reqErr := apiClient.ListInstances(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListUsers", func(t *testing.T) { - _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(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ListUsersResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for secretsmanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - instanceId := instanceIdValue - - resp, reqErr := apiClient.ListUsers(context.Background(), projectId, instanceId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService UpdateACL", func(t *testing.T) { - _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(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for secretsmanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - instanceId := instanceIdValue - aclId := aclIdValue - updateACLPayload := UpdateACLPayload{} - - reqErr := apiClient.UpdateACL(context.Background(), projectId, instanceId, aclId).UpdateACLPayload(updateACLPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService UpdateACLs", func(t *testing.T) { - _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(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for secretsmanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - instanceId := instanceIdValue - updateACLsPayload := UpdateACLsPayload{} - - reqErr := apiClient.UpdateACLs(context.Background(), projectId, instanceId).UpdateACLsPayload(updateACLsPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService UpdateInstance", func(t *testing.T) { - _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(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for secretsmanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - instanceId := instanceIdValue - updateInstancePayload := UpdateInstancePayload{} - - reqErr := apiClient.UpdateInstance(context.Background(), projectId, instanceId).UpdateInstancePayload(updateInstancePayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService UpdateUser", func(t *testing.T) { - _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(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for secretsmanager_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - instanceId := instanceIdValue - userId := userIdValue - updateUserPayload := UpdateUserPayload{} - - reqErr := apiClient.UpdateUser(context.Background(), projectId, instanceId, userId).UpdateUserPayload(updateUserPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - -} diff --git a/services/secretsmanager/go.mod b/services/secretsmanager/go.mod index f49dd3b7c..2625d5eed 100644 --- a/services/secretsmanager/go.mod +++ b/services/secretsmanager/go.mod @@ -2,9 +2,9 @@ module github.com/stackitcloud/stackit-sdk-go/services/secretsmanager go 1.21 +require github.com/stackitcloud/stackit-sdk-go/core v0.21.1 + require ( - github.com/google/uuid v1.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.21.1 + github.com/golang-jwt/jwt/v5 v5.3.1 // indirect + github.com/google/uuid v1.6.0 // indirect ) - -require github.com/golang-jwt/jwt/v5 v5.3.1 // indirect diff --git a/services/secretsmanager/oas_commit b/services/secretsmanager/oas_commit index 1c4304d8a..47b49289a 100644 --- a/services/secretsmanager/oas_commit +++ b/services/secretsmanager/oas_commit @@ -1 +1 @@ -4ba9d6ffcf1ec61aff0807a261f8c0ca25d266f8 +d7a7113a1117f58b72d89fb9f7ecc3cc9e94c8ad