From 63b9b7f6ee8e442a6681c91b39a3acf77870a066 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Thu, 27 Feb 2025 07:55:06 +0000 Subject: [PATCH] feat: update generated APIs --- api/audit_trail/v1alpha1/audit_trail_sdk.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/api/audit_trail/v1alpha1/audit_trail_sdk.go b/api/audit_trail/v1alpha1/audit_trail_sdk.go index 549ed0d00..108c14afc 100644 --- a/api/audit_trail/v1alpha1/audit_trail_sdk.go +++ b/api/audit_trail/v1alpha1/audit_trail_sdk.go @@ -336,6 +336,9 @@ type ListEventsResponse struct { type ListProductsRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` + + // OrganizationID: ID of the Organization containing the Audit Trail events. + OrganizationID string `json:"organization_id"` } // ListProductsResponse: list products response. @@ -441,6 +444,14 @@ func (s *API) ListProducts(req *ListProductsRequest, opts ...scw.RequestOption) req.Region = defaultRegion } + if req.OrganizationID == "" { + defaultOrganizationID, _ := s.client.GetDefaultOrganizationID() + req.OrganizationID = defaultOrganizationID + } + + query := url.Values{} + parameter.AddToQuery(query, "organization_id", req.OrganizationID) + if fmt.Sprint(req.Region) == "" { return nil, errors.New("field Region cannot be empty in request") } @@ -448,6 +459,7 @@ func (s *API) ListProducts(req *ListProductsRequest, opts ...scw.RequestOption) scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/audit-trail/v1alpha1/regions/" + fmt.Sprint(req.Region) + "/products", + Query: query, } var resp ListProductsResponse