Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(block): add organization_id filter in listings #1934

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions api/block/v1alpha1/block_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,9 @@ type ListSnapshotsRequest struct {
// ProjectID: filter by Project ID.
ProjectID *string `json:"-"`

// OrganizationID: filter by Organization ID.
OrganizationID *string `json:"-"`

// Page: page number.
Page *int32 `json:"-"`

Expand Down Expand Up @@ -680,6 +683,9 @@ type ListVolumesRequest struct {
// ProjectID: filter by Project ID.
ProjectID *string `json:"-"`

// OrganizationID: filter by Organization ID.
OrganizationID *string `json:"-"`

// Page: page number.
Page *int32 `json:"-"`

Expand Down Expand Up @@ -868,6 +874,7 @@ func (s *API) ListVolumes(req *ListVolumesRequest, opts ...scw.RequestOption) (*
query := url.Values{}
parameter.AddToQuery(query, "order_by", req.OrderBy)
parameter.AddToQuery(query, "project_id", req.ProjectID)
parameter.AddToQuery(query, "organization_id", req.OrganizationID)
parameter.AddToQuery(query, "page", req.Page)
parameter.AddToQuery(query, "page_size", req.PageSize)
parameter.AddToQuery(query, "name", req.Name)
Expand Down Expand Up @@ -1044,6 +1051,7 @@ func (s *API) ListSnapshots(req *ListSnapshotsRequest, opts ...scw.RequestOption
query := url.Values{}
parameter.AddToQuery(query, "order_by", req.OrderBy)
parameter.AddToQuery(query, "project_id", req.ProjectID)
parameter.AddToQuery(query, "organization_id", req.OrganizationID)
parameter.AddToQuery(query, "page", req.Page)
parameter.AddToQuery(query, "page_size", req.PageSize)
parameter.AddToQuery(query, "volume_id", req.VolumeID)
Expand Down
Loading