diff --git a/.changelog/1156.txt b/.changelog/1156.txt new file mode 100644 index 00000000000..2a19167b7df --- /dev/null +++ b/.changelog/1156.txt @@ -0,0 +1,31 @@ +```release-note:bug +firewall_rules: use empty reponse struct on each page call +``` + +```release-note:bug +filter: use empty reponse struct on each page call +``` + +```release-note:bug +email_routing_destination: use empty reponse struct on each page call +``` + +```release-note:bug +email_routing_rules: use empty reponse struct on each page call +``` + +```release-note:bug +lockdown: use empty reponse struct on each page call +``` + +```release-note:bug +queue: use empty reponse struct on each page call +``` + +```release-note:bug +teams_list: use empty reponse struct on each page call +``` + +```release-note:bug +workers_kv: use empty reponse struct on each page call +``` diff --git a/email_routing_destination.go b/email_routing_destination.go index e9705e55906..cb9e30a9453 100644 --- a/email_routing_destination.go +++ b/email_routing_destination.go @@ -61,6 +61,7 @@ func (api *API) ListEmailRoutingDestinationAddresses(ctx context.Context, rc *Re var addresses []EmailRoutingDestinationAddress var eResponse ListEmailRoutingAddressResponse for { + eResponse = ListEmailRoutingAddressResponse{} uri := buildURI(fmt.Sprintf("/accounts/%s/email/routing/addresses", rc.Identifier), params) res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil) diff --git a/email_routing_rules.go b/email_routing_rules.go index 22101b62455..a6c075f826d 100644 --- a/email_routing_rules.go +++ b/email_routing_rules.go @@ -103,6 +103,7 @@ func (api *API) ListEmailRoutingRules(ctx context.Context, rc *ResourceContainer var rules []EmailRoutingRule var rResponse ListEmailRoutingRuleResponse for { + rResponse = ListEmailRoutingRuleResponse{} uri := buildURI(fmt.Sprintf("/zones/%s/email/routing/rules", rc.Identifier), params) res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil) diff --git a/filter.go b/filter.go index 904b6b055f0..b5f084648a1 100644 --- a/filter.go +++ b/filter.go @@ -124,6 +124,7 @@ func (api *API) Filters(ctx context.Context, rc *ResourceContainer, params Filte var filters []Filter var fResponse FiltersDetailResponse for { + fResponse = FiltersDetailResponse{} uri := buildURI(fmt.Sprintf("/zones/%s/filters", rc.Identifier), params) res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil) diff --git a/firewall_rules.go b/firewall_rules.go index 4d5636c3796..51b4ae87ec2 100644 --- a/firewall_rules.go +++ b/firewall_rules.go @@ -90,6 +90,7 @@ func (api *API) FirewallRules(ctx context.Context, rc *ResourceContainer, params var firewallRules []FirewallRule var fResponse FirewallRulesDetailResponse for { + fResponse = FirewallRulesDetailResponse{} uri := buildURI(fmt.Sprintf("/zones/%s/firewall/rules", rc.Identifier), params) res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil) diff --git a/lockdown.go b/lockdown.go index 2a2f7446474..a946e5a2199 100644 --- a/lockdown.go +++ b/lockdown.go @@ -166,6 +166,7 @@ func (api *API) ListZoneLockdowns(ctx context.Context, rc *ResourceContainer, pa var zoneLockdowns []ZoneLockdown var zResponse ZoneLockdownListResponse for { + zResponse = ZoneLockdownListResponse{} uri := buildURI(fmt.Sprintf("/zones/%s/firewall/lockdowns", rc.Identifier), params) res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil) diff --git a/queue.go b/queue.go index 0bd5a4dfa6c..3b9aa5e90af 100644 --- a/queue.go +++ b/queue.go @@ -129,6 +129,7 @@ func (api *API) ListQueues(ctx context.Context, rc *ResourceContainer, params Li var queues []Queue var qResponse QueueListResponse for { + qResponse = QueueListResponse{} uri := buildURI(fmt.Sprintf("/accounts/%s/workers/queues", rc.Identifier), params) res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil) @@ -276,6 +277,7 @@ func (api *API) ListQueueConsumers(ctx context.Context, rc *ResourceContainer, p var queuesConsumers []QueueConsumer var qResponse ListQueueConsumersResponse for { + qResponse = ListQueueConsumersResponse{} uri := buildURI(fmt.Sprintf("/accounts/%s/workers/queues/%s/consumers", rc.Identifier, params.QueueName), params) res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil) diff --git a/teams_list.go b/teams_list.go index 2f430015693..30c21d9d2d5 100644 --- a/teams_list.go +++ b/teams_list.go @@ -172,6 +172,7 @@ func (api *API) ListTeamsListItems(ctx context.Context, rc *ResourceContainer, p var teamListItems []TeamsListItem var lResponse TeamsListItemsListResponse for { + lResponse = TeamsListItemsListResponse{} uri := buildURI( fmt.Sprintf("/%s/%s/gateway/lists/%s/items", rc.Level, rc.Identifier, params.ListID), params, diff --git a/workers_kv.go b/workers_kv.go index 7cdf30e3c6d..8a62924b630 100644 --- a/workers_kv.go +++ b/workers_kv.go @@ -153,6 +153,7 @@ func (api *API) ListWorkersKVNamespaces(ctx context.Context, rc *ResourceContain var namespaces []WorkersKVNamespace var nsResponse ListWorkersKVNamespacesResponse for { + nsResponse = ListWorkersKVNamespacesResponse{} uri := buildURI(fmt.Sprintf("/accounts/%s/storage/kv/namespaces", rc.Identifier), params) res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil)