diff --git a/client/client.go b/client/client.go index 175a57351..cd4d804a1 100644 --- a/client/client.go +++ b/client/client.go @@ -63,12 +63,13 @@ func (c *DatabricksClient) GetOAuthToken(ctx context.Context, authDetails string // Do sends an HTTP request against path. func (c *DatabricksClient) Do(ctx context.Context, method, path string, - headers map[string]string, request, response any, + headers map[string]string, queryParams map[string]any, request, response any, visitors ...func(*http.Request) error) error { opts := []httpclient.DoOption{} for _, v := range visitors { opts = append(opts, httpclient.WithRequestVisitor(v)) } + opts = append(opts, httpclient.WithQueryParameters(queryParams)) opts = append(opts, httpclient.WithRequestHeaders(headers)) opts = append(opts, httpclient.WithRequestData(request)) opts = append(opts, httpclient.WithResponseUnmarshal(response)) diff --git a/client/client_test.go b/client/client_test.go index b701045c4..fb30957c7 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -45,9 +45,11 @@ func TestSimpleRequestFailsURLError(t *testing.T) { require.NoError(t, err) err = c.Do(context.Background(), "GET", "/a/b", map[string]string{ "e": "f", - }, map[string]string{ - "c": "d", - }, nil) + }, + nil, + map[string]string{ + "c": "d", + }, nil) require.EqualError(t, err, `Get "https://some/a/b?c=d": nope`) } @@ -68,9 +70,11 @@ func TestSimpleRequestFailsAPIError(t *testing.T) { require.NoError(t, err) err = c.Do(context.Background(), "GET", "/a/b", map[string]string{ "e": "f", - }, map[string]string{ - "c": "d", - }, nil) + }, + nil, + map[string]string{ + "c": "d", + }, nil) require.EqualError(t, err, "nope") require.ErrorIs(t, err, apierr.ErrInvalidParameterValue) } @@ -117,9 +121,11 @@ func TestETag(t *testing.T) { require.NoError(t, err) err = c.Do(context.Background(), "GET", "/a/b", map[string]string{ "e": "f", - }, map[string]string{ - "c": "d", - }, nil) + }, + nil, + map[string]string{ + "c": "d", + }, nil) details := apierr.GetErrorInfo(err) require.Equal(t, 1, len(details)) errorDetails := details[0] @@ -148,7 +154,7 @@ func TestSimpleRequestSucceeds(t *testing.T) { }) require.NoError(t, err) var resp Dummy - err = c.Do(context.Background(), "POST", "/c", nil, Dummy{1}, &resp) + err = c.Do(context.Background(), "POST", "/c", nil, nil, Dummy{1}, &resp) require.NoError(t, err) require.Equal(t, 2, resp.Foo) } @@ -180,7 +186,7 @@ func TestSimpleRequestRetried(t *testing.T) { }) require.NoError(t, err) var resp Dummy - err = c.Do(context.Background(), "PATCH", "/a", nil, Dummy{1}, &resp) + err = c.Do(context.Background(), "PATCH", "/a", nil, nil, Dummy{1}, &resp) require.NoError(t, err) require.Equal(t, 2, resp.Foo) require.True(t, retried[0], "request was not retried") @@ -203,7 +209,7 @@ func TestSimpleRequestAPIError(t *testing.T) { }), }) require.NoError(t, err) - err = c.Do(context.Background(), "PATCH", "/a", nil, map[string]any{}, nil) + err = c.Do(context.Background(), "PATCH", "/a", nil, nil, map[string]any{}, nil) var aerr *apierr.APIError require.ErrorAs(t, err, &aerr) require.Equal(t, "NOT_FOUND", aerr.ErrorCode) @@ -223,7 +229,7 @@ func TestHttpTransport(t *testing.T) { client, err := New(cfg) require.NoError(t, err) - err = client.Do(context.Background(), "GET", "/a", nil, nil, bytes.Buffer{}) + err = client.Do(context.Background(), "GET", "/a", nil, nil, nil, bytes.Buffer{}) require.NoError(t, err) require.True(t, calledMock) } @@ -249,9 +255,9 @@ func TestDoRemovesDoubleSlashesFromFilesAPI(t *testing.T) { }), }) require.NoError(t, err) - err = c.Do(context.Background(), "GET", "/api/2.0/fs/files//Volumes/abc/def/ghi", nil, map[string]any{}, nil) + err = c.Do(context.Background(), "GET", "/api/2.0/fs/files//Volumes/abc/def/ghi", nil, nil, map[string]any{}, nil) require.NoError(t, err) - err = c.Do(context.Background(), "GET", "/api/2.0/anotherservice//test", nil, map[string]any{}, nil) + err = c.Do(context.Background(), "GET", "/api/2.0/anotherservice//test", nil, nil, map[string]any{}, nil) require.NoError(t, err) } @@ -340,7 +346,7 @@ func captureUserAgent(t *testing.T) string { }) require.NoError(t, err) - err = c.Do(context.Background(), "GET", "/a", nil, nil, nil) + err = c.Do(context.Background(), "GET", "/a", nil, nil, nil, nil) require.NoError(t, err) return userAgent @@ -450,7 +456,7 @@ func testNonJSONResponseIncludedInError(t *testing.T, statusCode int, status, er }) require.NoError(t, err) var m map[string]string - err = c.Do(context.Background(), "GET", "/a", nil, nil, &m) + err = c.Do(context.Background(), "GET", "/a", nil, nil, nil, &m) require.EqualError(t, err, errorMessage) } @@ -477,6 +483,6 @@ func TestRetryOn503(t *testing.T) { }), }) require.NoError(t, err) - err = c.Do(context.Background(), "GET", "/a/b", nil, map[string]any{}, nil) + err = c.Do(context.Background(), "GET", "/a/b", nil, nil, map[string]any{}, nil) require.NoError(t, err) } diff --git a/httpclient/api_client.go b/httpclient/api_client.go index 2130fd3bb..8cfec0a01 100644 --- a/httpclient/api_client.go +++ b/httpclient/api_client.go @@ -111,13 +111,21 @@ type DoOption struct { body any contentType string isAuthOption bool + queryParams map[string]any } // Do sends an HTTP request against path. func (c *ApiClient) Do(ctx context.Context, method, path string, opts ...DoOption) error { var authVisitor RequestVisitor + var explicitQueryParams map[string]any visitors := c.config.Visitors[:] for _, o := range opts { + if o.queryParams != nil { + if explicitQueryParams != nil { + return fmt.Errorf("only one set of query params is allowed") + } + explicitQueryParams = o.queryParams + } if o.in == nil { continue } @@ -150,7 +158,7 @@ func (c *ApiClient) Do(ctx context.Context, method, path string, opts ...DoOptio data = o.body contentType = o.contentType } - requestBody, err := makeRequestBody(method, &path, data, contentType) + requestBody, err := makeRequestBody(method, &path, data, contentType, explicitQueryParams) if err != nil { return fmt.Errorf("request marshal: %w", err) } diff --git a/httpclient/api_client_test.go b/httpclient/api_client_test.go index 5e382a565..b1ae3d157 100644 --- a/httpclient/api_client_test.go +++ b/httpclient/api_client_test.go @@ -67,6 +67,23 @@ func TestSimpleRequestFailsURLError(t *testing.T) { require.EqualError(t, err, `Get "/a/b?c=d": nope`) } +func TestQueryParameters(t *testing.T) { + c := NewApiClient(ClientConfig{ + RetryTimeout: 1 * time.Millisecond, + Transport: hc(func(r *http.Request) (*http.Response, error) { + require.Equal(t, "POST", r.Method) + require.Equal(t, "/a/b", r.URL.Path) + require.Equal(t, "c=d", r.URL.RawQuery) + return nil, fmt.Errorf("nope") + }), + }) + err := c.Do(context.Background(), "POST", "/a/b", + WithQueryParameters(map[string]any{ + "c": "d", + })) + require.EqualError(t, err, `Post "/a/b?c=d": nope`) +} + func TestSimpleRequestFailsAPIError(t *testing.T) { c := NewApiClient(ClientConfig{ Transport: hc(func(r *http.Request) (*http.Response, error) { diff --git a/httpclient/request.go b/httpclient/request.go index b8401fe19..ca76ad2ee 100644 --- a/httpclient/request.go +++ b/httpclient/request.go @@ -73,6 +73,18 @@ func WithRequestData(body any) DoOption { } } +// WithQueryParameters takes a map and sends it as query string for non GET/DELETE/HEAD calls. +// This is ignored for GET/DELETE/HEAD calls, as the query parameters are serialized from the body instead. +// +// Experimental: this method may eventually be split into more granular options. +func WithQueryParameters(queryParams map[string]any) DoOption { + // refactor this, so that we split JSON/query string serialization and make + // separate request visitors internally. + return DoOption{ + queryParams: queryParams, + } +} + // WithUrlEncodedData takes either a struct instance, map, string, bytes, or io.Reader plus // a content type, and sends it either as query string for GET and DELETE calls, or as request body // for POST, PUT, and PATCH calls. The content type is set to "application/x-www-form-urlencoded" @@ -148,24 +160,41 @@ func EncodeMultiSegmentPathParameter(p string) string { return b.String() } -func makeRequestBody(method string, requestURL *string, data interface{}, contentType string) (common.RequestBody, error) { - if data == nil { +// We used to not send any query parameters for non GET/DELETE/HEAD requests. +// Moreover, serialization for query paramters in GET/DELETE/HEAD requests depends on the `url` tag. +// This tag is wrongly generated and fixing it will have an unknown inpact on the SDK. +// So: +// * GET/DELETE/HEAD requests are sent with query parameters serialized from data using the `url` tag as before (no change). +// * The rest of the requests are sent with query parameters serialized from explicitQueryParams, which does not use the `url` tag. +// TODO: For SDK-Mod, refactor this and remove the `url` tag completely. +func makeRequestBody(method string, requestURL *string, data interface{}, contentType string, explicitQueryParams map[string]any) (common.RequestBody, error) { + if data == nil && len(explicitQueryParams) == 0 { return common.RequestBody{}, nil } - if method == "GET" || method == "DELETE" || method == "HEAD" { - qs, err := makeQueryString(data) - if err != nil { - return common.RequestBody{}, err + if data != nil { + if method == "GET" || method == "DELETE" || method == "HEAD" { + qs, err := makeQueryString(data) + if err != nil { + return common.RequestBody{}, err + } + *requestURL += "?" + qs + return common.NewRequestBody([]byte{}) + } + if contentType == UrlEncodedContentType { + qs, err := makeQueryString(data) + if err != nil { + return common.RequestBody{}, err + } + return common.NewRequestBody(qs) } - *requestURL += "?" + qs - return common.NewRequestBody([]byte{}) } - if contentType == UrlEncodedContentType { - qs, err := makeQueryString(data) + if len(explicitQueryParams) > 0 { + qs, err := makeQueryString(explicitQueryParams) if err != nil { return common.RequestBody{}, err } - return common.NewRequestBody(qs) + *requestURL += "?" + qs + return common.NewRequestBody(data) } return common.NewRequestBody(data) } diff --git a/httpclient/request_test.go b/httpclient/request_test.go index 6b388af53..695875099 100644 --- a/httpclient/request_test.go +++ b/httpclient/request_test.go @@ -20,7 +20,7 @@ func TestMakeRequestBody(t *testing.T) { Scope string `json:"scope" url:"scope"` } requestURL := "/a/b/c" - body, err := makeRequestBody("GET", &requestURL, x{"test"}, "") + body, err := makeRequestBody("GET", &requestURL, x{"test"}, "", nil) require.NoError(t, err) bodyBytes, err := io.ReadAll(body.Reader) require.NoError(t, err) @@ -28,7 +28,7 @@ func TestMakeRequestBody(t *testing.T) { require.Equal(t, 0, len(bodyBytes)) requestURL = "/a/b/c" - body, err = makeRequestBody("POST", &requestURL, x{"test"}, "") + body, err = makeRequestBody("POST", &requestURL, x{"test"}, "", nil) require.NoError(t, err) bodyBytes, err = io.ReadAll(body.Reader) require.NoError(t, err) @@ -37,7 +37,7 @@ func TestMakeRequestBody(t *testing.T) { require.Equal(t, []byte(x1), bodyBytes) requestURL = "/a/b/c" - body, err = makeRequestBody("HEAD", &requestURL, x{"test"}, "") + body, err = makeRequestBody("HEAD", &requestURL, x{"test"}, "", nil) require.NoError(t, err) bodyBytes, err = io.ReadAll(body.Reader) require.NoError(t, err) @@ -47,7 +47,7 @@ func TestMakeRequestBody(t *testing.T) { func TestMakeRequestBodyFromReader(t *testing.T) { requestURL := "/a/b/c" - body, err := makeRequestBody("PUT", &requestURL, strings.NewReader("abc"), "") + body, err := makeRequestBody("PUT", &requestURL, strings.NewReader("abc"), "", nil) require.NoError(t, err) bodyBytes, err := io.ReadAll(body.Reader) require.NoError(t, err) @@ -61,7 +61,7 @@ func TestUrlEncoding(t *testing.T) { GrantType: "grant", } requestURL := "/a/b/c" - body, err := makeRequestBody("POST", &requestURL, data, UrlEncodedContentType) + body, err := makeRequestBody("POST", &requestURL, data, UrlEncodedContentType, nil) require.NoError(t, err) bodyBytes, err := io.ReadAll(body.Reader) require.NoError(t, err) @@ -71,7 +71,7 @@ func TestUrlEncoding(t *testing.T) { func TestMakeRequestBodyReaderError(t *testing.T) { requestURL := "/a/b/c" - _, err := makeRequestBody("POST", &requestURL, errReader(false), "") + _, err := makeRequestBody("POST", &requestURL, errReader(false), "", nil) // The request body is only read once the request is sent, so no error // should be returned until then. require.NoError(t, err, "request body reader error should be ignored") @@ -82,7 +82,7 @@ func TestMakeRequestBodyJsonError(t *testing.T) { type x struct { Foo chan string `json:"foo"` } - _, err := makeRequestBody("POST", &requestURL, x{make(chan string)}, "") + _, err := makeRequestBody("POST", &requestURL, x{make(chan string)}, "", nil) require.EqualError(t, err, "request marshal failure: json: unsupported type: chan string") } @@ -97,13 +97,13 @@ func TestMakeRequestBodyQueryFailingEncode(t *testing.T) { type x struct { Foo failingUrlEncode `url:"foo"` } - _, err := makeRequestBody("GET", &requestURL, x{failingUrlEncode("always failing")}, "") + _, err := makeRequestBody("GET", &requestURL, x{failingUrlEncode("always failing")}, "", nil) require.EqualError(t, err, "cannot create query string: always failing") } func TestMakeRequestBodyQueryUnsupported(t *testing.T) { requestURL := "/a/b/c" - _, err := makeRequestBody("GET", &requestURL, true, "") + _, err := makeRequestBody("GET", &requestURL, true, "", nil) require.EqualError(t, err, "unsupported query string data: true") } @@ -141,3 +141,26 @@ func TestEncodeMultiSegmentPathParameter(t *testing.T) { // # and ? should be encoded. assert.Equal(t, "a%23b%3Fc", EncodeMultiSegmentPathParameter("a#b?c")) } + +func TestMakeRequestBodyExplicitQueryParams(t *testing.T) { + type x struct { + Scope string `json:"scope" url:"scope"` + } + requestURL := "/a/b/c" + // For GET, it should be ignored. + body, err := makeRequestBody("GET", &requestURL, x{"test"}, "", map[string]any{"foo": "bar"}) + require.NoError(t, err) + bodyBytes, err := io.ReadAll(body.Reader) + require.NoError(t, err) + require.Equal(t, "/a/b/c?scope=test", requestURL) + require.Equal(t, 0, len(bodyBytes)) + + requestURL = "/a/b/c" + body, err = makeRequestBody("POST", &requestURL, x{"test"}, "", map[string]any{"foo": "bar"}) + require.NoError(t, err) + bodyBytes, err = io.ReadAll(body.Reader) + require.NoError(t, err) + require.Equal(t, "/a/b/c?foo=bar", requestURL) + x1 := `{"scope":"test"}` + require.Equal(t, []byte(x1), bodyBytes) +} diff --git a/service/apps/impl.go b/service/apps/impl.go index 85cd53555..21121c39d 100755 --- a/service/apps/impl.go +++ b/service/apps/impl.go @@ -18,132 +18,147 @@ type appsImpl struct { func (a *appsImpl) Create(ctx context.Context, request CreateAppRequest) (*App, error) { var app App path := "/api/2.0/apps" + queryParams := make(map[string]any) + queryParams["no_compute"] = request.NoCompute headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request.App, &app) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.App, &app) return &app, err } func (a *appsImpl) Delete(ctx context.Context, request DeleteAppRequest) (*App, error) { var app App path := fmt.Sprintf("/api/2.0/apps/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &app) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &app) return &app, err } func (a *appsImpl) Deploy(ctx context.Context, request CreateAppDeploymentRequest) (*AppDeployment, error) { var appDeployment AppDeployment path := fmt.Sprintf("/api/2.0/apps/%v/deployments", request.AppName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request.AppDeployment, &appDeployment) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.AppDeployment, &appDeployment) return &appDeployment, err } func (a *appsImpl) Get(ctx context.Context, request GetAppRequest) (*App, error) { var app App path := fmt.Sprintf("/api/2.0/apps/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &app) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &app) return &app, err } func (a *appsImpl) GetDeployment(ctx context.Context, request GetAppDeploymentRequest) (*AppDeployment, error) { var appDeployment AppDeployment path := fmt.Sprintf("/api/2.0/apps/%v/deployments/%v", request.AppName, request.DeploymentId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &appDeployment) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &appDeployment) return &appDeployment, err } func (a *appsImpl) GetPermissionLevels(ctx context.Context, request GetAppPermissionLevelsRequest) (*GetAppPermissionLevelsResponse, error) { var getAppPermissionLevelsResponse GetAppPermissionLevelsResponse path := fmt.Sprintf("/api/2.0/permissions/apps/%v/permissionLevels", request.AppName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getAppPermissionLevelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getAppPermissionLevelsResponse) return &getAppPermissionLevelsResponse, err } func (a *appsImpl) GetPermissions(ctx context.Context, request GetAppPermissionsRequest) (*AppPermissions, error) { var appPermissions AppPermissions path := fmt.Sprintf("/api/2.0/permissions/apps/%v", request.AppName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &appPermissions) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &appPermissions) return &appPermissions, err } func (a *appsImpl) List(ctx context.Context, request ListAppsRequest) (*ListAppsResponse, error) { var listAppsResponse ListAppsResponse path := "/api/2.0/apps" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listAppsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAppsResponse) return &listAppsResponse, err } func (a *appsImpl) ListDeployments(ctx context.Context, request ListAppDeploymentsRequest) (*ListAppDeploymentsResponse, error) { var listAppDeploymentsResponse ListAppDeploymentsResponse path := fmt.Sprintf("/api/2.0/apps/%v/deployments", request.AppName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listAppDeploymentsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAppDeploymentsResponse) return &listAppDeploymentsResponse, err } func (a *appsImpl) SetPermissions(ctx context.Context, request AppPermissionsRequest) (*AppPermissions, error) { var appPermissions AppPermissions path := fmt.Sprintf("/api/2.0/permissions/apps/%v", request.AppName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &appPermissions) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &appPermissions) return &appPermissions, err } func (a *appsImpl) Start(ctx context.Context, request StartAppRequest) (*App, error) { var app App path := fmt.Sprintf("/api/2.0/apps/%v/start", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &app) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &app) return &app, err } func (a *appsImpl) Stop(ctx context.Context, request StopAppRequest) (*App, error) { var app App path := fmt.Sprintf("/api/2.0/apps/%v/stop", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &app) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &app) return &app, err } func (a *appsImpl) Update(ctx context.Context, request UpdateAppRequest) (*App, error) { var app App path := fmt.Sprintf("/api/2.0/apps/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request.App, &app) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.App, &app) return &app, err } func (a *appsImpl) UpdatePermissions(ctx context.Context, request AppPermissionsRequest) (*AppPermissions, error) { var appPermissions AppPermissions path := fmt.Sprintf("/api/2.0/permissions/apps/%v", request.AppName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &appPermissions) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &appPermissions) return &appPermissions, err } diff --git a/service/billing/impl.go b/service/billing/impl.go index 373be1aec..85942be54 100755 --- a/service/billing/impl.go +++ b/service/billing/impl.go @@ -18,9 +18,10 @@ type billableUsageImpl struct { func (a *billableUsageImpl) Download(ctx context.Context, request DownloadRequest) (*DownloadResponse, error) { var downloadResponse DownloadResponse path := fmt.Sprintf("/api/2.0/accounts/%v/usage/download", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "text/plain" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &downloadResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &downloadResponse) return &downloadResponse, err } @@ -32,47 +33,52 @@ type budgetsImpl struct { func (a *budgetsImpl) Create(ctx context.Context, request CreateBudgetConfigurationRequest) (*CreateBudgetConfigurationResponse, error) { var createBudgetConfigurationResponse CreateBudgetConfigurationResponse path := fmt.Sprintf("/api/2.1/accounts/%v/budgets", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createBudgetConfigurationResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createBudgetConfigurationResponse) return &createBudgetConfigurationResponse, err } func (a *budgetsImpl) Delete(ctx context.Context, request DeleteBudgetConfigurationRequest) error { var deleteBudgetConfigurationResponse DeleteBudgetConfigurationResponse path := fmt.Sprintf("/api/2.1/accounts/%v/budgets/%v", a.client.ConfiguredAccountID(), request.BudgetId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteBudgetConfigurationResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteBudgetConfigurationResponse) return err } func (a *budgetsImpl) Get(ctx context.Context, request GetBudgetConfigurationRequest) (*GetBudgetConfigurationResponse, error) { var getBudgetConfigurationResponse GetBudgetConfigurationResponse path := fmt.Sprintf("/api/2.1/accounts/%v/budgets/%v", a.client.ConfiguredAccountID(), request.BudgetId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getBudgetConfigurationResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getBudgetConfigurationResponse) return &getBudgetConfigurationResponse, err } func (a *budgetsImpl) List(ctx context.Context, request ListBudgetConfigurationsRequest) (*ListBudgetConfigurationsResponse, error) { var listBudgetConfigurationsResponse ListBudgetConfigurationsResponse path := fmt.Sprintf("/api/2.1/accounts/%v/budgets", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listBudgetConfigurationsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listBudgetConfigurationsResponse) return &listBudgetConfigurationsResponse, err } func (a *budgetsImpl) Update(ctx context.Context, request UpdateBudgetConfigurationRequest) (*UpdateBudgetConfigurationResponse, error) { var updateBudgetConfigurationResponse UpdateBudgetConfigurationResponse path := fmt.Sprintf("/api/2.1/accounts/%v/budgets/%v", a.client.ConfiguredAccountID(), request.BudgetId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateBudgetConfigurationResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateBudgetConfigurationResponse) return &updateBudgetConfigurationResponse, err } @@ -84,38 +90,42 @@ type logDeliveryImpl struct { func (a *logDeliveryImpl) Create(ctx context.Context, request WrappedCreateLogDeliveryConfiguration) (*WrappedLogDeliveryConfiguration, error) { var wrappedLogDeliveryConfiguration WrappedLogDeliveryConfiguration path := fmt.Sprintf("/api/2.0/accounts/%v/log-delivery", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &wrappedLogDeliveryConfiguration) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &wrappedLogDeliveryConfiguration) return &wrappedLogDeliveryConfiguration, err } func (a *logDeliveryImpl) Get(ctx context.Context, request GetLogDeliveryRequest) (*WrappedLogDeliveryConfiguration, error) { var wrappedLogDeliveryConfiguration WrappedLogDeliveryConfiguration path := fmt.Sprintf("/api/2.0/accounts/%v/log-delivery/%v", a.client.ConfiguredAccountID(), request.LogDeliveryConfigurationId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &wrappedLogDeliveryConfiguration) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &wrappedLogDeliveryConfiguration) return &wrappedLogDeliveryConfiguration, err } func (a *logDeliveryImpl) List(ctx context.Context, request ListLogDeliveryRequest) (*WrappedLogDeliveryConfigurations, error) { var wrappedLogDeliveryConfigurations WrappedLogDeliveryConfigurations path := fmt.Sprintf("/api/2.0/accounts/%v/log-delivery", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &wrappedLogDeliveryConfigurations) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &wrappedLogDeliveryConfigurations) return &wrappedLogDeliveryConfigurations, err } func (a *logDeliveryImpl) PatchStatus(ctx context.Context, request UpdateLogDeliveryConfigurationStatusRequest) error { var patchStatusResponse PatchStatusResponse path := fmt.Sprintf("/api/2.0/accounts/%v/log-delivery/%v", a.client.ConfiguredAccountID(), request.LogDeliveryConfigurationId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &patchStatusResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchStatusResponse) return err } @@ -127,18 +137,20 @@ type usageDashboardsImpl struct { func (a *usageDashboardsImpl) Create(ctx context.Context, request CreateBillingUsageDashboardRequest) (*CreateBillingUsageDashboardResponse, error) { var createBillingUsageDashboardResponse CreateBillingUsageDashboardResponse path := fmt.Sprintf("/api/2.0/accounts/%v/dashboard", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createBillingUsageDashboardResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createBillingUsageDashboardResponse) return &createBillingUsageDashboardResponse, err } func (a *usageDashboardsImpl) Get(ctx context.Context, request GetBillingUsageDashboardRequest) (*GetBillingUsageDashboardResponse, error) { var getBillingUsageDashboardResponse GetBillingUsageDashboardResponse path := fmt.Sprintf("/api/2.0/accounts/%v/dashboard", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getBillingUsageDashboardResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getBillingUsageDashboardResponse) return &getBillingUsageDashboardResponse, err } diff --git a/service/catalog/impl.go b/service/catalog/impl.go index 78c34e52d..91e940943 100755 --- a/service/catalog/impl.go +++ b/service/catalog/impl.go @@ -18,47 +18,52 @@ type accountMetastoreAssignmentsImpl struct { func (a *accountMetastoreAssignmentsImpl) Create(ctx context.Context, request AccountsCreateMetastoreAssignment) error { var createResponse CreateResponse path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/metastores/%v", a.client.ConfiguredAccountID(), request.WorkspaceId, request.MetastoreId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createResponse) return err } func (a *accountMetastoreAssignmentsImpl) Delete(ctx context.Context, request DeleteAccountMetastoreAssignmentRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/metastores/%v", a.client.ConfiguredAccountID(), request.WorkspaceId, request.MetastoreId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *accountMetastoreAssignmentsImpl) Get(ctx context.Context, request GetAccountMetastoreAssignmentRequest) (*AccountsMetastoreAssignment, error) { var accountsMetastoreAssignment AccountsMetastoreAssignment path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/metastore", a.client.ConfiguredAccountID(), request.WorkspaceId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &accountsMetastoreAssignment) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &accountsMetastoreAssignment) return &accountsMetastoreAssignment, err } func (a *accountMetastoreAssignmentsImpl) List(ctx context.Context, request ListAccountMetastoreAssignmentsRequest) (*ListAccountMetastoreAssignmentsResponse, error) { var listAccountMetastoreAssignmentsResponse ListAccountMetastoreAssignmentsResponse path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/workspaces", a.client.ConfiguredAccountID(), request.MetastoreId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listAccountMetastoreAssignmentsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAccountMetastoreAssignmentsResponse) return &listAccountMetastoreAssignmentsResponse, err } func (a *accountMetastoreAssignmentsImpl) Update(ctx context.Context, request AccountsUpdateMetastoreAssignment) error { var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/metastores/%v", a.client.ConfiguredAccountID(), request.WorkspaceId, request.MetastoreId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) return err } @@ -70,47 +75,52 @@ type accountMetastoresImpl struct { func (a *accountMetastoresImpl) Create(ctx context.Context, request AccountsCreateMetastore) (*AccountsMetastoreInfo, error) { var accountsMetastoreInfo AccountsMetastoreInfo path := fmt.Sprintf("/api/2.0/accounts/%v/metastores", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &accountsMetastoreInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &accountsMetastoreInfo) return &accountsMetastoreInfo, err } func (a *accountMetastoresImpl) Delete(ctx context.Context, request DeleteAccountMetastoreRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v", a.client.ConfiguredAccountID(), request.MetastoreId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *accountMetastoresImpl) Get(ctx context.Context, request GetAccountMetastoreRequest) (*AccountsMetastoreInfo, error) { var accountsMetastoreInfo AccountsMetastoreInfo path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v", a.client.ConfiguredAccountID(), request.MetastoreId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &accountsMetastoreInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &accountsMetastoreInfo) return &accountsMetastoreInfo, err } func (a *accountMetastoresImpl) List(ctx context.Context) (*ListMetastoresResponse, error) { var listMetastoresResponse ListMetastoresResponse path := fmt.Sprintf("/api/2.0/accounts/%v/metastores", a.client.ConfiguredAccountID()) + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &listMetastoresResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listMetastoresResponse) return &listMetastoresResponse, err } func (a *accountMetastoresImpl) Update(ctx context.Context, request AccountsUpdateMetastore) (*AccountsMetastoreInfo, error) { var accountsMetastoreInfo AccountsMetastoreInfo path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v", a.client.ConfiguredAccountID(), request.MetastoreId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &accountsMetastoreInfo) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &accountsMetastoreInfo) return &accountsMetastoreInfo, err } @@ -122,47 +132,52 @@ type accountStorageCredentialsImpl struct { func (a *accountStorageCredentialsImpl) Create(ctx context.Context, request AccountsCreateStorageCredential) (*AccountsStorageCredentialInfo, error) { var accountsStorageCredentialInfo AccountsStorageCredentialInfo path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/storage-credentials", a.client.ConfiguredAccountID(), request.MetastoreId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &accountsStorageCredentialInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &accountsStorageCredentialInfo) return &accountsStorageCredentialInfo, err } func (a *accountStorageCredentialsImpl) Delete(ctx context.Context, request DeleteAccountStorageCredentialRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/storage-credentials/%v", a.client.ConfiguredAccountID(), request.MetastoreId, request.StorageCredentialName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *accountStorageCredentialsImpl) Get(ctx context.Context, request GetAccountStorageCredentialRequest) (*AccountsStorageCredentialInfo, error) { var accountsStorageCredentialInfo AccountsStorageCredentialInfo path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/storage-credentials/%v", a.client.ConfiguredAccountID(), request.MetastoreId, request.StorageCredentialName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &accountsStorageCredentialInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &accountsStorageCredentialInfo) return &accountsStorageCredentialInfo, err } func (a *accountStorageCredentialsImpl) List(ctx context.Context, request ListAccountStorageCredentialsRequest) (*ListAccountStorageCredentialsResponse, error) { var listAccountStorageCredentialsResponse ListAccountStorageCredentialsResponse path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/storage-credentials", a.client.ConfiguredAccountID(), request.MetastoreId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listAccountStorageCredentialsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAccountStorageCredentialsResponse) return &listAccountStorageCredentialsResponse, err } func (a *accountStorageCredentialsImpl) Update(ctx context.Context, request AccountsUpdateStorageCredential) (*AccountsStorageCredentialInfo, error) { var accountsStorageCredentialInfo AccountsStorageCredentialInfo path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/storage-credentials/%v", a.client.ConfiguredAccountID(), request.MetastoreId, request.StorageCredentialName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &accountsStorageCredentialInfo) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &accountsStorageCredentialInfo) return &accountsStorageCredentialInfo, err } @@ -174,19 +189,21 @@ type artifactAllowlistsImpl struct { func (a *artifactAllowlistsImpl) Get(ctx context.Context, request GetArtifactAllowlistRequest) (*ArtifactAllowlistInfo, error) { var artifactAllowlistInfo ArtifactAllowlistInfo path := fmt.Sprintf("/api/2.1/unity-catalog/artifact-allowlists/%v", request.ArtifactType) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &artifactAllowlistInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &artifactAllowlistInfo) return &artifactAllowlistInfo, err } func (a *artifactAllowlistsImpl) Update(ctx context.Context, request SetArtifactAllowlist) (*ArtifactAllowlistInfo, error) { var artifactAllowlistInfo ArtifactAllowlistInfo path := fmt.Sprintf("/api/2.1/unity-catalog/artifact-allowlists/%v", request.ArtifactType) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &artifactAllowlistInfo) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &artifactAllowlistInfo) return &artifactAllowlistInfo, err } @@ -198,47 +215,52 @@ type catalogsImpl struct { func (a *catalogsImpl) Create(ctx context.Context, request CreateCatalog) (*CatalogInfo, error) { var catalogInfo CatalogInfo path := "/api/2.1/unity-catalog/catalogs" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &catalogInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &catalogInfo) return &catalogInfo, err } func (a *catalogsImpl) Delete(ctx context.Context, request DeleteCatalogRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/catalogs/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *catalogsImpl) Get(ctx context.Context, request GetCatalogRequest) (*CatalogInfo, error) { var catalogInfo CatalogInfo path := fmt.Sprintf("/api/2.1/unity-catalog/catalogs/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &catalogInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &catalogInfo) return &catalogInfo, err } func (a *catalogsImpl) List(ctx context.Context, request ListCatalogsRequest) (*ListCatalogsResponse, error) { var listCatalogsResponse ListCatalogsResponse path := "/api/2.1/unity-catalog/catalogs" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listCatalogsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listCatalogsResponse) return &listCatalogsResponse, err } func (a *catalogsImpl) Update(ctx context.Context, request UpdateCatalog) (*CatalogInfo, error) { var catalogInfo CatalogInfo path := fmt.Sprintf("/api/2.1/unity-catalog/catalogs/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &catalogInfo) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &catalogInfo) return &catalogInfo, err } @@ -250,47 +272,52 @@ type connectionsImpl struct { func (a *connectionsImpl) Create(ctx context.Context, request CreateConnection) (*ConnectionInfo, error) { var connectionInfo ConnectionInfo path := "/api/2.1/unity-catalog/connections" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &connectionInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &connectionInfo) return &connectionInfo, err } func (a *connectionsImpl) Delete(ctx context.Context, request DeleteConnectionRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/connections/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *connectionsImpl) Get(ctx context.Context, request GetConnectionRequest) (*ConnectionInfo, error) { var connectionInfo ConnectionInfo path := fmt.Sprintf("/api/2.1/unity-catalog/connections/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &connectionInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &connectionInfo) return &connectionInfo, err } func (a *connectionsImpl) List(ctx context.Context, request ListConnectionsRequest) (*ListConnectionsResponse, error) { var listConnectionsResponse ListConnectionsResponse path := "/api/2.1/unity-catalog/connections" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listConnectionsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listConnectionsResponse) return &listConnectionsResponse, err } func (a *connectionsImpl) Update(ctx context.Context, request UpdateConnection) (*ConnectionInfo, error) { var connectionInfo ConnectionInfo path := fmt.Sprintf("/api/2.1/unity-catalog/connections/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &connectionInfo) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &connectionInfo) return &connectionInfo, err } @@ -302,67 +329,74 @@ type credentialsImpl struct { func (a *credentialsImpl) CreateCredential(ctx context.Context, request CreateCredentialRequest) (*CredentialInfo, error) { var credentialInfo CredentialInfo path := "/api/2.1/unity-catalog/credentials" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &credentialInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &credentialInfo) return &credentialInfo, err } func (a *credentialsImpl) DeleteCredential(ctx context.Context, request DeleteCredentialRequest) error { var deleteCredentialResponse DeleteCredentialResponse path := fmt.Sprintf("/api/2.1/unity-catalog/credentials/%v", request.NameArg) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteCredentialResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteCredentialResponse) return err } func (a *credentialsImpl) GenerateTemporaryServiceCredential(ctx context.Context, request GenerateTemporaryServiceCredentialRequest) (*TemporaryCredentials, error) { var temporaryCredentials TemporaryCredentials path := "/api/2.1/unity-catalog/temporary-service-credentials" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &temporaryCredentials) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &temporaryCredentials) return &temporaryCredentials, err } func (a *credentialsImpl) GetCredential(ctx context.Context, request GetCredentialRequest) (*CredentialInfo, error) { var credentialInfo CredentialInfo path := fmt.Sprintf("/api/2.1/unity-catalog/credentials/%v", request.NameArg) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &credentialInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &credentialInfo) return &credentialInfo, err } func (a *credentialsImpl) ListCredentials(ctx context.Context, request ListCredentialsRequest) (*ListCredentialsResponse, error) { var listCredentialsResponse ListCredentialsResponse path := "/api/2.1/unity-catalog/credentials" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listCredentialsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listCredentialsResponse) return &listCredentialsResponse, err } func (a *credentialsImpl) UpdateCredential(ctx context.Context, request UpdateCredentialRequest) (*CredentialInfo, error) { var credentialInfo CredentialInfo path := fmt.Sprintf("/api/2.1/unity-catalog/credentials/%v", request.NameArg) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &credentialInfo) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &credentialInfo) return &credentialInfo, err } func (a *credentialsImpl) ValidateCredential(ctx context.Context, request ValidateCredentialRequest) (*ValidateCredentialResponse, error) { var validateCredentialResponse ValidateCredentialResponse path := "/api/2.1/unity-catalog/validate-credentials" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &validateCredentialResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &validateCredentialResponse) return &validateCredentialResponse, err } @@ -374,47 +408,52 @@ type externalLocationsImpl struct { func (a *externalLocationsImpl) Create(ctx context.Context, request CreateExternalLocation) (*ExternalLocationInfo, error) { var externalLocationInfo ExternalLocationInfo path := "/api/2.1/unity-catalog/external-locations" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &externalLocationInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &externalLocationInfo) return &externalLocationInfo, err } func (a *externalLocationsImpl) Delete(ctx context.Context, request DeleteExternalLocationRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/external-locations/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *externalLocationsImpl) Get(ctx context.Context, request GetExternalLocationRequest) (*ExternalLocationInfo, error) { var externalLocationInfo ExternalLocationInfo path := fmt.Sprintf("/api/2.1/unity-catalog/external-locations/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &externalLocationInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &externalLocationInfo) return &externalLocationInfo, err } func (a *externalLocationsImpl) List(ctx context.Context, request ListExternalLocationsRequest) (*ListExternalLocationsResponse, error) { var listExternalLocationsResponse ListExternalLocationsResponse path := "/api/2.1/unity-catalog/external-locations" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listExternalLocationsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listExternalLocationsResponse) return &listExternalLocationsResponse, err } func (a *externalLocationsImpl) Update(ctx context.Context, request UpdateExternalLocation) (*ExternalLocationInfo, error) { var externalLocationInfo ExternalLocationInfo path := fmt.Sprintf("/api/2.1/unity-catalog/external-locations/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &externalLocationInfo) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &externalLocationInfo) return &externalLocationInfo, err } @@ -426,47 +465,52 @@ type functionsImpl struct { func (a *functionsImpl) Create(ctx context.Context, request CreateFunctionRequest) (*FunctionInfo, error) { var functionInfo FunctionInfo path := "/api/2.1/unity-catalog/functions" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &functionInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &functionInfo) return &functionInfo, err } func (a *functionsImpl) Delete(ctx context.Context, request DeleteFunctionRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/functions/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *functionsImpl) Get(ctx context.Context, request GetFunctionRequest) (*FunctionInfo, error) { var functionInfo FunctionInfo path := fmt.Sprintf("/api/2.1/unity-catalog/functions/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &functionInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &functionInfo) return &functionInfo, err } func (a *functionsImpl) List(ctx context.Context, request ListFunctionsRequest) (*ListFunctionsResponse, error) { var listFunctionsResponse ListFunctionsResponse path := "/api/2.1/unity-catalog/functions" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listFunctionsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listFunctionsResponse) return &listFunctionsResponse, err } func (a *functionsImpl) Update(ctx context.Context, request UpdateFunction) (*FunctionInfo, error) { var functionInfo FunctionInfo path := fmt.Sprintf("/api/2.1/unity-catalog/functions/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &functionInfo) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &functionInfo) return &functionInfo, err } @@ -478,28 +522,31 @@ type grantsImpl struct { func (a *grantsImpl) Get(ctx context.Context, request GetGrantRequest) (*PermissionsList, error) { var permissionsList PermissionsList path := fmt.Sprintf("/api/2.1/unity-catalog/permissions/%v/%v", request.SecurableType, request.FullName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &permissionsList) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &permissionsList) return &permissionsList, err } func (a *grantsImpl) GetEffective(ctx context.Context, request GetEffectiveRequest) (*EffectivePermissionsList, error) { var effectivePermissionsList EffectivePermissionsList path := fmt.Sprintf("/api/2.1/unity-catalog/effective-permissions/%v/%v", request.SecurableType, request.FullName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &effectivePermissionsList) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &effectivePermissionsList) return &effectivePermissionsList, err } func (a *grantsImpl) Update(ctx context.Context, request UpdatePermissions) (*PermissionsList, error) { var permissionsList PermissionsList path := fmt.Sprintf("/api/2.1/unity-catalog/permissions/%v/%v", request.SecurableType, request.FullName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &permissionsList) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &permissionsList) return &permissionsList, err } @@ -511,94 +558,104 @@ type metastoresImpl struct { func (a *metastoresImpl) Assign(ctx context.Context, request CreateMetastoreAssignment) error { var assignResponse AssignResponse path := fmt.Sprintf("/api/2.1/unity-catalog/workspaces/%v/metastore", request.WorkspaceId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &assignResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &assignResponse) return err } func (a *metastoresImpl) Create(ctx context.Context, request CreateMetastore) (*MetastoreInfo, error) { var metastoreInfo MetastoreInfo path := "/api/2.1/unity-catalog/metastores" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &metastoreInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &metastoreInfo) return &metastoreInfo, err } func (a *metastoresImpl) Current(ctx context.Context) (*MetastoreAssignment, error) { var metastoreAssignment MetastoreAssignment path := "/api/2.1/unity-catalog/current-metastore-assignment" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &metastoreAssignment) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &metastoreAssignment) return &metastoreAssignment, err } func (a *metastoresImpl) Delete(ctx context.Context, request DeleteMetastoreRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *metastoresImpl) Get(ctx context.Context, request GetMetastoreRequest) (*MetastoreInfo, error) { var metastoreInfo MetastoreInfo path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &metastoreInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &metastoreInfo) return &metastoreInfo, err } func (a *metastoresImpl) List(ctx context.Context) (*ListMetastoresResponse, error) { var listMetastoresResponse ListMetastoresResponse path := "/api/2.1/unity-catalog/metastores" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &listMetastoresResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listMetastoresResponse) return &listMetastoresResponse, err } func (a *metastoresImpl) Summary(ctx context.Context) (*GetMetastoreSummaryResponse, error) { var getMetastoreSummaryResponse GetMetastoreSummaryResponse path := "/api/2.1/unity-catalog/metastore_summary" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &getMetastoreSummaryResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &getMetastoreSummaryResponse) return &getMetastoreSummaryResponse, err } func (a *metastoresImpl) Unassign(ctx context.Context, request UnassignRequest) error { var unassignResponse UnassignResponse path := fmt.Sprintf("/api/2.1/unity-catalog/workspaces/%v/metastore", request.WorkspaceId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &unassignResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &unassignResponse) return err } func (a *metastoresImpl) Update(ctx context.Context, request UpdateMetastore) (*MetastoreInfo, error) { var metastoreInfo MetastoreInfo path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &metastoreInfo) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &metastoreInfo) return &metastoreInfo, err } func (a *metastoresImpl) UpdateAssignment(ctx context.Context, request UpdateMetastoreAssignment) error { var updateAssignmentResponse UpdateAssignmentResponse path := fmt.Sprintf("/api/2.1/unity-catalog/workspaces/%v/metastore", request.WorkspaceId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &updateAssignmentResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateAssignmentResponse) return err } @@ -610,45 +667,50 @@ type modelVersionsImpl struct { func (a *modelVersionsImpl) Delete(ctx context.Context, request DeleteModelVersionRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/versions/%v", request.FullName, request.Version) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *modelVersionsImpl) Get(ctx context.Context, request GetModelVersionRequest) (*ModelVersionInfo, error) { var modelVersionInfo ModelVersionInfo path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/versions/%v", request.FullName, request.Version) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &modelVersionInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &modelVersionInfo) return &modelVersionInfo, err } func (a *modelVersionsImpl) GetByAlias(ctx context.Context, request GetByAliasRequest) (*ModelVersionInfo, error) { var modelVersionInfo ModelVersionInfo path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/aliases/%v", request.FullName, request.Alias) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &modelVersionInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &modelVersionInfo) return &modelVersionInfo, err } func (a *modelVersionsImpl) List(ctx context.Context, request ListModelVersionsRequest) (*ListModelVersionsResponse, error) { var listModelVersionsResponse ListModelVersionsResponse path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/versions", request.FullName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listModelVersionsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listModelVersionsResponse) return &listModelVersionsResponse, err } func (a *modelVersionsImpl) Update(ctx context.Context, request UpdateModelVersionRequest) (*ModelVersionInfo, error) { var modelVersionInfo ModelVersionInfo path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/versions/%v", request.FullName, request.Version) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &modelVersionInfo) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &modelVersionInfo) return &modelVersionInfo, err } @@ -660,28 +722,31 @@ type onlineTablesImpl struct { func (a *onlineTablesImpl) Create(ctx context.Context, request CreateOnlineTableRequest) (*OnlineTable, error) { var onlineTable OnlineTable path := "/api/2.0/online-tables" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request.Table, &onlineTable) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Table, &onlineTable) return &onlineTable, err } func (a *onlineTablesImpl) Delete(ctx context.Context, request DeleteOnlineTableRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/online-tables/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *onlineTablesImpl) Get(ctx context.Context, request GetOnlineTableRequest) (*OnlineTable, error) { var onlineTable OnlineTable path := fmt.Sprintf("/api/2.0/online-tables/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &onlineTable) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &onlineTable) return &onlineTable, err } @@ -693,82 +758,91 @@ type qualityMonitorsImpl struct { func (a *qualityMonitorsImpl) CancelRefresh(ctx context.Context, request CancelRefreshRequest) error { var cancelRefreshResponse CancelRefreshResponse path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes/%v/cancel", request.TableName, request.RefreshId) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodPost, path, headers, nil, &cancelRefreshResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &cancelRefreshResponse) return err } func (a *qualityMonitorsImpl) Create(ctx context.Context, request CreateMonitor) (*MonitorInfo, error) { var monitorInfo MonitorInfo path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.TableName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &monitorInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &monitorInfo) return &monitorInfo, err } func (a *qualityMonitorsImpl) Delete(ctx context.Context, request DeleteQualityMonitorRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.TableName) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *qualityMonitorsImpl) Get(ctx context.Context, request GetQualityMonitorRequest) (*MonitorInfo, error) { var monitorInfo MonitorInfo path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.TableName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &monitorInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &monitorInfo) return &monitorInfo, err } func (a *qualityMonitorsImpl) GetRefresh(ctx context.Context, request GetRefreshRequest) (*MonitorRefreshInfo, error) { var monitorRefreshInfo MonitorRefreshInfo path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes/%v", request.TableName, request.RefreshId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &monitorRefreshInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &monitorRefreshInfo) return &monitorRefreshInfo, err } func (a *qualityMonitorsImpl) ListRefreshes(ctx context.Context, request ListRefreshesRequest) (*MonitorRefreshListResponse, error) { var monitorRefreshListResponse MonitorRefreshListResponse path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes", request.TableName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &monitorRefreshListResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &monitorRefreshListResponse) return &monitorRefreshListResponse, err } func (a *qualityMonitorsImpl) RegenerateDashboard(ctx context.Context, request RegenerateDashboardRequest) (*RegenerateDashboardResponse, error) { var regenerateDashboardResponse RegenerateDashboardResponse path := fmt.Sprintf("/api/2.1/quality-monitoring/tables/%v/monitor/dashboard", request.TableName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, ®enerateDashboardResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, ®enerateDashboardResponse) return ®enerateDashboardResponse, err } func (a *qualityMonitorsImpl) RunRefresh(ctx context.Context, request RunRefreshRequest) (*MonitorRefreshInfo, error) { var monitorRefreshInfo MonitorRefreshInfo path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor/refreshes", request.TableName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, nil, &monitorRefreshInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &monitorRefreshInfo) return &monitorRefreshInfo, err } func (a *qualityMonitorsImpl) Update(ctx context.Context, request UpdateMonitor) (*MonitorInfo, error) { var monitorInfo MonitorInfo path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/monitor", request.TableName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &monitorInfo) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &monitorInfo) return &monitorInfo, err } @@ -780,64 +854,71 @@ type registeredModelsImpl struct { func (a *registeredModelsImpl) Create(ctx context.Context, request CreateRegisteredModelRequest) (*RegisteredModelInfo, error) { var registeredModelInfo RegisteredModelInfo path := "/api/2.1/unity-catalog/models" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, ®isteredModelInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, ®isteredModelInfo) return ®isteredModelInfo, err } func (a *registeredModelsImpl) Delete(ctx context.Context, request DeleteRegisteredModelRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v", request.FullName) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *registeredModelsImpl) DeleteAlias(ctx context.Context, request DeleteAliasRequest) error { var deleteAliasResponse DeleteAliasResponse path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/aliases/%v", request.FullName, request.Alias) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteAliasResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteAliasResponse) return err } func (a *registeredModelsImpl) Get(ctx context.Context, request GetRegisteredModelRequest) (*RegisteredModelInfo, error) { var registeredModelInfo RegisteredModelInfo path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v", request.FullName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, ®isteredModelInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, ®isteredModelInfo) return ®isteredModelInfo, err } func (a *registeredModelsImpl) List(ctx context.Context, request ListRegisteredModelsRequest) (*ListRegisteredModelsResponse, error) { var listRegisteredModelsResponse ListRegisteredModelsResponse path := "/api/2.1/unity-catalog/models" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listRegisteredModelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listRegisteredModelsResponse) return &listRegisteredModelsResponse, err } func (a *registeredModelsImpl) SetAlias(ctx context.Context, request SetRegisteredModelAliasRequest) (*RegisteredModelAlias, error) { var registeredModelAlias RegisteredModelAlias path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v/aliases/%v", request.FullName, request.Alias) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, ®isteredModelAlias) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, ®isteredModelAlias) return ®isteredModelAlias, err } func (a *registeredModelsImpl) Update(ctx context.Context, request UpdateRegisteredModelRequest) (*RegisteredModelInfo, error) { var registeredModelInfo RegisteredModelInfo path := fmt.Sprintf("/api/2.1/unity-catalog/models/%v", request.FullName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, ®isteredModelInfo) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, ®isteredModelInfo) return ®isteredModelInfo, err } @@ -849,18 +930,20 @@ type resourceQuotasImpl struct { func (a *resourceQuotasImpl) GetQuota(ctx context.Context, request GetQuotaRequest) (*GetQuotaResponse, error) { var getQuotaResponse GetQuotaResponse path := fmt.Sprintf("/api/2.1/unity-catalog/resource-quotas/%v/%v/%v", request.ParentSecurableType, request.ParentFullName, request.QuotaName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getQuotaResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getQuotaResponse) return &getQuotaResponse, err } func (a *resourceQuotasImpl) ListQuotas(ctx context.Context, request ListQuotasRequest) (*ListQuotasResponse, error) { var listQuotasResponse ListQuotasResponse path := "/api/2.1/unity-catalog/resource-quotas/all-resource-quotas" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listQuotasResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listQuotasResponse) return &listQuotasResponse, err } @@ -872,47 +955,52 @@ type schemasImpl struct { func (a *schemasImpl) Create(ctx context.Context, request CreateSchema) (*SchemaInfo, error) { var schemaInfo SchemaInfo path := "/api/2.1/unity-catalog/schemas" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &schemaInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &schemaInfo) return &schemaInfo, err } func (a *schemasImpl) Delete(ctx context.Context, request DeleteSchemaRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/schemas/%v", request.FullName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *schemasImpl) Get(ctx context.Context, request GetSchemaRequest) (*SchemaInfo, error) { var schemaInfo SchemaInfo path := fmt.Sprintf("/api/2.1/unity-catalog/schemas/%v", request.FullName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &schemaInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &schemaInfo) return &schemaInfo, err } func (a *schemasImpl) List(ctx context.Context, request ListSchemasRequest) (*ListSchemasResponse, error) { var listSchemasResponse ListSchemasResponse path := "/api/2.1/unity-catalog/schemas" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listSchemasResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listSchemasResponse) return &listSchemasResponse, err } func (a *schemasImpl) Update(ctx context.Context, request UpdateSchema) (*SchemaInfo, error) { var schemaInfo SchemaInfo path := fmt.Sprintf("/api/2.1/unity-catalog/schemas/%v", request.FullName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &schemaInfo) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &schemaInfo) return &schemaInfo, err } @@ -924,57 +1012,63 @@ type storageCredentialsImpl struct { func (a *storageCredentialsImpl) Create(ctx context.Context, request CreateStorageCredential) (*StorageCredentialInfo, error) { var storageCredentialInfo StorageCredentialInfo path := "/api/2.1/unity-catalog/storage-credentials" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &storageCredentialInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &storageCredentialInfo) return &storageCredentialInfo, err } func (a *storageCredentialsImpl) Delete(ctx context.Context, request DeleteStorageCredentialRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/storage-credentials/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *storageCredentialsImpl) Get(ctx context.Context, request GetStorageCredentialRequest) (*StorageCredentialInfo, error) { var storageCredentialInfo StorageCredentialInfo path := fmt.Sprintf("/api/2.1/unity-catalog/storage-credentials/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &storageCredentialInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &storageCredentialInfo) return &storageCredentialInfo, err } func (a *storageCredentialsImpl) List(ctx context.Context, request ListStorageCredentialsRequest) (*ListStorageCredentialsResponse, error) { var listStorageCredentialsResponse ListStorageCredentialsResponse path := "/api/2.1/unity-catalog/storage-credentials" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listStorageCredentialsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listStorageCredentialsResponse) return &listStorageCredentialsResponse, err } func (a *storageCredentialsImpl) Update(ctx context.Context, request UpdateStorageCredential) (*StorageCredentialInfo, error) { var storageCredentialInfo StorageCredentialInfo path := fmt.Sprintf("/api/2.1/unity-catalog/storage-credentials/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &storageCredentialInfo) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &storageCredentialInfo) return &storageCredentialInfo, err } func (a *storageCredentialsImpl) Validate(ctx context.Context, request ValidateStorageCredential) (*ValidateStorageCredentialResponse, error) { var validateStorageCredentialResponse ValidateStorageCredentialResponse path := "/api/2.1/unity-catalog/validate-storage-credentials" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &validateStorageCredentialResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &validateStorageCredentialResponse) return &validateStorageCredentialResponse, err } @@ -986,27 +1080,30 @@ type systemSchemasImpl struct { func (a *systemSchemasImpl) Disable(ctx context.Context, request DisableRequest) error { var disableResponse DisableResponse path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v/systemschemas/%v", request.MetastoreId, request.SchemaName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &disableResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &disableResponse) return err } func (a *systemSchemasImpl) Enable(ctx context.Context, request EnableRequest) error { var enableResponse EnableResponse path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v/systemschemas/%v", request.MetastoreId, request.SchemaName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, nil, &enableResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, nil, &enableResponse) return err } func (a *systemSchemasImpl) List(ctx context.Context, request ListSystemSchemasRequest) (*ListSystemSchemasResponse, error) { var listSystemSchemasResponse ListSystemSchemasResponse path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v/systemschemas", request.MetastoreId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listSystemSchemasResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listSystemSchemasResponse) return &listSystemSchemasResponse, err } @@ -1018,19 +1115,21 @@ type tableConstraintsImpl struct { func (a *tableConstraintsImpl) Create(ctx context.Context, request CreateTableConstraint) (*TableConstraint, error) { var tableConstraint TableConstraint path := "/api/2.1/unity-catalog/constraints" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &tableConstraint) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &tableConstraint) return &tableConstraint, err } func (a *tableConstraintsImpl) Delete(ctx context.Context, request DeleteTableConstraintRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/constraints/%v", request.FullName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } @@ -1042,55 +1141,61 @@ type tablesImpl struct { func (a *tablesImpl) Delete(ctx context.Context, request DeleteTableRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v", request.FullName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *tablesImpl) Exists(ctx context.Context, request ExistsRequest) (*TableExistsResponse, error) { var tableExistsResponse TableExistsResponse path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v/exists", request.FullName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &tableExistsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &tableExistsResponse) return &tableExistsResponse, err } func (a *tablesImpl) Get(ctx context.Context, request GetTableRequest) (*TableInfo, error) { var tableInfo TableInfo path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v", request.FullName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &tableInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &tableInfo) return &tableInfo, err } func (a *tablesImpl) List(ctx context.Context, request ListTablesRequest) (*ListTablesResponse, error) { var listTablesResponse ListTablesResponse path := "/api/2.1/unity-catalog/tables" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listTablesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listTablesResponse) return &listTablesResponse, err } func (a *tablesImpl) ListSummaries(ctx context.Context, request ListSummariesRequest) (*ListTableSummariesResponse, error) { var listTableSummariesResponse ListTableSummariesResponse path := "/api/2.1/unity-catalog/table-summaries" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listTableSummariesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listTableSummariesResponse) return &listTableSummariesResponse, err } func (a *tablesImpl) Update(ctx context.Context, request UpdateTableRequest) error { var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.1/unity-catalog/tables/%v", request.FullName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateResponse) return err } @@ -1102,10 +1207,11 @@ type temporaryTableCredentialsImpl struct { func (a *temporaryTableCredentialsImpl) GenerateTemporaryTableCredentials(ctx context.Context, request GenerateTemporaryTableCredentialRequest) (*GenerateTemporaryTableCredentialResponse, error) { var generateTemporaryTableCredentialResponse GenerateTemporaryTableCredentialResponse path := "/api/2.0/unity-catalog/temporary-table-credentials" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &generateTemporaryTableCredentialResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &generateTemporaryTableCredentialResponse) return &generateTemporaryTableCredentialResponse, err } @@ -1117,46 +1223,51 @@ type volumesImpl struct { func (a *volumesImpl) Create(ctx context.Context, request CreateVolumeRequestContent) (*VolumeInfo, error) { var volumeInfo VolumeInfo path := "/api/2.1/unity-catalog/volumes" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &volumeInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &volumeInfo) return &volumeInfo, err } func (a *volumesImpl) Delete(ctx context.Context, request DeleteVolumeRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/volumes/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *volumesImpl) List(ctx context.Context, request ListVolumesRequest) (*ListVolumesResponseContent, error) { var listVolumesResponseContent ListVolumesResponseContent path := "/api/2.1/unity-catalog/volumes" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listVolumesResponseContent) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listVolumesResponseContent) return &listVolumesResponseContent, err } func (a *volumesImpl) Read(ctx context.Context, request ReadVolumeRequest) (*VolumeInfo, error) { var volumeInfo VolumeInfo path := fmt.Sprintf("/api/2.1/unity-catalog/volumes/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &volumeInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &volumeInfo) return &volumeInfo, err } func (a *volumesImpl) Update(ctx context.Context, request UpdateVolumeRequestContent) (*VolumeInfo, error) { var volumeInfo VolumeInfo path := fmt.Sprintf("/api/2.1/unity-catalog/volumes/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &volumeInfo) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &volumeInfo) return &volumeInfo, err } @@ -1168,37 +1279,41 @@ type workspaceBindingsImpl struct { func (a *workspaceBindingsImpl) Get(ctx context.Context, request GetWorkspaceBindingRequest) (*CurrentWorkspaceBindings, error) { var currentWorkspaceBindings CurrentWorkspaceBindings path := fmt.Sprintf("/api/2.1/unity-catalog/workspace-bindings/catalogs/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, ¤tWorkspaceBindings) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, ¤tWorkspaceBindings) return ¤tWorkspaceBindings, err } func (a *workspaceBindingsImpl) GetBindings(ctx context.Context, request GetBindingsRequest) (*WorkspaceBindingsResponse, error) { var workspaceBindingsResponse WorkspaceBindingsResponse path := fmt.Sprintf("/api/2.1/unity-catalog/bindings/%v/%v", request.SecurableType, request.SecurableName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &workspaceBindingsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &workspaceBindingsResponse) return &workspaceBindingsResponse, err } func (a *workspaceBindingsImpl) Update(ctx context.Context, request UpdateWorkspaceBindings) (*CurrentWorkspaceBindings, error) { var currentWorkspaceBindings CurrentWorkspaceBindings path := fmt.Sprintf("/api/2.1/unity-catalog/workspace-bindings/catalogs/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, ¤tWorkspaceBindings) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, ¤tWorkspaceBindings) return ¤tWorkspaceBindings, err } func (a *workspaceBindingsImpl) UpdateBindings(ctx context.Context, request UpdateWorkspaceBindingsParameters) (*WorkspaceBindingsResponse, error) { var workspaceBindingsResponse WorkspaceBindingsResponse path := fmt.Sprintf("/api/2.1/unity-catalog/bindings/%v/%v", request.SecurableType, request.SecurableName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &workspaceBindingsResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &workspaceBindingsResponse) return &workspaceBindingsResponse, err } diff --git a/service/cleanrooms/impl.go b/service/cleanrooms/impl.go index 50937ebf0..5e47e439a 100755 --- a/service/cleanrooms/impl.go +++ b/service/cleanrooms/impl.go @@ -18,47 +18,52 @@ type cleanRoomAssetsImpl struct { func (a *cleanRoomAssetsImpl) Create(ctx context.Context, request CreateCleanRoomAssetRequest) (*CleanRoomAsset, error) { var cleanRoomAsset CleanRoomAsset path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets", request.CleanRoomName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request.Asset, &cleanRoomAsset) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Asset, &cleanRoomAsset) return &cleanRoomAsset, err } func (a *cleanRoomAssetsImpl) Delete(ctx context.Context, request DeleteCleanRoomAssetRequest) error { var deleteCleanRoomAssetResponse DeleteCleanRoomAssetResponse path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets/%v/%v", request.CleanRoomName, request.AssetType, request.AssetFullName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteCleanRoomAssetResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteCleanRoomAssetResponse) return err } func (a *cleanRoomAssetsImpl) Get(ctx context.Context, request GetCleanRoomAssetRequest) (*CleanRoomAsset, error) { var cleanRoomAsset CleanRoomAsset path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets/%v/%v", request.CleanRoomName, request.AssetType, request.AssetFullName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &cleanRoomAsset) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &cleanRoomAsset) return &cleanRoomAsset, err } func (a *cleanRoomAssetsImpl) List(ctx context.Context, request ListCleanRoomAssetsRequest) (*ListCleanRoomAssetsResponse, error) { var listCleanRoomAssetsResponse ListCleanRoomAssetsResponse path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets", request.CleanRoomName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listCleanRoomAssetsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listCleanRoomAssetsResponse) return &listCleanRoomAssetsResponse, err } func (a *cleanRoomAssetsImpl) Update(ctx context.Context, request UpdateCleanRoomAssetRequest) (*CleanRoomAsset, error) { var cleanRoomAsset CleanRoomAsset path := fmt.Sprintf("/api/2.0/clean-rooms/%v/assets/%v/%v", request.CleanRoomName, request.AssetType, request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request.Asset, &cleanRoomAsset) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.Asset, &cleanRoomAsset) return &cleanRoomAsset, err } @@ -70,9 +75,10 @@ type cleanRoomTaskRunsImpl struct { func (a *cleanRoomTaskRunsImpl) List(ctx context.Context, request ListCleanRoomNotebookTaskRunsRequest) (*ListCleanRoomNotebookTaskRunsResponse, error) { var listCleanRoomNotebookTaskRunsResponse ListCleanRoomNotebookTaskRunsResponse path := fmt.Sprintf("/api/2.0/clean-rooms/%v/runs", request.CleanRoomName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listCleanRoomNotebookTaskRunsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listCleanRoomNotebookTaskRunsResponse) return &listCleanRoomNotebookTaskRunsResponse, err } @@ -84,56 +90,62 @@ type cleanRoomsImpl struct { func (a *cleanRoomsImpl) Create(ctx context.Context, request CreateCleanRoomRequest) (*CleanRoom, error) { var cleanRoom CleanRoom path := "/api/2.0/clean-rooms" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request.CleanRoom, &cleanRoom) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.CleanRoom, &cleanRoom) return &cleanRoom, err } func (a *cleanRoomsImpl) CreateOutputCatalog(ctx context.Context, request CreateCleanRoomOutputCatalogRequest) (*CreateCleanRoomOutputCatalogResponse, error) { var createCleanRoomOutputCatalogResponse CreateCleanRoomOutputCatalogResponse path := fmt.Sprintf("/api/2.0/clean-rooms/%v/output-catalogs", request.CleanRoomName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request.OutputCatalog, &createCleanRoomOutputCatalogResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.OutputCatalog, &createCleanRoomOutputCatalogResponse) return &createCleanRoomOutputCatalogResponse, err } func (a *cleanRoomsImpl) Delete(ctx context.Context, request DeleteCleanRoomRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/clean-rooms/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *cleanRoomsImpl) Get(ctx context.Context, request GetCleanRoomRequest) (*CleanRoom, error) { var cleanRoom CleanRoom path := fmt.Sprintf("/api/2.0/clean-rooms/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &cleanRoom) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &cleanRoom) return &cleanRoom, err } func (a *cleanRoomsImpl) List(ctx context.Context, request ListCleanRoomsRequest) (*ListCleanRoomsResponse, error) { var listCleanRoomsResponse ListCleanRoomsResponse path := "/api/2.0/clean-rooms" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listCleanRoomsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listCleanRoomsResponse) return &listCleanRoomsResponse, err } func (a *cleanRoomsImpl) Update(ctx context.Context, request UpdateCleanRoomRequest) (*CleanRoom, error) { var cleanRoom CleanRoom path := fmt.Sprintf("/api/2.0/clean-rooms/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &cleanRoom) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &cleanRoom) return &cleanRoom, err } diff --git a/service/compute/impl.go b/service/compute/impl.go index abf2c76ff..4b4d7f6bb 100755 --- a/service/compute/impl.go +++ b/service/compute/impl.go @@ -18,86 +18,95 @@ type clusterPoliciesImpl struct { func (a *clusterPoliciesImpl) Create(ctx context.Context, request CreatePolicy) (*CreatePolicyResponse, error) { var createPolicyResponse CreatePolicyResponse path := "/api/2.0/policies/clusters/create" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createPolicyResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createPolicyResponse) return &createPolicyResponse, err } func (a *clusterPoliciesImpl) Delete(ctx context.Context, request DeletePolicy) error { var deletePolicyResponse DeletePolicyResponse path := "/api/2.0/policies/clusters/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &deletePolicyResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deletePolicyResponse) return err } func (a *clusterPoliciesImpl) Edit(ctx context.Context, request EditPolicy) error { var editPolicyResponse EditPolicyResponse path := "/api/2.0/policies/clusters/edit" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &editPolicyResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &editPolicyResponse) return err } func (a *clusterPoliciesImpl) Get(ctx context.Context, request GetClusterPolicyRequest) (*Policy, error) { var policy Policy path := "/api/2.0/policies/clusters/get" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &policy) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &policy) return &policy, err } func (a *clusterPoliciesImpl) GetPermissionLevels(ctx context.Context, request GetClusterPolicyPermissionLevelsRequest) (*GetClusterPolicyPermissionLevelsResponse, error) { var getClusterPolicyPermissionLevelsResponse GetClusterPolicyPermissionLevelsResponse path := fmt.Sprintf("/api/2.0/permissions/cluster-policies/%v/permissionLevels", request.ClusterPolicyId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getClusterPolicyPermissionLevelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getClusterPolicyPermissionLevelsResponse) return &getClusterPolicyPermissionLevelsResponse, err } func (a *clusterPoliciesImpl) GetPermissions(ctx context.Context, request GetClusterPolicyPermissionsRequest) (*ClusterPolicyPermissions, error) { var clusterPolicyPermissions ClusterPolicyPermissions path := fmt.Sprintf("/api/2.0/permissions/cluster-policies/%v", request.ClusterPolicyId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &clusterPolicyPermissions) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &clusterPolicyPermissions) return &clusterPolicyPermissions, err } func (a *clusterPoliciesImpl) List(ctx context.Context, request ListClusterPoliciesRequest) (*ListPoliciesResponse, error) { var listPoliciesResponse ListPoliciesResponse path := "/api/2.0/policies/clusters/list" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listPoliciesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listPoliciesResponse) return &listPoliciesResponse, err } func (a *clusterPoliciesImpl) SetPermissions(ctx context.Context, request ClusterPolicyPermissionsRequest) (*ClusterPolicyPermissions, error) { var clusterPolicyPermissions ClusterPolicyPermissions path := fmt.Sprintf("/api/2.0/permissions/cluster-policies/%v", request.ClusterPolicyId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &clusterPolicyPermissions) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &clusterPolicyPermissions) return &clusterPolicyPermissions, err } func (a *clusterPoliciesImpl) UpdatePermissions(ctx context.Context, request ClusterPolicyPermissionsRequest) (*ClusterPolicyPermissions, error) { var clusterPolicyPermissions ClusterPolicyPermissions path := fmt.Sprintf("/api/2.0/permissions/cluster-policies/%v", request.ClusterPolicyId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &clusterPolicyPermissions) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &clusterPolicyPermissions) return &clusterPolicyPermissions, err } @@ -109,203 +118,224 @@ type clustersImpl struct { func (a *clustersImpl) ChangeOwner(ctx context.Context, request ChangeClusterOwner) error { var changeClusterOwnerResponse ChangeClusterOwnerResponse path := "/api/2.1/clusters/change-owner" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &changeClusterOwnerResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &changeClusterOwnerResponse) return err } func (a *clustersImpl) Create(ctx context.Context, request CreateCluster) (*CreateClusterResponse, error) { var createClusterResponse CreateClusterResponse path := "/api/2.1/clusters/create" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createClusterResponse) return &createClusterResponse, err } func (a *clustersImpl) Delete(ctx context.Context, request DeleteCluster) error { var deleteClusterResponse DeleteClusterResponse path := "/api/2.1/clusters/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &deleteClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteClusterResponse) return err } func (a *clustersImpl) Edit(ctx context.Context, request EditCluster) error { var editClusterResponse EditClusterResponse path := "/api/2.1/clusters/edit" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &editClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &editClusterResponse) return err } func (a *clustersImpl) Events(ctx context.Context, request GetEvents) (*GetEventsResponse, error) { var getEventsResponse GetEventsResponse path := "/api/2.1/clusters/events" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &getEventsResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &getEventsResponse) return &getEventsResponse, err } func (a *clustersImpl) Get(ctx context.Context, request GetClusterRequest) (*ClusterDetails, error) { var clusterDetails ClusterDetails path := "/api/2.1/clusters/get" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &clusterDetails) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &clusterDetails) return &clusterDetails, err } func (a *clustersImpl) GetPermissionLevels(ctx context.Context, request GetClusterPermissionLevelsRequest) (*GetClusterPermissionLevelsResponse, error) { var getClusterPermissionLevelsResponse GetClusterPermissionLevelsResponse path := fmt.Sprintf("/api/2.0/permissions/clusters/%v/permissionLevels", request.ClusterId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getClusterPermissionLevelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getClusterPermissionLevelsResponse) return &getClusterPermissionLevelsResponse, err } func (a *clustersImpl) GetPermissions(ctx context.Context, request GetClusterPermissionsRequest) (*ClusterPermissions, error) { var clusterPermissions ClusterPermissions path := fmt.Sprintf("/api/2.0/permissions/clusters/%v", request.ClusterId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &clusterPermissions) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &clusterPermissions) return &clusterPermissions, err } func (a *clustersImpl) List(ctx context.Context, request ListClustersRequest) (*ListClustersResponse, error) { var listClustersResponse ListClustersResponse path := "/api/2.1/clusters/list" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listClustersResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listClustersResponse) return &listClustersResponse, err } func (a *clustersImpl) ListNodeTypes(ctx context.Context) (*ListNodeTypesResponse, error) { var listNodeTypesResponse ListNodeTypesResponse path := "/api/2.1/clusters/list-node-types" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &listNodeTypesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listNodeTypesResponse) return &listNodeTypesResponse, err } func (a *clustersImpl) ListZones(ctx context.Context) (*ListAvailableZonesResponse, error) { var listAvailableZonesResponse ListAvailableZonesResponse path := "/api/2.1/clusters/list-zones" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &listAvailableZonesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listAvailableZonesResponse) return &listAvailableZonesResponse, err } func (a *clustersImpl) PermanentDelete(ctx context.Context, request PermanentDeleteCluster) error { var permanentDeleteClusterResponse PermanentDeleteClusterResponse path := "/api/2.1/clusters/permanent-delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &permanentDeleteClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &permanentDeleteClusterResponse) return err } func (a *clustersImpl) Pin(ctx context.Context, request PinCluster) error { var pinClusterResponse PinClusterResponse path := "/api/2.1/clusters/pin" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &pinClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &pinClusterResponse) return err } func (a *clustersImpl) Resize(ctx context.Context, request ResizeCluster) error { var resizeClusterResponse ResizeClusterResponse path := "/api/2.1/clusters/resize" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &resizeClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &resizeClusterResponse) return err } func (a *clustersImpl) Restart(ctx context.Context, request RestartCluster) error { var restartClusterResponse RestartClusterResponse path := "/api/2.1/clusters/restart" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &restartClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &restartClusterResponse) return err } func (a *clustersImpl) SetPermissions(ctx context.Context, request ClusterPermissionsRequest) (*ClusterPermissions, error) { var clusterPermissions ClusterPermissions path := fmt.Sprintf("/api/2.0/permissions/clusters/%v", request.ClusterId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &clusterPermissions) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &clusterPermissions) return &clusterPermissions, err } func (a *clustersImpl) SparkVersions(ctx context.Context) (*GetSparkVersionsResponse, error) { var getSparkVersionsResponse GetSparkVersionsResponse path := "/api/2.1/clusters/spark-versions" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &getSparkVersionsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &getSparkVersionsResponse) return &getSparkVersionsResponse, err } func (a *clustersImpl) Start(ctx context.Context, request StartCluster) error { var startClusterResponse StartClusterResponse path := "/api/2.1/clusters/start" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &startClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &startClusterResponse) return err } func (a *clustersImpl) Unpin(ctx context.Context, request UnpinCluster) error { var unpinClusterResponse UnpinClusterResponse path := "/api/2.1/clusters/unpin" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &unpinClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &unpinClusterResponse) return err } func (a *clustersImpl) Update(ctx context.Context, request UpdateCluster) error { var updateClusterResponse UpdateClusterResponse path := "/api/2.1/clusters/update" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &updateClusterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &updateClusterResponse) return err } func (a *clustersImpl) UpdatePermissions(ctx context.Context, request ClusterPermissionsRequest) (*ClusterPermissions, error) { var clusterPermissions ClusterPermissions path := fmt.Sprintf("/api/2.0/permissions/clusters/%v", request.ClusterId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &clusterPermissions) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &clusterPermissions) return &clusterPermissions, err } @@ -317,58 +347,64 @@ type commandExecutionImpl struct { func (a *commandExecutionImpl) Cancel(ctx context.Context, request CancelCommand) error { var cancelResponse CancelResponse path := "/api/1.2/commands/cancel" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &cancelResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &cancelResponse) return err } func (a *commandExecutionImpl) CommandStatus(ctx context.Context, request CommandStatusRequest) (*CommandStatusResponse, error) { var commandStatusResponse CommandStatusResponse path := "/api/1.2/commands/status" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &commandStatusResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &commandStatusResponse) return &commandStatusResponse, err } func (a *commandExecutionImpl) ContextStatus(ctx context.Context, request ContextStatusRequest) (*ContextStatusResponse, error) { var contextStatusResponse ContextStatusResponse path := "/api/1.2/contexts/status" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &contextStatusResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &contextStatusResponse) return &contextStatusResponse, err } func (a *commandExecutionImpl) Create(ctx context.Context, request CreateContext) (*Created, error) { var created Created path := "/api/1.2/contexts/create" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &created) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &created) return &created, err } func (a *commandExecutionImpl) Destroy(ctx context.Context, request DestroyContext) error { var destroyResponse DestroyResponse path := "/api/1.2/contexts/destroy" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &destroyResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &destroyResponse) return err } func (a *commandExecutionImpl) Execute(ctx context.Context, request Command) (*Created, error) { var created Created path := "/api/1.2/commands/execute" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &created) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &created) return &created, err } @@ -380,45 +416,50 @@ type globalInitScriptsImpl struct { func (a *globalInitScriptsImpl) Create(ctx context.Context, request GlobalInitScriptCreateRequest) (*CreateResponse, error) { var createResponse CreateResponse path := "/api/2.0/global-init-scripts" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createResponse) return &createResponse, err } func (a *globalInitScriptsImpl) Delete(ctx context.Context, request DeleteGlobalInitScriptRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/global-init-scripts/%v", request.ScriptId) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *globalInitScriptsImpl) Get(ctx context.Context, request GetGlobalInitScriptRequest) (*GlobalInitScriptDetailsWithContent, error) { var globalInitScriptDetailsWithContent GlobalInitScriptDetailsWithContent path := fmt.Sprintf("/api/2.0/global-init-scripts/%v", request.ScriptId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &globalInitScriptDetailsWithContent) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &globalInitScriptDetailsWithContent) return &globalInitScriptDetailsWithContent, err } func (a *globalInitScriptsImpl) List(ctx context.Context) (*ListGlobalInitScriptsResponse, error) { var listGlobalInitScriptsResponse ListGlobalInitScriptsResponse path := "/api/2.0/global-init-scripts" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &listGlobalInitScriptsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listGlobalInitScriptsResponse) return &listGlobalInitScriptsResponse, err } func (a *globalInitScriptsImpl) Update(ctx context.Context, request GlobalInitScriptUpdateRequest) error { var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/global-init-scripts/%v", request.ScriptId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateResponse) return err } @@ -430,86 +471,95 @@ type instancePoolsImpl struct { func (a *instancePoolsImpl) Create(ctx context.Context, request CreateInstancePool) (*CreateInstancePoolResponse, error) { var createInstancePoolResponse CreateInstancePoolResponse path := "/api/2.0/instance-pools/create" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createInstancePoolResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createInstancePoolResponse) return &createInstancePoolResponse, err } func (a *instancePoolsImpl) Delete(ctx context.Context, request DeleteInstancePool) error { var deleteInstancePoolResponse DeleteInstancePoolResponse path := "/api/2.0/instance-pools/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &deleteInstancePoolResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteInstancePoolResponse) return err } func (a *instancePoolsImpl) Edit(ctx context.Context, request EditInstancePool) error { var editInstancePoolResponse EditInstancePoolResponse path := "/api/2.0/instance-pools/edit" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &editInstancePoolResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &editInstancePoolResponse) return err } func (a *instancePoolsImpl) Get(ctx context.Context, request GetInstancePoolRequest) (*GetInstancePool, error) { var getInstancePool GetInstancePool path := "/api/2.0/instance-pools/get" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getInstancePool) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getInstancePool) return &getInstancePool, err } func (a *instancePoolsImpl) GetPermissionLevels(ctx context.Context, request GetInstancePoolPermissionLevelsRequest) (*GetInstancePoolPermissionLevelsResponse, error) { var getInstancePoolPermissionLevelsResponse GetInstancePoolPermissionLevelsResponse path := fmt.Sprintf("/api/2.0/permissions/instance-pools/%v/permissionLevels", request.InstancePoolId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getInstancePoolPermissionLevelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getInstancePoolPermissionLevelsResponse) return &getInstancePoolPermissionLevelsResponse, err } func (a *instancePoolsImpl) GetPermissions(ctx context.Context, request GetInstancePoolPermissionsRequest) (*InstancePoolPermissions, error) { var instancePoolPermissions InstancePoolPermissions path := fmt.Sprintf("/api/2.0/permissions/instance-pools/%v", request.InstancePoolId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &instancePoolPermissions) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &instancePoolPermissions) return &instancePoolPermissions, err } func (a *instancePoolsImpl) List(ctx context.Context) (*ListInstancePools, error) { var listInstancePools ListInstancePools path := "/api/2.0/instance-pools/list" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &listInstancePools) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listInstancePools) return &listInstancePools, err } func (a *instancePoolsImpl) SetPermissions(ctx context.Context, request InstancePoolPermissionsRequest) (*InstancePoolPermissions, error) { var instancePoolPermissions InstancePoolPermissions path := fmt.Sprintf("/api/2.0/permissions/instance-pools/%v", request.InstancePoolId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &instancePoolPermissions) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &instancePoolPermissions) return &instancePoolPermissions, err } func (a *instancePoolsImpl) UpdatePermissions(ctx context.Context, request InstancePoolPermissionsRequest) (*InstancePoolPermissions, error) { var instancePoolPermissions InstancePoolPermissions path := fmt.Sprintf("/api/2.0/permissions/instance-pools/%v", request.InstancePoolId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &instancePoolPermissions) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &instancePoolPermissions) return &instancePoolPermissions, err } @@ -521,39 +571,43 @@ type instanceProfilesImpl struct { func (a *instanceProfilesImpl) Add(ctx context.Context, request AddInstanceProfile) error { var addResponse AddResponse path := "/api/2.0/instance-profiles/add" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &addResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &addResponse) return err } func (a *instanceProfilesImpl) Edit(ctx context.Context, request InstanceProfile) error { var editResponse EditResponse path := "/api/2.0/instance-profiles/edit" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &editResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &editResponse) return err } func (a *instanceProfilesImpl) List(ctx context.Context) (*ListInstanceProfilesResponse, error) { var listInstanceProfilesResponse ListInstanceProfilesResponse path := "/api/2.0/instance-profiles/list" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &listInstanceProfilesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listInstanceProfilesResponse) return &listInstanceProfilesResponse, err } func (a *instanceProfilesImpl) Remove(ctx context.Context, request RemoveInstanceProfile) error { var removeResponse RemoveResponse path := "/api/2.0/instance-profiles/remove" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &removeResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &removeResponse) return err } @@ -565,38 +619,42 @@ type librariesImpl struct { func (a *librariesImpl) AllClusterStatuses(ctx context.Context) (*ListAllClusterLibraryStatusesResponse, error) { var listAllClusterLibraryStatusesResponse ListAllClusterLibraryStatusesResponse path := "/api/2.0/libraries/all-cluster-statuses" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &listAllClusterLibraryStatusesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listAllClusterLibraryStatusesResponse) return &listAllClusterLibraryStatusesResponse, err } func (a *librariesImpl) ClusterStatus(ctx context.Context, request ClusterStatus) (*ClusterLibraryStatuses, error) { var clusterLibraryStatuses ClusterLibraryStatuses path := "/api/2.0/libraries/cluster-status" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &clusterLibraryStatuses) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &clusterLibraryStatuses) return &clusterLibraryStatuses, err } func (a *librariesImpl) Install(ctx context.Context, request InstallLibraries) error { var installLibrariesResponse InstallLibrariesResponse path := "/api/2.0/libraries/install" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &installLibrariesResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &installLibrariesResponse) return err } func (a *librariesImpl) Uninstall(ctx context.Context, request UninstallLibraries) error { var uninstallLibrariesResponse UninstallLibrariesResponse path := "/api/2.0/libraries/uninstall" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &uninstallLibrariesResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &uninstallLibrariesResponse) return err } @@ -608,28 +666,31 @@ type policyComplianceForClustersImpl struct { func (a *policyComplianceForClustersImpl) EnforceCompliance(ctx context.Context, request EnforceClusterComplianceRequest) (*EnforceClusterComplianceResponse, error) { var enforceClusterComplianceResponse EnforceClusterComplianceResponse path := "/api/2.0/policies/clusters/enforce-compliance" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &enforceClusterComplianceResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &enforceClusterComplianceResponse) return &enforceClusterComplianceResponse, err } func (a *policyComplianceForClustersImpl) GetCompliance(ctx context.Context, request GetClusterComplianceRequest) (*GetClusterComplianceResponse, error) { var getClusterComplianceResponse GetClusterComplianceResponse path := "/api/2.0/policies/clusters/get-compliance" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getClusterComplianceResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getClusterComplianceResponse) return &getClusterComplianceResponse, err } func (a *policyComplianceForClustersImpl) ListCompliance(ctx context.Context, request ListClusterCompliancesRequest) (*ListClusterCompliancesResponse, error) { var listClusterCompliancesResponse ListClusterCompliancesResponse path := "/api/2.0/policies/clusters/list-compliance" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listClusterCompliancesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listClusterCompliancesResponse) return &listClusterCompliancesResponse, err } @@ -641,17 +702,19 @@ type policyFamiliesImpl struct { func (a *policyFamiliesImpl) Get(ctx context.Context, request GetPolicyFamilyRequest) (*PolicyFamily, error) { var policyFamily PolicyFamily path := fmt.Sprintf("/api/2.0/policy-families/%v", request.PolicyFamilyId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &policyFamily) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &policyFamily) return &policyFamily, err } func (a *policyFamiliesImpl) List(ctx context.Context, request ListPolicyFamiliesRequest) (*ListPolicyFamiliesResponse, error) { var listPolicyFamiliesResponse ListPolicyFamiliesResponse path := "/api/2.0/policy-families" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listPolicyFamiliesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listPolicyFamiliesResponse) return &listPolicyFamiliesResponse, err } diff --git a/service/dashboards/impl.go b/service/dashboards/impl.go index babb7fc7c..c23deddd6 100755 --- a/service/dashboards/impl.go +++ b/service/dashboards/impl.go @@ -18,47 +18,52 @@ type genieImpl struct { func (a *genieImpl) CreateMessage(ctx context.Context, request GenieCreateConversationMessageRequest) (*GenieMessage, error) { var genieMessage GenieMessage path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages", request.SpaceId, request.ConversationId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &genieMessage) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &genieMessage) return &genieMessage, err } func (a *genieImpl) ExecuteMessageQuery(ctx context.Context, request GenieExecuteMessageQueryRequest) (*GenieGetMessageQueryResultResponse, error) { var genieGetMessageQueryResultResponse GenieGetMessageQueryResultResponse path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/execute-query", request.SpaceId, request.ConversationId, request.MessageId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, nil, &genieGetMessageQueryResultResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &genieGetMessageQueryResultResponse) return &genieGetMessageQueryResultResponse, err } func (a *genieImpl) GetMessage(ctx context.Context, request GenieGetConversationMessageRequest) (*GenieMessage, error) { var genieMessage GenieMessage path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v", request.SpaceId, request.ConversationId, request.MessageId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &genieMessage) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &genieMessage) return &genieMessage, err } func (a *genieImpl) GetMessageQueryResult(ctx context.Context, request GenieGetMessageQueryResultRequest) (*GenieGetMessageQueryResultResponse, error) { var genieGetMessageQueryResultResponse GenieGetMessageQueryResultResponse path := fmt.Sprintf("/api/2.0/genie/spaces/%v/conversations/%v/messages/%v/query-result", request.SpaceId, request.ConversationId, request.MessageId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &genieGetMessageQueryResultResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &genieGetMessageQueryResultResponse) return &genieGetMessageQueryResultResponse, err } func (a *genieImpl) StartConversation(ctx context.Context, request GenieStartConversationMessageRequest) (*GenieStartConversationResponse, error) { var genieStartConversationResponse GenieStartConversationResponse path := fmt.Sprintf("/api/2.0/genie/spaces/%v/start-conversation", request.SpaceId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &genieStartConversationResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &genieStartConversationResponse) return &genieStartConversationResponse, err } @@ -70,168 +75,186 @@ type lakeviewImpl struct { func (a *lakeviewImpl) Create(ctx context.Context, request CreateDashboardRequest) (*Dashboard, error) { var dashboard Dashboard path := "/api/2.0/lakeview/dashboards" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request.Dashboard, &dashboard) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Dashboard, &dashboard) return &dashboard, err } func (a *lakeviewImpl) CreateSchedule(ctx context.Context, request CreateScheduleRequest) (*Schedule, error) { var schedule Schedule path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules", request.DashboardId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request.Schedule, &schedule) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Schedule, &schedule) return &schedule, err } func (a *lakeviewImpl) CreateSubscription(ctx context.Context, request CreateSubscriptionRequest) (*Subscription, error) { var subscription Subscription path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v/subscriptions", request.DashboardId, request.ScheduleId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request.Subscription, &subscription) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Subscription, &subscription) return &subscription, err } func (a *lakeviewImpl) DeleteSchedule(ctx context.Context, request DeleteScheduleRequest) error { var deleteScheduleResponse DeleteScheduleResponse path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v", request.DashboardId, request.ScheduleId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteScheduleResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteScheduleResponse) return err } func (a *lakeviewImpl) DeleteSubscription(ctx context.Context, request DeleteSubscriptionRequest) error { var deleteSubscriptionResponse DeleteSubscriptionResponse path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v/subscriptions/%v", request.DashboardId, request.ScheduleId, request.SubscriptionId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteSubscriptionResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteSubscriptionResponse) return err } func (a *lakeviewImpl) Get(ctx context.Context, request GetDashboardRequest) (*Dashboard, error) { var dashboard Dashboard path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v", request.DashboardId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &dashboard) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &dashboard) return &dashboard, err } func (a *lakeviewImpl) GetPublished(ctx context.Context, request GetPublishedDashboardRequest) (*PublishedDashboard, error) { var publishedDashboard PublishedDashboard path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published", request.DashboardId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &publishedDashboard) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &publishedDashboard) return &publishedDashboard, err } func (a *lakeviewImpl) GetSchedule(ctx context.Context, request GetScheduleRequest) (*Schedule, error) { var schedule Schedule path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v", request.DashboardId, request.ScheduleId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &schedule) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &schedule) return &schedule, err } func (a *lakeviewImpl) GetSubscription(ctx context.Context, request GetSubscriptionRequest) (*Subscription, error) { var subscription Subscription path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v/subscriptions/%v", request.DashboardId, request.ScheduleId, request.SubscriptionId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &subscription) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &subscription) return &subscription, err } func (a *lakeviewImpl) List(ctx context.Context, request ListDashboardsRequest) (*ListDashboardsResponse, error) { var listDashboardsResponse ListDashboardsResponse path := "/api/2.0/lakeview/dashboards" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listDashboardsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listDashboardsResponse) return &listDashboardsResponse, err } func (a *lakeviewImpl) ListSchedules(ctx context.Context, request ListSchedulesRequest) (*ListSchedulesResponse, error) { var listSchedulesResponse ListSchedulesResponse path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules", request.DashboardId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listSchedulesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listSchedulesResponse) return &listSchedulesResponse, err } func (a *lakeviewImpl) ListSubscriptions(ctx context.Context, request ListSubscriptionsRequest) (*ListSubscriptionsResponse, error) { var listSubscriptionsResponse ListSubscriptionsResponse path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v/subscriptions", request.DashboardId, request.ScheduleId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listSubscriptionsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listSubscriptionsResponse) return &listSubscriptionsResponse, err } func (a *lakeviewImpl) Migrate(ctx context.Context, request MigrateDashboardRequest) (*Dashboard, error) { var dashboard Dashboard path := "/api/2.0/lakeview/dashboards/migrate" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &dashboard) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &dashboard) return &dashboard, err } func (a *lakeviewImpl) Publish(ctx context.Context, request PublishRequest) (*PublishedDashboard, error) { var publishedDashboard PublishedDashboard path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published", request.DashboardId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &publishedDashboard) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &publishedDashboard) return &publishedDashboard, err } func (a *lakeviewImpl) Trash(ctx context.Context, request TrashDashboardRequest) error { var trashDashboardResponse TrashDashboardResponse path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v", request.DashboardId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &trashDashboardResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &trashDashboardResponse) return err } func (a *lakeviewImpl) Unpublish(ctx context.Context, request UnpublishDashboardRequest) error { var unpublishDashboardResponse UnpublishDashboardResponse path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/published", request.DashboardId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &unpublishDashboardResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &unpublishDashboardResponse) return err } func (a *lakeviewImpl) Update(ctx context.Context, request UpdateDashboardRequest) (*Dashboard, error) { var dashboard Dashboard path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v", request.DashboardId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request.Dashboard, &dashboard) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.Dashboard, &dashboard) return &dashboard, err } func (a *lakeviewImpl) UpdateSchedule(ctx context.Context, request UpdateScheduleRequest) (*Schedule, error) { var schedule Schedule path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v", request.DashboardId, request.ScheduleId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request.Schedule, &schedule) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request.Schedule, &schedule) return &schedule, err } diff --git a/service/files/impl.go b/service/files/impl.go index 23b25c450..6e83c42cd 100755 --- a/service/files/impl.go +++ b/service/files/impl.go @@ -19,97 +19,107 @@ type dbfsImpl struct { func (a *dbfsImpl) AddBlock(ctx context.Context, request AddBlock) error { var addBlockResponse AddBlockResponse path := "/api/2.0/dbfs/add-block" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &addBlockResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &addBlockResponse) return err } func (a *dbfsImpl) Close(ctx context.Context, request Close) error { var closeResponse CloseResponse path := "/api/2.0/dbfs/close" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &closeResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &closeResponse) return err } func (a *dbfsImpl) Create(ctx context.Context, request Create) (*CreateResponse, error) { var createResponse CreateResponse path := "/api/2.0/dbfs/create" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createResponse) return &createResponse, err } func (a *dbfsImpl) Delete(ctx context.Context, request Delete) error { var deleteResponse DeleteResponse path := "/api/2.0/dbfs/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteResponse) return err } func (a *dbfsImpl) GetStatus(ctx context.Context, request GetStatusRequest) (*FileInfo, error) { var fileInfo FileInfo path := "/api/2.0/dbfs/get-status" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &fileInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &fileInfo) return &fileInfo, err } func (a *dbfsImpl) List(ctx context.Context, request ListDbfsRequest) (*ListStatusResponse, error) { var listStatusResponse ListStatusResponse path := "/api/2.0/dbfs/list" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listStatusResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listStatusResponse) return &listStatusResponse, err } func (a *dbfsImpl) Mkdirs(ctx context.Context, request MkDirs) error { var mkDirsResponse MkDirsResponse path := "/api/2.0/dbfs/mkdirs" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &mkDirsResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &mkDirsResponse) return err } func (a *dbfsImpl) Move(ctx context.Context, request Move) error { var moveResponse MoveResponse path := "/api/2.0/dbfs/move" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &moveResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &moveResponse) return err } func (a *dbfsImpl) Put(ctx context.Context, request Put) error { var putResponse PutResponse path := "/api/2.0/dbfs/put" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &putResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &putResponse) return err } func (a *dbfsImpl) Read(ctx context.Context, request ReadDbfsRequest) (*ReadResponse, error) { var readResponse ReadResponse path := "/api/2.0/dbfs/read" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &readResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &readResponse) return &readResponse, err } @@ -121,66 +131,75 @@ type filesImpl struct { func (a *filesImpl) CreateDirectory(ctx context.Context, request CreateDirectoryRequest) error { var createDirectoryResponse CreateDirectoryResponse path := fmt.Sprintf("/api/2.0/fs/directories%v", httpclient.EncodeMultiSegmentPathParameter(request.DirectoryPath)) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodPut, path, headers, nil, &createDirectoryResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, nil, &createDirectoryResponse) return err } func (a *filesImpl) Delete(ctx context.Context, request DeleteFileRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/fs/files%v", httpclient.EncodeMultiSegmentPathParameter(request.FilePath)) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *filesImpl) DeleteDirectory(ctx context.Context, request DeleteDirectoryRequest) error { var deleteDirectoryResponse DeleteDirectoryResponse path := fmt.Sprintf("/api/2.0/fs/directories%v", httpclient.EncodeMultiSegmentPathParameter(request.DirectoryPath)) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteDirectoryResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteDirectoryResponse) return err } func (a *filesImpl) Download(ctx context.Context, request DownloadRequest) (*DownloadResponse, error) { var downloadResponse DownloadResponse path := fmt.Sprintf("/api/2.0/fs/files%v", httpclient.EncodeMultiSegmentPathParameter(request.FilePath)) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/octet-stream" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &downloadResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &downloadResponse) return &downloadResponse, err } func (a *filesImpl) GetDirectoryMetadata(ctx context.Context, request GetDirectoryMetadataRequest) error { var getDirectoryMetadataResponse GetDirectoryMetadataResponse path := fmt.Sprintf("/api/2.0/fs/directories%v", httpclient.EncodeMultiSegmentPathParameter(request.DirectoryPath)) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodHead, path, headers, request, &getDirectoryMetadataResponse) + err := a.client.Do(ctx, http.MethodHead, path, headers, queryParams, request, &getDirectoryMetadataResponse) return err } func (a *filesImpl) GetMetadata(ctx context.Context, request GetMetadataRequest) (*GetMetadataResponse, error) { var getMetadataResponse GetMetadataResponse path := fmt.Sprintf("/api/2.0/fs/files%v", httpclient.EncodeMultiSegmentPathParameter(request.FilePath)) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodHead, path, headers, request, &getMetadataResponse) + err := a.client.Do(ctx, http.MethodHead, path, headers, queryParams, request, &getMetadataResponse) return &getMetadataResponse, err } func (a *filesImpl) ListDirectoryContents(ctx context.Context, request ListDirectoryContentsRequest) (*ListDirectoryResponse, error) { var listDirectoryResponse ListDirectoryResponse path := fmt.Sprintf("/api/2.0/fs/directories%v", httpclient.EncodeMultiSegmentPathParameter(request.DirectoryPath)) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listDirectoryResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listDirectoryResponse) return &listDirectoryResponse, err } func (a *filesImpl) Upload(ctx context.Context, request UploadRequest) error { var uploadResponse UploadResponse path := fmt.Sprintf("/api/2.0/fs/files%v", httpclient.EncodeMultiSegmentPathParameter(request.FilePath)) + queryParams := make(map[string]any) + queryParams["overwrite"] = request.Overwrite headers := make(map[string]string) headers["Content-Type"] = "application/octet-stream" - err := a.client.Do(ctx, http.MethodPut, path, headers, request.Contents, &uploadResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request.Contents, &uploadResponse) return err } diff --git a/service/iam/impl.go b/service/iam/impl.go index deb73a70c..f41d601c3 100755 --- a/service/iam/impl.go +++ b/service/iam/impl.go @@ -18,28 +18,31 @@ type accountAccessControlImpl struct { func (a *accountAccessControlImpl) GetAssignableRolesForResource(ctx context.Context, request GetAssignableRolesForResourceRequest) (*GetAssignableRolesForResourceResponse, error) { var getAssignableRolesForResourceResponse GetAssignableRolesForResourceResponse path := fmt.Sprintf("/api/2.0/preview/accounts/%v/access-control/assignable-roles", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getAssignableRolesForResourceResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getAssignableRolesForResourceResponse) return &getAssignableRolesForResourceResponse, err } func (a *accountAccessControlImpl) GetRuleSet(ctx context.Context, request GetRuleSetRequest) (*RuleSetResponse, error) { var ruleSetResponse RuleSetResponse path := fmt.Sprintf("/api/2.0/preview/accounts/%v/access-control/rule-sets", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &ruleSetResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &ruleSetResponse) return &ruleSetResponse, err } func (a *accountAccessControlImpl) UpdateRuleSet(ctx context.Context, request UpdateRuleSetRequest) (*RuleSetResponse, error) { var ruleSetResponse RuleSetResponse path := fmt.Sprintf("/api/2.0/preview/accounts/%v/access-control/rule-sets", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &ruleSetResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &ruleSetResponse) return &ruleSetResponse, err } @@ -51,28 +54,31 @@ type accountAccessControlProxyImpl struct { func (a *accountAccessControlProxyImpl) GetAssignableRolesForResource(ctx context.Context, request GetAssignableRolesForResourceRequest) (*GetAssignableRolesForResourceResponse, error) { var getAssignableRolesForResourceResponse GetAssignableRolesForResourceResponse path := "/api/2.0/preview/accounts/access-control/assignable-roles" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getAssignableRolesForResourceResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getAssignableRolesForResourceResponse) return &getAssignableRolesForResourceResponse, err } func (a *accountAccessControlProxyImpl) GetRuleSet(ctx context.Context, request GetRuleSetRequest) (*RuleSetResponse, error) { var ruleSetResponse RuleSetResponse path := "/api/2.0/preview/accounts/access-control/rule-sets" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &ruleSetResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &ruleSetResponse) return &ruleSetResponse, err } func (a *accountAccessControlProxyImpl) UpdateRuleSet(ctx context.Context, request UpdateRuleSetRequest) (*RuleSetResponse, error) { var ruleSetResponse RuleSetResponse path := "/api/2.0/preview/accounts/access-control/rule-sets" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &ruleSetResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &ruleSetResponse) return &ruleSetResponse, err } @@ -84,56 +90,62 @@ type accountGroupsImpl struct { func (a *accountGroupsImpl) Create(ctx context.Context, request Group) (*Group, error) { var group Group path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &group) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &group) return &group, err } func (a *accountGroupsImpl) Delete(ctx context.Context, request DeleteAccountGroupRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups/%v", a.client.ConfiguredAccountID(), request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *accountGroupsImpl) Get(ctx context.Context, request GetAccountGroupRequest) (*Group, error) { var group Group path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups/%v", a.client.ConfiguredAccountID(), request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &group) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &group) return &group, err } func (a *accountGroupsImpl) List(ctx context.Context, request ListAccountGroupsRequest) (*ListGroupsResponse, error) { var listGroupsResponse ListGroupsResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listGroupsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listGroupsResponse) return &listGroupsResponse, err } func (a *accountGroupsImpl) Patch(ctx context.Context, request PartialUpdate) error { var patchResponse PatchResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups/%v", a.client.ConfiguredAccountID(), request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &patchResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) return err } func (a *accountGroupsImpl) Update(ctx context.Context, request Group) error { var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Groups/%v", a.client.ConfiguredAccountID(), request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) return err } @@ -145,56 +157,62 @@ type accountServicePrincipalsImpl struct { func (a *accountServicePrincipalsImpl) Create(ctx context.Context, request ServicePrincipal) (*ServicePrincipal, error) { var servicePrincipal ServicePrincipal path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &servicePrincipal) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &servicePrincipal) return &servicePrincipal, err } func (a *accountServicePrincipalsImpl) Delete(ctx context.Context, request DeleteAccountServicePrincipalRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals/%v", a.client.ConfiguredAccountID(), request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *accountServicePrincipalsImpl) Get(ctx context.Context, request GetAccountServicePrincipalRequest) (*ServicePrincipal, error) { var servicePrincipal ServicePrincipal path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals/%v", a.client.ConfiguredAccountID(), request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &servicePrincipal) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &servicePrincipal) return &servicePrincipal, err } func (a *accountServicePrincipalsImpl) List(ctx context.Context, request ListAccountServicePrincipalsRequest) (*ListServicePrincipalResponse, error) { var listServicePrincipalResponse ListServicePrincipalResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listServicePrincipalResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listServicePrincipalResponse) return &listServicePrincipalResponse, err } func (a *accountServicePrincipalsImpl) Patch(ctx context.Context, request PartialUpdate) error { var patchResponse PatchResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals/%v", a.client.ConfiguredAccountID(), request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &patchResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) return err } func (a *accountServicePrincipalsImpl) Update(ctx context.Context, request ServicePrincipal) error { var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/ServicePrincipals/%v", a.client.ConfiguredAccountID(), request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) return err } @@ -206,56 +224,62 @@ type accountUsersImpl struct { func (a *accountUsersImpl) Create(ctx context.Context, request User) (*User, error) { var user User path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &user) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &user) return &user, err } func (a *accountUsersImpl) Delete(ctx context.Context, request DeleteAccountUserRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users/%v", a.client.ConfiguredAccountID(), request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *accountUsersImpl) Get(ctx context.Context, request GetAccountUserRequest) (*User, error) { var user User path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users/%v", a.client.ConfiguredAccountID(), request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &user) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &user) return &user, err } func (a *accountUsersImpl) List(ctx context.Context, request ListAccountUsersRequest) (*ListUsersResponse, error) { var listUsersResponse ListUsersResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listUsersResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listUsersResponse) return &listUsersResponse, err } func (a *accountUsersImpl) Patch(ctx context.Context, request PartialUpdate) error { var patchResponse PatchResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users/%v", a.client.ConfiguredAccountID(), request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &patchResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) return err } func (a *accountUsersImpl) Update(ctx context.Context, request User) error { var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/accounts/%v/scim/v2/Users/%v", a.client.ConfiguredAccountID(), request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) return err } @@ -267,9 +291,10 @@ type currentUserImpl struct { func (a *currentUserImpl) Me(ctx context.Context) (*User, error) { var user User path := "/api/2.0/preview/scim/v2/Me" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &user) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &user) return &user, err } @@ -281,56 +306,62 @@ type groupsImpl struct { func (a *groupsImpl) Create(ctx context.Context, request Group) (*Group, error) { var group Group path := "/api/2.0/preview/scim/v2/Groups" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &group) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &group) return &group, err } func (a *groupsImpl) Delete(ctx context.Context, request DeleteGroupRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/Groups/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *groupsImpl) Get(ctx context.Context, request GetGroupRequest) (*Group, error) { var group Group path := fmt.Sprintf("/api/2.0/preview/scim/v2/Groups/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &group) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &group) return &group, err } func (a *groupsImpl) List(ctx context.Context, request ListGroupsRequest) (*ListGroupsResponse, error) { var listGroupsResponse ListGroupsResponse path := "/api/2.0/preview/scim/v2/Groups" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listGroupsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listGroupsResponse) return &listGroupsResponse, err } func (a *groupsImpl) Patch(ctx context.Context, request PartialUpdate) error { var patchResponse PatchResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/Groups/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &patchResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) return err } func (a *groupsImpl) Update(ctx context.Context, request Group) error { var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/Groups/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) return err } @@ -342,10 +373,11 @@ type permissionMigrationImpl struct { func (a *permissionMigrationImpl) MigratePermissions(ctx context.Context, request MigratePermissionsRequest) (*MigratePermissionsResponse, error) { var migratePermissionsResponse MigratePermissionsResponse path := "/api/2.0/permissionmigration" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &migratePermissionsResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &migratePermissionsResponse) return &migratePermissionsResponse, err } @@ -357,38 +389,42 @@ type permissionsImpl struct { func (a *permissionsImpl) Get(ctx context.Context, request GetPermissionRequest) (*ObjectPermissions, error) { var objectPermissions ObjectPermissions path := fmt.Sprintf("/api/2.0/permissions/%v/%v", request.RequestObjectType, request.RequestObjectId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &objectPermissions) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &objectPermissions) return &objectPermissions, err } func (a *permissionsImpl) GetPermissionLevels(ctx context.Context, request GetPermissionLevelsRequest) (*GetPermissionLevelsResponse, error) { var getPermissionLevelsResponse GetPermissionLevelsResponse path := fmt.Sprintf("/api/2.0/permissions/%v/%v/permissionLevels", request.RequestObjectType, request.RequestObjectId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getPermissionLevelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPermissionLevelsResponse) return &getPermissionLevelsResponse, err } func (a *permissionsImpl) Set(ctx context.Context, request PermissionsRequest) (*ObjectPermissions, error) { var objectPermissions ObjectPermissions path := fmt.Sprintf("/api/2.0/permissions/%v/%v", request.RequestObjectType, request.RequestObjectId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &objectPermissions) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &objectPermissions) return &objectPermissions, err } func (a *permissionsImpl) Update(ctx context.Context, request PermissionsRequest) (*ObjectPermissions, error) { var objectPermissions ObjectPermissions path := fmt.Sprintf("/api/2.0/permissions/%v/%v", request.RequestObjectType, request.RequestObjectId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &objectPermissions) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &objectPermissions) return &objectPermissions, err } @@ -400,56 +436,62 @@ type servicePrincipalsImpl struct { func (a *servicePrincipalsImpl) Create(ctx context.Context, request ServicePrincipal) (*ServicePrincipal, error) { var servicePrincipal ServicePrincipal path := "/api/2.0/preview/scim/v2/ServicePrincipals" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &servicePrincipal) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &servicePrincipal) return &servicePrincipal, err } func (a *servicePrincipalsImpl) Delete(ctx context.Context, request DeleteServicePrincipalRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/ServicePrincipals/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *servicePrincipalsImpl) Get(ctx context.Context, request GetServicePrincipalRequest) (*ServicePrincipal, error) { var servicePrincipal ServicePrincipal path := fmt.Sprintf("/api/2.0/preview/scim/v2/ServicePrincipals/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &servicePrincipal) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &servicePrincipal) return &servicePrincipal, err } func (a *servicePrincipalsImpl) List(ctx context.Context, request ListServicePrincipalsRequest) (*ListServicePrincipalResponse, error) { var listServicePrincipalResponse ListServicePrincipalResponse path := "/api/2.0/preview/scim/v2/ServicePrincipals" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listServicePrincipalResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listServicePrincipalResponse) return &listServicePrincipalResponse, err } func (a *servicePrincipalsImpl) Patch(ctx context.Context, request PartialUpdate) error { var patchResponse PatchResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/ServicePrincipals/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &patchResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) return err } func (a *servicePrincipalsImpl) Update(ctx context.Context, request ServicePrincipal) error { var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/ServicePrincipals/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) return err } @@ -461,94 +503,104 @@ type usersImpl struct { func (a *usersImpl) Create(ctx context.Context, request User) (*User, error) { var user User path := "/api/2.0/preview/scim/v2/Users" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &user) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &user) return &user, err } func (a *usersImpl) Delete(ctx context.Context, request DeleteUserRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/Users/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *usersImpl) Get(ctx context.Context, request GetUserRequest) (*User, error) { var user User path := fmt.Sprintf("/api/2.0/preview/scim/v2/Users/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &user) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &user) return &user, err } func (a *usersImpl) GetPermissionLevels(ctx context.Context) (*GetPasswordPermissionLevelsResponse, error) { var getPasswordPermissionLevelsResponse GetPasswordPermissionLevelsResponse path := "/api/2.0/permissions/authorization/passwords/permissionLevels" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &getPasswordPermissionLevelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &getPasswordPermissionLevelsResponse) return &getPasswordPermissionLevelsResponse, err } func (a *usersImpl) GetPermissions(ctx context.Context) (*PasswordPermissions, error) { var passwordPermissions PasswordPermissions path := "/api/2.0/permissions/authorization/passwords" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &passwordPermissions) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &passwordPermissions) return &passwordPermissions, err } func (a *usersImpl) List(ctx context.Context, request ListUsersRequest) (*ListUsersResponse, error) { var listUsersResponse ListUsersResponse path := "/api/2.0/preview/scim/v2/Users" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listUsersResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listUsersResponse) return &listUsersResponse, err } func (a *usersImpl) Patch(ctx context.Context, request PartialUpdate) error { var patchResponse PatchResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/Users/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &patchResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &patchResponse) return err } func (a *usersImpl) SetPermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error) { var passwordPermissions PasswordPermissions path := "/api/2.0/permissions/authorization/passwords" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &passwordPermissions) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &passwordPermissions) return &passwordPermissions, err } func (a *usersImpl) Update(ctx context.Context, request User) error { var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/preview/scim/v2/Users/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) return err } func (a *usersImpl) UpdatePermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error) { var passwordPermissions PasswordPermissions path := "/api/2.0/permissions/authorization/passwords" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &passwordPermissions) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &passwordPermissions) return &passwordPermissions, err } @@ -560,36 +612,40 @@ type workspaceAssignmentImpl struct { func (a *workspaceAssignmentImpl) Delete(ctx context.Context, request DeleteWorkspaceAssignmentRequest) error { var deleteWorkspacePermissionAssignmentResponse DeleteWorkspacePermissionAssignmentResponse path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/permissionassignments/principals/%v", a.client.ConfiguredAccountID(), request.WorkspaceId, request.PrincipalId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteWorkspacePermissionAssignmentResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteWorkspacePermissionAssignmentResponse) return err } func (a *workspaceAssignmentImpl) Get(ctx context.Context, request GetWorkspaceAssignmentRequest) (*WorkspacePermissions, error) { var workspacePermissions WorkspacePermissions path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/permissionassignments/permissions", a.client.ConfiguredAccountID(), request.WorkspaceId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &workspacePermissions) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &workspacePermissions) return &workspacePermissions, err } func (a *workspaceAssignmentImpl) List(ctx context.Context, request ListWorkspaceAssignmentRequest) (*PermissionAssignments, error) { var permissionAssignments PermissionAssignments path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/permissionassignments", a.client.ConfiguredAccountID(), request.WorkspaceId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &permissionAssignments) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &permissionAssignments) return &permissionAssignments, err } func (a *workspaceAssignmentImpl) Update(ctx context.Context, request UpdateWorkspaceAssignments) (*PermissionAssignment, error) { var permissionAssignment PermissionAssignment path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v/permissionassignments/principals/%v", a.client.ConfiguredAccountID(), request.WorkspaceId, request.PrincipalId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &permissionAssignment) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &permissionAssignment) return &permissionAssignment, err } diff --git a/service/jobs/impl.go b/service/jobs/impl.go index 0929b10c4..d381d8876 100755 --- a/service/jobs/impl.go +++ b/service/jobs/impl.go @@ -18,192 +18,212 @@ type jobsImpl struct { func (a *jobsImpl) CancelAllRuns(ctx context.Context, request CancelAllRuns) error { var cancelAllRunsResponse CancelAllRunsResponse path := "/api/2.1/jobs/runs/cancel-all" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &cancelAllRunsResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &cancelAllRunsResponse) return err } func (a *jobsImpl) CancelRun(ctx context.Context, request CancelRun) error { var cancelRunResponse CancelRunResponse path := "/api/2.1/jobs/runs/cancel" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &cancelRunResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &cancelRunResponse) return err } func (a *jobsImpl) Create(ctx context.Context, request CreateJob) (*CreateResponse, error) { var createResponse CreateResponse path := "/api/2.1/jobs/create" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createResponse) return &createResponse, err } func (a *jobsImpl) Delete(ctx context.Context, request DeleteJob) error { var deleteResponse DeleteResponse path := "/api/2.1/jobs/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteResponse) return err } func (a *jobsImpl) DeleteRun(ctx context.Context, request DeleteRun) error { var deleteRunResponse DeleteRunResponse path := "/api/2.1/jobs/runs/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &deleteRunResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteRunResponse) return err } func (a *jobsImpl) ExportRun(ctx context.Context, request ExportRunRequest) (*ExportRunOutput, error) { var exportRunOutput ExportRunOutput path := "/api/2.1/jobs/runs/export" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &exportRunOutput) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &exportRunOutput) return &exportRunOutput, err } func (a *jobsImpl) Get(ctx context.Context, request GetJobRequest) (*Job, error) { var job Job path := "/api/2.1/jobs/get" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &job) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &job) return &job, err } func (a *jobsImpl) GetPermissionLevels(ctx context.Context, request GetJobPermissionLevelsRequest) (*GetJobPermissionLevelsResponse, error) { var getJobPermissionLevelsResponse GetJobPermissionLevelsResponse path := fmt.Sprintf("/api/2.0/permissions/jobs/%v/permissionLevels", request.JobId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getJobPermissionLevelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getJobPermissionLevelsResponse) return &getJobPermissionLevelsResponse, err } func (a *jobsImpl) GetPermissions(ctx context.Context, request GetJobPermissionsRequest) (*JobPermissions, error) { var jobPermissions JobPermissions path := fmt.Sprintf("/api/2.0/permissions/jobs/%v", request.JobId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &jobPermissions) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &jobPermissions) return &jobPermissions, err } func (a *jobsImpl) GetRun(ctx context.Context, request GetRunRequest) (*Run, error) { var run Run path := "/api/2.1/jobs/runs/get" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &run) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &run) return &run, err } func (a *jobsImpl) GetRunOutput(ctx context.Context, request GetRunOutputRequest) (*RunOutput, error) { var runOutput RunOutput path := "/api/2.1/jobs/runs/get-output" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &runOutput) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &runOutput) return &runOutput, err } func (a *jobsImpl) List(ctx context.Context, request ListJobsRequest) (*ListJobsResponse, error) { var listJobsResponse ListJobsResponse path := "/api/2.1/jobs/list" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listJobsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listJobsResponse) return &listJobsResponse, err } func (a *jobsImpl) ListRuns(ctx context.Context, request ListRunsRequest) (*ListRunsResponse, error) { var listRunsResponse ListRunsResponse path := "/api/2.1/jobs/runs/list" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listRunsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listRunsResponse) return &listRunsResponse, err } func (a *jobsImpl) RepairRun(ctx context.Context, request RepairRun) (*RepairRunResponse, error) { var repairRunResponse RepairRunResponse path := "/api/2.1/jobs/runs/repair" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &repairRunResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &repairRunResponse) return &repairRunResponse, err } func (a *jobsImpl) Reset(ctx context.Context, request ResetJob) error { var resetResponse ResetResponse path := "/api/2.1/jobs/reset" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &resetResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &resetResponse) return err } func (a *jobsImpl) RunNow(ctx context.Context, request RunNow) (*RunNowResponse, error) { var runNowResponse RunNowResponse path := "/api/2.1/jobs/run-now" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &runNowResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &runNowResponse) return &runNowResponse, err } func (a *jobsImpl) SetPermissions(ctx context.Context, request JobPermissionsRequest) (*JobPermissions, error) { var jobPermissions JobPermissions path := fmt.Sprintf("/api/2.0/permissions/jobs/%v", request.JobId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &jobPermissions) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &jobPermissions) return &jobPermissions, err } func (a *jobsImpl) Submit(ctx context.Context, request SubmitRun) (*SubmitRunResponse, error) { var submitRunResponse SubmitRunResponse path := "/api/2.1/jobs/runs/submit" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &submitRunResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &submitRunResponse) return &submitRunResponse, err } func (a *jobsImpl) Update(ctx context.Context, request UpdateJob) error { var updateResponse UpdateResponse path := "/api/2.1/jobs/update" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &updateResponse) return err } func (a *jobsImpl) UpdatePermissions(ctx context.Context, request JobPermissionsRequest) (*JobPermissions, error) { var jobPermissions JobPermissions path := fmt.Sprintf("/api/2.0/permissions/jobs/%v", request.JobId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &jobPermissions) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &jobPermissions) return &jobPermissions, err } @@ -215,27 +235,30 @@ type policyComplianceForJobsImpl struct { func (a *policyComplianceForJobsImpl) EnforceCompliance(ctx context.Context, request EnforcePolicyComplianceRequest) (*EnforcePolicyComplianceResponse, error) { var enforcePolicyComplianceResponse EnforcePolicyComplianceResponse path := "/api/2.0/policies/jobs/enforce-compliance" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &enforcePolicyComplianceResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &enforcePolicyComplianceResponse) return &enforcePolicyComplianceResponse, err } func (a *policyComplianceForJobsImpl) GetCompliance(ctx context.Context, request GetPolicyComplianceRequest) (*GetPolicyComplianceResponse, error) { var getPolicyComplianceResponse GetPolicyComplianceResponse path := "/api/2.0/policies/jobs/get-compliance" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getPolicyComplianceResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPolicyComplianceResponse) return &getPolicyComplianceResponse, err } func (a *policyComplianceForJobsImpl) ListCompliance(ctx context.Context, request ListJobComplianceRequest) (*ListJobComplianceForPolicyResponse, error) { var listJobComplianceForPolicyResponse ListJobComplianceForPolicyResponse path := "/api/2.0/policies/jobs/list-compliance" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listJobComplianceForPolicyResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listJobComplianceForPolicyResponse) return &listJobComplianceForPolicyResponse, err } diff --git a/service/marketplace/impl.go b/service/marketplace/impl.go index 81072eec0..278da15c6 100755 --- a/service/marketplace/impl.go +++ b/service/marketplace/impl.go @@ -18,18 +18,20 @@ type consumerFulfillmentsImpl struct { func (a *consumerFulfillmentsImpl) Get(ctx context.Context, request GetListingContentMetadataRequest) (*GetListingContentMetadataResponse, error) { var getListingContentMetadataResponse GetListingContentMetadataResponse path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/content", request.ListingId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getListingContentMetadataResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getListingContentMetadataResponse) return &getListingContentMetadataResponse, err } func (a *consumerFulfillmentsImpl) List(ctx context.Context, request ListFulfillmentsRequest) (*ListFulfillmentsResponse, error) { var listFulfillmentsResponse ListFulfillmentsResponse path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/fulfillments", request.ListingId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listFulfillmentsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listFulfillmentsResponse) return &listFulfillmentsResponse, err } @@ -41,47 +43,52 @@ type consumerInstallationsImpl struct { func (a *consumerInstallationsImpl) Create(ctx context.Context, request CreateInstallationRequest) (*Installation, error) { var installation Installation path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations", request.ListingId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &installation) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &installation) return &installation, err } func (a *consumerInstallationsImpl) Delete(ctx context.Context, request DeleteInstallationRequest) error { var deleteInstallationResponse DeleteInstallationResponse path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations/%v", request.ListingId, request.InstallationId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteInstallationResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteInstallationResponse) return err } func (a *consumerInstallationsImpl) List(ctx context.Context, request ListAllInstallationsRequest) (*ListAllInstallationsResponse, error) { var listAllInstallationsResponse ListAllInstallationsResponse path := "/api/2.1/marketplace-consumer/installations" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listAllInstallationsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAllInstallationsResponse) return &listAllInstallationsResponse, err } func (a *consumerInstallationsImpl) ListListingInstallations(ctx context.Context, request ListInstallationsRequest) (*ListInstallationsResponse, error) { var listInstallationsResponse ListInstallationsResponse path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations", request.ListingId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listInstallationsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listInstallationsResponse) return &listInstallationsResponse, err } func (a *consumerInstallationsImpl) Update(ctx context.Context, request UpdateInstallationRequest) (*UpdateInstallationResponse, error) { var updateInstallationResponse UpdateInstallationResponse path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations/%v", request.ListingId, request.InstallationId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateInstallationResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateInstallationResponse) return &updateInstallationResponse, err } @@ -93,36 +100,40 @@ type consumerListingsImpl struct { func (a *consumerListingsImpl) BatchGet(ctx context.Context, request BatchGetListingsRequest) (*BatchGetListingsResponse, error) { var batchGetListingsResponse BatchGetListingsResponse path := "/api/2.1/marketplace-consumer/listings:batchGet" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &batchGetListingsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &batchGetListingsResponse) return &batchGetListingsResponse, err } func (a *consumerListingsImpl) Get(ctx context.Context, request GetListingRequest) (*GetListingResponse, error) { var getListingResponse GetListingResponse path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getListingResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getListingResponse) return &getListingResponse, err } func (a *consumerListingsImpl) List(ctx context.Context, request ListListingsRequest) (*ListListingsResponse, error) { var listListingsResponse ListListingsResponse path := "/api/2.1/marketplace-consumer/listings" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listListingsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listListingsResponse) return &listListingsResponse, err } func (a *consumerListingsImpl) Search(ctx context.Context, request SearchListingsRequest) (*SearchListingsResponse, error) { var searchListingsResponse SearchListingsResponse path := "/api/2.1/marketplace-consumer/search-listings" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &searchListingsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &searchListingsResponse) return &searchListingsResponse, err } @@ -134,28 +145,31 @@ type consumerPersonalizationRequestsImpl struct { func (a *consumerPersonalizationRequestsImpl) Create(ctx context.Context, request CreatePersonalizationRequest) (*CreatePersonalizationRequestResponse, error) { var createPersonalizationRequestResponse CreatePersonalizationRequestResponse path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/personalization-requests", request.ListingId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createPersonalizationRequestResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createPersonalizationRequestResponse) return &createPersonalizationRequestResponse, err } func (a *consumerPersonalizationRequestsImpl) Get(ctx context.Context, request GetPersonalizationRequestRequest) (*GetPersonalizationRequestResponse, error) { var getPersonalizationRequestResponse GetPersonalizationRequestResponse path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/personalization-requests", request.ListingId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getPersonalizationRequestResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPersonalizationRequestResponse) return &getPersonalizationRequestResponse, err } func (a *consumerPersonalizationRequestsImpl) List(ctx context.Context, request ListAllPersonalizationRequestsRequest) (*ListAllPersonalizationRequestsResponse, error) { var listAllPersonalizationRequestsResponse ListAllPersonalizationRequestsResponse path := "/api/2.1/marketplace-consumer/personalization-requests" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listAllPersonalizationRequestsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAllPersonalizationRequestsResponse) return &listAllPersonalizationRequestsResponse, err } @@ -167,27 +181,30 @@ type consumerProvidersImpl struct { func (a *consumerProvidersImpl) BatchGet(ctx context.Context, request BatchGetProvidersRequest) (*BatchGetProvidersResponse, error) { var batchGetProvidersResponse BatchGetProvidersResponse path := "/api/2.1/marketplace-consumer/providers:batchGet" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &batchGetProvidersResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &batchGetProvidersResponse) return &batchGetProvidersResponse, err } func (a *consumerProvidersImpl) Get(ctx context.Context, request GetProviderRequest) (*GetProviderResponse, error) { var getProviderResponse GetProviderResponse path := fmt.Sprintf("/api/2.1/marketplace-consumer/providers/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getProviderResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getProviderResponse) return &getProviderResponse, err } func (a *consumerProvidersImpl) List(ctx context.Context, request ListProvidersRequest) (*ListProvidersResponse, error) { var listProvidersResponse ListProvidersResponse path := "/api/2.1/marketplace-consumer/providers" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listProvidersResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listProvidersResponse) return &listProvidersResponse, err } @@ -199,38 +216,42 @@ type providerExchangeFiltersImpl struct { func (a *providerExchangeFiltersImpl) Create(ctx context.Context, request CreateExchangeFilterRequest) (*CreateExchangeFilterResponse, error) { var createExchangeFilterResponse CreateExchangeFilterResponse path := "/api/2.0/marketplace-exchange/filters" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createExchangeFilterResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createExchangeFilterResponse) return &createExchangeFilterResponse, err } func (a *providerExchangeFiltersImpl) Delete(ctx context.Context, request DeleteExchangeFilterRequest) error { var deleteExchangeFilterResponse DeleteExchangeFilterResponse path := fmt.Sprintf("/api/2.0/marketplace-exchange/filters/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteExchangeFilterResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteExchangeFilterResponse) return err } func (a *providerExchangeFiltersImpl) List(ctx context.Context, request ListExchangeFiltersRequest) (*ListExchangeFiltersResponse, error) { var listExchangeFiltersResponse ListExchangeFiltersResponse path := "/api/2.0/marketplace-exchange/filters" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listExchangeFiltersResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listExchangeFiltersResponse) return &listExchangeFiltersResponse, err } func (a *providerExchangeFiltersImpl) Update(ctx context.Context, request UpdateExchangeFilterRequest) (*UpdateExchangeFilterResponse, error) { var updateExchangeFilterResponse UpdateExchangeFilterResponse path := fmt.Sprintf("/api/2.0/marketplace-exchange/filters/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateExchangeFilterResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateExchangeFilterResponse) return &updateExchangeFilterResponse, err } @@ -242,84 +263,93 @@ type providerExchangesImpl struct { func (a *providerExchangesImpl) AddListingToExchange(ctx context.Context, request AddExchangeForListingRequest) (*AddExchangeForListingResponse, error) { var addExchangeForListingResponse AddExchangeForListingResponse path := "/api/2.0/marketplace-exchange/exchanges-for-listing" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &addExchangeForListingResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &addExchangeForListingResponse) return &addExchangeForListingResponse, err } func (a *providerExchangesImpl) Create(ctx context.Context, request CreateExchangeRequest) (*CreateExchangeResponse, error) { var createExchangeResponse CreateExchangeResponse path := "/api/2.0/marketplace-exchange/exchanges" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createExchangeResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createExchangeResponse) return &createExchangeResponse, err } func (a *providerExchangesImpl) Delete(ctx context.Context, request DeleteExchangeRequest) error { var deleteExchangeResponse DeleteExchangeResponse path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteExchangeResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteExchangeResponse) return err } func (a *providerExchangesImpl) DeleteListingFromExchange(ctx context.Context, request RemoveExchangeForListingRequest) error { var removeExchangeForListingResponse RemoveExchangeForListingResponse path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges-for-listing/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &removeExchangeForListingResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &removeExchangeForListingResponse) return err } func (a *providerExchangesImpl) Get(ctx context.Context, request GetExchangeRequest) (*GetExchangeResponse, error) { var getExchangeResponse GetExchangeResponse path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getExchangeResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getExchangeResponse) return &getExchangeResponse, err } func (a *providerExchangesImpl) List(ctx context.Context, request ListExchangesRequest) (*ListExchangesResponse, error) { var listExchangesResponse ListExchangesResponse path := "/api/2.0/marketplace-exchange/exchanges" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listExchangesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listExchangesResponse) return &listExchangesResponse, err } func (a *providerExchangesImpl) ListExchangesForListing(ctx context.Context, request ListExchangesForListingRequest) (*ListExchangesForListingResponse, error) { var listExchangesForListingResponse ListExchangesForListingResponse path := "/api/2.0/marketplace-exchange/exchanges-for-listing" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listExchangesForListingResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listExchangesForListingResponse) return &listExchangesForListingResponse, err } func (a *providerExchangesImpl) ListListingsForExchange(ctx context.Context, request ListListingsForExchangeRequest) (*ListListingsForExchangeResponse, error) { var listListingsForExchangeResponse ListListingsForExchangeResponse path := "/api/2.0/marketplace-exchange/listings-for-exchange" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listListingsForExchangeResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listListingsForExchangeResponse) return &listListingsForExchangeResponse, err } func (a *providerExchangesImpl) Update(ctx context.Context, request UpdateExchangeRequest) (*UpdateExchangeResponse, error) { var updateExchangeResponse UpdateExchangeResponse path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateExchangeResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateExchangeResponse) return &updateExchangeResponse, err } @@ -331,37 +361,41 @@ type providerFilesImpl struct { func (a *providerFilesImpl) Create(ctx context.Context, request CreateFileRequest) (*CreateFileResponse, error) { var createFileResponse CreateFileResponse path := "/api/2.0/marketplace-provider/files" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createFileResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createFileResponse) return &createFileResponse, err } func (a *providerFilesImpl) Delete(ctx context.Context, request DeleteFileRequest) error { var deleteFileResponse DeleteFileResponse path := fmt.Sprintf("/api/2.0/marketplace-provider/files/%v", request.FileId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteFileResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteFileResponse) return err } func (a *providerFilesImpl) Get(ctx context.Context, request GetFileRequest) (*GetFileResponse, error) { var getFileResponse GetFileResponse path := fmt.Sprintf("/api/2.0/marketplace-provider/files/%v", request.FileId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getFileResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getFileResponse) return &getFileResponse, err } func (a *providerFilesImpl) List(ctx context.Context, request ListFilesRequest) (*ListFilesResponse, error) { var listFilesResponse ListFilesResponse path := "/api/2.0/marketplace-provider/files" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listFilesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listFilesResponse) return &listFilesResponse, err } @@ -373,47 +407,52 @@ type providerListingsImpl struct { func (a *providerListingsImpl) Create(ctx context.Context, request CreateListingRequest) (*CreateListingResponse, error) { var createListingResponse CreateListingResponse path := "/api/2.0/marketplace-provider/listing" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createListingResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createListingResponse) return &createListingResponse, err } func (a *providerListingsImpl) Delete(ctx context.Context, request DeleteListingRequest) error { var deleteListingResponse DeleteListingResponse path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteListingResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteListingResponse) return err } func (a *providerListingsImpl) Get(ctx context.Context, request GetListingRequest) (*GetListingResponse, error) { var getListingResponse GetListingResponse path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getListingResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getListingResponse) return &getListingResponse, err } func (a *providerListingsImpl) List(ctx context.Context, request GetListingsRequest) (*GetListingsResponse, error) { var getListingsResponse GetListingsResponse path := "/api/2.0/marketplace-provider/listings" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getListingsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getListingsResponse) return &getListingsResponse, err } func (a *providerListingsImpl) Update(ctx context.Context, request UpdateListingRequest) (*UpdateListingResponse, error) { var updateListingResponse UpdateListingResponse path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateListingResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateListingResponse) return &updateListingResponse, err } @@ -425,19 +464,21 @@ type providerPersonalizationRequestsImpl struct { func (a *providerPersonalizationRequestsImpl) List(ctx context.Context, request ListAllPersonalizationRequestsRequest) (*ListAllPersonalizationRequestsResponse, error) { var listAllPersonalizationRequestsResponse ListAllPersonalizationRequestsResponse path := "/api/2.0/marketplace-provider/personalization-requests" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listAllPersonalizationRequestsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAllPersonalizationRequestsResponse) return &listAllPersonalizationRequestsResponse, err } func (a *providerPersonalizationRequestsImpl) Update(ctx context.Context, request UpdatePersonalizationRequestRequest) (*UpdatePersonalizationRequestResponse, error) { var updatePersonalizationRequestResponse UpdatePersonalizationRequestResponse path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v/personalization-requests/%v/request-status", request.ListingId, request.RequestId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updatePersonalizationRequestResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updatePersonalizationRequestResponse) return &updatePersonalizationRequestResponse, err } @@ -449,37 +490,41 @@ type providerProviderAnalyticsDashboardsImpl struct { func (a *providerProviderAnalyticsDashboardsImpl) Create(ctx context.Context) (*ProviderAnalyticsDashboard, error) { var providerAnalyticsDashboard ProviderAnalyticsDashboard path := "/api/2.0/marketplace-provider/analytics_dashboard" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, nil, &providerAnalyticsDashboard) + err := a.client.Do(ctx, http.MethodPost, path, headers, nil, nil, &providerAnalyticsDashboard) return &providerAnalyticsDashboard, err } func (a *providerProviderAnalyticsDashboardsImpl) Get(ctx context.Context) (*ListProviderAnalyticsDashboardResponse, error) { var listProviderAnalyticsDashboardResponse ListProviderAnalyticsDashboardResponse path := "/api/2.0/marketplace-provider/analytics_dashboard" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &listProviderAnalyticsDashboardResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listProviderAnalyticsDashboardResponse) return &listProviderAnalyticsDashboardResponse, err } func (a *providerProviderAnalyticsDashboardsImpl) GetLatestVersion(ctx context.Context) (*GetLatestVersionProviderAnalyticsDashboardResponse, error) { var getLatestVersionProviderAnalyticsDashboardResponse GetLatestVersionProviderAnalyticsDashboardResponse path := "/api/2.0/marketplace-provider/analytics_dashboard/latest" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &getLatestVersionProviderAnalyticsDashboardResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &getLatestVersionProviderAnalyticsDashboardResponse) return &getLatestVersionProviderAnalyticsDashboardResponse, err } func (a *providerProviderAnalyticsDashboardsImpl) Update(ctx context.Context, request UpdateProviderAnalyticsDashboardRequest) (*UpdateProviderAnalyticsDashboardResponse, error) { var updateProviderAnalyticsDashboardResponse UpdateProviderAnalyticsDashboardResponse path := fmt.Sprintf("/api/2.0/marketplace-provider/analytics_dashboard/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateProviderAnalyticsDashboardResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateProviderAnalyticsDashboardResponse) return &updateProviderAnalyticsDashboardResponse, err } @@ -491,46 +536,51 @@ type providerProvidersImpl struct { func (a *providerProvidersImpl) Create(ctx context.Context, request CreateProviderRequest) (*CreateProviderResponse, error) { var createProviderResponse CreateProviderResponse path := "/api/2.0/marketplace-provider/provider" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createProviderResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createProviderResponse) return &createProviderResponse, err } func (a *providerProvidersImpl) Delete(ctx context.Context, request DeleteProviderRequest) error { var deleteProviderResponse DeleteProviderResponse path := fmt.Sprintf("/api/2.0/marketplace-provider/providers/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteProviderResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteProviderResponse) return err } func (a *providerProvidersImpl) Get(ctx context.Context, request GetProviderRequest) (*GetProviderResponse, error) { var getProviderResponse GetProviderResponse path := fmt.Sprintf("/api/2.0/marketplace-provider/providers/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getProviderResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getProviderResponse) return &getProviderResponse, err } func (a *providerProvidersImpl) List(ctx context.Context, request ListProvidersRequest) (*ListProvidersResponse, error) { var listProvidersResponse ListProvidersResponse path := "/api/2.0/marketplace-provider/providers" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listProvidersResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listProvidersResponse) return &listProvidersResponse, err } func (a *providerProvidersImpl) Update(ctx context.Context, request UpdateProviderRequest) (*UpdateProviderResponse, error) { var updateProviderResponse UpdateProviderResponse path := fmt.Sprintf("/api/2.0/marketplace-provider/providers/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateProviderResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateProviderResponse) return &updateProviderResponse, err } diff --git a/service/ml/impl.go b/service/ml/impl.go index faf6b0f12..3141be45a 100755 --- a/service/ml/impl.go +++ b/service/ml/impl.go @@ -18,292 +18,322 @@ type experimentsImpl struct { func (a *experimentsImpl) CreateExperiment(ctx context.Context, request CreateExperiment) (*CreateExperimentResponse, error) { var createExperimentResponse CreateExperimentResponse path := "/api/2.0/mlflow/experiments/create" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createExperimentResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createExperimentResponse) return &createExperimentResponse, err } func (a *experimentsImpl) CreateRun(ctx context.Context, request CreateRun) (*CreateRunResponse, error) { var createRunResponse CreateRunResponse path := "/api/2.0/mlflow/runs/create" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createRunResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createRunResponse) return &createRunResponse, err } func (a *experimentsImpl) DeleteExperiment(ctx context.Context, request DeleteExperiment) error { var deleteExperimentResponse DeleteExperimentResponse path := "/api/2.0/mlflow/experiments/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &deleteExperimentResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteExperimentResponse) return err } func (a *experimentsImpl) DeleteRun(ctx context.Context, request DeleteRun) error { var deleteRunResponse DeleteRunResponse path := "/api/2.0/mlflow/runs/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &deleteRunResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteRunResponse) return err } func (a *experimentsImpl) DeleteRuns(ctx context.Context, request DeleteRuns) (*DeleteRunsResponse, error) { var deleteRunsResponse DeleteRunsResponse path := "/api/2.0/mlflow/databricks/runs/delete-runs" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &deleteRunsResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteRunsResponse) return &deleteRunsResponse, err } func (a *experimentsImpl) DeleteTag(ctx context.Context, request DeleteTag) error { var deleteTagResponse DeleteTagResponse path := "/api/2.0/mlflow/runs/delete-tag" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &deleteTagResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteTagResponse) return err } func (a *experimentsImpl) GetByName(ctx context.Context, request GetByNameRequest) (*GetExperimentResponse, error) { var getExperimentResponse GetExperimentResponse path := "/api/2.0/mlflow/experiments/get-by-name" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getExperimentResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getExperimentResponse) return &getExperimentResponse, err } func (a *experimentsImpl) GetExperiment(ctx context.Context, request GetExperimentRequest) (*GetExperimentResponse, error) { var getExperimentResponse GetExperimentResponse path := "/api/2.0/mlflow/experiments/get" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getExperimentResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getExperimentResponse) return &getExperimentResponse, err } func (a *experimentsImpl) GetHistory(ctx context.Context, request GetHistoryRequest) (*GetMetricHistoryResponse, error) { var getMetricHistoryResponse GetMetricHistoryResponse path := "/api/2.0/mlflow/metrics/get-history" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getMetricHistoryResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getMetricHistoryResponse) return &getMetricHistoryResponse, err } func (a *experimentsImpl) GetPermissionLevels(ctx context.Context, request GetExperimentPermissionLevelsRequest) (*GetExperimentPermissionLevelsResponse, error) { var getExperimentPermissionLevelsResponse GetExperimentPermissionLevelsResponse path := fmt.Sprintf("/api/2.0/permissions/experiments/%v/permissionLevels", request.ExperimentId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getExperimentPermissionLevelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getExperimentPermissionLevelsResponse) return &getExperimentPermissionLevelsResponse, err } func (a *experimentsImpl) GetPermissions(ctx context.Context, request GetExperimentPermissionsRequest) (*ExperimentPermissions, error) { var experimentPermissions ExperimentPermissions path := fmt.Sprintf("/api/2.0/permissions/experiments/%v", request.ExperimentId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &experimentPermissions) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &experimentPermissions) return &experimentPermissions, err } func (a *experimentsImpl) GetRun(ctx context.Context, request GetRunRequest) (*GetRunResponse, error) { var getRunResponse GetRunResponse path := "/api/2.0/mlflow/runs/get" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getRunResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getRunResponse) return &getRunResponse, err } func (a *experimentsImpl) ListArtifacts(ctx context.Context, request ListArtifactsRequest) (*ListArtifactsResponse, error) { var listArtifactsResponse ListArtifactsResponse path := "/api/2.0/mlflow/artifacts/list" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listArtifactsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listArtifactsResponse) return &listArtifactsResponse, err } func (a *experimentsImpl) ListExperiments(ctx context.Context, request ListExperimentsRequest) (*ListExperimentsResponse, error) { var listExperimentsResponse ListExperimentsResponse path := "/api/2.0/mlflow/experiments/list" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listExperimentsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listExperimentsResponse) return &listExperimentsResponse, err } func (a *experimentsImpl) LogBatch(ctx context.Context, request LogBatch) error { var logBatchResponse LogBatchResponse path := "/api/2.0/mlflow/runs/log-batch" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &logBatchResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logBatchResponse) return err } func (a *experimentsImpl) LogInputs(ctx context.Context, request LogInputs) error { var logInputsResponse LogInputsResponse path := "/api/2.0/mlflow/runs/log-inputs" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &logInputsResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logInputsResponse) return err } func (a *experimentsImpl) LogMetric(ctx context.Context, request LogMetric) error { var logMetricResponse LogMetricResponse path := "/api/2.0/mlflow/runs/log-metric" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &logMetricResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logMetricResponse) return err } func (a *experimentsImpl) LogModel(ctx context.Context, request LogModel) error { var logModelResponse LogModelResponse path := "/api/2.0/mlflow/runs/log-model" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &logModelResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logModelResponse) return err } func (a *experimentsImpl) LogParam(ctx context.Context, request LogParam) error { var logParamResponse LogParamResponse path := "/api/2.0/mlflow/runs/log-parameter" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &logParamResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &logParamResponse) return err } func (a *experimentsImpl) RestoreExperiment(ctx context.Context, request RestoreExperiment) error { var restoreExperimentResponse RestoreExperimentResponse path := "/api/2.0/mlflow/experiments/restore" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &restoreExperimentResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &restoreExperimentResponse) return err } func (a *experimentsImpl) RestoreRun(ctx context.Context, request RestoreRun) error { var restoreRunResponse RestoreRunResponse path := "/api/2.0/mlflow/runs/restore" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &restoreRunResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &restoreRunResponse) return err } func (a *experimentsImpl) RestoreRuns(ctx context.Context, request RestoreRuns) (*RestoreRunsResponse, error) { var restoreRunsResponse RestoreRunsResponse path := "/api/2.0/mlflow/databricks/runs/restore-runs" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &restoreRunsResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &restoreRunsResponse) return &restoreRunsResponse, err } func (a *experimentsImpl) SearchExperiments(ctx context.Context, request SearchExperiments) (*SearchExperimentsResponse, error) { var searchExperimentsResponse SearchExperimentsResponse path := "/api/2.0/mlflow/experiments/search" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &searchExperimentsResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &searchExperimentsResponse) return &searchExperimentsResponse, err } func (a *experimentsImpl) SearchRuns(ctx context.Context, request SearchRuns) (*SearchRunsResponse, error) { var searchRunsResponse SearchRunsResponse path := "/api/2.0/mlflow/runs/search" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &searchRunsResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &searchRunsResponse) return &searchRunsResponse, err } func (a *experimentsImpl) SetExperimentTag(ctx context.Context, request SetExperimentTag) error { var setExperimentTagResponse SetExperimentTagResponse path := "/api/2.0/mlflow/experiments/set-experiment-tag" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &setExperimentTagResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &setExperimentTagResponse) return err } func (a *experimentsImpl) SetPermissions(ctx context.Context, request ExperimentPermissionsRequest) (*ExperimentPermissions, error) { var experimentPermissions ExperimentPermissions path := fmt.Sprintf("/api/2.0/permissions/experiments/%v", request.ExperimentId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &experimentPermissions) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &experimentPermissions) return &experimentPermissions, err } func (a *experimentsImpl) SetTag(ctx context.Context, request SetTag) error { var setTagResponse SetTagResponse path := "/api/2.0/mlflow/runs/set-tag" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &setTagResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &setTagResponse) return err } func (a *experimentsImpl) UpdateExperiment(ctx context.Context, request UpdateExperiment) error { var updateExperimentResponse UpdateExperimentResponse path := "/api/2.0/mlflow/experiments/update" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &updateExperimentResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &updateExperimentResponse) return err } func (a *experimentsImpl) UpdatePermissions(ctx context.Context, request ExperimentPermissionsRequest) (*ExperimentPermissions, error) { var experimentPermissions ExperimentPermissions path := fmt.Sprintf("/api/2.0/permissions/experiments/%v", request.ExperimentId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &experimentPermissions) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &experimentPermissions) return &experimentPermissions, err } func (a *experimentsImpl) UpdateRun(ctx context.Context, request UpdateRun) (*UpdateRunResponse, error) { var updateRunResponse UpdateRunResponse path := "/api/2.0/mlflow/runs/update" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &updateRunResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &updateRunResponse) return &updateRunResponse, err } @@ -315,342 +345,378 @@ type modelRegistryImpl struct { func (a *modelRegistryImpl) ApproveTransitionRequest(ctx context.Context, request ApproveTransitionRequest) (*ApproveTransitionRequestResponse, error) { var approveTransitionRequestResponse ApproveTransitionRequestResponse path := "/api/2.0/mlflow/transition-requests/approve" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &approveTransitionRequestResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &approveTransitionRequestResponse) return &approveTransitionRequestResponse, err } func (a *modelRegistryImpl) CreateComment(ctx context.Context, request CreateComment) (*CreateCommentResponse, error) { var createCommentResponse CreateCommentResponse path := "/api/2.0/mlflow/comments/create" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createCommentResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createCommentResponse) return &createCommentResponse, err } func (a *modelRegistryImpl) CreateModel(ctx context.Context, request CreateModelRequest) (*CreateModelResponse, error) { var createModelResponse CreateModelResponse path := "/api/2.0/mlflow/registered-models/create" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createModelResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createModelResponse) return &createModelResponse, err } func (a *modelRegistryImpl) CreateModelVersion(ctx context.Context, request CreateModelVersionRequest) (*CreateModelVersionResponse, error) { var createModelVersionResponse CreateModelVersionResponse path := "/api/2.0/mlflow/model-versions/create" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createModelVersionResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createModelVersionResponse) return &createModelVersionResponse, err } func (a *modelRegistryImpl) CreateTransitionRequest(ctx context.Context, request CreateTransitionRequest) (*CreateTransitionRequestResponse, error) { var createTransitionRequestResponse CreateTransitionRequestResponse path := "/api/2.0/mlflow/transition-requests/create" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createTransitionRequestResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createTransitionRequestResponse) return &createTransitionRequestResponse, err } func (a *modelRegistryImpl) CreateWebhook(ctx context.Context, request CreateRegistryWebhook) (*CreateWebhookResponse, error) { var createWebhookResponse CreateWebhookResponse path := "/api/2.0/mlflow/registry-webhooks/create" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createWebhookResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createWebhookResponse) return &createWebhookResponse, err } func (a *modelRegistryImpl) DeleteComment(ctx context.Context, request DeleteCommentRequest) error { var deleteCommentResponse DeleteCommentResponse path := "/api/2.0/mlflow/comments/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteCommentResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteCommentResponse) return err } func (a *modelRegistryImpl) DeleteModel(ctx context.Context, request DeleteModelRequest) error { var deleteModelResponse DeleteModelResponse path := "/api/2.0/mlflow/registered-models/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteModelResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteModelResponse) return err } func (a *modelRegistryImpl) DeleteModelTag(ctx context.Context, request DeleteModelTagRequest) error { var deleteModelTagResponse DeleteModelTagResponse path := "/api/2.0/mlflow/registered-models/delete-tag" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteModelTagResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteModelTagResponse) return err } func (a *modelRegistryImpl) DeleteModelVersion(ctx context.Context, request DeleteModelVersionRequest) error { var deleteModelVersionResponse DeleteModelVersionResponse path := "/api/2.0/mlflow/model-versions/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteModelVersionResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteModelVersionResponse) return err } func (a *modelRegistryImpl) DeleteModelVersionTag(ctx context.Context, request DeleteModelVersionTagRequest) error { var deleteModelVersionTagResponse DeleteModelVersionTagResponse path := "/api/2.0/mlflow/model-versions/delete-tag" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteModelVersionTagResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteModelVersionTagResponse) return err } func (a *modelRegistryImpl) DeleteTransitionRequest(ctx context.Context, request DeleteTransitionRequestRequest) error { var deleteTransitionRequestResponse DeleteTransitionRequestResponse path := "/api/2.0/mlflow/transition-requests/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteTransitionRequestResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteTransitionRequestResponse) return err } func (a *modelRegistryImpl) DeleteWebhook(ctx context.Context, request DeleteWebhookRequest) error { var deleteWebhookResponse DeleteWebhookResponse path := "/api/2.0/mlflow/registry-webhooks/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteWebhookResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteWebhookResponse) return err } func (a *modelRegistryImpl) GetLatestVersions(ctx context.Context, request GetLatestVersionsRequest) (*GetLatestVersionsResponse, error) { var getLatestVersionsResponse GetLatestVersionsResponse path := "/api/2.0/mlflow/registered-models/get-latest-versions" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &getLatestVersionsResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &getLatestVersionsResponse) return &getLatestVersionsResponse, err } func (a *modelRegistryImpl) GetModel(ctx context.Context, request GetModelRequest) (*GetModelResponse, error) { var getModelResponse GetModelResponse path := "/api/2.0/mlflow/databricks/registered-models/get" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getModelResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getModelResponse) return &getModelResponse, err } func (a *modelRegistryImpl) GetModelVersion(ctx context.Context, request GetModelVersionRequest) (*GetModelVersionResponse, error) { var getModelVersionResponse GetModelVersionResponse path := "/api/2.0/mlflow/model-versions/get" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getModelVersionResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getModelVersionResponse) return &getModelVersionResponse, err } func (a *modelRegistryImpl) GetModelVersionDownloadUri(ctx context.Context, request GetModelVersionDownloadUriRequest) (*GetModelVersionDownloadUriResponse, error) { var getModelVersionDownloadUriResponse GetModelVersionDownloadUriResponse path := "/api/2.0/mlflow/model-versions/get-download-uri" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getModelVersionDownloadUriResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getModelVersionDownloadUriResponse) return &getModelVersionDownloadUriResponse, err } func (a *modelRegistryImpl) GetPermissionLevels(ctx context.Context, request GetRegisteredModelPermissionLevelsRequest) (*GetRegisteredModelPermissionLevelsResponse, error) { var getRegisteredModelPermissionLevelsResponse GetRegisteredModelPermissionLevelsResponse path := fmt.Sprintf("/api/2.0/permissions/registered-models/%v/permissionLevels", request.RegisteredModelId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getRegisteredModelPermissionLevelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getRegisteredModelPermissionLevelsResponse) return &getRegisteredModelPermissionLevelsResponse, err } func (a *modelRegistryImpl) GetPermissions(ctx context.Context, request GetRegisteredModelPermissionsRequest) (*RegisteredModelPermissions, error) { var registeredModelPermissions RegisteredModelPermissions path := fmt.Sprintf("/api/2.0/permissions/registered-models/%v", request.RegisteredModelId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, ®isteredModelPermissions) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, ®isteredModelPermissions) return ®isteredModelPermissions, err } func (a *modelRegistryImpl) ListModels(ctx context.Context, request ListModelsRequest) (*ListModelsResponse, error) { var listModelsResponse ListModelsResponse path := "/api/2.0/mlflow/registered-models/list" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listModelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listModelsResponse) return &listModelsResponse, err } func (a *modelRegistryImpl) ListTransitionRequests(ctx context.Context, request ListTransitionRequestsRequest) (*ListTransitionRequestsResponse, error) { var listTransitionRequestsResponse ListTransitionRequestsResponse path := "/api/2.0/mlflow/transition-requests/list" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listTransitionRequestsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listTransitionRequestsResponse) return &listTransitionRequestsResponse, err } func (a *modelRegistryImpl) ListWebhooks(ctx context.Context, request ListWebhooksRequest) (*ListRegistryWebhooks, error) { var listRegistryWebhooks ListRegistryWebhooks path := "/api/2.0/mlflow/registry-webhooks/list" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listRegistryWebhooks) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listRegistryWebhooks) return &listRegistryWebhooks, err } func (a *modelRegistryImpl) RejectTransitionRequest(ctx context.Context, request RejectTransitionRequest) (*RejectTransitionRequestResponse, error) { var rejectTransitionRequestResponse RejectTransitionRequestResponse path := "/api/2.0/mlflow/transition-requests/reject" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &rejectTransitionRequestResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &rejectTransitionRequestResponse) return &rejectTransitionRequestResponse, err } func (a *modelRegistryImpl) RenameModel(ctx context.Context, request RenameModelRequest) (*RenameModelResponse, error) { var renameModelResponse RenameModelResponse path := "/api/2.0/mlflow/registered-models/rename" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &renameModelResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &renameModelResponse) return &renameModelResponse, err } func (a *modelRegistryImpl) SearchModelVersions(ctx context.Context, request SearchModelVersionsRequest) (*SearchModelVersionsResponse, error) { var searchModelVersionsResponse SearchModelVersionsResponse path := "/api/2.0/mlflow/model-versions/search" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &searchModelVersionsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &searchModelVersionsResponse) return &searchModelVersionsResponse, err } func (a *modelRegistryImpl) SearchModels(ctx context.Context, request SearchModelsRequest) (*SearchModelsResponse, error) { var searchModelsResponse SearchModelsResponse path := "/api/2.0/mlflow/registered-models/search" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &searchModelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &searchModelsResponse) return &searchModelsResponse, err } func (a *modelRegistryImpl) SetModelTag(ctx context.Context, request SetModelTagRequest) error { var setModelTagResponse SetModelTagResponse path := "/api/2.0/mlflow/registered-models/set-tag" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &setModelTagResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &setModelTagResponse) return err } func (a *modelRegistryImpl) SetModelVersionTag(ctx context.Context, request SetModelVersionTagRequest) error { var setModelVersionTagResponse SetModelVersionTagResponse path := "/api/2.0/mlflow/model-versions/set-tag" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &setModelVersionTagResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &setModelVersionTagResponse) return err } func (a *modelRegistryImpl) SetPermissions(ctx context.Context, request RegisteredModelPermissionsRequest) (*RegisteredModelPermissions, error) { var registeredModelPermissions RegisteredModelPermissions path := fmt.Sprintf("/api/2.0/permissions/registered-models/%v", request.RegisteredModelId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, ®isteredModelPermissions) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, ®isteredModelPermissions) return ®isteredModelPermissions, err } func (a *modelRegistryImpl) TestRegistryWebhook(ctx context.Context, request TestRegistryWebhookRequest) (*TestRegistryWebhookResponse, error) { var testRegistryWebhookResponse TestRegistryWebhookResponse path := "/api/2.0/mlflow/registry-webhooks/test" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &testRegistryWebhookResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &testRegistryWebhookResponse) return &testRegistryWebhookResponse, err } func (a *modelRegistryImpl) TransitionStage(ctx context.Context, request TransitionModelVersionStageDatabricks) (*TransitionStageResponse, error) { var transitionStageResponse TransitionStageResponse path := "/api/2.0/mlflow/databricks/model-versions/transition-stage" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &transitionStageResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &transitionStageResponse) return &transitionStageResponse, err } func (a *modelRegistryImpl) UpdateComment(ctx context.Context, request UpdateComment) (*UpdateCommentResponse, error) { var updateCommentResponse UpdateCommentResponse path := "/api/2.0/mlflow/comments/update" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &updateCommentResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateCommentResponse) return &updateCommentResponse, err } func (a *modelRegistryImpl) UpdateModel(ctx context.Context, request UpdateModelRequest) error { var updateModelResponse UpdateModelResponse path := "/api/2.0/mlflow/registered-models/update" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &updateModelResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateModelResponse) return err } func (a *modelRegistryImpl) UpdateModelVersion(ctx context.Context, request UpdateModelVersionRequest) error { var updateModelVersionResponse UpdateModelVersionResponse path := "/api/2.0/mlflow/model-versions/update" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &updateModelVersionResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateModelVersionResponse) return err } func (a *modelRegistryImpl) UpdatePermissions(ctx context.Context, request RegisteredModelPermissionsRequest) (*RegisteredModelPermissions, error) { var registeredModelPermissions RegisteredModelPermissions path := fmt.Sprintf("/api/2.0/permissions/registered-models/%v", request.RegisteredModelId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, ®isteredModelPermissions) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, ®isteredModelPermissions) return ®isteredModelPermissions, err } func (a *modelRegistryImpl) UpdateWebhook(ctx context.Context, request UpdateRegistryWebhook) error { var updateWebhookResponse UpdateWebhookResponse path := "/api/2.0/mlflow/registry-webhooks/update" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &updateWebhookResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateWebhookResponse) return err } diff --git a/service/oauth2/impl.go b/service/oauth2/impl.go index 643052a3b..484596f10 100755 --- a/service/oauth2/impl.go +++ b/service/oauth2/impl.go @@ -18,47 +18,54 @@ type accountFederationPolicyImpl struct { func (a *accountFederationPolicyImpl) Create(ctx context.Context, request CreateAccountFederationPolicyRequest) (*FederationPolicy, error) { var federationPolicy FederationPolicy path := fmt.Sprintf("/api/2.0/accounts/%v/federationPolicies", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) + queryParams["policy_id"] = request.PolicyId headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request.Policy, &federationPolicy) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Policy, &federationPolicy) return &federationPolicy, err } func (a *accountFederationPolicyImpl) Delete(ctx context.Context, request DeleteAccountFederationPolicyRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), request.PolicyId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *accountFederationPolicyImpl) Get(ctx context.Context, request GetAccountFederationPolicyRequest) (*FederationPolicy, error) { var federationPolicy FederationPolicy path := fmt.Sprintf("/api/2.0/accounts/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), request.PolicyId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &federationPolicy) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &federationPolicy) return &federationPolicy, err } func (a *accountFederationPolicyImpl) List(ctx context.Context, request ListAccountFederationPoliciesRequest) (*ListFederationPoliciesResponse, error) { var listFederationPoliciesResponse ListFederationPoliciesResponse path := fmt.Sprintf("/api/2.0/accounts/%v/federationPolicies", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listFederationPoliciesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listFederationPoliciesResponse) return &listFederationPoliciesResponse, err } func (a *accountFederationPolicyImpl) Update(ctx context.Context, request UpdateAccountFederationPolicyRequest) (*FederationPolicy, error) { var federationPolicy FederationPolicy path := fmt.Sprintf("/api/2.0/accounts/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), request.PolicyId) + queryParams := make(map[string]any) + queryParams["update_mask"] = request.UpdateMask headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request.Policy, &federationPolicy) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.Policy, &federationPolicy) return &federationPolicy, err } @@ -70,47 +77,52 @@ type customAppIntegrationImpl struct { func (a *customAppIntegrationImpl) Create(ctx context.Context, request CreateCustomAppIntegration) (*CreateCustomAppIntegrationOutput, error) { var createCustomAppIntegrationOutput CreateCustomAppIntegrationOutput path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/custom-app-integrations", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createCustomAppIntegrationOutput) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createCustomAppIntegrationOutput) return &createCustomAppIntegrationOutput, err } func (a *customAppIntegrationImpl) Delete(ctx context.Context, request DeleteCustomAppIntegrationRequest) error { var deleteCustomAppIntegrationOutput DeleteCustomAppIntegrationOutput path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/custom-app-integrations/%v", a.client.ConfiguredAccountID(), request.IntegrationId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteCustomAppIntegrationOutput) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteCustomAppIntegrationOutput) return err } func (a *customAppIntegrationImpl) Get(ctx context.Context, request GetCustomAppIntegrationRequest) (*GetCustomAppIntegrationOutput, error) { var getCustomAppIntegrationOutput GetCustomAppIntegrationOutput path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/custom-app-integrations/%v", a.client.ConfiguredAccountID(), request.IntegrationId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getCustomAppIntegrationOutput) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getCustomAppIntegrationOutput) return &getCustomAppIntegrationOutput, err } func (a *customAppIntegrationImpl) List(ctx context.Context, request ListCustomAppIntegrationsRequest) (*GetCustomAppIntegrationsOutput, error) { var getCustomAppIntegrationsOutput GetCustomAppIntegrationsOutput path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/custom-app-integrations", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getCustomAppIntegrationsOutput) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getCustomAppIntegrationsOutput) return &getCustomAppIntegrationsOutput, err } func (a *customAppIntegrationImpl) Update(ctx context.Context, request UpdateCustomAppIntegration) error { var updateCustomAppIntegrationOutput UpdateCustomAppIntegrationOutput path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/custom-app-integrations/%v", a.client.ConfiguredAccountID(), request.IntegrationId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &updateCustomAppIntegrationOutput) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateCustomAppIntegrationOutput) return err } @@ -122,9 +134,10 @@ type oAuthPublishedAppsImpl struct { func (a *oAuthPublishedAppsImpl) List(ctx context.Context, request ListOAuthPublishedAppsRequest) (*GetPublishedAppsOutput, error) { var getPublishedAppsOutput GetPublishedAppsOutput path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/published-apps", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getPublishedAppsOutput) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPublishedAppsOutput) return &getPublishedAppsOutput, err } @@ -136,47 +149,52 @@ type publishedAppIntegrationImpl struct { func (a *publishedAppIntegrationImpl) Create(ctx context.Context, request CreatePublishedAppIntegration) (*CreatePublishedAppIntegrationOutput, error) { var createPublishedAppIntegrationOutput CreatePublishedAppIntegrationOutput path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/published-app-integrations", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createPublishedAppIntegrationOutput) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createPublishedAppIntegrationOutput) return &createPublishedAppIntegrationOutput, err } func (a *publishedAppIntegrationImpl) Delete(ctx context.Context, request DeletePublishedAppIntegrationRequest) error { var deletePublishedAppIntegrationOutput DeletePublishedAppIntegrationOutput path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/published-app-integrations/%v", a.client.ConfiguredAccountID(), request.IntegrationId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deletePublishedAppIntegrationOutput) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deletePublishedAppIntegrationOutput) return err } func (a *publishedAppIntegrationImpl) Get(ctx context.Context, request GetPublishedAppIntegrationRequest) (*GetPublishedAppIntegrationOutput, error) { var getPublishedAppIntegrationOutput GetPublishedAppIntegrationOutput path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/published-app-integrations/%v", a.client.ConfiguredAccountID(), request.IntegrationId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getPublishedAppIntegrationOutput) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPublishedAppIntegrationOutput) return &getPublishedAppIntegrationOutput, err } func (a *publishedAppIntegrationImpl) List(ctx context.Context, request ListPublishedAppIntegrationsRequest) (*GetPublishedAppIntegrationsOutput, error) { var getPublishedAppIntegrationsOutput GetPublishedAppIntegrationsOutput path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/published-app-integrations", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getPublishedAppIntegrationsOutput) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPublishedAppIntegrationsOutput) return &getPublishedAppIntegrationsOutput, err } func (a *publishedAppIntegrationImpl) Update(ctx context.Context, request UpdatePublishedAppIntegration) error { var updatePublishedAppIntegrationOutput UpdatePublishedAppIntegrationOutput path := fmt.Sprintf("/api/2.0/accounts/%v/oauth2/published-app-integrations/%v", a.client.ConfiguredAccountID(), request.IntegrationId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &updatePublishedAppIntegrationOutput) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updatePublishedAppIntegrationOutput) return err } @@ -188,47 +206,54 @@ type servicePrincipalFederationPolicyImpl struct { func (a *servicePrincipalFederationPolicyImpl) Create(ctx context.Context, request CreateServicePrincipalFederationPolicyRequest) (*FederationPolicy, error) { var federationPolicy FederationPolicy path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/federationPolicies", a.client.ConfiguredAccountID(), request.ServicePrincipalId) + queryParams := make(map[string]any) + queryParams["policy_id"] = request.PolicyId headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request.Policy, &federationPolicy) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Policy, &federationPolicy) return &federationPolicy, err } func (a *servicePrincipalFederationPolicyImpl) Delete(ctx context.Context, request DeleteServicePrincipalFederationPolicyRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), request.ServicePrincipalId, request.PolicyId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *servicePrincipalFederationPolicyImpl) Get(ctx context.Context, request GetServicePrincipalFederationPolicyRequest) (*FederationPolicy, error) { var federationPolicy FederationPolicy path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), request.ServicePrincipalId, request.PolicyId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &federationPolicy) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &federationPolicy) return &federationPolicy, err } func (a *servicePrincipalFederationPolicyImpl) List(ctx context.Context, request ListServicePrincipalFederationPoliciesRequest) (*ListFederationPoliciesResponse, error) { var listFederationPoliciesResponse ListFederationPoliciesResponse path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/federationPolicies", a.client.ConfiguredAccountID(), request.ServicePrincipalId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listFederationPoliciesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listFederationPoliciesResponse) return &listFederationPoliciesResponse, err } func (a *servicePrincipalFederationPolicyImpl) Update(ctx context.Context, request UpdateServicePrincipalFederationPolicyRequest) (*FederationPolicy, error) { var federationPolicy FederationPolicy path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/federationPolicies/%v", a.client.ConfiguredAccountID(), request.ServicePrincipalId, request.PolicyId) + queryParams := make(map[string]any) + queryParams["update_mask"] = request.UpdateMask headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request.Policy, &federationPolicy) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request.Policy, &federationPolicy) return &federationPolicy, err } @@ -240,25 +265,28 @@ type servicePrincipalSecretsImpl struct { func (a *servicePrincipalSecretsImpl) Create(ctx context.Context, request CreateServicePrincipalSecretRequest) (*CreateServicePrincipalSecretResponse, error) { var createServicePrincipalSecretResponse CreateServicePrincipalSecretResponse path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/credentials/secrets", a.client.ConfiguredAccountID(), request.ServicePrincipalId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, nil, &createServicePrincipalSecretResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &createServicePrincipalSecretResponse) return &createServicePrincipalSecretResponse, err } func (a *servicePrincipalSecretsImpl) Delete(ctx context.Context, request DeleteServicePrincipalSecretRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/credentials/secrets/%v", a.client.ConfiguredAccountID(), request.ServicePrincipalId, request.SecretId) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *servicePrincipalSecretsImpl) List(ctx context.Context, request ListServicePrincipalSecretsRequest) (*ListServicePrincipalSecretsResponse, error) { var listServicePrincipalSecretsResponse ListServicePrincipalSecretsResponse path := fmt.Sprintf("/api/2.0/accounts/%v/servicePrincipals/%v/credentials/secrets", a.client.ConfiguredAccountID(), request.ServicePrincipalId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listServicePrincipalSecretsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listServicePrincipalSecretsResponse) return &listServicePrincipalSecretsResponse, err } diff --git a/service/pipelines/impl.go b/service/pipelines/impl.go index 45c169621..d4ad82054 100755 --- a/service/pipelines/impl.go +++ b/service/pipelines/impl.go @@ -18,130 +18,144 @@ type pipelinesImpl struct { func (a *pipelinesImpl) Create(ctx context.Context, request CreatePipeline) (*CreatePipelineResponse, error) { var createPipelineResponse CreatePipelineResponse path := "/api/2.0/pipelines" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createPipelineResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createPipelineResponse) return &createPipelineResponse, err } func (a *pipelinesImpl) Delete(ctx context.Context, request DeletePipelineRequest) error { var deletePipelineResponse DeletePipelineResponse path := fmt.Sprintf("/api/2.0/pipelines/%v", request.PipelineId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deletePipelineResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deletePipelineResponse) return err } func (a *pipelinesImpl) Get(ctx context.Context, request GetPipelineRequest) (*GetPipelineResponse, error) { var getPipelineResponse GetPipelineResponse path := fmt.Sprintf("/api/2.0/pipelines/%v", request.PipelineId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getPipelineResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPipelineResponse) return &getPipelineResponse, err } func (a *pipelinesImpl) GetPermissionLevels(ctx context.Context, request GetPipelinePermissionLevelsRequest) (*GetPipelinePermissionLevelsResponse, error) { var getPipelinePermissionLevelsResponse GetPipelinePermissionLevelsResponse path := fmt.Sprintf("/api/2.0/permissions/pipelines/%v/permissionLevels", request.PipelineId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getPipelinePermissionLevelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getPipelinePermissionLevelsResponse) return &getPipelinePermissionLevelsResponse, err } func (a *pipelinesImpl) GetPermissions(ctx context.Context, request GetPipelinePermissionsRequest) (*PipelinePermissions, error) { var pipelinePermissions PipelinePermissions path := fmt.Sprintf("/api/2.0/permissions/pipelines/%v", request.PipelineId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &pipelinePermissions) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &pipelinePermissions) return &pipelinePermissions, err } func (a *pipelinesImpl) GetUpdate(ctx context.Context, request GetUpdateRequest) (*GetUpdateResponse, error) { var getUpdateResponse GetUpdateResponse path := fmt.Sprintf("/api/2.0/pipelines/%v/updates/%v", request.PipelineId, request.UpdateId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getUpdateResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getUpdateResponse) return &getUpdateResponse, err } func (a *pipelinesImpl) ListPipelineEvents(ctx context.Context, request ListPipelineEventsRequest) (*ListPipelineEventsResponse, error) { var listPipelineEventsResponse ListPipelineEventsResponse path := fmt.Sprintf("/api/2.0/pipelines/%v/events", request.PipelineId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listPipelineEventsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listPipelineEventsResponse) return &listPipelineEventsResponse, err } func (a *pipelinesImpl) ListPipelines(ctx context.Context, request ListPipelinesRequest) (*ListPipelinesResponse, error) { var listPipelinesResponse ListPipelinesResponse path := "/api/2.0/pipelines" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listPipelinesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listPipelinesResponse) return &listPipelinesResponse, err } func (a *pipelinesImpl) ListUpdates(ctx context.Context, request ListUpdatesRequest) (*ListUpdatesResponse, error) { var listUpdatesResponse ListUpdatesResponse path := fmt.Sprintf("/api/2.0/pipelines/%v/updates", request.PipelineId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listUpdatesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listUpdatesResponse) return &listUpdatesResponse, err } func (a *pipelinesImpl) SetPermissions(ctx context.Context, request PipelinePermissionsRequest) (*PipelinePermissions, error) { var pipelinePermissions PipelinePermissions path := fmt.Sprintf("/api/2.0/permissions/pipelines/%v", request.PipelineId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &pipelinePermissions) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &pipelinePermissions) return &pipelinePermissions, err } func (a *pipelinesImpl) StartUpdate(ctx context.Context, request StartUpdate) (*StartUpdateResponse, error) { var startUpdateResponse StartUpdateResponse path := fmt.Sprintf("/api/2.0/pipelines/%v/updates", request.PipelineId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &startUpdateResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &startUpdateResponse) return &startUpdateResponse, err } func (a *pipelinesImpl) Stop(ctx context.Context, request StopRequest) error { var stopPipelineResponse StopPipelineResponse path := fmt.Sprintf("/api/2.0/pipelines/%v/stop", request.PipelineId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, nil, &stopPipelineResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &stopPipelineResponse) return err } func (a *pipelinesImpl) Update(ctx context.Context, request EditPipeline) error { var editPipelineResponse EditPipelineResponse path := fmt.Sprintf("/api/2.0/pipelines/%v", request.PipelineId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &editPipelineResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &editPipelineResponse) return err } func (a *pipelinesImpl) UpdatePermissions(ctx context.Context, request PipelinePermissionsRequest) (*PipelinePermissions, error) { var pipelinePermissions PipelinePermissions path := fmt.Sprintf("/api/2.0/permissions/pipelines/%v", request.PipelineId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &pipelinePermissions) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &pipelinePermissions) return &pipelinePermissions, err } diff --git a/service/pkg.go b/service/pkg.go index 0e5a53e7e..bd49b7d6b 100644 --- a/service/pkg.go +++ b/service/pkg.go @@ -48,10 +48,10 @@ // // - [marketplace.ConsumerProvidersAPI]: Providers are the entities that publish listings to the Marketplace. // -// - [provisioning.CredentialsAPI]: These APIs manage credential configurations for this workspace. -// // - [catalog.CredentialsAPI]: A credential represents an authentication and authorization mechanism for accessing services on your cloud tenant. // +// - [provisioning.CredentialsAPI]: These APIs manage credential configurations for this workspace. +// // - [settings.CredentialsManagerAPI]: Credentials manager interacts with with Identity Providers to to perform token exchanges using stored credentials and refresh tokens. // // - [settings.CspEnablementAccountAPI]: The compliance security profile settings at the account level control whether to enable it for new workspaces. diff --git a/service/provisioning/impl.go b/service/provisioning/impl.go index 6b389f472..00fe68611 100755 --- a/service/provisioning/impl.go +++ b/service/provisioning/impl.go @@ -18,37 +18,41 @@ type credentialsImpl struct { func (a *credentialsImpl) Create(ctx context.Context, request CreateCredentialRequest) (*Credential, error) { var credential Credential path := fmt.Sprintf("/api/2.0/accounts/%v/credentials", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &credential) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &credential) return &credential, err } func (a *credentialsImpl) Delete(ctx context.Context, request DeleteCredentialRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/credentials/%v", a.client.ConfiguredAccountID(), request.CredentialsId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *credentialsImpl) Get(ctx context.Context, request GetCredentialRequest) (*Credential, error) { var credential Credential path := fmt.Sprintf("/api/2.0/accounts/%v/credentials/%v", a.client.ConfiguredAccountID(), request.CredentialsId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &credential) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &credential) return &credential, err } func (a *credentialsImpl) List(ctx context.Context) ([]Credential, error) { var credentialList []Credential path := fmt.Sprintf("/api/2.0/accounts/%v/credentials", a.client.ConfiguredAccountID()) + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &credentialList) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &credentialList) return credentialList, err } @@ -60,37 +64,41 @@ type encryptionKeysImpl struct { func (a *encryptionKeysImpl) Create(ctx context.Context, request CreateCustomerManagedKeyRequest) (*CustomerManagedKey, error) { var customerManagedKey CustomerManagedKey path := fmt.Sprintf("/api/2.0/accounts/%v/customer-managed-keys", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &customerManagedKey) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &customerManagedKey) return &customerManagedKey, err } func (a *encryptionKeysImpl) Delete(ctx context.Context, request DeleteEncryptionKeyRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/customer-managed-keys/%v", a.client.ConfiguredAccountID(), request.CustomerManagedKeyId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *encryptionKeysImpl) Get(ctx context.Context, request GetEncryptionKeyRequest) (*CustomerManagedKey, error) { var customerManagedKey CustomerManagedKey path := fmt.Sprintf("/api/2.0/accounts/%v/customer-managed-keys/%v", a.client.ConfiguredAccountID(), request.CustomerManagedKeyId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &customerManagedKey) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &customerManagedKey) return &customerManagedKey, err } func (a *encryptionKeysImpl) List(ctx context.Context) ([]CustomerManagedKey, error) { var customerManagedKeyList []CustomerManagedKey path := fmt.Sprintf("/api/2.0/accounts/%v/customer-managed-keys", a.client.ConfiguredAccountID()) + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &customerManagedKeyList) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &customerManagedKeyList) return customerManagedKeyList, err } @@ -102,37 +110,41 @@ type networksImpl struct { func (a *networksImpl) Create(ctx context.Context, request CreateNetworkRequest) (*Network, error) { var network Network path := fmt.Sprintf("/api/2.0/accounts/%v/networks", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &network) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &network) return &network, err } func (a *networksImpl) Delete(ctx context.Context, request DeleteNetworkRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/networks/%v", a.client.ConfiguredAccountID(), request.NetworkId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *networksImpl) Get(ctx context.Context, request GetNetworkRequest) (*Network, error) { var network Network path := fmt.Sprintf("/api/2.0/accounts/%v/networks/%v", a.client.ConfiguredAccountID(), request.NetworkId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &network) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &network) return &network, err } func (a *networksImpl) List(ctx context.Context) ([]Network, error) { var networkList []Network path := fmt.Sprintf("/api/2.0/accounts/%v/networks", a.client.ConfiguredAccountID()) + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &networkList) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &networkList) return networkList, err } @@ -144,47 +156,52 @@ type privateAccessImpl struct { func (a *privateAccessImpl) Create(ctx context.Context, request UpsertPrivateAccessSettingsRequest) (*PrivateAccessSettings, error) { var privateAccessSettings PrivateAccessSettings path := fmt.Sprintf("/api/2.0/accounts/%v/private-access-settings", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &privateAccessSettings) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &privateAccessSettings) return &privateAccessSettings, err } func (a *privateAccessImpl) Delete(ctx context.Context, request DeletePrivateAccesRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/private-access-settings/%v", a.client.ConfiguredAccountID(), request.PrivateAccessSettingsId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *privateAccessImpl) Get(ctx context.Context, request GetPrivateAccesRequest) (*PrivateAccessSettings, error) { var privateAccessSettings PrivateAccessSettings path := fmt.Sprintf("/api/2.0/accounts/%v/private-access-settings/%v", a.client.ConfiguredAccountID(), request.PrivateAccessSettingsId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &privateAccessSettings) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &privateAccessSettings) return &privateAccessSettings, err } func (a *privateAccessImpl) List(ctx context.Context) ([]PrivateAccessSettings, error) { var privateAccessSettingsList []PrivateAccessSettings path := fmt.Sprintf("/api/2.0/accounts/%v/private-access-settings", a.client.ConfiguredAccountID()) + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &privateAccessSettingsList) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &privateAccessSettingsList) return privateAccessSettingsList, err } func (a *privateAccessImpl) Replace(ctx context.Context, request UpsertPrivateAccessSettingsRequest) error { var replaceResponse ReplaceResponse path := fmt.Sprintf("/api/2.0/accounts/%v/private-access-settings/%v", a.client.ConfiguredAccountID(), request.PrivateAccessSettingsId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &replaceResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &replaceResponse) return err } @@ -196,37 +213,41 @@ type storageImpl struct { func (a *storageImpl) Create(ctx context.Context, request CreateStorageConfigurationRequest) (*StorageConfiguration, error) { var storageConfiguration StorageConfiguration path := fmt.Sprintf("/api/2.0/accounts/%v/storage-configurations", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &storageConfiguration) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &storageConfiguration) return &storageConfiguration, err } func (a *storageImpl) Delete(ctx context.Context, request DeleteStorageRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/storage-configurations/%v", a.client.ConfiguredAccountID(), request.StorageConfigurationId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *storageImpl) Get(ctx context.Context, request GetStorageRequest) (*StorageConfiguration, error) { var storageConfiguration StorageConfiguration path := fmt.Sprintf("/api/2.0/accounts/%v/storage-configurations/%v", a.client.ConfiguredAccountID(), request.StorageConfigurationId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &storageConfiguration) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &storageConfiguration) return &storageConfiguration, err } func (a *storageImpl) List(ctx context.Context) ([]StorageConfiguration, error) { var storageConfigurationList []StorageConfiguration path := fmt.Sprintf("/api/2.0/accounts/%v/storage-configurations", a.client.ConfiguredAccountID()) + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &storageConfigurationList) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &storageConfigurationList) return storageConfigurationList, err } @@ -238,37 +259,41 @@ type vpcEndpointsImpl struct { func (a *vpcEndpointsImpl) Create(ctx context.Context, request CreateVpcEndpointRequest) (*VpcEndpoint, error) { var vpcEndpoint VpcEndpoint path := fmt.Sprintf("/api/2.0/accounts/%v/vpc-endpoints", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &vpcEndpoint) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &vpcEndpoint) return &vpcEndpoint, err } func (a *vpcEndpointsImpl) Delete(ctx context.Context, request DeleteVpcEndpointRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/vpc-endpoints/%v", a.client.ConfiguredAccountID(), request.VpcEndpointId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *vpcEndpointsImpl) Get(ctx context.Context, request GetVpcEndpointRequest) (*VpcEndpoint, error) { var vpcEndpoint VpcEndpoint path := fmt.Sprintf("/api/2.0/accounts/%v/vpc-endpoints/%v", a.client.ConfiguredAccountID(), request.VpcEndpointId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &vpcEndpoint) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &vpcEndpoint) return &vpcEndpoint, err } func (a *vpcEndpointsImpl) List(ctx context.Context) ([]VpcEndpoint, error) { var vpcEndpointList []VpcEndpoint path := fmt.Sprintf("/api/2.0/accounts/%v/vpc-endpoints", a.client.ConfiguredAccountID()) + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &vpcEndpointList) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &vpcEndpointList) return vpcEndpointList, err } @@ -280,46 +305,51 @@ type workspacesImpl struct { func (a *workspacesImpl) Create(ctx context.Context, request CreateWorkspaceRequest) (*Workspace, error) { var workspace Workspace path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &workspace) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &workspace) return &workspace, err } func (a *workspacesImpl) Delete(ctx context.Context, request DeleteWorkspaceRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v", a.client.ConfiguredAccountID(), request.WorkspaceId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *workspacesImpl) Get(ctx context.Context, request GetWorkspaceRequest) (*Workspace, error) { var workspace Workspace path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v", a.client.ConfiguredAccountID(), request.WorkspaceId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &workspace) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &workspace) return &workspace, err } func (a *workspacesImpl) List(ctx context.Context) ([]Workspace, error) { var workspaceList []Workspace path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces", a.client.ConfiguredAccountID()) + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &workspaceList) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &workspaceList) return workspaceList, err } func (a *workspacesImpl) Update(ctx context.Context, request UpdateWorkspaceRequest) error { var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/accounts/%v/workspaces/%v", a.client.ConfiguredAccountID(), request.WorkspaceId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateResponse) return err } diff --git a/service/serving/impl.go b/service/serving/impl.go index 77476ef7f..d31d545f8 100755 --- a/service/serving/impl.go +++ b/service/serving/impl.go @@ -21,161 +21,178 @@ type servingEndpointsImpl struct { func (a *servingEndpointsImpl) BuildLogs(ctx context.Context, request BuildLogsRequest) (*BuildLogsResponse, error) { var buildLogsResponse BuildLogsResponse path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/served-models/%v/build-logs", request.Name, request.ServedModelName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &buildLogsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &buildLogsResponse) return &buildLogsResponse, err } func (a *servingEndpointsImpl) Create(ctx context.Context, request CreateServingEndpoint) (*ServingEndpointDetailed, error) { var servingEndpointDetailed ServingEndpointDetailed path := "/api/2.0/serving-endpoints" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &servingEndpointDetailed) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &servingEndpointDetailed) return &servingEndpointDetailed, err } func (a *servingEndpointsImpl) Delete(ctx context.Context, request DeleteServingEndpointRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/serving-endpoints/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *servingEndpointsImpl) ExportMetrics(ctx context.Context, request ExportMetricsRequest) (*ExportMetricsResponse, error) { var exportMetricsResponse ExportMetricsResponse path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/metrics", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "text/plain" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &exportMetricsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &exportMetricsResponse) return &exportMetricsResponse, err } func (a *servingEndpointsImpl) Get(ctx context.Context, request GetServingEndpointRequest) (*ServingEndpointDetailed, error) { var servingEndpointDetailed ServingEndpointDetailed path := fmt.Sprintf("/api/2.0/serving-endpoints/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &servingEndpointDetailed) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &servingEndpointDetailed) return &servingEndpointDetailed, err } func (a *servingEndpointsImpl) GetOpenApi(ctx context.Context, request GetOpenApiRequest) error { var getOpenApiResponse GetOpenApiResponse path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/openapi", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getOpenApiResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getOpenApiResponse) return err } func (a *servingEndpointsImpl) GetPermissionLevels(ctx context.Context, request GetServingEndpointPermissionLevelsRequest) (*GetServingEndpointPermissionLevelsResponse, error) { var getServingEndpointPermissionLevelsResponse GetServingEndpointPermissionLevelsResponse path := fmt.Sprintf("/api/2.0/permissions/serving-endpoints/%v/permissionLevels", request.ServingEndpointId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getServingEndpointPermissionLevelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getServingEndpointPermissionLevelsResponse) return &getServingEndpointPermissionLevelsResponse, err } func (a *servingEndpointsImpl) GetPermissions(ctx context.Context, request GetServingEndpointPermissionsRequest) (*ServingEndpointPermissions, error) { var servingEndpointPermissions ServingEndpointPermissions path := fmt.Sprintf("/api/2.0/permissions/serving-endpoints/%v", request.ServingEndpointId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &servingEndpointPermissions) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &servingEndpointPermissions) return &servingEndpointPermissions, err } func (a *servingEndpointsImpl) List(ctx context.Context) (*ListEndpointsResponse, error) { var listEndpointsResponse ListEndpointsResponse path := "/api/2.0/serving-endpoints" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &listEndpointsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listEndpointsResponse) return &listEndpointsResponse, err } func (a *servingEndpointsImpl) Logs(ctx context.Context, request LogsRequest) (*ServerLogsResponse, error) { var serverLogsResponse ServerLogsResponse path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/served-models/%v/logs", request.Name, request.ServedModelName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &serverLogsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &serverLogsResponse) return &serverLogsResponse, err } func (a *servingEndpointsImpl) Patch(ctx context.Context, request PatchServingEndpointTags) ([]EndpointTag, error) { var endpointTagList []EndpointTag path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/tags", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &endpointTagList) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &endpointTagList) return endpointTagList, err } func (a *servingEndpointsImpl) Put(ctx context.Context, request PutRequest) (*PutResponse, error) { var putResponse PutResponse path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/rate-limits", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &putResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &putResponse) return &putResponse, err } func (a *servingEndpointsImpl) PutAiGateway(ctx context.Context, request PutAiGatewayRequest) (*PutAiGatewayResponse, error) { var putAiGatewayResponse PutAiGatewayResponse path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/ai-gateway", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &putAiGatewayResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &putAiGatewayResponse) return &putAiGatewayResponse, err } func (a *servingEndpointsImpl) Query(ctx context.Context, request QueryEndpointInput) (*QueryEndpointResponse, error) { var queryEndpointResponse QueryEndpointResponse path := fmt.Sprintf("/serving-endpoints/%v/invocations", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &queryEndpointResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &queryEndpointResponse) return &queryEndpointResponse, err } func (a *servingEndpointsImpl) SetPermissions(ctx context.Context, request ServingEndpointPermissionsRequest) (*ServingEndpointPermissions, error) { var servingEndpointPermissions ServingEndpointPermissions path := fmt.Sprintf("/api/2.0/permissions/serving-endpoints/%v", request.ServingEndpointId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &servingEndpointPermissions) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &servingEndpointPermissions) return &servingEndpointPermissions, err } func (a *servingEndpointsImpl) UpdateConfig(ctx context.Context, request EndpointCoreConfigInput) (*ServingEndpointDetailed, error) { var servingEndpointDetailed ServingEndpointDetailed path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/config", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &servingEndpointDetailed) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &servingEndpointDetailed) return &servingEndpointDetailed, err } func (a *servingEndpointsImpl) UpdatePermissions(ctx context.Context, request ServingEndpointPermissionsRequest) (*ServingEndpointPermissions, error) { var servingEndpointPermissions ServingEndpointPermissions path := fmt.Sprintf("/api/2.0/permissions/serving-endpoints/%v", request.ServingEndpointId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &servingEndpointPermissions) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &servingEndpointPermissions) return &servingEndpointPermissions, err } @@ -219,6 +236,9 @@ func (a *servingEndpointsDataPlaneImpl) Query(ctx context.Context, request Query headers["Content-Type"] = "application/json" opts := []httpclient.DoOption{} opts = append(opts, httpclient.WithRequestHeaders(headers)) + queryParams := make(map[string]any) + opts = append(opts, httpclient.WithQueryParameters(queryParams)) + var queryEndpointResponse QueryEndpointResponse opts = append(opts, httpclient.WithRequestData(request)) opts = append(opts, httpclient.WithResponseUnmarshal(&queryEndpointResponse)) diff --git a/service/settings/impl.go b/service/settings/impl.go index 3681bffc2..ea0048fc6 100755 --- a/service/settings/impl.go +++ b/service/settings/impl.go @@ -18,57 +18,63 @@ type accountIpAccessListsImpl struct { func (a *accountIpAccessListsImpl) Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error) { var createIpAccessListResponse CreateIpAccessListResponse path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createIpAccessListResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createIpAccessListResponse) return &createIpAccessListResponse, err } func (a *accountIpAccessListsImpl) Delete(ctx context.Context, request DeleteAccountIpAccessListRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists/%v", a.client.ConfiguredAccountID(), request.IpAccessListId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *accountIpAccessListsImpl) Get(ctx context.Context, request GetAccountIpAccessListRequest) (*GetIpAccessListResponse, error) { var getIpAccessListResponse GetIpAccessListResponse path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists/%v", a.client.ConfiguredAccountID(), request.IpAccessListId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getIpAccessListResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getIpAccessListResponse) return &getIpAccessListResponse, err } func (a *accountIpAccessListsImpl) List(ctx context.Context) (*GetIpAccessListsResponse, error) { var getIpAccessListsResponse GetIpAccessListsResponse path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists", a.client.ConfiguredAccountID()) + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &getIpAccessListsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &getIpAccessListsResponse) return &getIpAccessListsResponse, err } func (a *accountIpAccessListsImpl) Replace(ctx context.Context, request ReplaceIpAccessList) error { var replaceResponse ReplaceResponse path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists/%v", a.client.ConfiguredAccountID(), request.IpAccessListId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &replaceResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &replaceResponse) return err } func (a *accountIpAccessListsImpl) Update(ctx context.Context, request UpdateIpAccessList) error { var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/accounts/%v/ip-access-lists/%v", a.client.ConfiguredAccountID(), request.IpAccessListId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateResponse) return err } @@ -85,28 +91,31 @@ type aibiDashboardEmbeddingAccessPolicyImpl struct { func (a *aibiDashboardEmbeddingAccessPolicyImpl) Delete(ctx context.Context, request DeleteAibiDashboardEmbeddingAccessPolicySettingRequest) (*DeleteAibiDashboardEmbeddingAccessPolicySettingResponse, error) { var deleteAibiDashboardEmbeddingAccessPolicySettingResponse DeleteAibiDashboardEmbeddingAccessPolicySettingResponse path := "/api/2.0/settings/types/aibi_dash_embed_ws_acc_policy/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteAibiDashboardEmbeddingAccessPolicySettingResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteAibiDashboardEmbeddingAccessPolicySettingResponse) return &deleteAibiDashboardEmbeddingAccessPolicySettingResponse, err } func (a *aibiDashboardEmbeddingAccessPolicyImpl) Get(ctx context.Context, request GetAibiDashboardEmbeddingAccessPolicySettingRequest) (*AibiDashboardEmbeddingAccessPolicySetting, error) { var aibiDashboardEmbeddingAccessPolicySetting AibiDashboardEmbeddingAccessPolicySetting path := "/api/2.0/settings/types/aibi_dash_embed_ws_acc_policy/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &aibiDashboardEmbeddingAccessPolicySetting) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &aibiDashboardEmbeddingAccessPolicySetting) return &aibiDashboardEmbeddingAccessPolicySetting, err } func (a *aibiDashboardEmbeddingAccessPolicyImpl) Update(ctx context.Context, request UpdateAibiDashboardEmbeddingAccessPolicySettingRequest) (*AibiDashboardEmbeddingAccessPolicySetting, error) { var aibiDashboardEmbeddingAccessPolicySetting AibiDashboardEmbeddingAccessPolicySetting path := "/api/2.0/settings/types/aibi_dash_embed_ws_acc_policy/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &aibiDashboardEmbeddingAccessPolicySetting) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &aibiDashboardEmbeddingAccessPolicySetting) return &aibiDashboardEmbeddingAccessPolicySetting, err } @@ -118,28 +127,31 @@ type aibiDashboardEmbeddingApprovedDomainsImpl struct { func (a *aibiDashboardEmbeddingApprovedDomainsImpl) Delete(ctx context.Context, request DeleteAibiDashboardEmbeddingApprovedDomainsSettingRequest) (*DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse, error) { var deleteAibiDashboardEmbeddingApprovedDomainsSettingResponse DeleteAibiDashboardEmbeddingApprovedDomainsSettingResponse path := "/api/2.0/settings/types/aibi_dash_embed_ws_apprvd_domains/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteAibiDashboardEmbeddingApprovedDomainsSettingResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteAibiDashboardEmbeddingApprovedDomainsSettingResponse) return &deleteAibiDashboardEmbeddingApprovedDomainsSettingResponse, err } func (a *aibiDashboardEmbeddingApprovedDomainsImpl) Get(ctx context.Context, request GetAibiDashboardEmbeddingApprovedDomainsSettingRequest) (*AibiDashboardEmbeddingApprovedDomainsSetting, error) { var aibiDashboardEmbeddingApprovedDomainsSetting AibiDashboardEmbeddingApprovedDomainsSetting path := "/api/2.0/settings/types/aibi_dash_embed_ws_apprvd_domains/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &aibiDashboardEmbeddingApprovedDomainsSetting) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &aibiDashboardEmbeddingApprovedDomainsSetting) return &aibiDashboardEmbeddingApprovedDomainsSetting, err } func (a *aibiDashboardEmbeddingApprovedDomainsImpl) Update(ctx context.Context, request UpdateAibiDashboardEmbeddingApprovedDomainsSettingRequest) (*AibiDashboardEmbeddingApprovedDomainsSetting, error) { var aibiDashboardEmbeddingApprovedDomainsSetting AibiDashboardEmbeddingApprovedDomainsSetting path := "/api/2.0/settings/types/aibi_dash_embed_ws_apprvd_domains/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &aibiDashboardEmbeddingApprovedDomainsSetting) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &aibiDashboardEmbeddingApprovedDomainsSetting) return &aibiDashboardEmbeddingApprovedDomainsSetting, err } @@ -151,19 +163,21 @@ type automaticClusterUpdateImpl struct { func (a *automaticClusterUpdateImpl) Get(ctx context.Context, request GetAutomaticClusterUpdateSettingRequest) (*AutomaticClusterUpdateSetting, error) { var automaticClusterUpdateSetting AutomaticClusterUpdateSetting path := "/api/2.0/settings/types/automatic_cluster_update/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &automaticClusterUpdateSetting) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &automaticClusterUpdateSetting) return &automaticClusterUpdateSetting, err } func (a *automaticClusterUpdateImpl) Update(ctx context.Context, request UpdateAutomaticClusterUpdateSettingRequest) (*AutomaticClusterUpdateSetting, error) { var automaticClusterUpdateSetting AutomaticClusterUpdateSetting path := "/api/2.0/settings/types/automatic_cluster_update/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &automaticClusterUpdateSetting) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &automaticClusterUpdateSetting) return &automaticClusterUpdateSetting, err } @@ -175,19 +189,21 @@ type complianceSecurityProfileImpl struct { func (a *complianceSecurityProfileImpl) Get(ctx context.Context, request GetComplianceSecurityProfileSettingRequest) (*ComplianceSecurityProfileSetting, error) { var complianceSecurityProfileSetting ComplianceSecurityProfileSetting path := "/api/2.0/settings/types/shield_csp_enablement_ws_db/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &complianceSecurityProfileSetting) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &complianceSecurityProfileSetting) return &complianceSecurityProfileSetting, err } func (a *complianceSecurityProfileImpl) Update(ctx context.Context, request UpdateComplianceSecurityProfileSettingRequest) (*ComplianceSecurityProfileSetting, error) { var complianceSecurityProfileSetting ComplianceSecurityProfileSetting path := "/api/2.0/settings/types/shield_csp_enablement_ws_db/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &complianceSecurityProfileSetting) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &complianceSecurityProfileSetting) return &complianceSecurityProfileSetting, err } @@ -199,10 +215,11 @@ type credentialsManagerImpl struct { func (a *credentialsManagerImpl) ExchangeToken(ctx context.Context, request ExchangeTokenRequest) (*ExchangeTokenResponse, error) { var exchangeTokenResponse ExchangeTokenResponse path := "/api/2.0/credentials-manager/exchange-tokens/token" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &exchangeTokenResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &exchangeTokenResponse) return &exchangeTokenResponse, err } @@ -214,19 +231,21 @@ type cspEnablementAccountImpl struct { func (a *cspEnablementAccountImpl) Get(ctx context.Context, request GetCspEnablementAccountSettingRequest) (*CspEnablementAccountSetting, error) { var cspEnablementAccountSetting CspEnablementAccountSetting path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/shield_csp_enablement_ac/names/default", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &cspEnablementAccountSetting) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &cspEnablementAccountSetting) return &cspEnablementAccountSetting, err } func (a *cspEnablementAccountImpl) Update(ctx context.Context, request UpdateCspEnablementAccountSettingRequest) (*CspEnablementAccountSetting, error) { var cspEnablementAccountSetting CspEnablementAccountSetting path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/shield_csp_enablement_ac/names/default", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &cspEnablementAccountSetting) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &cspEnablementAccountSetting) return &cspEnablementAccountSetting, err } @@ -238,28 +257,31 @@ type defaultNamespaceImpl struct { func (a *defaultNamespaceImpl) Delete(ctx context.Context, request DeleteDefaultNamespaceSettingRequest) (*DeleteDefaultNamespaceSettingResponse, error) { var deleteDefaultNamespaceSettingResponse DeleteDefaultNamespaceSettingResponse path := "/api/2.0/settings/types/default_namespace_ws/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteDefaultNamespaceSettingResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteDefaultNamespaceSettingResponse) return &deleteDefaultNamespaceSettingResponse, err } func (a *defaultNamespaceImpl) Get(ctx context.Context, request GetDefaultNamespaceSettingRequest) (*DefaultNamespaceSetting, error) { var defaultNamespaceSetting DefaultNamespaceSetting path := "/api/2.0/settings/types/default_namespace_ws/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &defaultNamespaceSetting) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &defaultNamespaceSetting) return &defaultNamespaceSetting, err } func (a *defaultNamespaceImpl) Update(ctx context.Context, request UpdateDefaultNamespaceSettingRequest) (*DefaultNamespaceSetting, error) { var defaultNamespaceSetting DefaultNamespaceSetting path := "/api/2.0/settings/types/default_namespace_ws/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &defaultNamespaceSetting) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &defaultNamespaceSetting) return &defaultNamespaceSetting, err } @@ -271,28 +293,31 @@ type disableLegacyAccessImpl struct { func (a *disableLegacyAccessImpl) Delete(ctx context.Context, request DeleteDisableLegacyAccessRequest) (*DeleteDisableLegacyAccessResponse, error) { var deleteDisableLegacyAccessResponse DeleteDisableLegacyAccessResponse path := "/api/2.0/settings/types/disable_legacy_access/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteDisableLegacyAccessResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteDisableLegacyAccessResponse) return &deleteDisableLegacyAccessResponse, err } func (a *disableLegacyAccessImpl) Get(ctx context.Context, request GetDisableLegacyAccessRequest) (*DisableLegacyAccess, error) { var disableLegacyAccess DisableLegacyAccess path := "/api/2.0/settings/types/disable_legacy_access/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &disableLegacyAccess) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &disableLegacyAccess) return &disableLegacyAccess, err } func (a *disableLegacyAccessImpl) Update(ctx context.Context, request UpdateDisableLegacyAccessRequest) (*DisableLegacyAccess, error) { var disableLegacyAccess DisableLegacyAccess path := "/api/2.0/settings/types/disable_legacy_access/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &disableLegacyAccess) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &disableLegacyAccess) return &disableLegacyAccess, err } @@ -304,28 +329,31 @@ type disableLegacyDbfsImpl struct { func (a *disableLegacyDbfsImpl) Delete(ctx context.Context, request DeleteDisableLegacyDbfsRequest) (*DeleteDisableLegacyDbfsResponse, error) { var deleteDisableLegacyDbfsResponse DeleteDisableLegacyDbfsResponse path := "/api/2.0/settings/types/disable_legacy_dbfs/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteDisableLegacyDbfsResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteDisableLegacyDbfsResponse) return &deleteDisableLegacyDbfsResponse, err } func (a *disableLegacyDbfsImpl) Get(ctx context.Context, request GetDisableLegacyDbfsRequest) (*DisableLegacyDbfs, error) { var disableLegacyDbfs DisableLegacyDbfs path := "/api/2.0/settings/types/disable_legacy_dbfs/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &disableLegacyDbfs) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &disableLegacyDbfs) return &disableLegacyDbfs, err } func (a *disableLegacyDbfsImpl) Update(ctx context.Context, request UpdateDisableLegacyDbfsRequest) (*DisableLegacyDbfs, error) { var disableLegacyDbfs DisableLegacyDbfs path := "/api/2.0/settings/types/disable_legacy_dbfs/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &disableLegacyDbfs) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &disableLegacyDbfs) return &disableLegacyDbfs, err } @@ -337,28 +365,31 @@ type disableLegacyFeaturesImpl struct { func (a *disableLegacyFeaturesImpl) Delete(ctx context.Context, request DeleteDisableLegacyFeaturesRequest) (*DeleteDisableLegacyFeaturesResponse, error) { var deleteDisableLegacyFeaturesResponse DeleteDisableLegacyFeaturesResponse path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/disable_legacy_features/names/default", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteDisableLegacyFeaturesResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteDisableLegacyFeaturesResponse) return &deleteDisableLegacyFeaturesResponse, err } func (a *disableLegacyFeaturesImpl) Get(ctx context.Context, request GetDisableLegacyFeaturesRequest) (*DisableLegacyFeatures, error) { var disableLegacyFeatures DisableLegacyFeatures path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/disable_legacy_features/names/default", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &disableLegacyFeatures) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &disableLegacyFeatures) return &disableLegacyFeatures, err } func (a *disableLegacyFeaturesImpl) Update(ctx context.Context, request UpdateDisableLegacyFeaturesRequest) (*DisableLegacyFeatures, error) { var disableLegacyFeatures DisableLegacyFeatures path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/disable_legacy_features/names/default", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &disableLegacyFeatures) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &disableLegacyFeatures) return &disableLegacyFeatures, err } @@ -370,19 +401,21 @@ type enhancedSecurityMonitoringImpl struct { func (a *enhancedSecurityMonitoringImpl) Get(ctx context.Context, request GetEnhancedSecurityMonitoringSettingRequest) (*EnhancedSecurityMonitoringSetting, error) { var enhancedSecurityMonitoringSetting EnhancedSecurityMonitoringSetting path := "/api/2.0/settings/types/shield_esm_enablement_ws_db/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &enhancedSecurityMonitoringSetting) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &enhancedSecurityMonitoringSetting) return &enhancedSecurityMonitoringSetting, err } func (a *enhancedSecurityMonitoringImpl) Update(ctx context.Context, request UpdateEnhancedSecurityMonitoringSettingRequest) (*EnhancedSecurityMonitoringSetting, error) { var enhancedSecurityMonitoringSetting EnhancedSecurityMonitoringSetting path := "/api/2.0/settings/types/shield_esm_enablement_ws_db/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &enhancedSecurityMonitoringSetting) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &enhancedSecurityMonitoringSetting) return &enhancedSecurityMonitoringSetting, err } @@ -394,19 +427,21 @@ type esmEnablementAccountImpl struct { func (a *esmEnablementAccountImpl) Get(ctx context.Context, request GetEsmEnablementAccountSettingRequest) (*EsmEnablementAccountSetting, error) { var esmEnablementAccountSetting EsmEnablementAccountSetting path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/shield_esm_enablement_ac/names/default", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &esmEnablementAccountSetting) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &esmEnablementAccountSetting) return &esmEnablementAccountSetting, err } func (a *esmEnablementAccountImpl) Update(ctx context.Context, request UpdateEsmEnablementAccountSettingRequest) (*EsmEnablementAccountSetting, error) { var esmEnablementAccountSetting EsmEnablementAccountSetting path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/shield_esm_enablement_ac/names/default", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &esmEnablementAccountSetting) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &esmEnablementAccountSetting) return &esmEnablementAccountSetting, err } @@ -418,57 +453,63 @@ type ipAccessListsImpl struct { func (a *ipAccessListsImpl) Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error) { var createIpAccessListResponse CreateIpAccessListResponse path := "/api/2.0/ip-access-lists" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createIpAccessListResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createIpAccessListResponse) return &createIpAccessListResponse, err } func (a *ipAccessListsImpl) Delete(ctx context.Context, request DeleteIpAccessListRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/ip-access-lists/%v", request.IpAccessListId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *ipAccessListsImpl) Get(ctx context.Context, request GetIpAccessListRequest) (*FetchIpAccessListResponse, error) { var fetchIpAccessListResponse FetchIpAccessListResponse path := fmt.Sprintf("/api/2.0/ip-access-lists/%v", request.IpAccessListId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &fetchIpAccessListResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &fetchIpAccessListResponse) return &fetchIpAccessListResponse, err } func (a *ipAccessListsImpl) List(ctx context.Context) (*ListIpAccessListResponse, error) { var listIpAccessListResponse ListIpAccessListResponse path := "/api/2.0/ip-access-lists" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &listIpAccessListResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listIpAccessListResponse) return &listIpAccessListResponse, err } func (a *ipAccessListsImpl) Replace(ctx context.Context, request ReplaceIpAccessList) error { var replaceResponse ReplaceResponse path := fmt.Sprintf("/api/2.0/ip-access-lists/%v", request.IpAccessListId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &replaceResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &replaceResponse) return err } func (a *ipAccessListsImpl) Update(ctx context.Context, request UpdateIpAccessList) error { var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/ip-access-lists/%v", request.IpAccessListId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateResponse) return err } @@ -480,74 +521,82 @@ type networkConnectivityImpl struct { func (a *networkConnectivityImpl) CreateNetworkConnectivityConfiguration(ctx context.Context, request CreateNetworkConnectivityConfigRequest) (*NetworkConnectivityConfiguration, error) { var networkConnectivityConfiguration NetworkConnectivityConfiguration path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &networkConnectivityConfiguration) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &networkConnectivityConfiguration) return &networkConnectivityConfiguration, err } func (a *networkConnectivityImpl) CreatePrivateEndpointRule(ctx context.Context, request CreatePrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, error) { var nccAzurePrivateEndpointRule NccAzurePrivateEndpointRule path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v/private-endpoint-rules", a.client.ConfiguredAccountID(), request.NetworkConnectivityConfigId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &nccAzurePrivateEndpointRule) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &nccAzurePrivateEndpointRule) return &nccAzurePrivateEndpointRule, err } func (a *networkConnectivityImpl) DeleteNetworkConnectivityConfiguration(ctx context.Context, request DeleteNetworkConnectivityConfigurationRequest) error { var deleteNetworkConnectivityConfigurationResponse DeleteNetworkConnectivityConfigurationResponse path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v", a.client.ConfiguredAccountID(), request.NetworkConnectivityConfigId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteNetworkConnectivityConfigurationResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteNetworkConnectivityConfigurationResponse) return err } func (a *networkConnectivityImpl) DeletePrivateEndpointRule(ctx context.Context, request DeletePrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, error) { var nccAzurePrivateEndpointRule NccAzurePrivateEndpointRule path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v/private-endpoint-rules/%v", a.client.ConfiguredAccountID(), request.NetworkConnectivityConfigId, request.PrivateEndpointRuleId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &nccAzurePrivateEndpointRule) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &nccAzurePrivateEndpointRule) return &nccAzurePrivateEndpointRule, err } func (a *networkConnectivityImpl) GetNetworkConnectivityConfiguration(ctx context.Context, request GetNetworkConnectivityConfigurationRequest) (*NetworkConnectivityConfiguration, error) { var networkConnectivityConfiguration NetworkConnectivityConfiguration path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v", a.client.ConfiguredAccountID(), request.NetworkConnectivityConfigId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &networkConnectivityConfiguration) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &networkConnectivityConfiguration) return &networkConnectivityConfiguration, err } func (a *networkConnectivityImpl) GetPrivateEndpointRule(ctx context.Context, request GetPrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, error) { var nccAzurePrivateEndpointRule NccAzurePrivateEndpointRule path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v/private-endpoint-rules/%v", a.client.ConfiguredAccountID(), request.NetworkConnectivityConfigId, request.PrivateEndpointRuleId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &nccAzurePrivateEndpointRule) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &nccAzurePrivateEndpointRule) return &nccAzurePrivateEndpointRule, err } func (a *networkConnectivityImpl) ListNetworkConnectivityConfigurations(ctx context.Context, request ListNetworkConnectivityConfigurationsRequest) (*ListNetworkConnectivityConfigurationsResponse, error) { var listNetworkConnectivityConfigurationsResponse ListNetworkConnectivityConfigurationsResponse path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listNetworkConnectivityConfigurationsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listNetworkConnectivityConfigurationsResponse) return &listNetworkConnectivityConfigurationsResponse, err } func (a *networkConnectivityImpl) ListPrivateEndpointRules(ctx context.Context, request ListPrivateEndpointRulesRequest) (*ListNccAzurePrivateEndpointRulesResponse, error) { var listNccAzurePrivateEndpointRulesResponse ListNccAzurePrivateEndpointRulesResponse path := fmt.Sprintf("/api/2.0/accounts/%v/network-connectivity-configs/%v/private-endpoint-rules", a.client.ConfiguredAccountID(), request.NetworkConnectivityConfigId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listNccAzurePrivateEndpointRulesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listNccAzurePrivateEndpointRulesResponse) return &listNccAzurePrivateEndpointRulesResponse, err } @@ -559,47 +608,52 @@ type notificationDestinationsImpl struct { func (a *notificationDestinationsImpl) Create(ctx context.Context, request CreateNotificationDestinationRequest) (*NotificationDestination, error) { var notificationDestination NotificationDestination path := "/api/2.0/notification-destinations" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, ¬ificationDestination) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, ¬ificationDestination) return ¬ificationDestination, err } func (a *notificationDestinationsImpl) Delete(ctx context.Context, request DeleteNotificationDestinationRequest) error { var empty Empty path := fmt.Sprintf("/api/2.0/notification-destinations/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &empty) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &empty) return err } func (a *notificationDestinationsImpl) Get(ctx context.Context, request GetNotificationDestinationRequest) (*NotificationDestination, error) { var notificationDestination NotificationDestination path := fmt.Sprintf("/api/2.0/notification-destinations/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, ¬ificationDestination) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, ¬ificationDestination) return ¬ificationDestination, err } func (a *notificationDestinationsImpl) List(ctx context.Context, request ListNotificationDestinationsRequest) (*ListNotificationDestinationsResponse, error) { var listNotificationDestinationsResponse ListNotificationDestinationsResponse path := "/api/2.0/notification-destinations" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listNotificationDestinationsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listNotificationDestinationsResponse) return &listNotificationDestinationsResponse, err } func (a *notificationDestinationsImpl) Update(ctx context.Context, request UpdateNotificationDestinationRequest) (*NotificationDestination, error) { var notificationDestination NotificationDestination path := fmt.Sprintf("/api/2.0/notification-destinations/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, ¬ificationDestination) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, ¬ificationDestination) return ¬ificationDestination, err } @@ -611,28 +665,31 @@ type personalComputeImpl struct { func (a *personalComputeImpl) Delete(ctx context.Context, request DeletePersonalComputeSettingRequest) (*DeletePersonalComputeSettingResponse, error) { var deletePersonalComputeSettingResponse DeletePersonalComputeSettingResponse path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/dcp_acct_enable/names/default", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deletePersonalComputeSettingResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deletePersonalComputeSettingResponse) return &deletePersonalComputeSettingResponse, err } func (a *personalComputeImpl) Get(ctx context.Context, request GetPersonalComputeSettingRequest) (*PersonalComputeSetting, error) { var personalComputeSetting PersonalComputeSetting path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/dcp_acct_enable/names/default", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &personalComputeSetting) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &personalComputeSetting) return &personalComputeSetting, err } func (a *personalComputeImpl) Update(ctx context.Context, request UpdatePersonalComputeSettingRequest) (*PersonalComputeSetting, error) { var personalComputeSetting PersonalComputeSetting path := fmt.Sprintf("/api/2.0/accounts/%v/settings/types/dcp_acct_enable/names/default", a.client.ConfiguredAccountID()) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &personalComputeSetting) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &personalComputeSetting) return &personalComputeSetting, err } @@ -644,28 +701,31 @@ type restrictWorkspaceAdminsImpl struct { func (a *restrictWorkspaceAdminsImpl) Delete(ctx context.Context, request DeleteRestrictWorkspaceAdminsSettingRequest) (*DeleteRestrictWorkspaceAdminsSettingResponse, error) { var deleteRestrictWorkspaceAdminsSettingResponse DeleteRestrictWorkspaceAdminsSettingResponse path := "/api/2.0/settings/types/restrict_workspace_admins/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteRestrictWorkspaceAdminsSettingResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteRestrictWorkspaceAdminsSettingResponse) return &deleteRestrictWorkspaceAdminsSettingResponse, err } func (a *restrictWorkspaceAdminsImpl) Get(ctx context.Context, request GetRestrictWorkspaceAdminsSettingRequest) (*RestrictWorkspaceAdminsSetting, error) { var restrictWorkspaceAdminsSetting RestrictWorkspaceAdminsSetting path := "/api/2.0/settings/types/restrict_workspace_admins/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &restrictWorkspaceAdminsSetting) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &restrictWorkspaceAdminsSetting) return &restrictWorkspaceAdminsSetting, err } func (a *restrictWorkspaceAdminsImpl) Update(ctx context.Context, request UpdateRestrictWorkspaceAdminsSettingRequest) (*RestrictWorkspaceAdminsSetting, error) { var restrictWorkspaceAdminsSetting RestrictWorkspaceAdminsSetting path := "/api/2.0/settings/types/restrict_workspace_admins/names/default" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &restrictWorkspaceAdminsSetting) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &restrictWorkspaceAdminsSetting) return &restrictWorkspaceAdminsSetting, err } @@ -682,75 +742,83 @@ type tokenManagementImpl struct { func (a *tokenManagementImpl) CreateOboToken(ctx context.Context, request CreateOboTokenRequest) (*CreateOboTokenResponse, error) { var createOboTokenResponse CreateOboTokenResponse path := "/api/2.0/token-management/on-behalf-of/tokens" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createOboTokenResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createOboTokenResponse) return &createOboTokenResponse, err } func (a *tokenManagementImpl) Delete(ctx context.Context, request DeleteTokenManagementRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/token-management/tokens/%v", request.TokenId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *tokenManagementImpl) Get(ctx context.Context, request GetTokenManagementRequest) (*GetTokenResponse, error) { var getTokenResponse GetTokenResponse path := fmt.Sprintf("/api/2.0/token-management/tokens/%v", request.TokenId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getTokenResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getTokenResponse) return &getTokenResponse, err } func (a *tokenManagementImpl) GetPermissionLevels(ctx context.Context) (*GetTokenPermissionLevelsResponse, error) { var getTokenPermissionLevelsResponse GetTokenPermissionLevelsResponse path := "/api/2.0/permissions/authorization/tokens/permissionLevels" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &getTokenPermissionLevelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &getTokenPermissionLevelsResponse) return &getTokenPermissionLevelsResponse, err } func (a *tokenManagementImpl) GetPermissions(ctx context.Context) (*TokenPermissions, error) { var tokenPermissions TokenPermissions path := "/api/2.0/permissions/authorization/tokens" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &tokenPermissions) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &tokenPermissions) return &tokenPermissions, err } func (a *tokenManagementImpl) List(ctx context.Context, request ListTokenManagementRequest) (*ListTokensResponse, error) { var listTokensResponse ListTokensResponse path := "/api/2.0/token-management/tokens" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listTokensResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listTokensResponse) return &listTokensResponse, err } func (a *tokenManagementImpl) SetPermissions(ctx context.Context, request TokenPermissionsRequest) (*TokenPermissions, error) { var tokenPermissions TokenPermissions path := "/api/2.0/permissions/authorization/tokens" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &tokenPermissions) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &tokenPermissions) return &tokenPermissions, err } func (a *tokenManagementImpl) UpdatePermissions(ctx context.Context, request TokenPermissionsRequest) (*TokenPermissions, error) { var tokenPermissions TokenPermissions path := "/api/2.0/permissions/authorization/tokens" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &tokenPermissions) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &tokenPermissions) return &tokenPermissions, err } @@ -762,29 +830,32 @@ type tokensImpl struct { func (a *tokensImpl) Create(ctx context.Context, request CreateTokenRequest) (*CreateTokenResponse, error) { var createTokenResponse CreateTokenResponse path := "/api/2.0/token/create" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createTokenResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createTokenResponse) return &createTokenResponse, err } func (a *tokensImpl) Delete(ctx context.Context, request RevokeTokenRequest) error { var revokeTokenResponse RevokeTokenResponse path := "/api/2.0/token/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &revokeTokenResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &revokeTokenResponse) return err } func (a *tokensImpl) List(ctx context.Context) (*ListPublicTokensResponse, error) { var listPublicTokensResponse ListPublicTokensResponse path := "/api/2.0/token/list" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &listPublicTokensResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listPublicTokensResponse) return &listPublicTokensResponse, err } @@ -796,17 +867,19 @@ type workspaceConfImpl struct { func (a *workspaceConfImpl) GetStatus(ctx context.Context, request GetStatusRequest) (*map[string]string, error) { var workspaceConf map[string]string path := "/api/2.0/workspace-conf" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &workspaceConf) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &workspaceConf) return &workspaceConf, err } func (a *workspaceConfImpl) SetStatus(ctx context.Context, request WorkspaceConf) error { var setStatusResponse SetStatusResponse path := "/api/2.0/workspace-conf" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &setStatusResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &setStatusResponse) return err } diff --git a/service/sharing/impl.go b/service/sharing/impl.go index 8eb8b3378..c6e2bccb6 100755 --- a/service/sharing/impl.go +++ b/service/sharing/impl.go @@ -20,56 +20,62 @@ type providersImpl struct { func (a *providersImpl) Create(ctx context.Context, request CreateProvider) (*ProviderInfo, error) { var providerInfo ProviderInfo path := "/api/2.1/unity-catalog/providers" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &providerInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &providerInfo) return &providerInfo, err } func (a *providersImpl) Delete(ctx context.Context, request DeleteProviderRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/providers/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *providersImpl) Get(ctx context.Context, request GetProviderRequest) (*ProviderInfo, error) { var providerInfo ProviderInfo path := fmt.Sprintf("/api/2.1/unity-catalog/providers/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &providerInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &providerInfo) return &providerInfo, err } func (a *providersImpl) List(ctx context.Context, request ListProvidersRequest) (*ListProvidersResponse, error) { var listProvidersResponse ListProvidersResponse path := "/api/2.1/unity-catalog/providers" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listProvidersResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listProvidersResponse) return &listProvidersResponse, err } func (a *providersImpl) ListShares(ctx context.Context, request ListSharesRequest) (*ListProviderSharesResponse, error) { var listProviderSharesResponse ListProviderSharesResponse path := fmt.Sprintf("/api/2.1/unity-catalog/providers/%v/shares", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listProviderSharesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listProviderSharesResponse) return &listProviderSharesResponse, err } func (a *providersImpl) Update(ctx context.Context, request UpdateProvider) (*ProviderInfo, error) { var providerInfo ProviderInfo path := fmt.Sprintf("/api/2.1/unity-catalog/providers/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &providerInfo) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &providerInfo) return &providerInfo, err } @@ -81,18 +87,20 @@ type recipientActivationImpl struct { func (a *recipientActivationImpl) GetActivationUrlInfo(ctx context.Context, request GetActivationUrlInfoRequest) error { var getActivationUrlInfoResponse GetActivationUrlInfoResponse path := fmt.Sprintf("/api/2.1/unity-catalog/public/data_sharing_activation_info/%v", request.ActivationUrl) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getActivationUrlInfoResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getActivationUrlInfoResponse) return err } func (a *recipientActivationImpl) RetrieveToken(ctx context.Context, request RetrieveTokenRequest) (*RetrieveTokenResponse, error) { var retrieveTokenResponse RetrieveTokenResponse path := fmt.Sprintf("/api/2.1/unity-catalog/public/data_sharing_activation/%v", request.ActivationUrl) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &retrieveTokenResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &retrieveTokenResponse) return &retrieveTokenResponse, err } @@ -104,66 +112,73 @@ type recipientsImpl struct { func (a *recipientsImpl) Create(ctx context.Context, request CreateRecipient) (*RecipientInfo, error) { var recipientInfo RecipientInfo path := "/api/2.1/unity-catalog/recipients" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &recipientInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &recipientInfo) return &recipientInfo, err } func (a *recipientsImpl) Delete(ctx context.Context, request DeleteRecipientRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/recipients/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *recipientsImpl) Get(ctx context.Context, request GetRecipientRequest) (*RecipientInfo, error) { var recipientInfo RecipientInfo path := fmt.Sprintf("/api/2.1/unity-catalog/recipients/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &recipientInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &recipientInfo) return &recipientInfo, err } func (a *recipientsImpl) List(ctx context.Context, request ListRecipientsRequest) (*ListRecipientsResponse, error) { var listRecipientsResponse ListRecipientsResponse path := "/api/2.1/unity-catalog/recipients" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listRecipientsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listRecipientsResponse) return &listRecipientsResponse, err } func (a *recipientsImpl) RotateToken(ctx context.Context, request RotateRecipientToken) (*RecipientInfo, error) { var recipientInfo RecipientInfo path := fmt.Sprintf("/api/2.1/unity-catalog/recipients/%v/rotate-token", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &recipientInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &recipientInfo) return &recipientInfo, err } func (a *recipientsImpl) SharePermissions(ctx context.Context, request SharePermissionsRequest) (*GetRecipientSharePermissionsResponse, error) { var getRecipientSharePermissionsResponse GetRecipientSharePermissionsResponse path := fmt.Sprintf("/api/2.1/unity-catalog/recipients/%v/share-permissions", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getRecipientSharePermissionsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getRecipientSharePermissionsResponse) return &getRecipientSharePermissionsResponse, err } func (a *recipientsImpl) Update(ctx context.Context, request UpdateRecipient) error { var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.1/unity-catalog/recipients/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateResponse) return err } @@ -175,65 +190,74 @@ type sharesImpl struct { func (a *sharesImpl) Create(ctx context.Context, request CreateShare) (*ShareInfo, error) { var shareInfo ShareInfo path := "/api/2.1/unity-catalog/shares" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &shareInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &shareInfo) return &shareInfo, err } func (a *sharesImpl) Delete(ctx context.Context, request DeleteShareRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.1/unity-catalog/shares/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *sharesImpl) Get(ctx context.Context, request GetShareRequest) (*ShareInfo, error) { var shareInfo ShareInfo path := fmt.Sprintf("/api/2.1/unity-catalog/shares/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &shareInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &shareInfo) return &shareInfo, err } func (a *sharesImpl) List(ctx context.Context, request ListSharesRequest) (*ListSharesResponse, error) { var listSharesResponse ListSharesResponse path := "/api/2.1/unity-catalog/shares" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listSharesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listSharesResponse) return &listSharesResponse, err } func (a *sharesImpl) SharePermissions(ctx context.Context, request SharePermissionsRequest) (*catalog.PermissionsList, error) { var permissionsList catalog.PermissionsList path := fmt.Sprintf("/api/2.1/unity-catalog/shares/%v/permissions", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &permissionsList) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &permissionsList) return &permissionsList, err } func (a *sharesImpl) Update(ctx context.Context, request UpdateShare) (*ShareInfo, error) { var shareInfo ShareInfo path := fmt.Sprintf("/api/2.1/unity-catalog/shares/%v", request.Name) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &shareInfo) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &shareInfo) return &shareInfo, err } func (a *sharesImpl) UpdatePermissions(ctx context.Context, request UpdateSharePermissions) error { var updatePermissionsResponse UpdatePermissionsResponse path := fmt.Sprintf("/api/2.1/unity-catalog/shares/%v/permissions", request.Name) + queryParams := make(map[string]any) + queryParams["max_results"] = request.MaxResults + queryParams["page_token"] = request.PageToken headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &updatePermissionsResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updatePermissionsResponse) return err } diff --git a/service/sql/impl.go b/service/sql/impl.go index eb053fd97..5ab751c15 100755 --- a/service/sql/impl.go +++ b/service/sql/impl.go @@ -18,47 +18,52 @@ type alertsImpl struct { func (a *alertsImpl) Create(ctx context.Context, request CreateAlertRequest) (*Alert, error) { var alert Alert path := "/api/2.0/sql/alerts" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &alert) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &alert) return &alert, err } func (a *alertsImpl) Delete(ctx context.Context, request TrashAlertRequest) error { var empty Empty path := fmt.Sprintf("/api/2.0/sql/alerts/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &empty) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &empty) return err } func (a *alertsImpl) Get(ctx context.Context, request GetAlertRequest) (*Alert, error) { var alert Alert path := fmt.Sprintf("/api/2.0/sql/alerts/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &alert) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &alert) return &alert, err } func (a *alertsImpl) List(ctx context.Context, request ListAlertsRequest) (*ListAlertsResponse, error) { var listAlertsResponse ListAlertsResponse path := "/api/2.0/sql/alerts" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listAlertsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAlertsResponse) return &listAlertsResponse, err } func (a *alertsImpl) Update(ctx context.Context, request UpdateAlertRequest) (*Alert, error) { var alert Alert path := fmt.Sprintf("/api/2.0/sql/alerts/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &alert) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &alert) return &alert, err } @@ -70,47 +75,52 @@ type alertsLegacyImpl struct { func (a *alertsLegacyImpl) Create(ctx context.Context, request CreateAlert) (*LegacyAlert, error) { var legacyAlert LegacyAlert path := "/api/2.0/preview/sql/alerts" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &legacyAlert) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &legacyAlert) return &legacyAlert, err } func (a *alertsLegacyImpl) Delete(ctx context.Context, request DeleteAlertsLegacyRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/preview/sql/alerts/%v", request.AlertId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *alertsLegacyImpl) Get(ctx context.Context, request GetAlertsLegacyRequest) (*LegacyAlert, error) { var legacyAlert LegacyAlert path := fmt.Sprintf("/api/2.0/preview/sql/alerts/%v", request.AlertId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &legacyAlert) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &legacyAlert) return &legacyAlert, err } func (a *alertsLegacyImpl) List(ctx context.Context) ([]LegacyAlert, error) { var legacyAlertList []LegacyAlert path := "/api/2.0/preview/sql/alerts" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &legacyAlertList) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &legacyAlertList) return legacyAlertList, err } func (a *alertsLegacyImpl) Update(ctx context.Context, request EditAlert) error { var updateResponse UpdateResponse path := fmt.Sprintf("/api/2.0/preview/sql/alerts/%v", request.AlertId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &updateResponse) return err } @@ -122,29 +132,32 @@ type dashboardWidgetsImpl struct { func (a *dashboardWidgetsImpl) Create(ctx context.Context, request CreateWidget) (*Widget, error) { var widget Widget path := "/api/2.0/preview/sql/widgets" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &widget) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &widget) return &widget, err } func (a *dashboardWidgetsImpl) Delete(ctx context.Context, request DeleteDashboardWidgetRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/preview/sql/widgets/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *dashboardWidgetsImpl) Update(ctx context.Context, request CreateWidget) (*Widget, error) { var widget Widget path := fmt.Sprintf("/api/2.0/preview/sql/widgets/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &widget) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &widget) return &widget, err } @@ -156,56 +169,62 @@ type dashboardsImpl struct { func (a *dashboardsImpl) Create(ctx context.Context, request DashboardPostContent) (*Dashboard, error) { var dashboard Dashboard path := "/api/2.0/preview/sql/dashboards" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &dashboard) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &dashboard) return &dashboard, err } func (a *dashboardsImpl) Delete(ctx context.Context, request DeleteDashboardRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/preview/sql/dashboards/%v", request.DashboardId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *dashboardsImpl) Get(ctx context.Context, request GetDashboardRequest) (*Dashboard, error) { var dashboard Dashboard path := fmt.Sprintf("/api/2.0/preview/sql/dashboards/%v", request.DashboardId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &dashboard) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &dashboard) return &dashboard, err } func (a *dashboardsImpl) List(ctx context.Context, request ListDashboardsRequest) (*ListResponse, error) { var listResponse ListResponse path := "/api/2.0/preview/sql/dashboards" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listResponse) return &listResponse, err } func (a *dashboardsImpl) Restore(ctx context.Context, request RestoreDashboardRequest) error { var restoreResponse RestoreResponse path := fmt.Sprintf("/api/2.0/preview/sql/dashboards/trash/%v", request.DashboardId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, nil, &restoreResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &restoreResponse) return err } func (a *dashboardsImpl) Update(ctx context.Context, request DashboardEditContent) (*Dashboard, error) { var dashboard Dashboard path := fmt.Sprintf("/api/2.0/preview/sql/dashboards/%v", request.DashboardId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &dashboard) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &dashboard) return &dashboard, err } @@ -217,9 +236,10 @@ type dataSourcesImpl struct { func (a *dataSourcesImpl) List(ctx context.Context) ([]DataSource, error) { var dataSourceList []DataSource path := "/api/2.0/preview/sql/data_sources" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &dataSourceList) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &dataSourceList) return dataSourceList, err } @@ -231,29 +251,32 @@ type dbsqlPermissionsImpl struct { func (a *dbsqlPermissionsImpl) Get(ctx context.Context, request GetDbsqlPermissionRequest) (*GetResponse, error) { var getResponse GetResponse path := fmt.Sprintf("/api/2.0/preview/sql/permissions/%v/%v", request.ObjectType, request.ObjectId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getResponse) return &getResponse, err } func (a *dbsqlPermissionsImpl) Set(ctx context.Context, request SetRequest) (*SetResponse, error) { var setResponse SetResponse path := fmt.Sprintf("/api/2.0/preview/sql/permissions/%v/%v", request.ObjectType, request.ObjectId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &setResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &setResponse) return &setResponse, err } func (a *dbsqlPermissionsImpl) TransferOwnership(ctx context.Context, request TransferOwnershipRequest) (*Success, error) { var success Success path := fmt.Sprintf("/api/2.0/preview/sql/permissions/%v/%v/transfer", request.ObjectType, request.ObjectId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &success) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &success) return &success, err } @@ -265,56 +288,62 @@ type queriesImpl struct { func (a *queriesImpl) Create(ctx context.Context, request CreateQueryRequest) (*Query, error) { var query Query path := "/api/2.0/sql/queries" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &query) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &query) return &query, err } func (a *queriesImpl) Delete(ctx context.Context, request TrashQueryRequest) error { var empty Empty path := fmt.Sprintf("/api/2.0/sql/queries/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &empty) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &empty) return err } func (a *queriesImpl) Get(ctx context.Context, request GetQueryRequest) (*Query, error) { var query Query path := fmt.Sprintf("/api/2.0/sql/queries/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &query) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &query) return &query, err } func (a *queriesImpl) List(ctx context.Context, request ListQueriesRequest) (*ListQueryObjectsResponse, error) { var listQueryObjectsResponse ListQueryObjectsResponse path := "/api/2.0/sql/queries" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listQueryObjectsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listQueryObjectsResponse) return &listQueryObjectsResponse, err } func (a *queriesImpl) ListVisualizations(ctx context.Context, request ListVisualizationsForQueryRequest) (*ListVisualizationsForQueryResponse, error) { var listVisualizationsForQueryResponse ListVisualizationsForQueryResponse path := fmt.Sprintf("/api/2.0/sql/queries/%v/visualizations", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listVisualizationsForQueryResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listVisualizationsForQueryResponse) return &listVisualizationsForQueryResponse, err } func (a *queriesImpl) Update(ctx context.Context, request UpdateQueryRequest) (*Query, error) { var query Query path := fmt.Sprintf("/api/2.0/sql/queries/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &query) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &query) return &query, err } @@ -326,56 +355,62 @@ type queriesLegacyImpl struct { func (a *queriesLegacyImpl) Create(ctx context.Context, request QueryPostContent) (*LegacyQuery, error) { var legacyQuery LegacyQuery path := "/api/2.0/preview/sql/queries" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &legacyQuery) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &legacyQuery) return &legacyQuery, err } func (a *queriesLegacyImpl) Delete(ctx context.Context, request DeleteQueriesLegacyRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/preview/sql/queries/%v", request.QueryId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *queriesLegacyImpl) Get(ctx context.Context, request GetQueriesLegacyRequest) (*LegacyQuery, error) { var legacyQuery LegacyQuery path := fmt.Sprintf("/api/2.0/preview/sql/queries/%v", request.QueryId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &legacyQuery) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &legacyQuery) return &legacyQuery, err } func (a *queriesLegacyImpl) List(ctx context.Context, request ListQueriesLegacyRequest) (*QueryList, error) { var queryList QueryList path := "/api/2.0/preview/sql/queries" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &queryList) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &queryList) return &queryList, err } func (a *queriesLegacyImpl) Restore(ctx context.Context, request RestoreQueriesLegacyRequest) error { var restoreResponse RestoreResponse path := fmt.Sprintf("/api/2.0/preview/sql/queries/trash/%v", request.QueryId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, nil, &restoreResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &restoreResponse) return err } func (a *queriesLegacyImpl) Update(ctx context.Context, request QueryEditContent) (*LegacyQuery, error) { var legacyQuery LegacyQuery path := fmt.Sprintf("/api/2.0/preview/sql/queries/%v", request.QueryId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &legacyQuery) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &legacyQuery) return &legacyQuery, err } @@ -387,9 +422,10 @@ type queryHistoryImpl struct { func (a *queryHistoryImpl) List(ctx context.Context, request ListQueryHistoryRequest) (*ListQueriesResponse, error) { var listQueriesResponse ListQueriesResponse path := "/api/2.0/sql/history/queries" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listQueriesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listQueriesResponse) return &listQueriesResponse, err } @@ -401,29 +437,32 @@ type queryVisualizationsImpl struct { func (a *queryVisualizationsImpl) Create(ctx context.Context, request CreateVisualizationRequest) (*Visualization, error) { var visualization Visualization path := "/api/2.0/sql/visualizations" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &visualization) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &visualization) return &visualization, err } func (a *queryVisualizationsImpl) Delete(ctx context.Context, request DeleteVisualizationRequest) error { var empty Empty path := fmt.Sprintf("/api/2.0/sql/visualizations/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &empty) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &empty) return err } func (a *queryVisualizationsImpl) Update(ctx context.Context, request UpdateVisualizationRequest) (*Visualization, error) { var visualization Visualization path := fmt.Sprintf("/api/2.0/sql/visualizations/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &visualization) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &visualization) return &visualization, err } @@ -435,29 +474,32 @@ type queryVisualizationsLegacyImpl struct { func (a *queryVisualizationsLegacyImpl) Create(ctx context.Context, request CreateQueryVisualizationsLegacyRequest) (*LegacyVisualization, error) { var legacyVisualization LegacyVisualization path := "/api/2.0/preview/sql/visualizations" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &legacyVisualization) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &legacyVisualization) return &legacyVisualization, err } func (a *queryVisualizationsLegacyImpl) Delete(ctx context.Context, request DeleteQueryVisualizationsLegacyRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/preview/sql/visualizations/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteResponse) return err } func (a *queryVisualizationsLegacyImpl) Update(ctx context.Context, request LegacyVisualization) (*LegacyVisualization, error) { var legacyVisualization LegacyVisualization path := fmt.Sprintf("/api/2.0/preview/sql/visualizations/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &legacyVisualization) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &legacyVisualization) return &legacyVisualization, err } @@ -469,36 +511,40 @@ type statementExecutionImpl struct { func (a *statementExecutionImpl) CancelExecution(ctx context.Context, request CancelExecutionRequest) error { var cancelExecutionResponse CancelExecutionResponse path := fmt.Sprintf("/api/2.0/sql/statements/%v/cancel", request.StatementId) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodPost, path, headers, nil, &cancelExecutionResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &cancelExecutionResponse) return err } func (a *statementExecutionImpl) ExecuteStatement(ctx context.Context, request ExecuteStatementRequest) (*StatementResponse, error) { var statementResponse StatementResponse path := "/api/2.0/sql/statements/" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &statementResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &statementResponse) return &statementResponse, err } func (a *statementExecutionImpl) GetStatement(ctx context.Context, request GetStatementRequest) (*StatementResponse, error) { var statementResponse StatementResponse path := fmt.Sprintf("/api/2.0/sql/statements/%v", request.StatementId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &statementResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &statementResponse) return &statementResponse, err } func (a *statementExecutionImpl) GetStatementResultChunkN(ctx context.Context, request GetStatementResultChunkNRequest) (*ResultData, error) { var resultData ResultData path := fmt.Sprintf("/api/2.0/sql/statements/%v/result/chunks/%v", request.StatementId, request.ChunkIndex) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &resultData) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &resultData) return &resultData, err } @@ -510,121 +556,134 @@ type warehousesImpl struct { func (a *warehousesImpl) Create(ctx context.Context, request CreateWarehouseRequest) (*CreateWarehouseResponse, error) { var createWarehouseResponse CreateWarehouseResponse path := "/api/2.0/sql/warehouses" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createWarehouseResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createWarehouseResponse) return &createWarehouseResponse, err } func (a *warehousesImpl) Delete(ctx context.Context, request DeleteWarehouseRequest) error { var deleteWarehouseResponse DeleteWarehouseResponse path := fmt.Sprintf("/api/2.0/sql/warehouses/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteWarehouseResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteWarehouseResponse) return err } func (a *warehousesImpl) Edit(ctx context.Context, request EditWarehouseRequest) error { var editWarehouseResponse EditWarehouseResponse path := fmt.Sprintf("/api/2.0/sql/warehouses/%v/edit", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &editWarehouseResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &editWarehouseResponse) return err } func (a *warehousesImpl) Get(ctx context.Context, request GetWarehouseRequest) (*GetWarehouseResponse, error) { var getWarehouseResponse GetWarehouseResponse path := fmt.Sprintf("/api/2.0/sql/warehouses/%v", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getWarehouseResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getWarehouseResponse) return &getWarehouseResponse, err } func (a *warehousesImpl) GetPermissionLevels(ctx context.Context, request GetWarehousePermissionLevelsRequest) (*GetWarehousePermissionLevelsResponse, error) { var getWarehousePermissionLevelsResponse GetWarehousePermissionLevelsResponse path := fmt.Sprintf("/api/2.0/permissions/warehouses/%v/permissionLevels", request.WarehouseId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getWarehousePermissionLevelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getWarehousePermissionLevelsResponse) return &getWarehousePermissionLevelsResponse, err } func (a *warehousesImpl) GetPermissions(ctx context.Context, request GetWarehousePermissionsRequest) (*WarehousePermissions, error) { var warehousePermissions WarehousePermissions path := fmt.Sprintf("/api/2.0/permissions/warehouses/%v", request.WarehouseId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &warehousePermissions) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &warehousePermissions) return &warehousePermissions, err } func (a *warehousesImpl) GetWorkspaceWarehouseConfig(ctx context.Context) (*GetWorkspaceWarehouseConfigResponse, error) { var getWorkspaceWarehouseConfigResponse GetWorkspaceWarehouseConfigResponse path := "/api/2.0/sql/config/warehouses" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &getWorkspaceWarehouseConfigResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &getWorkspaceWarehouseConfigResponse) return &getWorkspaceWarehouseConfigResponse, err } func (a *warehousesImpl) List(ctx context.Context, request ListWarehousesRequest) (*ListWarehousesResponse, error) { var listWarehousesResponse ListWarehousesResponse path := "/api/2.0/sql/warehouses" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listWarehousesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listWarehousesResponse) return &listWarehousesResponse, err } func (a *warehousesImpl) SetPermissions(ctx context.Context, request WarehousePermissionsRequest) (*WarehousePermissions, error) { var warehousePermissions WarehousePermissions path := fmt.Sprintf("/api/2.0/permissions/warehouses/%v", request.WarehouseId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &warehousePermissions) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &warehousePermissions) return &warehousePermissions, err } func (a *warehousesImpl) SetWorkspaceWarehouseConfig(ctx context.Context, request SetWorkspaceWarehouseConfigRequest) error { var setWorkspaceWarehouseConfigResponse SetWorkspaceWarehouseConfigResponse path := "/api/2.0/sql/config/warehouses" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &setWorkspaceWarehouseConfigResponse) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &setWorkspaceWarehouseConfigResponse) return err } func (a *warehousesImpl) Start(ctx context.Context, request StartRequest) error { var startWarehouseResponse StartWarehouseResponse path := fmt.Sprintf("/api/2.0/sql/warehouses/%v/start", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, nil, &startWarehouseResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &startWarehouseResponse) return err } func (a *warehousesImpl) Stop(ctx context.Context, request StopRequest) error { var stopWarehouseResponse StopWarehouseResponse path := fmt.Sprintf("/api/2.0/sql/warehouses/%v/stop", request.Id) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, nil, &stopWarehouseResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &stopWarehouseResponse) return err } func (a *warehousesImpl) UpdatePermissions(ctx context.Context, request WarehousePermissionsRequest) (*WarehousePermissions, error) { var warehousePermissions WarehousePermissions path := fmt.Sprintf("/api/2.0/permissions/warehouses/%v", request.WarehouseId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &warehousePermissions) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &warehousePermissions) return &warehousePermissions, err } diff --git a/service/vectorsearch/impl.go b/service/vectorsearch/impl.go index 92563db06..1e69a9afe 100755 --- a/service/vectorsearch/impl.go +++ b/service/vectorsearch/impl.go @@ -18,36 +18,40 @@ type vectorSearchEndpointsImpl struct { func (a *vectorSearchEndpointsImpl) CreateEndpoint(ctx context.Context, request CreateEndpoint) (*EndpointInfo, error) { var endpointInfo EndpointInfo path := "/api/2.0/vector-search/endpoints" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &endpointInfo) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &endpointInfo) return &endpointInfo, err } func (a *vectorSearchEndpointsImpl) DeleteEndpoint(ctx context.Context, request DeleteEndpointRequest) error { var deleteEndpointResponse DeleteEndpointResponse path := fmt.Sprintf("/api/2.0/vector-search/endpoints/%v", request.EndpointName) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteEndpointResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteEndpointResponse) return err } func (a *vectorSearchEndpointsImpl) GetEndpoint(ctx context.Context, request GetEndpointRequest) (*EndpointInfo, error) { var endpointInfo EndpointInfo path := fmt.Sprintf("/api/2.0/vector-search/endpoints/%v", request.EndpointName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &endpointInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &endpointInfo) return &endpointInfo, err } func (a *vectorSearchEndpointsImpl) ListEndpoints(ctx context.Context, request ListEndpointsRequest) (*ListEndpointResponse, error) { var listEndpointResponse ListEndpointResponse path := "/api/2.0/vector-search/endpoints" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listEndpointResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listEndpointResponse) return &listEndpointResponse, err } @@ -59,93 +63,103 @@ type vectorSearchIndexesImpl struct { func (a *vectorSearchIndexesImpl) CreateIndex(ctx context.Context, request CreateVectorIndexRequest) (*CreateVectorIndexResponse, error) { var createVectorIndexResponse CreateVectorIndexResponse path := "/api/2.0/vector-search/indexes" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createVectorIndexResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createVectorIndexResponse) return &createVectorIndexResponse, err } func (a *vectorSearchIndexesImpl) DeleteDataVectorIndex(ctx context.Context, request DeleteDataVectorIndexRequest) (*DeleteDataVectorIndexResponse, error) { var deleteDataVectorIndexResponse DeleteDataVectorIndexResponse path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/delete-data", request.IndexName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &deleteDataVectorIndexResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteDataVectorIndexResponse) return &deleteDataVectorIndexResponse, err } func (a *vectorSearchIndexesImpl) DeleteIndex(ctx context.Context, request DeleteIndexRequest) error { var deleteIndexResponse DeleteIndexResponse path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v", request.IndexName) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteIndexResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteIndexResponse) return err } func (a *vectorSearchIndexesImpl) GetIndex(ctx context.Context, request GetIndexRequest) (*VectorIndex, error) { var vectorIndex VectorIndex path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v", request.IndexName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &vectorIndex) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &vectorIndex) return &vectorIndex, err } func (a *vectorSearchIndexesImpl) ListIndexes(ctx context.Context, request ListIndexesRequest) (*ListVectorIndexesResponse, error) { var listVectorIndexesResponse ListVectorIndexesResponse path := "/api/2.0/vector-search/indexes" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listVectorIndexesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listVectorIndexesResponse) return &listVectorIndexesResponse, err } func (a *vectorSearchIndexesImpl) QueryIndex(ctx context.Context, request QueryVectorIndexRequest) (*QueryVectorIndexResponse, error) { var queryVectorIndexResponse QueryVectorIndexResponse path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/query", request.IndexName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &queryVectorIndexResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &queryVectorIndexResponse) return &queryVectorIndexResponse, err } func (a *vectorSearchIndexesImpl) QueryNextPage(ctx context.Context, request QueryVectorIndexNextPageRequest) (*QueryVectorIndexResponse, error) { var queryVectorIndexResponse QueryVectorIndexResponse path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/query-next-page", request.IndexName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &queryVectorIndexResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &queryVectorIndexResponse) return &queryVectorIndexResponse, err } func (a *vectorSearchIndexesImpl) ScanIndex(ctx context.Context, request ScanVectorIndexRequest) (*ScanVectorIndexResponse, error) { var scanVectorIndexResponse ScanVectorIndexResponse path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/scan", request.IndexName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &scanVectorIndexResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &scanVectorIndexResponse) return &scanVectorIndexResponse, err } func (a *vectorSearchIndexesImpl) SyncIndex(ctx context.Context, request SyncIndexRequest) error { var syncIndexResponse SyncIndexResponse path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/sync", request.IndexName) + queryParams := make(map[string]any) headers := make(map[string]string) - err := a.client.Do(ctx, http.MethodPost, path, headers, nil, &syncIndexResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, nil, &syncIndexResponse) return err } func (a *vectorSearchIndexesImpl) UpsertDataVectorIndex(ctx context.Context, request UpsertDataVectorIndexRequest) (*UpsertDataVectorIndexResponse, error) { var upsertDataVectorIndexResponse UpsertDataVectorIndexResponse path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/upsert-data", request.IndexName) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &upsertDataVectorIndexResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &upsertDataVectorIndexResponse) return &upsertDataVectorIndexResponse, err } diff --git a/service/workspace/ext_utilities.go b/service/workspace/ext_utilities.go index d55053c3f..f851279e3 100644 --- a/service/workspace/ext_utilities.go +++ b/service/workspace/ext_utilities.go @@ -207,7 +207,7 @@ func (a *WorkspaceAPI) Upload(ctx context.Context, path string, r io.Reader, opt headers := map[string]string{ "Content-Type": w.FormDataContentType(), } - return a.workspaceImpl.client.Do(ctx, "POST", "/api/2.0/workspace/import", headers, buf.Bytes(), nil) + return a.workspaceImpl.client.Do(ctx, "POST", "/api/2.0/workspace/import", headers, nil, buf.Bytes(), nil) } // WriteFile is identical to [os.WriteFile] but for Workspace File. @@ -241,7 +241,7 @@ func (a *WorkspaceAPI) Download(ctx context.Context, path string, opts ...Downlo v(query) } headers := map[string]string{"Content-Type": "application/json"} - err := a.workspaceImpl.client.Do(ctx, "GET", "/api/2.0/workspace/export", headers, query, &buf) + err := a.workspaceImpl.client.Do(ctx, "GET", "/api/2.0/workspace/export", headers, nil, query, &buf) if err != nil { return nil, err } diff --git a/service/workspace/impl.go b/service/workspace/impl.go index 4542d181a..63af14521 100755 --- a/service/workspace/impl.go +++ b/service/workspace/impl.go @@ -18,47 +18,52 @@ type gitCredentialsImpl struct { func (a *gitCredentialsImpl) Create(ctx context.Context, request CreateCredentialsRequest) (*CreateCredentialsResponse, error) { var createCredentialsResponse CreateCredentialsResponse path := "/api/2.0/git-credentials" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createCredentialsResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createCredentialsResponse) return &createCredentialsResponse, err } func (a *gitCredentialsImpl) Delete(ctx context.Context, request DeleteCredentialsRequest) error { var deleteCredentialsResponse DeleteCredentialsResponse path := fmt.Sprintf("/api/2.0/git-credentials/%v", request.CredentialId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteCredentialsResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteCredentialsResponse) return err } func (a *gitCredentialsImpl) Get(ctx context.Context, request GetCredentialsRequest) (*GetCredentialsResponse, error) { var getCredentialsResponse GetCredentialsResponse path := fmt.Sprintf("/api/2.0/git-credentials/%v", request.CredentialId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getCredentialsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getCredentialsResponse) return &getCredentialsResponse, err } func (a *gitCredentialsImpl) List(ctx context.Context) (*ListCredentialsResponse, error) { var listCredentialsResponse ListCredentialsResponse path := "/api/2.0/git-credentials" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &listCredentialsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listCredentialsResponse) return &listCredentialsResponse, err } func (a *gitCredentialsImpl) Update(ctx context.Context, request UpdateCredentialsRequest) error { var updateCredentialsResponse UpdateCredentialsResponse path := fmt.Sprintf("/api/2.0/git-credentials/%v", request.CredentialId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &updateCredentialsResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateCredentialsResponse) return err } @@ -70,85 +75,94 @@ type reposImpl struct { func (a *reposImpl) Create(ctx context.Context, request CreateRepoRequest) (*CreateRepoResponse, error) { var createRepoResponse CreateRepoResponse path := "/api/2.0/repos" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createRepoResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createRepoResponse) return &createRepoResponse, err } func (a *reposImpl) Delete(ctx context.Context, request DeleteRepoRequest) error { var deleteRepoResponse DeleteRepoResponse path := fmt.Sprintf("/api/2.0/repos/%v", request.RepoId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteRepoResponse) + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteRepoResponse) return err } func (a *reposImpl) Get(ctx context.Context, request GetRepoRequest) (*GetRepoResponse, error) { var getRepoResponse GetRepoResponse path := fmt.Sprintf("/api/2.0/repos/%v", request.RepoId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getRepoResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getRepoResponse) return &getRepoResponse, err } func (a *reposImpl) GetPermissionLevels(ctx context.Context, request GetRepoPermissionLevelsRequest) (*GetRepoPermissionLevelsResponse, error) { var getRepoPermissionLevelsResponse GetRepoPermissionLevelsResponse path := fmt.Sprintf("/api/2.0/permissions/repos/%v/permissionLevels", request.RepoId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getRepoPermissionLevelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getRepoPermissionLevelsResponse) return &getRepoPermissionLevelsResponse, err } func (a *reposImpl) GetPermissions(ctx context.Context, request GetRepoPermissionsRequest) (*RepoPermissions, error) { var repoPermissions RepoPermissions path := fmt.Sprintf("/api/2.0/permissions/repos/%v", request.RepoId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &repoPermissions) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &repoPermissions) return &repoPermissions, err } func (a *reposImpl) List(ctx context.Context, request ListReposRequest) (*ListReposResponse, error) { var listReposResponse ListReposResponse path := "/api/2.0/repos" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listReposResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listReposResponse) return &listReposResponse, err } func (a *reposImpl) SetPermissions(ctx context.Context, request RepoPermissionsRequest) (*RepoPermissions, error) { var repoPermissions RepoPermissions path := fmt.Sprintf("/api/2.0/permissions/repos/%v", request.RepoId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &repoPermissions) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &repoPermissions) return &repoPermissions, err } func (a *reposImpl) Update(ctx context.Context, request UpdateRepoRequest) error { var updateRepoResponse UpdateRepoResponse path := fmt.Sprintf("/api/2.0/repos/%v", request.RepoId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &updateRepoResponse) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &updateRepoResponse) return err } func (a *reposImpl) UpdatePermissions(ctx context.Context, request RepoPermissionsRequest) (*RepoPermissions, error) { var repoPermissions RepoPermissions path := fmt.Sprintf("/api/2.0/permissions/repos/%v", request.RepoId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &repoPermissions) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &repoPermissions) return &repoPermissions, err } @@ -160,105 +174,116 @@ type secretsImpl struct { func (a *secretsImpl) CreateScope(ctx context.Context, request CreateScope) error { var createScopeResponse CreateScopeResponse path := "/api/2.0/secrets/scopes/create" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createScopeResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &createScopeResponse) return err } func (a *secretsImpl) DeleteAcl(ctx context.Context, request DeleteAcl) error { var deleteAclResponse DeleteAclResponse path := "/api/2.0/secrets/acls/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &deleteAclResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteAclResponse) return err } func (a *secretsImpl) DeleteScope(ctx context.Context, request DeleteScope) error { var deleteScopeResponse DeleteScopeResponse path := "/api/2.0/secrets/scopes/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &deleteScopeResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteScopeResponse) return err } func (a *secretsImpl) DeleteSecret(ctx context.Context, request DeleteSecret) error { var deleteSecretResponse DeleteSecretResponse path := "/api/2.0/secrets/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &deleteSecretResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteSecretResponse) return err } func (a *secretsImpl) GetAcl(ctx context.Context, request GetAclRequest) (*AclItem, error) { var aclItem AclItem path := "/api/2.0/secrets/acls/get" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &aclItem) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &aclItem) return &aclItem, err } func (a *secretsImpl) GetSecret(ctx context.Context, request GetSecretRequest) (*GetSecretResponse, error) { var getSecretResponse GetSecretResponse path := "/api/2.0/secrets/get" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getSecretResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getSecretResponse) return &getSecretResponse, err } func (a *secretsImpl) ListAcls(ctx context.Context, request ListAclsRequest) (*ListAclsResponse, error) { var listAclsResponse ListAclsResponse path := "/api/2.0/secrets/acls/list" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listAclsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listAclsResponse) return &listAclsResponse, err } func (a *secretsImpl) ListScopes(ctx context.Context) (*ListScopesResponse, error) { var listScopesResponse ListScopesResponse path := "/api/2.0/secrets/scopes/list" + headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &listScopesResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, nil, nil, &listScopesResponse) return &listScopesResponse, err } func (a *secretsImpl) ListSecrets(ctx context.Context, request ListSecretsRequest) (*ListSecretsResponse, error) { var listSecretsResponse ListSecretsResponse path := "/api/2.0/secrets/list" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listSecretsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listSecretsResponse) return &listSecretsResponse, err } func (a *secretsImpl) PutAcl(ctx context.Context, request PutAcl) error { var putAclResponse PutAclResponse path := "/api/2.0/secrets/acls/put" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &putAclResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &putAclResponse) return err } func (a *secretsImpl) PutSecret(ctx context.Context, request PutSecret) error { var putSecretResponse PutSecretResponse path := "/api/2.0/secrets/put" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &putSecretResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &putSecretResponse) return err } @@ -270,94 +295,104 @@ type workspaceImpl struct { func (a *workspaceImpl) Delete(ctx context.Context, request Delete) error { var deleteResponse DeleteResponse path := "/api/2.0/workspace/delete" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &deleteResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &deleteResponse) return err } func (a *workspaceImpl) Export(ctx context.Context, request ExportRequest) (*ExportResponse, error) { var exportResponse ExportResponse path := "/api/2.0/workspace/export" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &exportResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &exportResponse) return &exportResponse, err } func (a *workspaceImpl) GetPermissionLevels(ctx context.Context, request GetWorkspaceObjectPermissionLevelsRequest) (*GetWorkspaceObjectPermissionLevelsResponse, error) { var getWorkspaceObjectPermissionLevelsResponse GetWorkspaceObjectPermissionLevelsResponse path := fmt.Sprintf("/api/2.0/permissions/%v/%v/permissionLevels", request.WorkspaceObjectType, request.WorkspaceObjectId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getWorkspaceObjectPermissionLevelsResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &getWorkspaceObjectPermissionLevelsResponse) return &getWorkspaceObjectPermissionLevelsResponse, err } func (a *workspaceImpl) GetPermissions(ctx context.Context, request GetWorkspaceObjectPermissionsRequest) (*WorkspaceObjectPermissions, error) { var workspaceObjectPermissions WorkspaceObjectPermissions path := fmt.Sprintf("/api/2.0/permissions/%v/%v", request.WorkspaceObjectType, request.WorkspaceObjectId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &workspaceObjectPermissions) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &workspaceObjectPermissions) return &workspaceObjectPermissions, err } func (a *workspaceImpl) GetStatus(ctx context.Context, request GetStatusRequest) (*ObjectInfo, error) { var objectInfo ObjectInfo path := "/api/2.0/workspace/get-status" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &objectInfo) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &objectInfo) return &objectInfo, err } func (a *workspaceImpl) Import(ctx context.Context, request Import) error { var importResponse ImportResponse path := "/api/2.0/workspace/import" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &importResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &importResponse) return err } func (a *workspaceImpl) List(ctx context.Context, request ListWorkspaceRequest) (*ListResponse, error) { var listResponse ListResponse path := "/api/2.0/workspace/list" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listResponse) + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &listResponse) return &listResponse, err } func (a *workspaceImpl) Mkdirs(ctx context.Context, request Mkdirs) error { var mkdirsResponse MkdirsResponse path := "/api/2.0/workspace/mkdirs" + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &mkdirsResponse) + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request, &mkdirsResponse) return err } func (a *workspaceImpl) SetPermissions(ctx context.Context, request WorkspaceObjectPermissionsRequest) (*WorkspaceObjectPermissions, error) { var workspaceObjectPermissions WorkspaceObjectPermissions path := fmt.Sprintf("/api/2.0/permissions/%v/%v", request.WorkspaceObjectType, request.WorkspaceObjectId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPut, path, headers, request, &workspaceObjectPermissions) + err := a.client.Do(ctx, http.MethodPut, path, headers, queryParams, request, &workspaceObjectPermissions) return &workspaceObjectPermissions, err } func (a *workspaceImpl) UpdatePermissions(ctx context.Context, request WorkspaceObjectPermissionsRequest) (*WorkspaceObjectPermissions, error) { var workspaceObjectPermissions WorkspaceObjectPermissions path := fmt.Sprintf("/api/2.0/permissions/%v/%v", request.WorkspaceObjectType, request.WorkspaceObjectId) + queryParams := make(map[string]any) headers := make(map[string]string) headers["Accept"] = "application/json" headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &workspaceObjectPermissions) + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &workspaceObjectPermissions) return &workspaceObjectPermissions, err }