diff --git a/services/auditlog/api_default_test.go b/services/auditlog/api_default_test.go deleted file mode 100644 index 6262a8483..000000000 --- a/services/auditlog/api_default_test.go +++ /dev/null @@ -1,190 +0,0 @@ -/* -STACKIT Audit Log API - -Testing DefaultApiService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package auditlog - -import ( - "context" - "encoding/json" - "net/http" - "net/http/httptest" - "net/url" - "strings" - "testing" - "time" - - "github.com/google/uuid" - "github.com/stackitcloud/stackit-sdk-go/core/config" -) - -func Test_auditlog_DefaultApiService(t *testing.T) { - - t.Run("Test DefaultApiService ListFolderAuditLogEntries", func(t *testing.T) { - _apiUrlPath := "/v2/folders/{folderId}" - folderIdValue := uuid.NewString() - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"folderId"+"}", url.PathEscape(ParameterValueToString(folderIdValue, "folderId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ListAuditLogEntriesResponse{} - 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 auditlog_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) - } - - folderId := folderIdValue - var startTimeRange time.Time - var endTimeRange time.Time - - resp, reqErr := apiClient.ListFolderAuditLogEntries(context.Background(), folderId).StartTimeRange(startTimeRange).EndTimeRange(endTimeRange).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListOrganizationAuditLogEntries", func(t *testing.T) { - _apiUrlPath := "/v2/organizations/{organizationId}" - organizationIdValue := uuid.NewString() - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ListAuditLogEntriesResponse{} - 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 auditlog_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) - } - - organizationId := organizationIdValue - var startTimeRange time.Time - var endTimeRange time.Time - - resp, reqErr := apiClient.ListOrganizationAuditLogEntries(context.Background(), organizationId).StartTimeRange(startTimeRange).EndTimeRange(endTimeRange).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListProjectAuditLogEntries", func(t *testing.T) { - _apiUrlPath := "/v2/projects/{projectId}" - 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 := ListAuditLogEntriesResponse{} - 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 auditlog_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 - var startTimeRange time.Time - var endTimeRange time.Time - - resp, reqErr := apiClient.ListProjectAuditLogEntries(context.Background(), projectId).StartTimeRange(startTimeRange).EndTimeRange(endTimeRange).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - -} diff --git a/services/auditlog/go.mod b/services/auditlog/go.mod index 3f3461bd4..9905faf29 100644 --- a/services/auditlog/go.mod +++ b/services/auditlog/go.mod @@ -2,9 +2,9 @@ module github.com/stackitcloud/stackit-sdk-go/services/auditlog 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/auditlog/oas_commit b/services/auditlog/oas_commit index 1c4304d8a..588ee296b 100644 --- a/services/auditlog/oas_commit +++ b/services/auditlog/oas_commit @@ -1 +1 @@ -4ba9d6ffcf1ec61aff0807a261f8c0ca25d266f8 +964ac4ce34f0b6417f2496a1d48585c4926dee3a