diff --git a/CHANGELOG.md b/CHANGELOG.md index deb620631..29d4b1ff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ - **Feature:**: Added `IntermediateStateReached` to `AsyncActionHandler` that can be used to check for an intermediate state when executing the wait function of a wait handler - `iaas`: [v0.11.0](services/iaas/CHANGELOG.md#v0110-2024-10-11) - **Feature:** Filter networks by labels using the new `LabelSelector` method on `ApiListNetworksRequest` +- `loadbalancer`: [v0.16.0](services/loadbalancer/CHANGELOG.md#v0160-2024-10-11) +- **Feature:** Add pagination to `ListLoadBalancers` with the new fields `pageSize` and `pageId` on `ApiListLoadBalancersRequest` and the field `NextPageId` in `ListLoadBalancersResponse` ## Release (2024-09-19) diff --git a/services/loadbalancer/CHANGELOG.md b/services/loadbalancer/CHANGELOG.md index 57abd1063..dea4324c2 100644 --- a/services/loadbalancer/CHANGELOG.md +++ b/services/loadbalancer/CHANGELOG.md @@ -1,4 +1,9 @@ +## v0.16.0 (2024-10-11) + +- **Feature:** Add pagination to `ListLoadBalancers` with the new fields `pageSize` and `pageId` on `ApiListLoadBalancersRequest` and the field `NextPageId` in `ListLoadBalancersResponse` + ## v0.15.0 (2024-08-08) + - **Feature:** New API method `ListPlans` to list the available service plans ## v0.14.0 (2024-07-10) diff --git a/services/loadbalancer/api_default.go b/services/loadbalancer/api_default.go index 74da11143..d4c6a0066 100644 --- a/services/loadbalancer/api_default.go +++ b/services/loadbalancer/api_default.go @@ -1627,6 +1627,22 @@ type ApiListLoadBalancersRequest struct { ctx context.Context apiService *DefaultApiService projectId string + pageSize *string + pageId *string +} + +// page_size specifies how many load balancers should be returned on this page. Must be a positive number <= 1000 + +func (r ApiListLoadBalancersRequest) PageSize(pageSize string) ApiListLoadBalancersRequest { + r.pageSize = &pageSize + return r +} + +// page_id is a page identifier returned by the previous response and is used to request the next page + +func (r ApiListLoadBalancersRequest) PageId(pageId string) ApiListLoadBalancersRequest { + r.pageId = &pageId + return r } func (r ApiListLoadBalancersRequest) Execute() (*ListLoadBalancersResponse, error) { @@ -1649,6 +1665,12 @@ func (r ApiListLoadBalancersRequest) Execute() (*ListLoadBalancersResponse, erro localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "") + } + if r.pageId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageId", r.pageId, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/services/loadbalancer/model_list_load_balancers_response.go b/services/loadbalancer/model_list_load_balancers_response.go index 2f4608229..cea30af9a 100644 --- a/services/loadbalancer/model_list_load_balancers_response.go +++ b/services/loadbalancer/model_list_load_balancers_response.go @@ -13,4 +13,6 @@ package loadbalancer // ListLoadBalancersResponse struct for ListLoadBalancersResponse type ListLoadBalancersResponse struct { LoadBalancers *[]LoadBalancer `json:"loadBalancers,omitempty"` + // Continue token from the ListLoadBalancerResponse with Limit option + NextPageId *string `json:"nextPageId,omitempty"` }