Skip to content

Commit

Permalink
feat(iam): add filtering on multiple IDs on listing endpoints (#1972)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot committed Jan 10, 2024
1 parent 70eec6d commit 2ad2262
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion api/iam/v1alpha1/iam_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ type ListAPIKeysRequest struct {
// Expired: defines whether to filter out expired API keys or not.
Expired *bool `json:"-"`

// AccessKey: filter by access key.
// Deprecated: AccessKey: filter by access key (deprecated in favor of `access_keys`).
AccessKey *string `json:"-"`

// Description: filter by description.
Expand All @@ -1266,6 +1266,9 @@ type ListAPIKeysRequest struct {
// BearerType: filter by type of bearer.
// Default value: unknown_bearer_type
BearerType BearerType `json:"-"`

// AccessKeys: filter by a list of access keys.
AccessKeys []string `json:"-"`
}

// ListAPIKeysResponse: list api keys response.
Expand Down Expand Up @@ -1596,6 +1599,9 @@ type ListPoliciesRequest struct {

// Tag: filter by tags containing a given string.
Tag *string `json:"-"`

// PolicyIDs: filter by a list of IDs.
PolicyIDs []string `json:"-"`
}

// ListPoliciesResponse: list policies response.
Expand Down Expand Up @@ -2638,6 +2644,7 @@ func (s *API) ListPolicies(req *ListPoliciesRequest, opts ...scw.RequestOption)
parameter.AddToQuery(query, "no_principal", req.NoPrincipal)
parameter.AddToQuery(query, "policy_name", req.PolicyName)
parameter.AddToQuery(query, "tag", req.Tag)
parameter.AddToQuery(query, "policy_ids", req.PolicyIDs)

scwReq := &scw.ScalewayRequest{
Method: "GET",
Expand Down Expand Up @@ -2889,6 +2896,7 @@ func (s *API) ListAPIKeys(req *ListAPIKeysRequest, opts ...scw.RequestOption) (*
parameter.AddToQuery(query, "description", req.Description)
parameter.AddToQuery(query, "bearer_id", req.BearerID)
parameter.AddToQuery(query, "bearer_type", req.BearerType)
parameter.AddToQuery(query, "access_keys", req.AccessKeys)
parameter.AddToQuery(query, "application_id", req.ApplicationID)
parameter.AddToQuery(query, "user_id", req.UserID)

Expand Down

0 comments on commit 2ad2262

Please sign in to comment.