From 7e61ab677c9eaa730ae201cab705d942d8718914 Mon Sep 17 00:00:00 2001 From: Ed Umansky Date: Fri, 9 Oct 2026 23:58:03 -0600 Subject: [PATCH] Fix --paginate for flows, Link-header lists, and single-object GETs Contact Center paging now honours endpoints that page with `size`, report totals in `pageInfo`, or return a bare array (the flow store, functions). Other areas follow Link rel="next" headers on the same host, fall back to the endpoint's own offset parameter (start, offset, or SCIM startIndex), and stop if a page repeats. The generator only emits the --paginate branch for GETs that declare paging parameters or are list commands. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UtLeQHRwiKpRw7YnQ3KoEt --- README.md | 2 +- cmd/admin/admin_audit.go | 2 + cmd/admin/analytics.go | 21 - cmd/admin/archive_users.go | 14 - cmd/admin/authorizations.go | 8 +- cmd/admin/classifications.go | 1 + cmd/admin/data_sources.go | 28 - cmd/admin/events.go | 8 +- cmd/admin/groups.go | 9 +- cmd/admin/guest_management.go | 7 - cmd/admin/hybrid_clusters.go | 8 +- cmd/admin/hybrid_connectors.go | 8 +- cmd/admin/identity_org.go | 7 - cmd/admin/licenses.go | 8 +- cmd/admin/meeting_qualities.go | 1 + cmd/admin/org_contacts.go | 8 +- cmd/admin/organizations.go | 8 +- cmd/admin/partner_administrators.go | 14 - cmd/admin/partner_reports_templates.go | 9 +- cmd/admin/partner_tags.go | 23 +- cmd/admin/people.go | 15 +- cmd/admin/recording_report.go | 10 +- cmd/admin/recordings.go | 17 +- cmd/admin/report_templates.go | 1 + cmd/admin/reports.go | 8 +- cmd/admin/resource_groups.go | 8 +- cmd/admin/resource_memberships.go | 9 +- cmd/admin/roles.go | 8 +- cmd/admin/scim_2_groups.go | 9 +- cmd/admin/scim_2_schemas.go | 21 - cmd/admin/scim_2_users.go | 15 +- cmd/admin/security_audit.go | 1 + cmd/admin/send_activation_email.go | 8 +- cmd/admin/settings.go | 7 - cmd/admin/workspace_locations.go | 16 +- cmd/admin/workspace_metrics.go | 14 - cmd/calling/announcement_playlist.go | 9 +- cmd/calling/announcement_repository.go | 43 +- cmd/calling/auto_attendant.go | 22 +- cmd/calling/call_controls.go | 17 +- cmd/calling/call_controls_for_me.go | 8 +- cmd/calling/call_park.go | 21 - cmd/calling/call_pickup.go | 7 - cmd/calling/call_queue.go | 57 +- cmd/calling/call_recording.go | 57 +- cmd/calling/call_routing.go | 71 +- cmd/calling/call_settings_for_me.go | 626 +----------------- cmd/calling/caller_reputation_provider.go | 21 - cmd/calling/calling_service.go | 36 +- cmd/calling/client_call.go | 7 - cmd/calling/conference_controls.go | 7 - cmd/calling/converged_recordings.go | 16 +- cmd/calling/customer_assist.go | 30 +- cmd/calling/customer_experience_essentials.go | 30 +- cmd/calling/dect_devices.go | 33 +- cmd/calling/device_call.go | 189 +----- cmd/calling/devices.go | 7 - cmd/calling/emergency_services.go | 91 --- cmd/calling/external_voicemail.go | 9 +- cmd/calling/hot_desk.go | 1 + .../hot_desking_sign_in_via_voice_portal.go | 14 - cmd/calling/hunt_group.go | 21 - cmd/calling/location_call.go | 72 +- cmd/calling/location_call_handling.go | 49 -- cmd/calling/location_schedules.go | 14 - cmd/calling/location_voicemail.go | 28 - cmd/calling/locations.go | 16 +- cmd/calling/metrics.go | 7 - cmd/calling/mode_management.go | 35 - cmd/calling/numbers.go | 7 - cmd/calling/operating_modes.go | 15 +- cmd/calling/paging_group.go | 7 - cmd/calling/partner_reports_templates.go | 9 +- cmd/calling/people.go | 15 +- cmd/calling/pstn.go | 14 - cmd/calling/recording_report.go | 10 +- cmd/calling/reports.go | 8 +- cmd/calling/reports_detailed_call_history.go | 2 + cmd/calling/send_activation_email.go | 8 +- cmd/calling/single_number_reach.go | 7 - cmd/calling/user_call.go | 367 +--------- cmd/calling/virtual_extensions.go | 21 - cmd/calling/virtual_line_call.go | 156 +---- cmd/calling/workspace_call.go | 232 +------ cmd/calling/workspaces.go | 21 - cmd/cc/activities.go | 14 - cmd/cc/address_book.go | 14 - cmd/cc/agent_personal_greeting_files.go | 7 - cmd/cc/agent_wellbeing.go | 7 - cmd/cc/agents.go | 7 - cmd/cc/ai_feature.go | 14 - cmd/cc/asset.go | 7 - cmd/cc/audio_files.go | 7 - cmd/cc/auto_csat.go | 14 - cmd/cc/auxiliary_code.go | 7 - cmd/cc/business_hour.go | 7 - cmd/cc/call_monitoring.go | 7 - cmd/cc/callbacks.go | 7 - cmd/cc/campaign_manager.go | 7 - cmd/cc/channel.go | 7 - cmd/cc/contact_list_management.go | 7 - cmd/cc/contact_number.go | 7 - cmd/cc/contact_service_queue.go | 7 - cmd/cc/data_sources.go | 28 - cmd/cc/desktop_layout.go | 7 - cmd/cc/desktop_profile.go | 7 - cmd/cc/dial_number.go | 7 - cmd/cc/dial_plan.go | 7 - cmd/cc/dnc_management.go | 7 - cmd/cc/entry_point.go | 7 - cmd/cc/estimated_wait_time.go | 7 - cmd/cc/flow.go | 31 +- cmd/cc/functions.go | 8 +- cmd/cc/generated_summaries.go | 7 - cmd/cc/global_variables.go | 14 - cmd/cc/holiday_list.go | 7 - cmd/cc/journey.go | 98 --- cmd/cc/journey_profile_creation_insights.go | 63 -- cmd/cc/journey_subscription.go | 7 - cmd/cc/journey_trigger_actions.go | 21 - cmd/cc/journey_workspace_management.go | 7 - cmd/cc/multimedia_profile.go | 7 - cmd/cc/outdial_ani.go | 14 - cmd/cc/overrides.go | 7 - cmd/cc/queues.go | 7 - cmd/cc/resource_collection.go | 7 - cmd/cc/search_metadata.go | 7 - cmd/cc/site.go | 7 - cmd/cc/skill.go | 7 - cmd/cc/skill_profile.go | 7 - cmd/cc/subscriptions.go | 14 - cmd/cc/team.go | 7 - cmd/cc/templates.go | 7 - cmd/cc/usage_reports.go | 14 - cmd/cc/user_profiles.go | 14 - cmd/cc/users.go | 21 - cmd/cc/work_types.go | 7 - cmd/device/device_call.go | 189 +----- cmd/device/device_configurations.go | 1 + cmd/device/devices.go | 7 - cmd/device/hot_desk.go | 1 + cmd/device/locations.go | 16 +- cmd/device/workspace_locations.go | 16 +- cmd/device/workspace_metrics.go | 14 - cmd/device/workspace_personalization.go | 7 - cmd/device/workspaces.go | 21 - cmd/device/xapi.go | 14 - cmd/meetings/chats.go | 1 + cmd/meetings/closed_captions.go | 9 +- cmd/meetings/invitees.go | 8 +- cmd/meetings/meeting_polls.go | 3 + cmd/meetings/meeting_qa.go | 2 + cmd/meetings/meeting_qualities.go | 1 + cmd/meetings/meeting_summary.go | 2 + cmd/meetings/meetings.go | 74 +-- cmd/meetings/participants.go | 8 +- cmd/meetings/people.go | 15 +- cmd/meetings/preferences.go | 42 -- cmd/meetings/recording_report.go | 10 +- cmd/meetings/recordings.go | 17 +- cmd/meetings/session_types.go | 2 + cmd/meetings/site.go | 7 - cmd/meetings/slido.go | 1 + cmd/meetings/slidosecurepremium.go | 1 + cmd/meetings/summaries.go | 14 - cmd/meetings/tracking_codes.go | 15 +- cmd/meetings/transcripts.go | 17 +- cmd/meetings/video_mesh.go | 116 +--- cmd/meetings/webhooks.go | 8 +- cmd/messaging/attachment_actions.go | 7 - cmd/messaging/ecm_folder_linking.go | 8 +- cmd/messaging/events.go | 8 +- cmd/messaging/hds.go | 73 +- cmd/messaging/memberships.go | 8 +- cmd/messaging/messages.go | 9 +- cmd/messaging/people.go | 15 +- cmd/messaging/room_tabs.go | 8 +- cmd/messaging/rooms.go | 15 +- cmd/messaging/team_memberships.go | 8 +- cmd/messaging/teams.go | 8 +- cmd/messaging/webhooks.go | 8 +- codegen/generate_cli.py | 33 +- codegen/test_generate_cli.py | 66 ++ internal/client/client.go | 20 +- internal/client/pagination.go | 189 ++++-- internal/client/pagination_test.go | 319 +++++++++ internal/client/request.go | 39 +- site/src/content/docs/cc.mdx | 2 + site/src/content/docs/getting-started.mdx | 2 +- skill/SKILL.md | 2 + 190 files changed, 798 insertions(+), 4287 deletions(-) create mode 100644 internal/client/pagination_test.go diff --git a/README.md b/README.md index 7961ede..ebca30a 100644 --- a/README.md +++ b/README.md @@ -202,7 +202,7 @@ webex cc users list --output csv > users.csv | `--organization ` | Override org ID | | `--output json\|table\|csv\|raw` | Output format (default: json) | | `--debug` | Show HTTP request/response details | -| `--paginate` | Auto-paginate list results | +| `--paginate` | Auto-paginate list results (ignored by commands that return one object) | | `--dry-run` | Print write requests without executing them | ## Configuration diff --git a/cmd/admin/admin_audit.go b/cmd/admin/admin_audit.go index 7d5d6a6..6688fb7 100644 --- a/cmd/admin/admin_audit.go +++ b/cmd/admin/admin_audit.go @@ -62,6 +62,7 @@ Long result sets will be split into [pages](/docs/basics#pagination). req.QueryParam("eventCategories", eventCategories) req.QueryParam("eventCategories", eventCategories) if config.Paginate() { + req.OffsetPaging("offset", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -94,6 +95,7 @@ Long result sets will be split into [pages](/docs/basics#pagination). RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/adminAudit/eventCategories") if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/admin/analytics.go b/cmd/admin/analytics.go index d07ca57..dea9289 100644 --- a/cmd/admin/analytics.go +++ b/cmd/admin/analytics.go @@ -48,13 +48,6 @@ func init() { } req.QueryParam("from", from) req.QueryParam("to", to) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -89,13 +82,6 @@ func init() { } req.QueryParam("from", from) req.QueryParam("to", to) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -132,13 +118,6 @@ func init() { req.QueryParam("siteUrl", siteUrl) req.QueryParam("from", from) req.QueryParam("to", to) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/archive_users.go b/cmd/admin/archive_users.go index ab1ae94..53a92ad 100644 --- a/cmd/admin/archive_users.go +++ b/cmd/admin/archive_users.go @@ -36,13 +36,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/identity/organizations/{orgId}/v1/ArchivedUser/{useruuid}") req.PathParam("orgId", orgId) req.PathParam("useruuid", useruuid) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -68,13 +61,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/identity/organizations/{orgId}/v1/ArchivedUser") req.PathParam("orgId", orgId) req.QueryParam("filter", filter) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/authorizations.go b/cmd/admin/authorizations.go index 4df072b..4299213 100644 --- a/cmd/admin/authorizations.go +++ b/cmd/admin/authorizations.go @@ -37,6 +37,7 @@ func init() { req.QueryParam("personId", personId) req.QueryParam("personEmail", personEmail) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -106,13 +107,6 @@ func init() { Long: `Epoch-based expiration time for the token.`, RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/authorizations/tokenExpiry") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/classifications.go b/cmd/admin/classifications.go index 696e20a..04da80a 100644 --- a/cmd/admin/classifications.go +++ b/cmd/admin/classifications.go @@ -33,6 +33,7 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/classifications") if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/admin/data_sources.go b/cmd/admin/data_sources.go index 3e5a348..c563f9e 100644 --- a/cmd/admin/data_sources.go +++ b/cmd/admin/data_sources.go @@ -81,13 +81,6 @@ func init() { Long: "Lists all data sources registered by the Service App. Requires the `spark-admin:datasource_read` scope.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/dataSources") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -105,13 +98,6 @@ func init() { Long: `Lists the available data source schemas. A valid API access token is required, but no specific scope is needed.`, RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/dataSources/schemas") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -131,13 +117,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/dataSources/schemas/{schemaId}") req.PathParam("schemaId", schemaId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -180,13 +159,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/dataSources/{dataSourceId}") req.PathParam("dataSourceId", dataSourceId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/events.go b/cmd/admin/events.go index a2bad38..d66710b 100644 --- a/cmd/admin/events.go +++ b/cmd/admin/events.go @@ -59,6 +59,7 @@ Long result sets will be split into [pages](/docs/basics#pagination).`, req.QueryParam("max", max) req.QueryParam("serviceType", serviceType) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -92,13 +93,6 @@ Long result sets will be split into [pages](/docs/basics#pagination).`, RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/events/{eventId}") req.PathParam("eventId", eventId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/groups.go b/cmd/admin/groups.go index f78671c..01184be 100644 --- a/cmd/admin/groups.go +++ b/cmd/admin/groups.go @@ -79,6 +79,7 @@ func init() { req.QueryParam("startIndex", startIndex) req.QueryParam("count", count) if config.Paginate() { + req.OffsetPaging("startIndex", "count", 1) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -148,13 +149,6 @@ Optionally, the members may be retrieved with this request. The maximum number o req := client.NewRequest(config.CallingBaseURL, "GET", "/groups/{groupId}") req.PathParam("groupId", groupId) req.QueryParam("includeMembers", includeMembers) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -207,6 +201,7 @@ Optionally, the members may be retrieved with this request. The maximum number o req.QueryParam("startIndex", startIndex) req.QueryParam("count", count) if config.Paginate() { + req.OffsetPaging("startIndex", "count", 1) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/admin/guest_management.go b/cmd/admin/guest_management.go index c86cd7a..d7accd7 100644 --- a/cmd/admin/guest_management.go +++ b/cmd/admin/guest_management.go @@ -67,13 +67,6 @@ func init() { Long: "To retrieve the number of guests, the scopes `guest-issuer:read` or `guest-issuer:write` are needed.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/guests/count") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/hybrid_clusters.go b/cmd/admin/hybrid_clusters.go index 5404116..a74ad47 100644 --- a/cmd/admin/hybrid_clusters.go +++ b/cmd/admin/hybrid_clusters.go @@ -35,6 +35,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/hybrid/clusters") req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -63,13 +64,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/hybrid/clusters/{hybridClusterId}") req.PathParam("hybridClusterId", hybridClusterId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/hybrid_connectors.go b/cmd/admin/hybrid_connectors.go index 54585a5..fd71247 100644 --- a/cmd/admin/hybrid_connectors.go +++ b/cmd/admin/hybrid_connectors.go @@ -35,6 +35,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/hybrid/connectors") req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -61,13 +62,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/hybrid/connectors/{connectorId}") req.PathParam("connectorId", connectorId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/identity_org.go b/cmd/admin/identity_org.go index cdc3677..1c57f98 100644 --- a/cmd/admin/identity_org.go +++ b/cmd/admin/identity_org.go @@ -38,13 +38,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/identity/organizations/{orgId}") req.PathParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/licenses.go b/cmd/admin/licenses.go index 8d70102..f10cacc 100644 --- a/cmd/admin/licenses.go +++ b/cmd/admin/licenses.go @@ -35,6 +35,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/licenses") req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -67,13 +68,6 @@ func init() { req.QueryParam("includeAssignedTo", includeAssignedTo) req.QueryParam("next", next) req.QueryParam("limit", limit) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/meeting_qualities.go b/cmd/admin/meeting_qualities.go index 2df997f..8bf882a 100644 --- a/cmd/admin/meeting_qualities.go +++ b/cmd/admin/meeting_qualities.go @@ -39,6 +39,7 @@ func init() { req.QueryParam("max", max) req.QueryParam("offset", offset) if config.Paginate() { + req.OffsetPaging("offset", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/admin/org_contacts.go b/cmd/admin/org_contacts.go index 67b52bd..d410882 100644 --- a/cmd/admin/org_contacts.go +++ b/cmd/admin/org_contacts.go @@ -70,13 +70,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/contacts/organizations/{orgid}/contacts/{contactId}") req.PathParam("orgid", orgid) req.PathParam("contactId", contactId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -171,6 +164,7 @@ func init() { req.QueryParam("groupIds", groupIds) req.QueryParam("groupIds", groupIds) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/admin/organizations.go b/cmd/admin/organizations.go index bdb15b1..fbfb993 100644 --- a/cmd/admin/organizations.go +++ b/cmd/admin/organizations.go @@ -33,6 +33,7 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/organizations") if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -58,13 +59,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/organizations/{orgId}") req.PathParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/partner_administrators.go b/cmd/admin/partner_administrators.go index 251ba3e..c51d8f1 100644 --- a/cmd/admin/partner_administrators.go +++ b/cmd/admin/partner_administrators.go @@ -34,13 +34,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/partner/organizations") req.QueryParam("managedBy", managedBy) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -61,13 +54,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/partner/organizations/{orgId}/partnerAdmins") req.PathParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/partner_reports_templates.go b/cmd/admin/partner_reports_templates.go index dbebb7f..ae45011 100644 --- a/cmd/admin/partner_reports_templates.go +++ b/cmd/admin/partner_reports_templates.go @@ -57,6 +57,7 @@ func init() { req.QueryParam("regionId", regionId) req.QueryParam("onBehalfOfSubPartnerOrgId", onBehalfOfSubPartnerOrgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -135,13 +136,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/partner/reports/{reportId}") req.PathParam("reportId", reportId) req.QueryParam("onBehalfOfSubPartnerOrgId", onBehalfOfSubPartnerOrgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -189,6 +183,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/partner/reports/templates") req.QueryParam("onBehalfOfSubPartnerOrgId", onBehalfOfSubPartnerOrgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/admin/partner_tags.go b/cmd/admin/partner_tags.go index ce22679..a80bcf5 100644 --- a/cmd/admin/partner_tags.go +++ b/cmd/admin/partner_tags.go @@ -34,13 +34,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/partner/tags") req.QueryParam("type", typeVal) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -93,13 +86,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/partner/tags/organizations/{orgId}") req.PathParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -125,6 +111,7 @@ This API can be used by a partner full admin, a read-only partner, or an partner req.QueryParam("tags", tags) req.QueryParam("max", max) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -192,6 +179,7 @@ This API can be used by partner full admins, partner admins and admin read-only req.QueryParam("tags", tags) req.QueryParam("max", max) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -222,13 +210,6 @@ This API can be used by partner full admins, partner admins and admin read-only req := client.NewRequest(config.CallingBaseURL, "GET", "/partner/tags/organizations/{orgId}/subscriptions/{subscriptionId}") req.PathParam("orgId", orgId) req.PathParam("subscriptionId", subscriptionId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/people.go b/cmd/admin/people.go index 8d628b1..327a114 100644 --- a/cmd/admin/people.go +++ b/cmd/admin/people.go @@ -53,6 +53,7 @@ func init() { req.QueryParam("max", max) req.QueryParam("excludeStatus", excludeStatus) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -123,13 +124,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}") req.PathParam("personId", personId) req.QueryParam("callingData", callingData) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -214,13 +208,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/people/me") req.QueryParam("callingData", callingData) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/recording_report.go b/cmd/admin/recording_report.go index bf10f99..d39c7ab 100644 --- a/cmd/admin/recording_report.go +++ b/cmd/admin/recording_report.go @@ -55,6 +55,7 @@ func init() { req.QueryParam("siteUrl", siteUrl) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -94,6 +95,7 @@ func init() { req.QueryParam("max", max) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -140,6 +142,7 @@ func init() { req.QueryParam("siteUrl", siteUrl) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -173,13 +176,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/recordingReport/meetingArchives/{archiveId}") req.PathParam("archiveId", archiveId) req.Header("timezone", timezone) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/recordings.go b/cmd/admin/recordings.go index 6bb29c5..46e4414 100644 --- a/cmd/admin/recordings.go +++ b/cmd/admin/recordings.go @@ -71,6 +71,7 @@ func init() { req.QueryParam("status", status) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -138,6 +139,7 @@ func init() { req.QueryParam("status", status) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -202,13 +204,6 @@ func init() { req.QueryParam("hostEmail", hostEmail) req.Header("timezone", timezone) req.Header("siteUrl", siteUrl) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -467,6 +462,7 @@ func init() { req.Header("timezone", timezone) req.Header("hostEmail", hostEmail) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -509,13 +505,6 @@ func init() { req.QueryParam("personId", personId) req.Header("timezone", timezone) req.Header("hostEmail", hostEmail) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/report_templates.go b/cmd/admin/report_templates.go index d8d5861..dbb2703 100644 --- a/cmd/admin/report_templates.go +++ b/cmd/admin/report_templates.go @@ -47,6 +47,7 @@ When creating a report, ensure you provide all fields marked as "required": "yes RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/report/templates") if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/admin/reports.go b/cmd/admin/reports.go index 32ab846..c049287 100644 --- a/cmd/admin/reports.go +++ b/cmd/admin/reports.go @@ -55,6 +55,7 @@ func init() { req.QueryParam("from", from) req.QueryParam("to", to) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -130,13 +131,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/reports/{reportId}") req.PathParam("reportId", reportId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/resource_groups.go b/cmd/admin/resource_groups.go index 8822c35..2014019 100644 --- a/cmd/admin/resource_groups.go +++ b/cmd/admin/resource_groups.go @@ -37,6 +37,7 @@ Use query parameters to filter the response.`, req := client.NewRequest(config.CallingBaseURL, "GET", "/resourceGroups") req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -63,13 +64,6 @@ Use query parameters to filter the response.`, RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/resourceGroups/{resourceGroupId}") req.PathParam("resourceGroupId", resourceGroupId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/resource_memberships.go b/cmd/admin/resource_memberships.go index 86dcc49..5e4f1bb 100644 --- a/cmd/admin/resource_memberships.go +++ b/cmd/admin/resource_memberships.go @@ -45,6 +45,7 @@ Use query parameters to filter the response.`, req.QueryParam("status", status) req.QueryParam("max", max) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -75,13 +76,6 @@ Use query parameters to filter the response.`, RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/resourceGroup/memberships/{resourceGroupMembershipId}") req.PathParam("resourceGroupMembershipId", resourceGroupMembershipId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -164,6 +158,7 @@ Use query parameters to filter the response.`, req.QueryParam("type", typeVal) req.QueryParam("max", max) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/admin/roles.go b/cmd/admin/roles.go index 703e509..68d2771 100644 --- a/cmd/admin/roles.go +++ b/cmd/admin/roles.go @@ -33,6 +33,7 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/roles") if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -58,13 +59,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/roles/{roleId}") req.PathParam("roleId", roleId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/scim_2_groups.go b/cmd/admin/scim_2_groups.go index 86afcbd..239f024 100644 --- a/cmd/admin/scim_2_groups.go +++ b/cmd/admin/scim_2_groups.go @@ -87,6 +87,7 @@ func init() { req.QueryParam("includeMembers", includeMembers) req.QueryParam("memberType", memberType) if config.Paginate() { + req.OffsetPaging("startIndex", "count", 1) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -127,13 +128,6 @@ func init() { req.PathParam("orgId", orgId) req.PathParam("groupId", groupId) req.QueryParam("excludedAttributes", excludedAttributes) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -264,6 +258,7 @@ func init() { req.QueryParam("count", count) req.QueryParam("memberType", memberType) if config.Paginate() { + req.OffsetPaging("startIndex", "count", 1) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/admin/scim_2_schemas.go b/cmd/admin/scim_2_schemas.go index 26bda0c..480162a 100644 --- a/cmd/admin/scim_2_schemas.go +++ b/cmd/admin/scim_2_schemas.go @@ -32,13 +32,6 @@ func init() { Long: "This API allows the service client to get all the `Group` schemas information from CI.\n\n**Authorization:**\n\nOAuth token rendered by Identity Broker.\n\nOne of the following OAuth scopes is required:\n\n- `identity:people_rw`\n\n- `identity:organizations_rw`\n\nThe following administrators can use this API:\n\n- `id_full_admin`\n\n- `id_user_admin`\n\n- `id_readonly_admin`\n\n- `id_device_admin`", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/Schemas/SCIM2/Group") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -56,13 +49,6 @@ func init() { Long: "This API allows the service client to get all the `User` schemas information from CI.\n\n**Authorization:**\n\nOAuth token rendered by Identity Broker.\n\nOne of the following OAuth scopes is required:\n\n- `identity:people_rw`\n\n- `identity:organizations_rw`\n\nThe following administrators can use this API:\n\n- `id_full_admin`\n\n- `id_user_admin`\n\n- `id_readonly_admin`\n\n- `id_device_admin`", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/Schemas/SCIM2/User") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -82,13 +68,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/Schemas/SCIM2/{schemaId}") req.PathParam("schemaId", schemaId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/scim_2_users.go b/cmd/admin/scim_2_users.go index 2f6912d..b931641 100644 --- a/cmd/admin/scim_2_users.go +++ b/cmd/admin/scim_2_users.go @@ -89,6 +89,7 @@ func init() { req.QueryParam("includeGroupDetails", includeGroupDetails) req.QueryParam("groupUsageTypes", groupUsageTypes) if config.Paginate() { + req.OffsetPaging("startIndex", "count", 1) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -128,13 +129,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/identity/scim/{orgId}/v2/Users/{userId}") req.PathParam("orgId", orgId) req.PathParam("userId", userId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -253,13 +247,6 @@ func init() { Long: "
\n\n**Authorization**\n\nOAuth token rendered by Identity Broker.\n\n
\n\nOne of the following OAuth scopes is required:\n\n- `identity:people_rw`\n\n- `identity:people_read`\n\n
\n\nThe API can be used by any user to retrieve user information using their own access token.\n\n
", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/identity/scim/v2/Users/me") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/security_audit.go b/cmd/admin/security_audit.go index bd73a48..36c8638 100644 --- a/cmd/admin/security_audit.go +++ b/cmd/admin/security_audit.go @@ -46,6 +46,7 @@ func init() { req.QueryParam("eventCategories", eventCategories) req.QueryParam("eventCategories", eventCategories) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/admin/send_activation_email.go b/cmd/admin/send_activation_email.go index 1c1323f..55eb61a 100644 --- a/cmd/admin/send_activation_email.go +++ b/cmd/admin/send_activation_email.go @@ -57,13 +57,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/identity/organizations/{orgId}/jobs/sendActivationEmails/{jobId}/status") req.PathParam("orgId", orgId) req.PathParam("jobId", jobId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -92,6 +85,7 @@ func init() { req.PathParam("jobId", jobId) req.QueryParam("max", max) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/admin/settings.go b/cmd/admin/settings.go index 48e684d..1a45da4 100644 --- a/cmd/admin/settings.go +++ b/cmd/admin/settings.go @@ -36,13 +36,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/settings/organizations/{orgId}/settings/{settingKey}") req.PathParam("orgId", orgId) req.PathParam("settingKey", settingKey) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/workspace_locations.go b/cmd/admin/workspace_locations.go index 5ecb935..d130a08 100644 --- a/cmd/admin/workspace_locations.go +++ b/cmd/admin/workspace_locations.go @@ -45,6 +45,7 @@ func init() { req.QueryParam("countryCode", countryCode) req.QueryParam("cityName", cityName) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -125,13 +126,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaceLocations/{locationId}") req.PathParam("locationId", locationId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -232,6 +226,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaceLocations/{locationId}/floors") req.PathParam("locationId", locationId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -300,13 +295,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaceLocations/{locationId}/floors/{floorId}") req.PathParam("locationId", locationId) req.PathParam("floorId", floorId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/admin/workspace_metrics.go b/cmd/admin/workspace_metrics.go index f00d113..1d06212 100644 --- a/cmd/admin/workspace_metrics.go +++ b/cmd/admin/workspace_metrics.go @@ -56,13 +56,6 @@ func init() { req.QueryParam("to", to) req.QueryParam("unit", unit) req.QueryParam("sortBy", sortBy) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -106,13 +99,6 @@ func init() { req.QueryParam("measurement", measurement) req.QueryParam("from", from) req.QueryParam("to", to) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/announcement_playlist.go b/cmd/calling/announcement_playlist.go index 011342d..37fe054 100644 --- a/cmd/calling/announcement_playlist.go +++ b/cmd/calling/announcement_playlist.go @@ -37,6 +37,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/announcements/playlists") req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -103,13 +104,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/announcements/playlists/{playlistId}") req.PathParam("playlistId", playlistId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -201,6 +195,7 @@ func init() { req.PathParam("playlistId", playlistId) req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/calling/announcement_repository.go b/cmd/calling/announcement_repository.go index 21bf5a5..ec5e5c7 100644 --- a/cmd/calling/announcement_repository.go +++ b/cmd/calling/announcement_repository.go @@ -85,13 +85,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/announcements/usage") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -138,13 +131,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/announcements/{announcementId}") req.PathParam("announcementId", announcementId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -169,13 +155,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/announcements/usage") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -230,13 +209,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("announcementId", announcementId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -302,13 +274,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/textToSpeech/usage") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -331,13 +296,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/textToSpeech/{ttsId}") req.PathParam("ttsId", ttsId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -361,6 +319,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/textToSpeech/voices") req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/calling/auto_attendant.go b/cmd/calling/auto_attendant.go index b4560f0..45083cc 100644 --- a/cmd/calling/auto_attendant.go +++ b/cmd/calling/auto_attendant.go @@ -80,13 +80,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("autoAttendantId", autoAttendantId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -217,13 +210,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("autoAttendantId", autoAttendantId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -340,13 +326,6 @@ Retrieving a selective call forwarding rule's settings for an auto attendant req req.PathParam("autoAttendantId", autoAttendantId) req.PathParam("ruleId", ruleId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -653,6 +632,7 @@ Retrieving a selective call forwarding rule's settings for an auto attendant req req.PathParam("autoAttendantId", autoAttendantId) req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/calling/call_controls.go b/cmd/calling/call_controls.go index 6172368..2c1d650 100644 --- a/cmd/calling/call_controls.go +++ b/cmd/calling/call_controls.go @@ -786,6 +786,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/calls") req.QueryParam("lineOwnerId", lineOwnerId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -814,13 +815,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/calls/{callId}") req.PathParam("callId", callId) req.QueryParam("lineOwnerId", lineOwnerId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -844,6 +838,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/calls/history") req.QueryParam("type", typeVal) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -999,6 +994,7 @@ func init() { req.PathParam("memberId", memberId) req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -1031,13 +1027,6 @@ func init() { req.PathParam("memberId", memberId) req.PathParam("callId", callId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/call_controls_for_me.go b/cmd/calling/call_controls_for_me.go index 67d486d..d8c4633 100644 --- a/cmd/calling/call_controls_for_me.go +++ b/cmd/calling/call_controls_for_me.go @@ -149,6 +149,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/calls/members/me/calls") req.QueryParam("lineOwnerId", lineOwnerId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -177,13 +178,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/calls/members/me/calls/{callId}") req.PathParam("callId", callId) req.QueryParam("lineOwnerId", lineOwnerId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/call_park.go b/cmd/calling/call_park.go index 2f36b03..4f2d720 100644 --- a/cmd/calling/call_park.go +++ b/cmd/calling/call_park.go @@ -146,13 +146,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("callParkId", callParkId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -310,13 +303,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/callParks/settings") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -426,13 +412,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("callParkExtensionId", callParkExtensionId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/call_pickup.go b/cmd/calling/call_pickup.go index c6361a6..5a12328 100644 --- a/cmd/calling/call_pickup.go +++ b/cmd/calling/call_pickup.go @@ -161,13 +161,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("callPickupId", callPickupId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/call_queue.go b/cmd/calling/call_queue.go index 888b19a..a4f28c4 100644 --- a/cmd/calling/call_queue.go +++ b/cmd/calling/call_queue.go @@ -159,13 +159,6 @@ func init() { req.PathParam("queueId", queueId) req.QueryParam("orgId", orgId) req.QueryParam("hasCxEssentials", hasCxEssentials) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -235,6 +228,7 @@ func init() { req.PathParam("queueId", queueId) req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -301,13 +295,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("queueId", queueId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -416,13 +403,6 @@ func init() { req.PathParam("queueId", queueId) req.PathParam("ruleId", ruleId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -528,13 +508,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("queueId", queueId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -602,13 +575,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("queueId", queueId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -676,13 +642,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("queueId", queueId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -750,13 +709,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("queueId", queueId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1484,13 +1436,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/announcements/playlists/{playListId}/usage") req.PathParam("playListId", playListId) req.QueryParam("playlistUsageType", playlistUsageType) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/call_recording.go b/cmd/calling/call_recording.go index ed97e4f..a78c024 100644 --- a/cmd/calling/call_recording.go +++ b/cmd/calling/call_recording.go @@ -36,13 +36,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/callRecording") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -100,13 +93,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/callRecording/vendors/{vendorId}/termsOfService") req.PathParam("vendorId", vendorId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -168,13 +154,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/callRecording/complianceAnnouncement") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -241,13 +220,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/callRecording/complianceAnnouncement") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -321,13 +293,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/callRecording/regions") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -440,13 +405,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/callRecording/vendors") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -544,13 +502,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/callRecording/{jobId}") req.PathParam("jobId", jobId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -578,6 +529,7 @@ func init() { req.QueryParam("orgId", orgId) req.QueryParam("max", max) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -607,13 +559,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/callRecording/vendors") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/call_routing.go b/cmd/calling/call_routing.go index 5c02320..5b2573c 100644 --- a/cmd/calling/call_routing.go +++ b/cmd/calling/call_routing.go @@ -131,13 +131,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/premisePstn/trunks/{trunkId}/usagePstnConnection") req.PathParam("trunkId", trunkId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -162,13 +155,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/premisePstn/trunks/{trunkId}/usageRouteGroup") req.PathParam("trunkId", trunkId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -193,13 +179,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/premisePstn/trunks/{trunkId}/usage") req.PathParam("trunkId", trunkId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -383,13 +362,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/premisePstn/dialPlans/{dialPlanId}") req.PathParam("dialPlanId", dialPlanId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -636,13 +608,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/premisePstn/trunks/{trunkId}") req.PathParam("trunkId", trunkId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -741,6 +706,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/premisePstn/trunks/trunkTypes") req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -839,13 +805,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/premisePstn/routeGroups/{routeGroupId}") req.PathParam("routeGroupId", routeGroupId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -929,13 +888,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/premisePstn/routeGroups/{routeGroupId}/usage") req.PathParam("routeGroupId", routeGroupId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1241,13 +1193,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/premisePstn/routeLists/{routeListId}") req.PathParam("routeListId", routeListId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1525,13 +1470,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/callRouting/translationPatterns/{translationId}") req.PathParam("translationId", translationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1672,13 +1610,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("translationId", translationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/call_settings_for_me.go b/cmd/calling/call_settings_for_me.go index 6c29f93..16dae23 100644 --- a/cmd/calling/call_settings_for_me.go +++ b/cmd/calling/call_settings_for_me.go @@ -36,13 +36,6 @@ func init() { Long: "Retrieve user's own Personal Assistant details.\n\nPersonal Assistant is used to manage a user's incoming calls when they are away.\n\nRetrieving Personal Assistant details requires a user auth token with `spark:telephony_config_read` scope.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/personalAssistant") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -111,6 +104,7 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/availablePreferredAnswerEndpoints") if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -136,13 +130,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/secondaryLines/{lineOwnerId}/availablePreferredAnswerEndpoints") req.PathParam("lineOwnerId", lineOwnerId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -162,13 +149,6 @@ func init() { Long: "Retrieve the selected preferred answering endpoint for the user. If a preferred endpoint is not set for the person, API returns empty \n\n A Webex Calling user may be associated with multiple endpoints such as Webex App (desktop or mobile), Cisco desk IP phone, Webex Calling-supported analog devices or third-party endpoints. Preferred answering endpoints allow users to specify which of these devices should be prioritized for answering calls, particularly when a person's extension (or a virtual line assigned to them) rings on multiple devices. This helps ensure that calls are answered on the most convenient or appropriate device for the person.\n\n This API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/preferredAnswerEndpoint") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -220,13 +200,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/secondaryLines/{lineOwnerId}/preferredAnswerEndpoint") req.PathParam("lineOwnerId", lineOwnerId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -282,13 +255,6 @@ func init() { Long: "Retrieve \"Mobile User Aware\" override setting for Do Not Disturb feature.\n\nWhen enabled, a mobile device will still ring even if Do Not Disturb, Quiet Hours, or Presenting Status are enabled.\n\nWhen disabled, a mobile device will return busy for all incoming calls if Do Not Disturb, Quiet Hours, or Presenting Status are enabled.\n\nIt requires a user auth token with `spark:telephony_config_read` scope.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/webexGoOverride") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -338,13 +304,6 @@ func init() { Long: "Get Caller ID Settings for the authenticated user.\n\nCalling Line ID Delivery Blocking in Webex prevents your name and phone number from being shown to people you call.\nConnected Line Identification Restriction allows you to block your name and phone number from being shown when receiving a call.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/callerId") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -399,13 +358,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/secondaryLines/{lineownerId}/callerId") req.PathParam("lineownerId", lineownerId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -464,13 +416,6 @@ func init() { Long: "Read selected caller ID settings associated with the authenticated user.\n\nCaller ID settings control how a person's information is displayed when making outgoing calls.\nSelected Caller ID settings allow users to choose which configuration among available caller IDs is selected currently.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/selectedCallerId") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -518,13 +463,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/secondaryLines/{lineownerId}/selectedCallerId") req.PathParam("lineownerId", lineownerId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -576,13 +514,6 @@ func init() { Long: "Get details of available caller IDs of the authenticated user.\n\nCaller ID settings control how a person's information is displayed when making outgoing calls.\nThe available caller ID list shows the caller IDs that the user can choose from.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/availableCallerIds") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -602,13 +533,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/secondaryLines/{lineownerId}/availableCallerIds") req.PathParam("lineownerId", lineownerId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -629,6 +553,7 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/endpoints") if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -654,13 +579,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/endpoints/{endpointId}") req.PathParam("endpointId", endpointId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -712,13 +630,6 @@ func init() { Long: "Get details of call recording settings associated with the authenticated user.\n\nCall recording settings allow you to access and customize options that determine when and how your calls are recorded, providing control over recording modes and notifications.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/callRecording") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -738,13 +649,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/secondaryLines/{lineownerId}/callRecording") req.PathParam("lineownerId", lineownerId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -764,13 +668,6 @@ func init() { Long: "Get profile details for the authenticated user.\n\nProfile details include the user's name, email, location and calling details.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -788,13 +685,6 @@ func init() { Long: "Retrieve all Feature Access Codes configured for services that are assigned to the authenticated user. For each feature access code, the name and code are returned. If an alternate code is defined, it is also returned.\n\nFeature access codes (FACs), also known as star codes, give users access to advanced calling features.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/featureAccessCode") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -814,13 +704,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/secondaryLines/{lineownerId}/featureAccessCode") req.PathParam("lineownerId", lineownerId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -840,13 +723,6 @@ func init() { Long: "Get list of assigned executive assistants for an authenticated user.\n\nAs an executive, you can add assistants to your executive pool to manage calls for you. You can set when and which types of calls they can handle. Assistants can opt in when needed or opt out when not required.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/executive/assignedAssistants") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -899,13 +775,6 @@ func init() { Long: "Get a list of available executive assistants for the authenticated user.\n\nAs an executive, you can add assistants to your executive pool to manage calls for you. You can set when and which types of calls they can handle. Assistants can opt in when needed or opt out when not required.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/executive/availableAssistants") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -923,13 +792,6 @@ func init() { Long: "Get settings for an executive assistant.\n\nExecutive assistants can make, answer, intercept, and route calls appropriately on behalf of their executive.\nAssistants can also set the call forwarding destination, and join or leave an executive\u2019s pool.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/executive/assistant") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -975,13 +837,6 @@ func init() { Long: "Retrieves the list of enabled calling services for the authenticated user.\n\nThese services are designed to improve call handling and ensure that users can manage their communications effectively. They are commonly found in both personal and business telephony systems.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/services") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1001,13 +856,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/secondaryLines/{lineownerId}/services") req.PathParam("lineownerId", lineownerId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1027,13 +875,6 @@ func init() { Long: "Retrieves all single number reach settings configured for the authenticated user.\n\nThe \"Single Number Reach\" feature in Webex allows users to access their business phone capabilities from any device, making it easy to make and receive calls as if at their office. This is especially useful for remote or mobile workers needing flexibility.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/singleNumberReach") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1196,13 +1037,6 @@ func init() { Long: "Read call forwarding settings associated with the authenticated user.\n\nThree types of call forwarding are supported:\n\n+ Always - forwards all incoming calls to the destination you choose.\n\n+ When busy - forwards all incoming calls to the destination you chose while the phone is in use or the person is busy.\n\n+ When no answer - forwarding only occurs when you are away or not answering your phone.\n\nIn addition, the Business Continuity feature will send calls to a destination of your choice if your phone is not connected to the network for any reason, such as a power outage, failed Internet connection, or wiring problem.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/callForwarding") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1250,13 +1084,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/secondaryLines/{lineownerId}/callForwarding") req.PathParam("lineownerId", lineownerId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1308,13 +1135,6 @@ func init() { Long: "Get Call Pickup Group Settings for the authenticated user.\n\nCall pickup group enables a user to answer any ringing line within their pickup group. A call pickup group is an administrator-defined set of users within a location, to which the call pickup feature applies.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/callPickupGroup") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1334,13 +1154,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/secondaryLines/{lineownerId}/callPickupGroup") req.PathParam("lineownerId", lineownerId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1360,13 +1173,6 @@ func init() { Long: "Get details of call park settings associated with the authenticated user.\n\nCall Park allows call recipients to place a call on hold so that it can be retrieved from another device.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/callPark") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1386,13 +1192,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/secondaryLines/{lineownerId}/callPark") req.PathParam("lineownerId", lineownerId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1440,13 +1239,6 @@ func init() { Long: "Retrieve a person's voicemail settings.\n\nThe voicemail feature transfers callers to voicemail based on your settings. You can then retrieve voice messages via voicemail.\n\nOptionally, notifications can be sent to a mobile phone via text or email. These notifications will not include the voicemail files.\n\nThis API requires a user auth token with a scope of `spark-admin:people_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/voicemail") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1498,13 +1290,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/secondaryLines/{lineownerId}/voicemail") req.PathParam("lineownerId", lineownerId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1524,13 +1309,6 @@ func init() { Long: "Get details of call block settings associated with the authenticated user.\n\nCall block settings allow you to get the User Call Block Number List.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/callBlock") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1582,13 +1360,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/callBlock/numbers/{phoneNumberId}") req.PathParam("phoneNumberId", phoneNumberId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1629,13 +1400,6 @@ func init() { Long: "Retrieves the monitoring settings of the logged in person, which shows specified people, places, virtual lines or call park extensions that are being monitored.\n\nMonitors the line status which indicates if a person, place or virtual line is on a call and if a call has been parked on that extension.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/monitoring") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1653,13 +1417,6 @@ func init() { Long: "Retrieves the call center settings and list of all call centers the logged in user belongs to.\n\nCalls from the Call Centers are routed to agents based on configuration. An agent can be assigned to one or more call queues and can be managed by supervisors.\nThe user must have the call center service assigned.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/queues") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1707,13 +1464,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/secondaryLines/{lineownerId}/queues") req.PathParam("lineownerId", lineownerId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1765,13 +1515,6 @@ func init() { Long: "Retrieve the effective call captions settings of the authenticated user.\n\n**NOTE**: The call captions feature is not supported for Webex Calling Standard users or users assigned to locations in India.\n\nThe call caption feature allows the customer to enable and manage closed captions and transcript functionality (rolling caption panel) in Webex Calling, without requiring the user to escalate the call to a meeting.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/callCaptions") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1789,13 +1532,6 @@ func init() { Long: "Get call policies settings for the authenticated user.\n\nCall Policies in Webex allow you to manage how your call information is displayed and handled. You can view privacy settings for your connected line ID on redirected calls and review other call-related preferences.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/callPolicies") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1845,13 +1581,6 @@ func init() { Long: "Get executive screening settings for the authenticated user.\n\nExecutive Screening in Webex allows you to manage how incoming calls are screened and alerted based on your preferences. You can enable or disable executive screening and configure alert types and locations for notifications.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/executive/screening") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1913,13 +1642,6 @@ func init() { Long: "Get executive call filtering settings for the authenticated user.\n\nExecutive Call Filtering in Webex allows you to control which calls are allowed to reach the executive assistant based on custom criteria, such as specific phone numbers or call types. You can enable or disable call filtering and configure filter rules to manage incoming calls.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/executive/callFiltering") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1967,13 +1689,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/executive/callFiltering/criteria/{id}") req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2046,13 +1761,6 @@ func init() { Long: "Get Do Not Disturb settings for the authenticated user.\n\nDo Not Disturb (DND) enables users to block or silence incoming calls on their phone. When activated, the phone either stops ringing or rejects calls depending on the configured option, but users can still see call information and answer calls if desired.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/doNotDisturb") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2136,13 +1844,6 @@ func init() { Long: "Get executive alert settings for the authenticated user.\n\nExecutive Alert settings in Webex allow you to control how calls are routed to executive assistants, including alerting mode, rollover options, and caller ID presentation. You can configure settings such as sequential or simultaneous alerting, and specify what happens when calls aren't answered.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/executive/alert") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2224,13 +1925,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/countries/{countryCode}") req.PathParam("countryCode", countryCode) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2250,13 +1944,6 @@ func init() { Long: "Retrieve the list of available announcement languages for the authenticated user's telephony configuration.\n\nAnnouncement languages determine the language used for system prompts and announcements during calls.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/announcementLanguages") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2274,13 +1961,6 @@ func init() { Long: "Retrieve Barge-In settings of the user.\n\nThe Barge-In feature enables you to use a Feature Access Code (FAC) to answer a call that was directed to another subscriber, or barge-in on the call if it was already answered. Barge-In can be used across locations.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/bargeIn") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2333,13 +2013,6 @@ func init() { Long: "Get Priority Alert Settings for the authenticated user.\n\nPriority alert allows you to set up a unique ringtone based on predefined criteria. This is helpful, when the user wants to be quickly notified that a specific phone number is calling.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/priorityAlert") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2444,13 +2117,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/priorityAlert/criteria/{id}") req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2548,13 +2214,6 @@ func init() { Long: "Get Schedules for Call Settings for the authenticated user.\n\nSchedules are used to define specific time periods which can be applied to various Call Settings, such as Sequential Ring, or Priority Alert. These call settings perform the defined actions based on the time frame in the schedule, making it more convenient for users to manage their calls.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/schedules") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2604,13 +2263,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/schedules/{scheduleType}/{scheduleId}") req.PathParam("scheduleType", scheduleType) req.PathParam("scheduleId", scheduleId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2735,13 +2387,6 @@ func init() { req.PathParam("scheduleType", scheduleType) req.PathParam("scheduleId", scheduleId) req.PathParam("eventId", eventId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2834,17 +2479,10 @@ func init() { Use: "get-user-location-schedule", Short: "Get User's Location Level Schedule", Long: "Get Location Schedule for Call Settings of the authenticated user.\n\nSchedules are used to define specific time periods which can be applied to various Call Settings, such as Sequential Ring, or Priority Alert. These call settings perform the defined actions based on the time frame in the schedule, making it more convenient for users to manage their calls.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", - RunE: func(cmd *cobra.Command, args []string) error { - req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/locations/schedules/{scheduleType}/{scheduleId}") - req.PathParam("scheduleType", scheduleType) - req.PathParam("scheduleId", scheduleId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } + RunE: func(cmd *cobra.Command, args []string) error { + req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/locations/schedules/{scheduleType}/{scheduleId}") + req.PathParam("scheduleType", scheduleType) + req.PathParam("scheduleId", scheduleId) resp, statusCode, err := req.Do() if err != nil { return err @@ -2866,13 +2504,6 @@ func init() { Long: "Get Call Notify Settings for the authenticated user.\n\nCall Notify allows you to set up a unique ringtone based on predefined criteria. This is helpful, when the user wants to be quickly notified that a specific phone number is calling.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/callNotify") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2980,13 +2611,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/callNotify/criteria/{id}") req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3084,13 +2708,6 @@ func init() { Long: "Get Selective Call Accept Settings for the authenticated user.\n\nSelective Call Accept allows you to create customized rules to accept specific calls for users based on the phone number,identity and the time or day of the call.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/selectiveAccept") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3195,13 +2812,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/selectiveAccept/criteria/{id}") req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3402,13 +3012,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/selectiveForward/criteria/{id}") req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3512,13 +3115,6 @@ func init() { Long: "Get Selective Call Forward Settings for the authenticated user.\n\nSelective Call Forward allows you to create customized rules to forward specific calls for users based on the phone number,identity and the time or day of the call.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/selectiveForward") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3577,13 +3173,6 @@ func init() { Long: "Get Selective Call Reject Settings for the authenticated user.\n\nSelective Call Reject allows you to create customized rules to reject specific calls for users based on the phone number,identity and the time or day of the call.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/selectiveReject") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3686,13 +3275,6 @@ func init() { Long: "Get Anonymous Call Rejection Settings for the authenticated user.\n\nAnonymous Call Rejection allows you to reject calls from anonymous callers.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/anonymousCallReject") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3744,13 +3326,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/selectiveReject/criteria/{id}") req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3848,13 +3423,6 @@ func init() { Long: "Get Call Waiting Settings for the authenticated user.\n\nCall Waiting allows a user to receive multiple calls simultaneously. When the user is on an active call, they can receive an incoming call and switch between the two calls.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/callWaiting") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3904,13 +3472,6 @@ func init() { Long: "Get Sequential Ring Settings for the authenticated user.\n\nSequential Ring allows calls to ring additional phone numbers in sequence if the initial call is not answered. This can be configured to ring up to five phone numbers with customizable ring patterns.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/sequentialRing") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4011,13 +3572,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/sequentialRing/criteria/{id}") req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4115,13 +3669,6 @@ func init() { Long: "Get Priority Alert Settings for the authenticated user.\n\nPriority alert allows you to set up a unique ringtone based on predefined criteria. This is helpful, when the user wants to be quickly notified that a specific phone number is calling.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/priorityAlert") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4226,13 +3773,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/priorityAlert/criteria/{id}") req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4330,13 +3870,6 @@ func init() { Long: "Get Schedules for Call Settings for the authenticated user.\n\nSchedules are used to define specific time periods which can be applied to various Call Settings, such as Sequential Ring, or Priority Alert. These call settings perform the defined actions based on the time frame in the schedule, making it more convenient for users to manage their calls.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/schedules") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4386,13 +3919,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/schedules/{scheduleType}/{scheduleId}") req.PathParam("scheduleType", scheduleType) req.PathParam("scheduleId", scheduleId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4517,13 +4043,6 @@ func init() { req.PathParam("scheduleType", scheduleType) req.PathParam("scheduleId", scheduleId) req.PathParam("eventId", eventId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4620,13 +4139,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/locations/schedules/{scheduleType}/{scheduleId}") req.PathParam("scheduleType", scheduleType) req.PathParam("scheduleId", scheduleId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4648,13 +4160,6 @@ func init() { Long: "Get Call Notify Settings for the authenticated user.\n\nCall Notify allows you to set up a unique ringtone based on predefined criteria. This is helpful, when the user wants to be quickly notified that a specific phone number is calling.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/callNotify") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4762,13 +4267,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/callNotify/criteria/{id}") req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4866,13 +4364,6 @@ func init() { Long: "Get Selective Call Accept Settings for the authenticated user.\n\nSelective Call Accept allows you to create customized rules to accept specific calls for users based on the phone number,identity and the time or day of the call.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/selectiveAccept") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4977,13 +4468,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/selectiveAccept/criteria/{id}") req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -5184,13 +4668,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/selectiveForward/criteria/{id}") req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -5294,13 +4771,6 @@ func init() { Long: "Get Selective Call Forward Settings for the authenticated user.\n\nSelective Call Forward allows you to create customized rules to forward specific calls for users based on the phone number,identity and the time or day of the call.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/selectiveForward") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -5359,13 +4829,6 @@ func init() { Long: "Get Selective Call Reject Settings for the authenticated user.\n\nSelective Call Reject allows you to create customized rules to reject specific calls for users based on the phone number,identity and the time or day of the call.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/selectiveReject") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -5468,13 +4931,6 @@ func init() { Long: "Get Anonymous Call Rejection Settings for the authenticated user.\n\nAnonymous Call Rejection allows you to reject calls from anonymous callers.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/anonymousCallReject") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -5526,13 +4982,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/selectiveReject/criteria/{id}") req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -5630,13 +5079,6 @@ func init() { Long: "Get Call Waiting Settings for the authenticated user.\n\nCall Waiting allows a user to receive multiple calls simultaneously. When the user is on an active call, they can receive an incoming call and switch between the two calls.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/callWaiting") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -5686,13 +5128,6 @@ func init() { Long: "Get Sequential Ring Settings for the authenticated user.\n\nSequential Ring allows calls to ring additional phone numbers in sequence if the initial call is not answered. This can be configured to ring up to five phone numbers with customizable ring patterns.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/sequentialRing") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -5793,13 +5228,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/sequentialRing/criteria/{id}") req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -5897,13 +5325,6 @@ func init() { Long: "Retrieve simultaneous ring settings for the authenticated user.\n\nThe Simultaneous Ring feature allows you to configure your office phone and other phones of your choice to ring simultaneously. Schedules can also be set up to ring these phones during certain times of the day or days of the week.\n\nRetrieving settings requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/simultaneousRing") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -5951,13 +5372,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/simultaneousRing/criteria/{id}") req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -6108,13 +5522,6 @@ func init() { Long: "Retrieve available guest calling numbers for the authenticated user.\n\nThis API returns a list of phone numbers that can be used for guest calling purposes.\n\nRetrieving guest calling numbers requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/guestCalling/numbers") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -6132,13 +5539,6 @@ func init() { Long: "Retrieve personal assistant settings for a person. The personal assistant feature allows users to configure an automated attendant that can handle incoming calls when they are unavailable, including presence-based routing and call transfer options.\n\nPersonal Assistant is a feature of Webex Calling that helps manage incoming calls based on the user's availability status.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/personalAssistant") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -6206,13 +5606,6 @@ func init() { Long: "Get person's voicemail passcode rules. Voicemail rules specify the default passcode requirements. They are provided for informational purposes only and cannot be modified.\n\nThe voicemail feature allows users to manage their voicemail settings as part of Webex Calling. Voicemail rules help ensure secure access to voice messages by defining passcode complexity requirements.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/voicemail/rules") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -6262,13 +5655,6 @@ func init() { Long: "Retrieve hoteling guest settings for a person. Hoteling allows a person to temporarily use a device as a guest, associating their extension and configuration with that device for a limited time. This API returns the current hoteling guest configuration including any active host association details.\n\nHoteling is a feature of Webex Calling that enables flexible workspace solutions by allowing users to log into shared devices.\n\nThis API requires a user auth token with a scope of `spark:telephony_config_read`.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/hoteling/guest") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/caller_reputation_provider.go b/cmd/calling/caller_reputation_provider.go index a7313ed..f0c82df 100644 --- a/cmd/calling/caller_reputation_provider.go +++ b/cmd/calling/caller_reputation_provider.go @@ -34,13 +34,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/serviceSettings/callerReputationProvider") req.QueryParam("organizationId", organizationId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -114,13 +107,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/serviceSettings/callerReputationProvider/status") req.QueryParam("organizationId", organizationId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -176,13 +162,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/serviceSettings/callerReputationProvider/providers") req.QueryParam("organizationId", organizationId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/calling_service.go b/cmd/calling/calling_service.go index 02e1fc1..c1fb402 100644 --- a/cmd/calling/calling_service.go +++ b/cmd/calling/calling_service.go @@ -37,6 +37,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/announcementLanguages") req.QueryParam("ttsLanguage", ttsLanguage) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -63,13 +64,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/voicemail/settings") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -134,13 +128,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/voicemail/rules") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -192,13 +179,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/moh/settings") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -254,13 +234,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/callCaptions") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -319,13 +292,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/largeOrgStatus") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/client_call.go b/cmd/calling/client_call.go index e734cb3..53c4e80 100644 --- a/cmd/calling/client_call.go +++ b/cmd/calling/client_call.go @@ -34,13 +34,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/settings/msTeams") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/conference_controls.go b/cmd/calling/conference_controls.go index 7c4c09a..4a03b58 100644 --- a/cmd/calling/conference_controls.go +++ b/cmd/calling/conference_controls.go @@ -92,13 +92,6 @@ and a participant to be added to the conference.`, RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/conference") req.QueryParam("lineOwnerId", lineOwnerId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/converged_recordings.go b/cmd/calling/converged_recordings.go index b6bf284..7dee7fc 100644 --- a/cmd/calling/converged_recordings.go +++ b/cmd/calling/converged_recordings.go @@ -67,6 +67,7 @@ func init() { req.QueryParam("topic", topic) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -137,6 +138,7 @@ func init() { req.QueryParam("topic", topic) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -178,13 +180,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/convergedRecordings/{recordingId}") req.PathParam("recordingId", recordingId) req.Header("timezone", timezone) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -248,13 +243,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/convergedRecordings/{recordingId}/metadata") req.PathParam("recordingId", recordingId) req.QueryParam("showAllTypes", showAllTypes) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/customer_assist.go b/cmd/calling/customer_assist.go index 591c2d5..cb77a74 100644 --- a/cmd/calling/customer_assist.go +++ b/cmd/calling/customer_assist.go @@ -37,6 +37,7 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/cxEssentials/wrapup/reasons") if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -103,13 +104,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/cxEssentials/wrapup/reasons/{wrapupReasonId}") req.PathParam("wrapupReasonId", wrapupReasonId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -235,13 +229,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/cxEssentials/wrapup/reasons/{wrapupReasonId}/availableQueues") req.PathParam("wrapupReasonId", wrapupReasonId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -265,13 +252,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/cxEssentials/locations/{locationId}/queues/{queueId}/wrapup/settings") req.PathParam("locationId", locationId) req.PathParam("queueId", queueId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -348,13 +328,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("queueId", queueId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -423,6 +396,7 @@ func init() { req.QueryParam("orgId", orgId) req.QueryParam("hasCxEssentials", hasCxEssentials) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/calling/customer_experience_essentials.go b/cmd/calling/customer_experience_essentials.go index 926dc70..703b89f 100644 --- a/cmd/calling/customer_experience_essentials.go +++ b/cmd/calling/customer_experience_essentials.go @@ -37,6 +37,7 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/cxEssentials/wrapup/reasons") if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -103,13 +104,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/cxEssentials/wrapup/reasons/{wrapupReasonId}") req.PathParam("wrapupReasonId", wrapupReasonId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -235,13 +229,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/cxEssentials/wrapup/reasons/{wrapupReasonId}/availableQueues") req.PathParam("wrapupReasonId", wrapupReasonId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -265,13 +252,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/cxEssentials/locations/{locationId}/queues/{queueId}/wrapup/settings") req.PathParam("locationId", locationId) req.PathParam("queueId", queueId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -348,13 +328,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("queueId", queueId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -423,6 +396,7 @@ func init() { req.QueryParam("orgId", orgId) req.QueryParam("hasCxEssentials", hasCxEssentials) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/calling/dect_devices.go b/cmd/calling/dect_devices.go index 7c54cb1..e40cbcb 100644 --- a/cmd/calling/dect_devices.go +++ b/cmd/calling/dect_devices.go @@ -92,6 +92,7 @@ func init() { req.QueryParam("name", name) req.QueryParam("locationId", locationId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -124,13 +125,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("dectNetworkId", dectNetworkId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -283,6 +277,7 @@ func init() { req.PathParam("dectNetworkId", dectNetworkId) req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -347,13 +342,6 @@ func init() { req.PathParam("dectNetworkId", dectNetworkId) req.PathParam("baseStationId", baseStationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -470,6 +458,7 @@ func init() { req.QueryParam("basestationId", basestationId) req.QueryParam("memberId", memberId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -508,13 +497,6 @@ func init() { req.PathParam("dectNetworkId", dectNetworkId) req.PathParam("handsetId", handsetId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -714,6 +696,7 @@ func init() { req.PathParam("personId", personId) req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -745,6 +728,7 @@ func init() { req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -859,13 +843,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("dectNetworkId", dectNetworkId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/device_call.go b/cmd/calling/device_call.go index d7f6d91..4c75364 100644 --- a/cmd/calling/device_call.go +++ b/cmd/calling/device_call.go @@ -40,13 +40,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/{deviceId}/members") req.PathParam("deviceId", deviceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -187,13 +180,6 @@ func init() { req.PathParam("deviceId", deviceId) req.QueryParam("orgId", orgId) req.QueryParam("deviceModel", deviceModel) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -257,13 +243,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/devices/settings") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -288,13 +267,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/{deviceId}") req.PathParam("deviceId", deviceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -358,13 +330,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/devices") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -424,13 +389,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/devices") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -503,6 +461,7 @@ func init() { req.QueryParam("allowConfigureLayoutEnabled", allowConfigureLayoutEnabled) req.QueryParam("type", typeVal) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -531,13 +490,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/settings") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -590,6 +542,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/lineKeyTemplates") req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -618,13 +571,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/lineKeyTemplates/{templateId}") req.PathParam("templateId", templateId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -769,6 +715,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/applyLineKeyTemplate") req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -797,13 +744,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/applyLineKeyTemplate/{jobId}") req.PathParam("jobId", jobId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -828,13 +768,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/applyLineKeyTemplate/{jobId}/errors") req.PathParam("jobId", jobId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -857,13 +790,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/dects/supportedDevices") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -884,13 +810,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/dectNetworks/supportedDevices") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1010,13 +929,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/callDeviceSettings/{jobId}") req.PathParam("jobId", jobId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1077,13 +989,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/{deviceId}/layout") req.PathParam("deviceId", deviceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1177,6 +1082,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/rebuildPhones") req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -1205,13 +1111,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/rebuildPhones/{jobId}") req.PathParam("jobId", jobId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1236,13 +1135,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/rebuildPhones/{jobId}/errors") req.PathParam("jobId", jobId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1267,13 +1159,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/devices/settings") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1337,13 +1222,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/devices/settings") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1406,6 +1284,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/backgroundImages") req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -1489,13 +1368,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/devices/count") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1530,13 +1402,6 @@ func init() { req.QueryParam("locationId", locationId) req.QueryParam("extension", extension) req.QueryParam("usageType", usageType) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1578,13 +1443,6 @@ func init() { req.QueryParam("usageType", usageType) req.QueryParam("excludeVirtualLine", excludeVirtualLine) req.QueryParam("deviceLocationId", deviceLocationId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1617,6 +1475,7 @@ func init() { req.QueryParam("allowConfigureLayoutEnabled", allowConfigureLayoutEnabled) req.QueryParam("type", typeVal) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -1647,13 +1506,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/dynamicSettings/validationSchema") req.QueryParam("orgId", orgId) req.QueryParam("familyOrModelDisplayName", familyOrModelDisplayName) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1679,13 +1531,6 @@ func init() { req.QueryParam("orgId", orgId) req.QueryParam("familyOrModelDisplayName", familyOrModelDisplayName) req.QueryParam("includeSettingsType", includeSettingsType) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1926,13 +1771,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/dynamicDeviceSettings/{jobId}") req.PathParam("jobId", jobId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1996,6 +1834,7 @@ func init() { req.QueryParam("allowConfigureLayoutEnabled", allowConfigureLayoutEnabled) req.QueryParam("type", typeVal) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -2028,13 +1867,6 @@ func init() { req.QueryParam("orgId", orgId) req.QueryParam("familyOrModelDisplayName", familyOrModelDisplayName) req.QueryParam("includeSettingsType", includeSettingsType) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2275,13 +2107,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/dynamicDeviceSettings/{jobId}") req.PathParam("jobId", jobId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/devices.go b/cmd/calling/devices.go index 203e551..1f12824 100644 --- a/cmd/calling/devices.go +++ b/cmd/calling/devices.go @@ -172,13 +172,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/devices/{deviceId}") req.PathParam("deviceId", deviceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/emergency_services.go b/cmd/calling/emergency_services.go index 698c984..9d10227 100644 --- a/cmd/calling/emergency_services.go +++ b/cmd/calling/emergency_services.go @@ -125,13 +125,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/redSky") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -187,13 +180,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/redSky/status") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -293,13 +279,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/redSky") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -324,13 +303,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/redSky/status") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -462,13 +434,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/emergencyCallNotification") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -532,13 +497,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/emergencyCallNotification") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -605,13 +563,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/huntGroups/{huntGroupId}/emergencyCallbackNumber/dependencies") req.PathParam("huntGroupId", huntGroupId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -636,13 +587,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/emergencyCallbackNumber") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -715,13 +659,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/emergencyCallbackNumber/dependencies") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -746,13 +683,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/emergencyCallbackNumber") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -822,13 +752,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/emergencyCallbackNumber/dependencies") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -853,13 +776,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/emergencyCallbackNumber/dependencies") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -884,13 +800,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/emergencyCallbackNumber") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/external_voicemail.go b/cmd/calling/external_voicemail.go index acffd3e..8fd420a 100644 --- a/cmd/calling/external_voicemail.go +++ b/cmd/calling/external_voicemail.go @@ -786,6 +786,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/calls") req.QueryParam("lineOwnerId", lineOwnerId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -814,13 +815,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/calls/{callId}") req.PathParam("callId", callId) req.QueryParam("lineOwnerId", lineOwnerId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -844,6 +838,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/calls/history") req.QueryParam("type", typeVal) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/calling/hot_desk.go b/cmd/calling/hot_desk.go index be564fd..aaa155d 100644 --- a/cmd/calling/hot_desk.go +++ b/cmd/calling/hot_desk.go @@ -39,6 +39,7 @@ func init() { req.QueryParam("personId", personId) req.QueryParam("workspaceId", workspaceId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/calling/hot_desking_sign_in_via_voice_portal.go b/cmd/calling/hot_desking_sign_in_via_voice_portal.go index 135f72e..8c62ad2 100644 --- a/cmd/calling/hot_desking_sign_in_via_voice_portal.go +++ b/cmd/calling/hot_desking_sign_in_via_voice_portal.go @@ -36,13 +36,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/features/hotDesking") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -106,13 +99,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/features/hotDesking/guest") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/hunt_group.go b/cmd/calling/hunt_group.go index e9a60d4..b0b595b 100644 --- a/cmd/calling/hunt_group.go +++ b/cmd/calling/hunt_group.go @@ -143,13 +143,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("huntGroupId", huntGroupId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -217,13 +210,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("huntGroupId", huntGroupId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -332,13 +318,6 @@ func init() { req.PathParam("huntGroupId", huntGroupId) req.PathParam("ruleId", ruleId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/location_call.go b/cmd/calling/location_call.go index 3f88400..ab01643 100644 --- a/cmd/calling/location_call.go +++ b/cmd/calling/location_call.go @@ -157,13 +157,6 @@ Searching and viewing locations in your organization requires an administrator a req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -222,6 +215,7 @@ Searching and viewing locations in your organization requires an administrator a req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/updateRoutingPrefix") req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -250,13 +244,6 @@ Searching and viewing locations in your organization requires an administrator a req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/updateRoutingPrefix/{jobId}") req.PathParam("jobId", jobId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -281,13 +268,6 @@ Searching and viewing locations in your organization requires an administrator a req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/updateRoutingPrefix/{jobId}/errors") req.PathParam("jobId", jobId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -357,13 +337,6 @@ Searching and viewing locations in your organization requires an administrator a req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/features/emergencyCallbackNumber") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -542,13 +515,6 @@ Searching and viewing locations in your organization requires an administrator a req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/musicOnHold") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -573,13 +539,6 @@ Searching and viewing locations in your organization requires an administrator a req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/privateNetworkConnect") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -944,6 +903,7 @@ Searching and viewing locations in your organization requires an administrator a req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -988,13 +948,6 @@ Searching and viewing locations in your organization requires an administrator a req.QueryParam("phoneNumber", phoneNumber) req.QueryParam("extension", extension) req.QueryParam("personId", personId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1291,13 +1244,6 @@ Searching and viewing locations in your organization requires an administrator a req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/locations/deleteCallingLocation/{jobId}/errors") req.PathParam("jobId", jobId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1322,13 +1268,6 @@ Searching and viewing locations in your organization requires an administrator a req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/locations/deleteCallingLocation/{jobId}") req.PathParam("jobId", jobId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1353,13 +1292,6 @@ Searching and viewing locations in your organization requires an administrator a req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/callCaptions") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/location_call_handling.go b/cmd/calling/location_call_handling.go index ac6d8f5..d0a2a72 100644 --- a/cmd/calling/location_call_handling.go +++ b/cmd/calling/location_call_handling.go @@ -77,13 +77,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/internalDialing") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -143,13 +136,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/intercept") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -213,13 +199,6 @@ Retrieving a location's outgoing call settings requires a full, user or read-onl req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/outgoingPermission") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -283,13 +262,6 @@ Updating a location's outgoing call settings requires a full administrator or lo req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/outgoingPermission/autoTransferNumbers") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -359,13 +331,6 @@ Updating a location's outgoing call settings requires a full administrator or lo req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/outgoingPermission/accessCodes") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -492,13 +457,6 @@ Creating an access code for the given location requires a full or user administr req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/outgoingPermission/digitPatterns") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -597,13 +555,6 @@ Creating an access code for the given location requires a full or user administr req.PathParam("locationId", locationId) req.PathParam("digitPatternId", digitPatternId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/location_schedules.go b/cmd/calling/location_schedules.go index ad0bf1f..04fc21c 100644 --- a/cmd/calling/location_schedules.go +++ b/cmd/calling/location_schedules.go @@ -118,13 +118,6 @@ func init() { req.PathParam("type", typeVal) req.PathParam("scheduleId", scheduleId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -234,13 +227,6 @@ func init() { req.PathParam("scheduleId", scheduleId) req.PathParam("eventId", eventId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/location_voicemail.go b/cmd/calling/location_voicemail.go index 344e731..ec5c6fc 100644 --- a/cmd/calling/location_voicemail.go +++ b/cmd/calling/location_voicemail.go @@ -38,13 +38,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/voicemail") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -108,13 +101,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/voicePortal") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -174,13 +160,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/voicePortal/passcodeRules") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -249,13 +228,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("voicemailGroupId", voicemailGroupId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/locations.go b/cmd/calling/locations.go index d989b88..ff02466 100644 --- a/cmd/calling/locations.go +++ b/cmd/calling/locations.go @@ -43,6 +43,7 @@ func init() { req.QueryParam("orgId", orgId) req.QueryParam("max", max) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -105,13 +106,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/locations/{locationId}") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -170,6 +164,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/locations/{locationId}/floors") req.PathParam("locationId", locationId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -238,13 +233,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/locations/{locationId}/floors/{floorId}") req.PathParam("locationId", locationId) req.PathParam("floorId", floorId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/metrics.go b/cmd/calling/metrics.go index bd5dad1..d6f117e 100644 --- a/cmd/calling/metrics.go +++ b/cmd/calling/metrics.go @@ -54,13 +54,6 @@ This operation requires a Pro Pack for Control Hub license. The access token mus req.QueryParam("from", from) req.QueryParam("to", to) req.QueryParam("location", location) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/mode_management.go b/cmd/calling/mode_management.go index cd15089..23740fd 100644 --- a/cmd/calling/mode_management.go +++ b/cmd/calling/mode_management.go @@ -36,13 +36,6 @@ func init() { Long: "Retrieves a list of all mode management features (Auto Attendants, Call Queues, and Hunt Groups) for which the authenticated user has been designated as a mode manager. This API returns basic information about each feature including its ID, name, and type.\n\nMode Management allows designated managers to switch features between different operational configurations based on time schedules or manual triggers. This is useful for managing business hours, holidays, and emergency scenarios.\n\nThis API requires a user auth token with the `spark:telephony_config_read` scope. The authenticated user must be configured as a mode manager for at least one feature to receive results.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/modeManagement/features") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -62,13 +55,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/modeManagement/features/commonModes") req.QueryParam("featureIds", featureIds) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -124,13 +110,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/modeManagement/features/{featureId}") req.PathParam("featureId", featureId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -152,13 +131,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/modeManagement/features/{featureId}/normalOperationMode") req.PathParam("featureId", featureId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -182,13 +154,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/me/settings/modeManagement/features/{featureId}/modes/{modeId}") req.PathParam("featureId", featureId) req.PathParam("modeId", modeId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/numbers.go b/cmd/calling/numbers.go index 6ca46d9..e2ffb3e 100644 --- a/cmd/calling/numbers.go +++ b/cmd/calling/numbers.go @@ -348,13 +348,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/numbers/manageNumbers/{jobId}") req.PathParam("jobId", jobId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/operating_modes.go b/cmd/calling/operating_modes.go index dd8dc6d..11bcad8 100644 --- a/cmd/calling/operating_modes.go +++ b/cmd/calling/operating_modes.go @@ -81,13 +81,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/operatingModes/{modeId}") req.PathParam("modeId", modeId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -204,13 +197,6 @@ func init() { req.PathParam("modeId", modeId) req.PathParam("holidayId", holidayId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -340,6 +326,7 @@ func init() { req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/calling/paging_group.go b/cmd/calling/paging_group.go index d0a5fc9..f1ea166 100644 --- a/cmd/calling/paging_group.go +++ b/cmd/calling/paging_group.go @@ -145,13 +145,6 @@ func init() { req.PathParam("locationId", locationId) req.PathParam("pagingId", pagingId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/partner_reports_templates.go b/cmd/calling/partner_reports_templates.go index c2cf856..24fc4f8 100644 --- a/cmd/calling/partner_reports_templates.go +++ b/cmd/calling/partner_reports_templates.go @@ -57,6 +57,7 @@ func init() { req.QueryParam("regionId", regionId) req.QueryParam("onBehalfOfSubPartnerOrgId", onBehalfOfSubPartnerOrgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -135,13 +136,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/partner/reports/{reportId}") req.PathParam("reportId", reportId) req.QueryParam("onBehalfOfSubPartnerOrgId", onBehalfOfSubPartnerOrgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -189,6 +183,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/partner/reports/templates") req.QueryParam("onBehalfOfSubPartnerOrgId", onBehalfOfSubPartnerOrgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/calling/people.go b/cmd/calling/people.go index ab518ea..e8966c2 100644 --- a/cmd/calling/people.go +++ b/cmd/calling/people.go @@ -53,6 +53,7 @@ func init() { req.QueryParam("max", max) req.QueryParam("excludeStatus", excludeStatus) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -123,13 +124,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}") req.PathParam("personId", personId) req.QueryParam("callingData", callingData) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -214,13 +208,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/people/me") req.QueryParam("callingData", callingData) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/pstn.go b/cmd/calling/pstn.go index c8ad11a..d2c7f52 100644 --- a/cmd/calling/pstn.go +++ b/cmd/calling/pstn.go @@ -39,13 +39,6 @@ func init() { req.QueryParam("orgId", orgId) req.QueryParam("serviceTypes", serviceTypes) req.QueryParam("serviceTypes", serviceTypes) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -116,13 +109,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/pstn/locations/{locationId}/connection") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/recording_report.go b/cmd/calling/recording_report.go index 94ff4bb..6d6436d 100644 --- a/cmd/calling/recording_report.go +++ b/cmd/calling/recording_report.go @@ -55,6 +55,7 @@ func init() { req.QueryParam("siteUrl", siteUrl) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -94,6 +95,7 @@ func init() { req.QueryParam("max", max) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -140,6 +142,7 @@ func init() { req.QueryParam("siteUrl", siteUrl) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -173,13 +176,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/recordingReport/meetingArchives/{archiveId}") req.PathParam("archiveId", archiveId) req.Header("timezone", timezone) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/reports.go b/cmd/calling/reports.go index 4b83de6..0772cf5 100644 --- a/cmd/calling/reports.go +++ b/cmd/calling/reports.go @@ -55,6 +55,7 @@ func init() { req.QueryParam("from", from) req.QueryParam("to", to) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -127,13 +128,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/reports/{reportId}") req.PathParam("reportId", reportId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/reports_detailed_call_history.go b/cmd/calling/reports_detailed_call_history.go index 1984032..fe6496b 100644 --- a/cmd/calling/reports_detailed_call_history.go +++ b/cmd/calling/reports_detailed_call_history.go @@ -41,6 +41,7 @@ func init() { req.QueryParam("locations", locations) req.QueryParam("max", max) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -77,6 +78,7 @@ func init() { req.QueryParam("locations", locations) req.QueryParam("max", max) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/calling/send_activation_email.go b/cmd/calling/send_activation_email.go index 4e14cfd..aa26dd3 100644 --- a/cmd/calling/send_activation_email.go +++ b/cmd/calling/send_activation_email.go @@ -57,13 +57,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/identity/organizations/{orgId}/jobs/sendActivationEmails/{jobId}/status") req.PathParam("orgId", orgId) req.PathParam("jobId", jobId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -92,6 +85,7 @@ func init() { req.PathParam("jobId", jobId) req.QueryParam("max", max) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/calling/single_number_reach.go b/cmd/calling/single_number_reach.go index 1829ddf..1b610aa 100644 --- a/cmd/calling/single_number_reach.go +++ b/cmd/calling/single_number_reach.go @@ -123,13 +123,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/singleNumberReach") req.PathParam("personId", personId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/user_call.go b/cmd/calling/user_call.go index 7c131b9..73ceca0 100644 --- a/cmd/calling/user_call.go +++ b/cmd/calling/user_call.go @@ -42,13 +42,6 @@ This API requires a full, user, or read-only administrator or location administr req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/applications") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -132,13 +125,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/bargeIn") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -205,13 +191,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/callForwarding") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -271,13 +250,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/intercept") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -337,13 +309,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/callRecording") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -403,13 +368,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/callWaiting") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -473,13 +431,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/callerId") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -539,13 +490,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/callingBehavior") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -612,13 +556,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/doNotDisturb") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -688,13 +625,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/executiveAssistant") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -758,13 +688,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/hoteling") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -828,13 +751,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/monitoring") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -901,13 +817,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/incomingPermission") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -980,13 +889,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/outgoingPermission") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1049,6 +951,7 @@ This API requires a full or user administrator or location administrator auth to req.QueryParam("orgId", orgId) req.QueryParam("preferE164Format", preferE164Format) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -1084,13 +987,6 @@ This API requires a full, user, or read-only administrator or location administr req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/privacy") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1170,13 +1066,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/pushToTalk") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1249,13 +1138,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/reception") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1404,13 +1286,6 @@ This API requires a full or user administrator or location administrator auth to req.PathParam("scheduleType", scheduleType) req.PathParam("scheduleId", scheduleId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1520,13 +1395,6 @@ This API requires a full or user administrator or location administrator auth to req.PathParam("scheduleId", scheduleId) req.PathParam("eventId", eventId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1683,13 +1551,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/voicemail") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1848,13 +1709,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/person/moveLocation/{jobId}") req.PathParam("jobId", jobId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1964,13 +1818,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/musicOnHold") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2030,13 +1877,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/outgoingPermission/accessCodes") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2166,13 +2006,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/outgoingPermission/autoTransferNumbers") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2245,13 +2078,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/outgoingPermission/digitPatterns") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2389,13 +2215,6 @@ This API requires a full or user administrator or location administrator auth to req.PathParam("personId", personId) req.PathParam("digitPatternId", digitPatternId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2537,13 +2356,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/preferredAnswerEndpoint") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2660,13 +2472,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/applications/{applicationId}/members") req.PathParam("personId", personId) req.PathParam("applicationId", applicationId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2763,13 +2568,6 @@ This API requires a full or user administrator or location administrator auth to Long: `Get a summary of the voicemail messages for the user.`, RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/voiceMessages/summary") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2790,6 +2588,7 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/voiceMessages") req.QueryParam("lineOwnerId", lineOwnerId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -2909,13 +2708,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/agent/availableCallerIds") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2938,13 +2730,6 @@ This API requires a full or user administrator or location administrator auth to RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/agent/callerId") req.PathParam("personId", personId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3004,13 +2789,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/features/callBridge") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3337,13 +3115,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/settings/msTeams") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3410,13 +3181,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/features/personalAssistant") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3548,6 +3312,7 @@ This API requires a full or user administrator or location administrator auth to req.PathParam("personId", personId) req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -3617,13 +3382,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/selectiveAccept") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3749,13 +3507,6 @@ This API requires a full or user administrator or location administrator auth to req.PathParam("personId", personId) req.PathParam("id", id) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3874,13 +3625,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/selectiveReject") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4006,13 +3750,6 @@ This API requires a full or user administrator or location administrator auth to req.PathParam("personId", personId) req.PathParam("id", id) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4131,13 +3868,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/selectiveForward") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4278,13 +4008,6 @@ This API requires a full or user administrator or location administrator auth to req.PathParam("personId", personId) req.PathParam("id", id) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4409,13 +4132,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}/features/applications") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4487,13 +4203,6 @@ This API requires a full or user administrator or location administrator auth to RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/applications/members") req.PathParam("personId", personId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4549,13 +4258,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/callCaptions") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4625,13 +4327,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/executive/callFiltering") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4693,13 +4388,6 @@ This API requires a full or user administrator or location administrator auth to req.PathParam("personId", personId) req.PathParam("id", id) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4828,13 +4516,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/executive/alert") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -4928,13 +4609,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/executive/assignedAssistants") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -5041,13 +4715,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/executive/assistant") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -5107,13 +4774,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/executive/screening") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -5197,13 +4857,6 @@ This API requires a full or user administrator or location administrator auth to req.QueryParam("memberName", memberName) req.QueryParam("phoneNumber", phoneNumber) req.QueryParam("extension", extension) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -5232,13 +4885,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -5305,13 +4951,6 @@ This API requires a full or user administrator or location administrator auth to req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/countries/{countryCode}") req.PathParam("countryCode", countryCode) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/virtual_extensions.go b/cmd/calling/virtual_extensions.go index 530fc70..76390fe 100644 --- a/cmd/calling/virtual_extensions.go +++ b/cmd/calling/virtual_extensions.go @@ -142,13 +142,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualExtensions/{extensionId}") req.PathParam("extensionId", extensionId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -246,13 +239,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualExtensions/settings") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -437,13 +423,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualExtensionRanges/{extensionRangeId}") req.PathParam("extensionRangeId", extensionRangeId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/virtual_line_call.go b/cmd/calling/virtual_line_call.go index 8da9c9a..019e3c7 100644 --- a/cmd/calling/virtual_line_call.go +++ b/cmd/calling/virtual_line_call.go @@ -163,13 +163,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/callRecording") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -253,13 +246,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -350,13 +336,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/number") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -421,6 +400,7 @@ func init() { req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -452,6 +432,7 @@ func init() { req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -482,13 +463,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/callerId") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -548,13 +522,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/callWaiting") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -618,13 +585,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/callForwarding") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -684,13 +644,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/incomingPermission") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -763,13 +716,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/outgoingPermission") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -833,13 +779,6 @@ This API requires a full, user or read-only administrator auth token with a scop req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/outgoingPermission/accessCodes") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -973,13 +912,6 @@ This API requires a full, user or read-only administrator auth token with a scop req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/outgoingPermission/autoTransferNumbers") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1052,13 +984,6 @@ This API requires a full, user or read-only administrator auth token with a scop req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/outgoingPermission/digitPatterns") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1196,13 +1121,6 @@ This API requires a full, user or read-only administrator auth token with a scop req.PathParam("virtualLineId", virtualLineId) req.PathParam("digitPatternId", digitPatternId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1309,13 +1227,6 @@ This API requires a full, user or read-only administrator auth token with a scop req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/intercept") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1375,13 +1286,6 @@ This API requires a full, user or read-only administrator auth token with a scop req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/agent/availableCallerIds") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1404,13 +1308,6 @@ This API requires a full, user or read-only administrator auth token with a scop RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/agent/callerId") req.PathParam("virtualLineId", virtualLineId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1470,13 +1367,6 @@ This API requires a full, user or read-only administrator auth token with a scop req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/voicemail") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1610,13 +1500,6 @@ This API requires a full, user or read-only administrator auth token with a scop req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/musicOnHold") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1676,13 +1559,6 @@ This API requires a full, user or read-only administrator auth token with a scop req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/pushToTalk") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1755,13 +1631,6 @@ This API requires a full, user or read-only administrator auth token with a scop req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/callBridge") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1825,13 +1694,6 @@ This API requires a full, user or read-only administrator auth token with a scop req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/bargeIn") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1898,13 +1760,6 @@ This API requires a full, user or read-only administrator auth token with a scop req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/privacy") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2199,13 +2054,6 @@ This API requires a full, user or read-only administrator auth token with a scop req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/virtualLines/{virtualLineId}/doNotDisturb") req.PathParam("virtualLineId", virtualLineId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/workspace_call.go b/cmd/calling/workspace_call.go index 24aeb2e..a4d931e 100644 --- a/cmd/calling/workspace_call.go +++ b/cmd/calling/workspace_call.go @@ -40,13 +40,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaces/{workspaceId}/features/callForwarding") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -106,13 +99,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaces/{workspaceId}/features/callWaiting") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -176,13 +162,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaces/{workspaceId}/features/callerId") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -242,13 +221,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaces/{workspaceId}/features/monitoring") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -316,6 +288,7 @@ func init() { req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -346,13 +319,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaces/{workspaceId}/features/incomingPermission") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -425,13 +391,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaces/{workspaceId}/features/outgoingPermission") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -491,13 +450,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaces/{workspaceId}/features/outgoingPermission/accessCodes") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -627,13 +579,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaces/{workspaceId}/features/intercept") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -693,13 +638,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaces/{workspaceId}/features/outgoingPermission/autoTransferNumbers") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -772,13 +710,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/musicOnHold") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -866,13 +797,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/outgoingPermission/digitPatterns") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1010,13 +934,6 @@ func init() { req.PathParam("workspaceId", workspaceId) req.PathParam("digitPatternId", digitPatternId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1123,13 +1040,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/features/callRecordings") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1367,13 +1277,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/anonymousCallReject") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1437,13 +1340,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/bargeIn") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1510,13 +1406,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/doNotDisturb") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1583,13 +1472,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/callBridge") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1653,13 +1535,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/pushToTalk") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1732,13 +1607,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/privacy") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1814,13 +1682,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/voicemail") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1921,13 +1782,6 @@ func init() { req.PathParam("workspaceId", workspaceId) req.PathParam("id", id) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2046,13 +1900,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/callPolicies") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2176,13 +2023,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/sequentialRing") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2242,13 +2082,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/simultaneousRing") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2310,13 +2143,6 @@ func init() { req.PathParam("workspaceId", workspaceId) req.PathParam("id", id) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2495,13 +2321,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/selectiveReject") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2567,13 +2386,6 @@ func init() { req.PathParam("workspaceId", workspaceId) req.PathParam("id", id) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2787,13 +2599,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/selectiveAccept") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2859,13 +2664,6 @@ func init() { req.PathParam("workspaceId", workspaceId) req.PathParam("id", id) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3044,13 +2842,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/priorityAlert") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3116,13 +2907,6 @@ func init() { req.PathParam("workspaceId", workspaceId) req.PathParam("id", id) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3301,13 +3085,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/selectiveForward") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -3382,13 +3159,6 @@ func init() { req.PathParam("workspaceId", workspaceId) req.PathParam("id", id) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/calling/workspaces.go b/cmd/calling/workspaces.go index fc9fc43..d68b117 100644 --- a/cmd/calling/workspaces.go +++ b/cmd/calling/workspaces.go @@ -147,13 +147,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaces/{workspaceId}") req.PathParam("workspaceId", workspaceId) req.QueryParam("includeDevices", includeDevices) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -229,13 +222,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaces/{workspaceId}/capabilities") req.PathParam("workspaceId", workspaceId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -261,13 +247,6 @@ func init() { req.PathParam("workspaceId", workspaceId) req.QueryParam("includeDevices", includeDevices) req.QueryParam("includeCapabilities", includeCapabilities) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/activities.go b/cmd/cc/activities.go index 008690b..afecec2 100644 --- a/cmd/cc/activities.go +++ b/cmd/cc/activities.go @@ -66,13 +66,6 @@ func init() { req.PathParam("orgid", orgid) req.PathParam("projectId", "5e5c9ad6d61f870d6d778c1b") req.PathParam("activityName", activityName) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -109,13 +102,6 @@ func init() { req.QueryParam("validate", validate) req.QueryParam("parentValue", parentValue) req.QueryParam("parentInputName", parentInputName) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/address_book.go b/cmd/cc/address_book.go index 6d15da5..eedb8ae 100644 --- a/cmd/cc/address_book.go +++ b/cmd/cc/address_book.go @@ -259,13 +259,6 @@ func init() { req.PathParam("orgid", orgid) req.PathParam("addressBookId", addressBookId) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -377,13 +370,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/v3/address-book/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/agent_personal_greeting_files.go b/cmd/cc/agent_personal_greeting_files.go index d530559..8e86123 100644 --- a/cmd/cc/agent_personal_greeting_files.go +++ b/cmd/cc/agent_personal_greeting_files.go @@ -105,13 +105,6 @@ func init() { req.PathParam("orgid", orgid) req.PathParam("id", id) req.QueryParam("includeUrl", includeUrl) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/agent_wellbeing.go b/cmd/cc/agent_wellbeing.go index 96a7252..cca20fa 100644 --- a/cmd/cc/agent_wellbeing.go +++ b/cmd/cc/agent_wellbeing.go @@ -121,13 +121,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/agent-burnout/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/agents.go b/cmd/cc/agents.go index 7ff8e69..5deee9e 100644 --- a/cmd/cc/agents.go +++ b/cmd/cc/agents.go @@ -362,13 +362,6 @@ If the header is not present in the request or if gzip is not listed as one of t req.QueryParam("agentIds", agentIds) req.QueryParam("orgId", orgid) req.Header("TrackingId", trackingId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/ai_feature.go b/cmd/cc/ai_feature.go index 7a1955a..939cce9 100644 --- a/cmd/cc/ai_feature.go +++ b/cmd/cc/ai_feature.go @@ -39,13 +39,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/ai-feature/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -234,13 +227,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/ai-feature/auto-csat/question/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/asset.go b/cmd/cc/asset.go index f6002fb..a189e32 100644 --- a/cmd/cc/asset.go +++ b/cmd/cc/asset.go @@ -105,13 +105,6 @@ func init() { req.PathParam("orgid", orgid) req.PathParam("id", id) req.QueryParam("includeChannelName", includeChannelName) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/audio_files.go b/cmd/cc/audio_files.go index accbd58..0796ee4 100644 --- a/cmd/cc/audio_files.go +++ b/cmd/cc/audio_files.go @@ -71,13 +71,6 @@ func init() { req.PathParam("orgid", orgid) req.PathParam("id", id) req.QueryParam("includeUrl", includeUrl) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/auto_csat.go b/cmd/cc/auto_csat.go index 93e4bb4..85b180e 100644 --- a/cmd/cc/auto_csat.go +++ b/cmd/cc/auto_csat.go @@ -134,13 +134,6 @@ func init() { req.PathParam("orgid", orgid) req.PathParam("autoCsatId", autoCsatId) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -198,13 +191,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/auto-csat/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/auxiliary_code.go b/cmd/cc/auxiliary_code.go index 773b59b..8abda27 100644 --- a/cmd/cc/auxiliary_code.go +++ b/cmd/cc/auxiliary_code.go @@ -279,13 +279,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/auxiliary-code/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/business_hour.go b/cmd/cc/business_hour.go index 560c266..bded5e9 100644 --- a/cmd/cc/business_hour.go +++ b/cmd/cc/business_hour.go @@ -190,13 +190,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/business-hours/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/call_monitoring.go b/cmd/cc/call_monitoring.go index b79c2e8..618a3ca 100644 --- a/cmd/cc/call_monitoring.go +++ b/cmd/cc/call_monitoring.go @@ -174,13 +174,6 @@ func init() { Long: `Fetches all active subscriptions for a given clientID.`, RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CcBaseURL, "GET", "/v1/monitor/sessions") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/callbacks.go b/cmd/cc/callbacks.go index 27621e9..5e6523a 100644 --- a/cmd/cc/callbacks.go +++ b/cmd/cc/callbacks.go @@ -145,13 +145,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/v1/callbacks/organization/{orgid}/scheduled-callback/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/campaign_manager.go b/cmd/cc/campaign_manager.go index cc16a83..cd24733 100644 --- a/cmd/cc/campaign_manager.go +++ b/cmd/cc/campaign_manager.go @@ -127,13 +127,6 @@ func init() { req.QueryParam("interactionId", interactionId) req.QueryParam("agentId", agentId) req.QueryParam("trackingId", trackingId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/channel.go b/cmd/cc/channel.go index 2885141..96ff2fa 100644 --- a/cmd/cc/channel.go +++ b/cmd/cc/channel.go @@ -103,13 +103,6 @@ func init() { req.PathParam("orgid", orgid) req.PathParam("id", id) req.QueryParam("includeLogoUrlVersioned", includeLogoUrlVersioned) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/contact_list_management.go b/cmd/cc/contact_list_management.go index a923ea4..022f044 100644 --- a/cmd/cc/contact_list_management.go +++ b/cmd/cc/contact_list_management.go @@ -204,13 +204,6 @@ func init() { req.PathParam("campaignId", campaignId) req.QueryParam("status", status) req.QueryParam("source", source) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/contact_number.go b/cmd/cc/contact_number.go index 783bb24..752d3dd 100644 --- a/cmd/cc/contact_number.go +++ b/cmd/cc/contact_number.go @@ -178,13 +178,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/contact-number/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/contact_service_queue.go b/cmd/cc/contact_service_queue.go index a1e85bf..ed28652 100644 --- a/cmd/cc/contact_service_queue.go +++ b/cmd/cc/contact_service_queue.go @@ -359,13 +359,6 @@ func init() { req.PathParam("orgid", orgid) req.PathParam("id", id) req.QueryParam("agentsUpdatedInfo", agentsUpdatedInfo) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/data_sources.go b/cmd/cc/data_sources.go index 95b5e1a..ff75b0d 100644 --- a/cmd/cc/data_sources.go +++ b/cmd/cc/data_sources.go @@ -81,13 +81,6 @@ func init() { Long: "Lists all data sources registered by the Service App. Requires the `spark-admin:datasource_read` scope.", RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CcBaseURL, "GET", "/dataSources") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -105,13 +98,6 @@ func init() { Long: `Lists the available data source schemas. A valid API access token is required, but no specific scope is needed.`, RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CcBaseURL, "GET", "/dataSources/schemas") - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -131,13 +117,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CcBaseURL, "GET", "/dataSources/schemas/{schemaId}") req.PathParam("schemaId", schemaId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -180,13 +159,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CcBaseURL, "GET", "/dataSources/{dataSourceId}") req.PathParam("dataSourceId", dataSourceId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/desktop_layout.go b/cmd/cc/desktop_layout.go index a7b8d43..419677b 100644 --- a/cmd/cc/desktop_layout.go +++ b/cmd/cc/desktop_layout.go @@ -221,13 +221,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/desktop-layout/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/desktop_profile.go b/cmd/cc/desktop_profile.go index aec963c..e80175f 100644 --- a/cmd/cc/desktop_profile.go +++ b/cmd/cc/desktop_profile.go @@ -366,13 +366,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/agent-profile/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/dial_number.go b/cmd/cc/dial_number.go index 832fee0..b8c4e76 100644 --- a/cmd/cc/dial_number.go +++ b/cmd/cc/dial_number.go @@ -280,13 +280,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/dial-number/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/dial_plan.go b/cmd/cc/dial_plan.go index 37a6bbd..592d260 100644 --- a/cmd/cc/dial_plan.go +++ b/cmd/cc/dial_plan.go @@ -225,13 +225,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/dial-plan/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/dnc_management.go b/cmd/cc/dnc_management.go index 22a7cd1..064f3b8 100644 --- a/cmd/cc/dnc_management.go +++ b/cmd/cc/dnc_management.go @@ -82,13 +82,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/v3/campaign-management/dncList/{dncListName}/phoneNumber/{phoneNumber}") req.PathParam("dncListName", dncListName) req.PathParam("phoneNumber", phoneNumber) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/entry_point.go b/cmd/cc/entry_point.go index 0838a16..bc67f30 100644 --- a/cmd/cc/entry_point.go +++ b/cmd/cc/entry_point.go @@ -222,13 +222,6 @@ func init() { req.PathParam("orgid", orgid) req.PathParam("id", id) req.QueryParam("includeNames", includeNames) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/estimated_wait_time.go b/cmd/cc/estimated_wait_time.go index 767dd43..ba81b1c 100644 --- a/cmd/cc/estimated_wait_time.go +++ b/cmd/cc/estimated_wait_time.go @@ -45,13 +45,6 @@ func init() { req.QueryParam("minValidSamples", minValidSamples) req.QueryParam("orgId", orgid) req.Header("TrackingId", trackingId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/flow.go b/cmd/cc/flow.go index 865b87a..e297c4d 100644 --- a/cmd/cc/flow.go +++ b/cmd/cc/flow.go @@ -44,13 +44,6 @@ func init() { req.PathParam("projectId", "5e5c9ad6d61f870d6d778c1b") req.PathParam("flowId", flowId) req.QueryParam("version", version) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -125,6 +118,8 @@ func init() { req.QueryParam("includePagination", includePagination) req.QueryParam("isValidation", isValidation) if config.Paginate() { + req.PageSizeParam("size") + req.QueryParam("includePagination", "true") resp, statusCode, err := req.DoPaginated(false) if err != nil { return err @@ -348,13 +343,6 @@ func init() { req.PathParam("projectId", "5e5c9ad6d61f870d6d778c1b") req.PathParam("flowId", flowId) req.QueryParam("flowType", flowType) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -472,13 +460,6 @@ func init() { req.PathParam("flowId", flowId) req.QueryParam("versionId", versionId) req.QueryParam("flowType", flowType) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -511,13 +492,6 @@ func init() { req.PathParam("flowId", flowId) req.QueryParam("version", version) req.QueryParam("flowType", flowType) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -555,6 +529,7 @@ func init() { req.QueryParam("size", size) req.QueryParam("keyValueFilter", keyValueFilter) if config.Paginate() { + req.PageSizeParam("size") resp, statusCode, err := req.DoPaginated(false) if err != nil { return err diff --git a/cmd/cc/functions.go b/cmd/cc/functions.go index f11c6e4..a1f25f3 100644 --- a/cmd/cc/functions.go +++ b/cmd/cc/functions.go @@ -61,6 +61,7 @@ func init() { req.QueryParam("fields", fields) req.QueryParam("isValidation", isValidation) if config.Paginate() { + req.PageSizeParam("size") resp, statusCode, err := req.DoPaginated(false) if err != nil { return err @@ -137,13 +138,6 @@ func init() { req.PathParam("id", id) req.QueryParam("versionOrTag", versionOrTag) req.QueryParam("metaDataOnly", metaDataOnly) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/generated_summaries.go b/cmd/cc/generated_summaries.go index c21a022..0434125 100644 --- a/cmd/cc/generated_summaries.go +++ b/cmd/cc/generated_summaries.go @@ -39,13 +39,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/generated-summaries/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/global_variables.go b/cmd/cc/global_variables.go index 7123806..181d288 100644 --- a/cmd/cc/global_variables.go +++ b/cmd/cc/global_variables.go @@ -201,13 +201,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/cad-variable/reportable-count") req.PathParam("orgid", orgid) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -232,13 +225,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/cad-variable/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/holiday_list.go b/cmd/cc/holiday_list.go index 86878a4..fc376ec 100644 --- a/cmd/cc/holiday_list.go +++ b/cmd/cc/holiday_list.go @@ -190,13 +190,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/holiday-list/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/journey.go b/cmd/cc/journey.go index 94c3827..dc52eb6 100644 --- a/cmd/cc/journey.go +++ b/cmd/cc/journey.go @@ -38,13 +38,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CcBaseURL, "GET", "/admin/v1/api/workspace/workspace-id/{workspaceId}") req.PathParam("workspaceId", workspaceId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -128,13 +121,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/admin/v1/api/profile-view-template/workspace-id/{workspaceId}/template-id/{templateId}") req.PathParam("workspaceId", workspaceId) req.PathParam("templateId", templateId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -331,13 +317,6 @@ For a more information on Patch Requests, see this [JSON PATCH guide](https://j RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CcBaseURL, "GET", "/admin/v1/api/wxcc-subscription/workspace-id/{workspaceId}") req.PathParam("workspaceId", workspaceId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -784,13 +763,6 @@ If not, this will return ALL the Persons within the organization and workspace. req := client.NewRequest(config.CcBaseURL, "GET", "/admin/v1/api/profile-view-template/workspace-id/{workspaceId}/template-name/{templateName}") req.PathParam("workspaceId", workspaceId) req.PathParam("templateName", templateName) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -860,13 +832,6 @@ If not, this will return ALL the Persons within the organization and workspace. req := client.NewRequest(config.CcBaseURL, "GET", "/admin/v1/api/journey-actions/workspace-id/{workspaceId}/template-id/{templateId}") req.PathParam("workspaceId", workspaceId) req.PathParam("templateId", templateId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -930,13 +895,6 @@ If not, this will return ALL the Persons within the organization and workspace. req.PathParam("workspaceId", workspaceId) req.PathParam("templateId", templateId) req.PathParam("actionName", actionName) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -966,13 +924,6 @@ If not, this will return ALL the Persons within the organization and workspace. req.PathParam("workspaceId", workspaceId) req.PathParam("templateId", templateId) req.PathParam("actionId", actionId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1071,13 +1022,6 @@ If not, this will return ALL the Persons within the organization and workspace. req.PathParam("workspaceId", workspaceId) req.PathParam("personId", personId) req.PathParam("templateName", templateName) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1143,13 +1087,6 @@ If not, this will return ALL the Persons within the organization and workspace. req.PathParam("workspaceId", workspaceId) req.PathParam("personId", personId) req.PathParam("templateId", templateId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1179,13 +1116,6 @@ If not, this will return ALL the Persons within the organization and workspace. req.PathParam("workspaceId", workspaceId) req.PathParam("identity", identity) req.PathParam("templateName", templateName) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1215,13 +1145,6 @@ If not, this will return ALL the Persons within the organization and workspace. req.PathParam("workspaceId", workspaceId) req.PathParam("identity", identity) req.PathParam("templateId", templateId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1251,13 +1174,6 @@ If not, this will return ALL the Persons within the organization and workspace. req.PathParam("workspaceId", workspaceId) req.PathParam("identity", identity) req.PathParam("templateName", templateName) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1287,13 +1203,6 @@ If not, this will return ALL the Persons within the organization and workspace. req.PathParam("workspaceId", workspaceId) req.PathParam("identity", identity) req.PathParam("templateId", templateId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1374,13 +1283,6 @@ If not, this will return ALL the Persons within the organization and workspace. req.PathParam("identity", identity) req.QueryParam("filter", filter) req.QueryParam("data", data) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/journey_profile_creation_insights.go b/cmd/cc/journey_profile_creation_insights.go index 134feb5..764e2ac 100644 --- a/cmd/cc/journey_profile_creation_insights.go +++ b/cmd/cc/journey_profile_creation_insights.go @@ -38,13 +38,6 @@ Role and Scope: Requires id full admin role with cjp:config_write or cjp:config_ req := client.NewRequest(config.CcBaseURL, "GET", "/admin/v1/api/profile-view-template/workspace-id/{workspaceId}/template-id/{templateId}") req.PathParam("workspaceId", workspaceId) req.PathParam("templateId", templateId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -214,13 +207,6 @@ Role and Scope: Requires id full admin role with cjp:config_write or cjp:config_ req := client.NewRequest(config.CcBaseURL, "GET", "/admin/v1/api/profile-view-template/workspace-id/{workspaceId}/template-name/{templateName}") req.PathParam("workspaceId", workspaceId) req.PathParam("templateName", templateName) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -250,13 +236,6 @@ Role and Scope: Requires id full admin role with cjds:admin_org_write or cjds:ad req.PathParam("workspaceId", workspaceId) req.PathParam("personId", personId) req.PathParam("templateName", templateName) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -288,13 +267,6 @@ Role and Scope: Requires id full admin role with cjds:admin_org_write or cjds:ad req.PathParam("workspaceId", workspaceId) req.PathParam("personId", personId) req.PathParam("templateId", templateId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -324,13 +296,6 @@ Role and Scope: Requires id full admin role with cjds:admin_org_write or cjds:ad req.PathParam("workspaceId", workspaceId) req.PathParam("identity", identity) req.PathParam("templateName", templateName) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -360,13 +325,6 @@ Role and Scope: Requires id full admin role with cjds:admin_org_write or cjds:ad req.PathParam("workspaceId", workspaceId) req.PathParam("identity", identity) req.PathParam("templateId", templateId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -398,13 +356,6 @@ Role and Scope: Requires id full admin role with cjds:admin_org_write or cjds:ad req.PathParam("workspaceId", workspaceId) req.PathParam("identity", identity) req.PathParam("templateName", templateName) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -436,13 +387,6 @@ Role and Scope: Requires id full admin role with cjds:admin_org_write or cjds:ad req.PathParam("workspaceId", workspaceId) req.PathParam("identity", identity) req.PathParam("templateId", templateId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -527,13 +471,6 @@ Role and Scope: Requires id full admin role with cjds:admin_org_write or cjds:ad req.PathParam("identity", identity) req.QueryParam("filter", filter) req.QueryParam("data", data) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/journey_subscription.go b/cmd/cc/journey_subscription.go index 7e9da69..1171038 100644 --- a/cmd/cc/journey_subscription.go +++ b/cmd/cc/journey_subscription.go @@ -34,13 +34,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CcBaseURL, "GET", "/admin/v1/api/wxcc-subscription/workspace-id/{workspaceId}") req.PathParam("workspaceId", workspaceId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/journey_trigger_actions.go b/cmd/cc/journey_trigger_actions.go index 9bce290..3b64ce3 100644 --- a/cmd/cc/journey_trigger_actions.go +++ b/cmd/cc/journey_trigger_actions.go @@ -82,13 +82,6 @@ Role and Scope: It requires id full admin or any role with cjp:config_read or cj req := client.NewRequest(config.CcBaseURL, "GET", "/admin/v1/api/journey-actions/workspace-id/{workspaceId}/template-id/{templateId}") req.PathParam("workspaceId", workspaceId) req.PathParam("templateId", templateId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -154,13 +147,6 @@ Role and Scope:It requires id full admin or any role with cjp:config_read or cjp req.PathParam("workspaceId", workspaceId) req.PathParam("templateId", templateId) req.PathParam("actionName", actionName) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -192,13 +178,6 @@ Role and Scope: It requires id full admin role with cjp:config_read or cjp:confi req.PathParam("workspaceId", workspaceId) req.PathParam("templateId", templateId) req.PathParam("actionId", actionId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/journey_workspace_management.go b/cmd/cc/journey_workspace_management.go index 1df2f8e..01e1237 100644 --- a/cmd/cc/journey_workspace_management.go +++ b/cmd/cc/journey_workspace_management.go @@ -34,13 +34,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CcBaseURL, "GET", "/admin/v1/api/workspace/workspace-id/{workspaceId}") req.PathParam("workspaceId", workspaceId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/multimedia_profile.go b/cmd/cc/multimedia_profile.go index 8b6d9f5..f775735 100644 --- a/cmd/cc/multimedia_profile.go +++ b/cmd/cc/multimedia_profile.go @@ -204,13 +204,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/multimedia-profile/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/outdial_ani.go b/cmd/cc/outdial_ani.go index 058f863..6c33d03 100644 --- a/cmd/cc/outdial_ani.go +++ b/cmd/cc/outdial_ani.go @@ -228,13 +228,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/outdial-ani/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -464,13 +457,6 @@ func init() { req.PathParam("orgid", orgid) req.PathParam("outDialAniId", outDialAniId) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/overrides.go b/cmd/cc/overrides.go index 1fbbe68..705ddf0 100644 --- a/cmd/cc/overrides.go +++ b/cmd/cc/overrides.go @@ -190,13 +190,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/overrides/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/queues.go b/cmd/cc/queues.go index 34ed55a..b9c9ead 100644 --- a/cmd/cc/queues.go +++ b/cmd/cc/queues.go @@ -64,13 +64,6 @@ If the header is not present in the request or if gzip is not listed as one of t req.QueryParam("queueIds", queueIds) req.QueryParam("orgId", orgid) req.Header("TrackingId", trackingId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/resource_collection.go b/cmd/cc/resource_collection.go index e722f94..6668f2c 100644 --- a/cmd/cc/resource_collection.go +++ b/cmd/cc/resource_collection.go @@ -135,13 +135,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/resource-collection/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/search_metadata.go b/cmd/cc/search_metadata.go index f2e2faf..44ac3e5 100644 --- a/cmd/cc/search_metadata.go +++ b/cmd/cc/search_metadata.go @@ -36,13 +36,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/search/v2/meta") req.Header("X-ORGANIZATION-ID", xOrganizationId) req.Header("TrackingId", trackingId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/site.go b/cmd/cc/site.go index 9c13d8e..a9f7a2a 100644 --- a/cmd/cc/site.go +++ b/cmd/cc/site.go @@ -229,13 +229,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/site/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/skill.go b/cmd/cc/skill.go index 5d1763e..1e67706 100644 --- a/cmd/cc/skill.go +++ b/cmd/cc/skill.go @@ -211,13 +211,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/skill/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/skill_profile.go b/cmd/cc/skill_profile.go index 189d366..8e82035 100644 --- a/cmd/cc/skill_profile.go +++ b/cmd/cc/skill_profile.go @@ -213,13 +213,6 @@ func init() { req.PathParam("orgid", orgid) req.PathParam("id", id) req.QueryParam("includeSkillDetails", includeSkillDetails) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/subscriptions.go b/cmd/cc/subscriptions.go index 85aa349..05e1c05 100644 --- a/cmd/cc/subscriptions.go +++ b/cmd/cc/subscriptions.go @@ -203,13 +203,6 @@ func init() { req.PathParam("id", id) req.QueryParam("orgId", orgid) req.Header("TrackingId", trackingId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -237,13 +230,6 @@ func init() { req.PathParam("id", id) req.QueryParam("orgId", orgid) req.Header("TrackingId", trackingId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/team.go b/cmd/cc/team.go index d118a88..0b11481 100644 --- a/cmd/cc/team.go +++ b/cmd/cc/team.go @@ -275,13 +275,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/team/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/templates.go b/cmd/cc/templates.go index 74430fa..e6d3138 100644 --- a/cmd/cc/templates.go +++ b/cmd/cc/templates.go @@ -61,13 +61,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CcBaseURL, "GET", "/templates/{id}") req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/usage_reports.go b/cmd/cc/usage_reports.go index 01c4912..b86f7a7 100644 --- a/cmd/cc/usage_reports.go +++ b/cmd/cc/usage_reports.go @@ -129,13 +129,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CcBaseURL, "GET", "/v1/usage-reports/{reportId}") req.PathParam("reportId", reportId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -179,13 +172,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CcBaseURL, "GET", "/v1/usage-reports/{fileId}/download") req.PathParam("fileId", fileId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/user_profiles.go b/cmd/cc/user_profiles.go index da72126..5ef1bbd 100644 --- a/cmd/cc/user_profiles.go +++ b/cmd/cc/user_profiles.go @@ -177,13 +177,6 @@ func init() { req.PathParam("orgid", orgid) req.PathParam("id", id) req.QueryParam("includeNames", includeNames) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -348,13 +341,6 @@ func init() { req.PathParam("orgid", orgid) req.PathParam("id", id) req.QueryParam("names", names) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/users.go b/cmd/cc/users.go index 94e0a30..3799a5d 100644 --- a/cmd/cc/users.go +++ b/cmd/cc/users.go @@ -176,13 +176,6 @@ func init() { req.QueryParam("includeUserProfile", includeUserProfile) req.QueryParam("includeNames", includeNames) req.QueryParam("includeSkillDetails", includeSkillDetails) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -329,13 +322,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/user/with-user-profile/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -376,13 +362,6 @@ func init() { req.QueryParam("includeSkillDetails", includeSkillDetails) req.QueryParam("checkIfUserHasDynamicSkill", checkIfUserHasDynamicSkill) req.QueryParam("dynamicSkillId", dynamicSkillId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/cc/work_types.go b/cmd/cc/work_types.go index f877137..6e7f3d9 100644 --- a/cmd/cc/work_types.go +++ b/cmd/cc/work_types.go @@ -186,13 +186,6 @@ func init() { req := client.NewRequest(config.CcBaseURL, "GET", "/organization/{orgid}/work-type/{id}") req.PathParam("orgid", orgid) req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(false) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/device/device_call.go b/cmd/device/device_call.go index ba57822..b72494e 100644 --- a/cmd/device/device_call.go +++ b/cmd/device/device_call.go @@ -40,13 +40,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/{deviceId}/members") req.PathParam("deviceId", deviceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -187,13 +180,6 @@ func init() { req.PathParam("deviceId", deviceId) req.QueryParam("orgId", orgId) req.QueryParam("deviceModel", deviceModel) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -257,13 +243,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/locations/{locationId}/devices/settings") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -288,13 +267,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/{deviceId}") req.PathParam("deviceId", deviceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -358,13 +330,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/devices") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -424,13 +389,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/devices") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -503,6 +461,7 @@ func init() { req.QueryParam("allowConfigureLayoutEnabled", allowConfigureLayoutEnabled) req.QueryParam("type", typeVal) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -531,13 +490,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/settings") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -590,6 +542,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/lineKeyTemplates") req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -618,13 +571,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/lineKeyTemplates/{templateId}") req.PathParam("templateId", templateId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -769,6 +715,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/applyLineKeyTemplate") req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -797,13 +744,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/applyLineKeyTemplate/{jobId}") req.PathParam("jobId", jobId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -828,13 +768,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/applyLineKeyTemplate/{jobId}/errors") req.PathParam("jobId", jobId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -857,13 +790,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/dects/supportedDevices") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -884,13 +810,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/dectNetworks/supportedDevices") req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1010,13 +929,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/callDeviceSettings/{jobId}") req.PathParam("jobId", jobId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1077,13 +989,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/{deviceId}/layout") req.PathParam("deviceId", deviceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1177,6 +1082,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/rebuildPhones") req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -1205,13 +1111,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/rebuildPhones/{jobId}") req.PathParam("jobId", jobId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1236,13 +1135,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/rebuildPhones/{jobId}/errors") req.PathParam("jobId", jobId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1267,13 +1159,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/devices/settings") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1337,13 +1222,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/workspaces/{workspaceId}/devices/settings") req.PathParam("workspaceId", workspaceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1406,6 +1284,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/backgroundImages") req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -1489,13 +1368,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/people/{personId}/devices/count") req.PathParam("personId", personId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1530,13 +1402,6 @@ func init() { req.QueryParam("locationId", locationId) req.QueryParam("extension", extension) req.QueryParam("usageType", usageType) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1578,13 +1443,6 @@ func init() { req.QueryParam("usageType", usageType) req.QueryParam("excludeVirtualLine", excludeVirtualLine) req.QueryParam("deviceLocationId", deviceLocationId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1617,6 +1475,7 @@ func init() { req.QueryParam("allowConfigureLayoutEnabled", allowConfigureLayoutEnabled) req.QueryParam("type", typeVal) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -1647,13 +1506,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/devices/dynamicSettings/validationSchema") req.QueryParam("orgId", orgId) req.QueryParam("familyOrModelDisplayName", familyOrModelDisplayName) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1679,13 +1531,6 @@ func init() { req.QueryParam("orgId", orgId) req.QueryParam("familyOrModelDisplayName", familyOrModelDisplayName) req.QueryParam("includeSettingsType", includeSettingsType) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1926,13 +1771,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/dynamicDeviceSettings/{jobId}") req.PathParam("jobId", jobId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1996,6 +1834,7 @@ func init() { req.QueryParam("allowConfigureLayoutEnabled", allowConfigureLayoutEnabled) req.QueryParam("type", typeVal) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -2028,13 +1867,6 @@ func init() { req.QueryParam("orgId", orgId) req.QueryParam("familyOrModelDisplayName", familyOrModelDisplayName) req.QueryParam("includeSettingsType", includeSettingsType) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -2275,13 +2107,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/telephony/config/jobs/devices/dynamicDeviceSettings/{jobId}") req.PathParam("jobId", jobId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/device/device_configurations.go b/cmd/device/device_configurations.go index bb9b521..28d9aa9 100644 --- a/cmd/device/device_configurations.go +++ b/cmd/device/device_configurations.go @@ -37,6 +37,7 @@ func init() { req.QueryParam("deviceId", deviceId) req.QueryParam("key", key) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/device/devices.go b/cmd/device/devices.go index bf06016..a30e8d4 100644 --- a/cmd/device/devices.go +++ b/cmd/device/devices.go @@ -172,13 +172,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/devices/{deviceId}") req.PathParam("deviceId", deviceId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/device/hot_desk.go b/cmd/device/hot_desk.go index b733a08..719be22 100644 --- a/cmd/device/hot_desk.go +++ b/cmd/device/hot_desk.go @@ -39,6 +39,7 @@ func init() { req.QueryParam("personId", personId) req.QueryParam("workspaceId", workspaceId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/device/locations.go b/cmd/device/locations.go index 528dc7a..8ea4868 100644 --- a/cmd/device/locations.go +++ b/cmd/device/locations.go @@ -43,6 +43,7 @@ func init() { req.QueryParam("orgId", orgId) req.QueryParam("max", max) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -105,13 +106,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/locations/{locationId}") req.PathParam("locationId", locationId) req.QueryParam("orgId", orgId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -194,6 +188,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/locations/{locationId}/floors") req.PathParam("locationId", locationId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -262,13 +257,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/locations/{locationId}/floors/{floorId}") req.PathParam("locationId", locationId) req.PathParam("floorId", floorId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/device/workspace_locations.go b/cmd/device/workspace_locations.go index 932e53c..2575e3b 100644 --- a/cmd/device/workspace_locations.go +++ b/cmd/device/workspace_locations.go @@ -45,6 +45,7 @@ func init() { req.QueryParam("countryCode", countryCode) req.QueryParam("cityName", cityName) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -125,13 +126,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaceLocations/{locationId}") req.PathParam("locationId", locationId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -232,6 +226,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaceLocations/{locationId}/floors") req.PathParam("locationId", locationId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -300,13 +295,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaceLocations/{locationId}/floors/{floorId}") req.PathParam("locationId", locationId) req.PathParam("floorId", floorId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/device/workspace_metrics.go b/cmd/device/workspace_metrics.go index 9de6c95..4c35381 100644 --- a/cmd/device/workspace_metrics.go +++ b/cmd/device/workspace_metrics.go @@ -56,13 +56,6 @@ func init() { req.QueryParam("to", to) req.QueryParam("unit", unit) req.QueryParam("sortBy", sortBy) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -106,13 +99,6 @@ func init() { req.QueryParam("measurement", measurement) req.QueryParam("from", from) req.QueryParam("to", to) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/device/workspace_personalization.go b/cmd/device/workspace_personalization.go index 989425d..d1396c7 100644 --- a/cmd/device/workspace_personalization.go +++ b/cmd/device/workspace_personalization.go @@ -70,13 +70,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaces/{workspaceId}/personalizationTask") req.PathParam("workspaceId", workspaceId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/device/workspaces.go b/cmd/device/workspaces.go index 3309ba5..a0a668d 100644 --- a/cmd/device/workspaces.go +++ b/cmd/device/workspaces.go @@ -147,13 +147,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaces/{workspaceId}") req.PathParam("workspaceId", workspaceId) req.QueryParam("includeDevices", includeDevices) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -229,13 +222,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/workspaces/{workspaceId}/capabilities") req.PathParam("workspaceId", workspaceId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -261,13 +247,6 @@ func init() { req.PathParam("workspaceId", workspaceId) req.QueryParam("includeDevices", includeDevices) req.QueryParam("includeCapabilities", includeCapabilities) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/device/xapi.go b/cmd/device/xapi.go index 86995bb..a5843eb 100644 --- a/cmd/device/xapi.go +++ b/cmd/device/xapi.go @@ -37,13 +37,6 @@ func init() { req.QueryParam("deviceId", deviceId) req.QueryParam("name", name) req.QueryParam("name", name) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -104,13 +97,6 @@ func init() { req.QueryParam("status", status) req.QueryParam("command", command) req.QueryParam("command", command) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/meetings/chats.go b/cmd/meetings/chats.go index fafbc33..3de1410 100644 --- a/cmd/meetings/chats.go +++ b/cmd/meetings/chats.go @@ -39,6 +39,7 @@ func init() { req.QueryParam("max", max) req.QueryParam("offset", offset) if config.Paginate() { + req.OffsetPaging("offset", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/meetings/closed_captions.go b/cmd/meetings/closed_captions.go index 6d1bde8..d39b0e6 100644 --- a/cmd/meetings/closed_captions.go +++ b/cmd/meetings/closed_captions.go @@ -35,6 +35,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/meetingClosedCaptions") req.QueryParam("meetingId", meetingId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -64,6 +65,7 @@ func init() { req.PathParam("closedCaptionId", closedCaptionId) req.QueryParam("meetingId", meetingId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -98,13 +100,6 @@ func init() { req.QueryParam("format", format) req.QueryParam("meetingId", meetingId) req.Header("timezone", timezone) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/meetings/invitees.go b/cmd/meetings/invitees.go index d411398..efee4e1 100644 --- a/cmd/meetings/invitees.go +++ b/cmd/meetings/invitees.go @@ -41,6 +41,7 @@ func init() { req.QueryParam("hostEmail", hostEmail) req.QueryParam("panelist", panelist) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -150,13 +151,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/meetingInvitees/{meetingInviteeId}") req.PathParam("meetingInviteeId", meetingInviteeId) req.QueryParam("hostEmail", hostEmail) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/meetings/meeting_polls.go b/cmd/meetings/meeting_polls.go index 74275a1..db2b501 100644 --- a/cmd/meetings/meeting_polls.go +++ b/cmd/meetings/meeting_polls.go @@ -35,6 +35,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/meetings/polls") req.QueryParam("meetingId", meetingId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -64,6 +65,7 @@ func init() { req.QueryParam("meetingId", meetingId) req.QueryParam("max", max) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -98,6 +100,7 @@ func init() { req.QueryParam("meetingId", meetingId) req.QueryParam("max", max) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/meetings/meeting_qa.go b/cmd/meetings/meeting_qa.go index 77c9378..eb35418 100644 --- a/cmd/meetings/meeting_qa.go +++ b/cmd/meetings/meeting_qa.go @@ -37,6 +37,7 @@ func init() { req.QueryParam("meetingId", meetingId) req.QueryParam("max", max) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -69,6 +70,7 @@ func init() { req.QueryParam("meetingId", meetingId) req.QueryParam("max", max) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/meetings/meeting_qualities.go b/cmd/meetings/meeting_qualities.go index 29b6095..517398f 100644 --- a/cmd/meetings/meeting_qualities.go +++ b/cmd/meetings/meeting_qualities.go @@ -39,6 +39,7 @@ func init() { req.QueryParam("max", max) req.QueryParam("offset", offset) if config.Paginate() { + req.OffsetPaging("offset", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/meetings/meeting_summary.go b/cmd/meetings/meeting_summary.go index c754abe..0945fd4 100644 --- a/cmd/meetings/meeting_summary.go +++ b/cmd/meetings/meeting_summary.go @@ -55,6 +55,7 @@ func init() { req.QueryParam("max", max) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -110,6 +111,7 @@ func init() { req.QueryParam("meetingTitle", meetingTitle) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/meetings/meetings.go b/cmd/meetings/meetings.go index e82b48c..2ea3bb0 100644 --- a/cmd/meetings/meetings.go +++ b/cmd/meetings/meetings.go @@ -44,13 +44,6 @@ func init() { req.PathParam("meetingId", meetingId) req.QueryParam("current", current) req.Header("timezone", timezone) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -81,6 +74,7 @@ func init() { req.QueryParam("current", current) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -195,6 +189,7 @@ func init() { req.Header("password", password) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -254,13 +249,6 @@ func init() { req.QueryParam("hostEmail", hostEmail) req.Header("password", password) req.Header("timezone", timezone) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -453,6 +441,7 @@ func init() { req.QueryParam("hostEmail", hostEmail) req.QueryParam("siteUrl", siteUrl) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -488,13 +477,6 @@ func init() { req.PathParam("templateId", templateId) req.QueryParam("hostEmail", hostEmail) req.Header("timezone", timezone) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -518,13 +500,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/meetings/controls") req.QueryParam("meetingId", meetingId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -589,6 +564,7 @@ func init() { req.QueryParam("hostEmail", hostEmail) req.QueryParam("siteUrl", siteUrl) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -620,13 +596,6 @@ func init() { req.PathParam("sessionTypeId", sessionTypeId) req.QueryParam("hostEmail", hostEmail) req.QueryParam("siteUrl", siteUrl) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -654,13 +623,6 @@ func init() { req.PathParam("meetingId", meetingId) req.QueryParam("current", current) req.QueryParam("hostEmail", hostEmail) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -791,6 +753,7 @@ func init() { req.QueryParam("registrationTimeFrom", registrationTimeFrom) req.QueryParam("registrationTimeTo", registrationTimeTo) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -868,13 +831,6 @@ func init() { req.PathParam("registrantId", registrantId) req.QueryParam("current", current) req.QueryParam("hostEmail", hostEmail) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1113,6 +1069,7 @@ func init() { req.PathParam("meetingId", meetingId) req.QueryParam("hostEmail", hostEmail) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -1145,13 +1102,6 @@ func init() { req.PathParam("meetingId", meetingId) req.PathParam("interpreterId", interpreterId) req.QueryParam("hostEmail", hostEmail) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1265,6 +1215,7 @@ func init() { req.PathParam("meetingId", meetingId) req.Header("hostEmail", hostEmail) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -1354,13 +1305,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/meetings/{meetingId}/survey") req.PathParam("meetingId", meetingId) req.Header("hostEmail", hostEmail) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1394,6 +1338,7 @@ func init() { req.Header("timezone", timezone) req.Header("hostEmail", hostEmail) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -1511,6 +1456,7 @@ func init() { req.Header("hostEmail", hostEmail) req.Header("personId", personId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -1545,6 +1491,7 @@ func init() { req.QueryParam("service", service) req.QueryParam("hostEmail", hostEmail) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -1810,6 +1757,7 @@ func init() { req.Header("timezone", timezone) req.Header("hostEmail", hostEmail) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/meetings/participants.go b/cmd/meetings/participants.go index 0a5d2e6..07c9003 100644 --- a/cmd/meetings/participants.go +++ b/cmd/meetings/participants.go @@ -53,6 +53,7 @@ func init() { req.QueryParam("joinTimeTo", joinTimeTo) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -142,13 +143,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/meetingParticipants/{participantId}") req.PathParam("participantId", participantId) req.QueryParam("hostEmail", hostEmail) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/meetings/people.go b/cmd/meetings/people.go index 33bc5be..0d343cd 100644 --- a/cmd/meetings/people.go +++ b/cmd/meetings/people.go @@ -53,6 +53,7 @@ func init() { req.QueryParam("max", max) req.QueryParam("excludeStatus", excludeStatus) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -123,13 +124,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/people/{personId}") req.PathParam("personId", personId) req.QueryParam("callingData", callingData) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -214,13 +208,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/people/me") req.QueryParam("callingData", callingData) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/meetings/preferences.go b/cmd/meetings/preferences.go index 4256a38..f6fc3c7 100644 --- a/cmd/meetings/preferences.go +++ b/cmd/meetings/preferences.go @@ -40,13 +40,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/meetingPreferences") req.QueryParam("userEmail", userEmail) req.QueryParam("siteUrl", siteUrl) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -70,13 +63,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/meetingPreferences/personalMeetingRoom") req.QueryParam("userEmail", userEmail) req.QueryParam("siteUrl", siteUrl) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -134,13 +120,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/meetingPreferences/audio") req.QueryParam("userEmail", userEmail) req.QueryParam("siteUrl", siteUrl) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -198,13 +177,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/meetingPreferences/video") req.QueryParam("userEmail", userEmail) req.QueryParam("siteUrl", siteUrl) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -262,13 +234,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/meetingPreferences/schedulingOptions") req.QueryParam("userEmail", userEmail) req.QueryParam("siteUrl", siteUrl) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -418,13 +383,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/meetingPreferences/sites") req.QueryParam("userEmail", userEmail) req.QueryParam("siteUrl", siteUrl) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/meetings/recording_report.go b/cmd/meetings/recording_report.go index 50d890b..64465aa 100644 --- a/cmd/meetings/recording_report.go +++ b/cmd/meetings/recording_report.go @@ -55,6 +55,7 @@ func init() { req.QueryParam("siteUrl", siteUrl) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -94,6 +95,7 @@ func init() { req.QueryParam("max", max) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -140,6 +142,7 @@ func init() { req.QueryParam("siteUrl", siteUrl) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -173,13 +176,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/recordingReport/meetingArchives/{archiveId}") req.PathParam("archiveId", archiveId) req.Header("timezone", timezone) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/meetings/recordings.go b/cmd/meetings/recordings.go index 9b8cff6..6377d8f 100644 --- a/cmd/meetings/recordings.go +++ b/cmd/meetings/recordings.go @@ -71,6 +71,7 @@ func init() { req.QueryParam("status", status) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -138,6 +139,7 @@ func init() { req.QueryParam("status", status) req.Header("timezone", timezone) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -202,13 +204,6 @@ func init() { req.QueryParam("hostEmail", hostEmail) req.Header("timezone", timezone) req.Header("siteUrl", siteUrl) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -467,6 +462,7 @@ func init() { req.Header("timezone", timezone) req.Header("hostEmail", hostEmail) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -509,13 +505,6 @@ func init() { req.QueryParam("personId", personId) req.Header("timezone", timezone) req.Header("hostEmail", hostEmail) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/meetings/session_types.go b/cmd/meetings/session_types.go index b32fa7b..0d49a0d 100644 --- a/cmd/meetings/session_types.go +++ b/cmd/meetings/session_types.go @@ -37,6 +37,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/admin/meeting/config/sessionTypes") req.QueryParam("siteUrl", siteUrl) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -68,6 +69,7 @@ func init() { req.QueryParam("personId", personId) req.Header("email", email) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/meetings/site.go b/cmd/meetings/site.go index a2df973..fdeb04d 100644 --- a/cmd/meetings/site.go +++ b/cmd/meetings/site.go @@ -34,13 +34,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/admin/meeting/config/commonSettings") req.QueryParam("siteUrl", siteUrl) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/meetings/slido.go b/cmd/meetings/slido.go index 9bace38..65a6cb3 100644 --- a/cmd/meetings/slido.go +++ b/cmd/meetings/slido.go @@ -53,6 +53,7 @@ Every resource has properties: req.QueryParam("sessionId", sessionId) req.QueryParam("start", start) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/meetings/slidosecurepremium.go b/cmd/meetings/slidosecurepremium.go index 8eba91a..4663358 100644 --- a/cmd/meetings/slidosecurepremium.go +++ b/cmd/meetings/slidosecurepremium.go @@ -53,6 +53,7 @@ Every resource has properties: req.QueryParam("sessionId", sessionId) req.QueryParam("start", start) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err diff --git a/cmd/meetings/summaries.go b/cmd/meetings/summaries.go index 20c52dd..b7109d4 100644 --- a/cmd/meetings/summaries.go +++ b/cmd/meetings/summaries.go @@ -34,13 +34,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/meetingSummaries") req.QueryParam("meetingId", meetingId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -61,13 +54,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/admin/meetingSummaries") req.QueryParam("meetingId", meetingId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/meetings/tracking_codes.go b/cmd/meetings/tracking_codes.go index 437e223..aafa1a4 100644 --- a/cmd/meetings/tracking_codes.go +++ b/cmd/meetings/tracking_codes.go @@ -35,6 +35,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/admin/meeting/config/trackingCodes") req.QueryParam("siteUrl", siteUrl) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -91,13 +92,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/admin/meeting/config/trackingCodes/{trackingCodeId}") req.PathParam("trackingCodeId", trackingCodeId) req.QueryParam("siteUrl", siteUrl) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -180,13 +174,6 @@ func init() { req.QueryParam("siteUrl", siteUrl) req.QueryParam("personId", personId) req.Header("email", email) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/meetings/transcripts.go b/cmd/meetings/transcripts.go index 75b2389..ac0360a 100644 --- a/cmd/meetings/transcripts.go +++ b/cmd/meetings/transcripts.go @@ -55,6 +55,7 @@ func init() { req.QueryParam("hostEmail", hostEmail) req.QueryParam("siteUrl", siteUrl) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -102,6 +103,7 @@ func init() { req.QueryParam("max", max) req.QueryParam("siteUrl", siteUrl) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -136,13 +138,6 @@ func init() { req.PathParam("transcriptId", transcriptId) req.QueryParam("format", format) req.QueryParam("hostEmail", hostEmail) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -169,6 +164,7 @@ func init() { req.PathParam("transcriptId", transcriptId) req.QueryParam("max", max) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -199,13 +195,6 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/meetingTranscripts/{transcriptId}/snippets/{snippetId}") req.PathParam("transcriptId", transcriptId) req.PathParam("snippetId", snippetId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/meetings/video_mesh.go b/cmd/meetings/video_mesh.go index 94602c5..1cf4f77 100644 --- a/cmd/meetings/video_mesh.go +++ b/cmd/meetings/video_mesh.go @@ -51,6 +51,7 @@ func init() { req.QueryParam("to", to) req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -92,13 +93,6 @@ func init() { req.PathParam("clusterId", clusterId) req.QueryParam("from", from) req.QueryParam("to", to) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -136,6 +130,7 @@ func init() { req.QueryParam("to", to) req.QueryParam("clusterId", clusterId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -177,13 +172,6 @@ func init() { req.PathParam("nodeId", nodeId) req.QueryParam("from", from) req.QueryParam("to", to) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -231,6 +219,7 @@ On-demand test results can be obtained along with the periodic tests that are ex req.QueryParam("from", from) req.QueryParam("to", to) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -283,13 +272,6 @@ On-demand test results can be obtained along with the periodic tests that are ex req.QueryParam("triggerType", triggerType) req.QueryParam("from", from) req.QueryParam("to", to) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -336,13 +318,6 @@ On-demand test results can be obtained along with the periodic tests that are ex req.QueryParam("triggerType", triggerType) req.QueryParam("from", from) req.QueryParam("to", to) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -380,6 +355,7 @@ On-demand test results can be obtained along with the periodic tests that are ex req.QueryParam("to", to) req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -422,6 +398,7 @@ On-demand test results can be obtained along with the periodic tests that are ex req.QueryParam("to", to) req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -463,13 +440,6 @@ On-demand test results can be obtained along with the periodic tests that are ex req.QueryParam("from", from) req.QueryParam("to", to) req.QueryParam("clusterId", clusterId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -506,6 +476,7 @@ On-demand test results can be obtained along with the periodic tests that are ex req.QueryParam("to", to) req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -547,13 +518,6 @@ On-demand test results can be obtained along with the periodic tests that are ex req.QueryParam("from", from) req.QueryParam("to", to) req.QueryParam("clusterId", clusterId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -604,6 +568,7 @@ Changes in V2: req.QueryParam("from", from) req.QueryParam("to", to) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -660,13 +625,6 @@ Changes in V2: req.QueryParam("triggerType", triggerType) req.QueryParam("from", from) req.QueryParam("to", to) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -717,13 +675,6 @@ Changes in V2: req.QueryParam("triggerType", triggerType) req.QueryParam("from", from) req.QueryParam("to", to) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -749,6 +700,7 @@ Changes in V2: req := client.NewRequest(config.CallingBaseURL, "GET", "/videoMesh/clusters") req.QueryParam("orgId", orgId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -775,13 +727,6 @@ Changes in V2: RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/videoMesh/clusters/{clusterId}") req.PathParam("clusterId", clusterId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -879,13 +824,6 @@ The test is run on a maximum of 10 nodes present in the cluster, chosen at rando RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/videoMesh/testStatus") req.QueryParam("commandId", commandId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -907,13 +845,6 @@ The test is run on a maximum of 10 nodes present in the cluster, chosen at rando RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/videoMesh/testResults") req.QueryParam("commandId", commandId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -954,6 +885,7 @@ The test is run on a maximum of 10 nodes present in the cluster, chosen at rando req.QueryParam("from", from) req.QueryParam("to", to) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -1003,13 +935,6 @@ The test is run on a maximum of 10 nodes present in the cluster, chosen at rando req.QueryParam("triggerType", triggerType) req.QueryParam("from", from) req.QueryParam("to", to) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1053,13 +978,6 @@ The test is run on a maximum of 10 nodes present in the cluster, chosen at rando req.QueryParam("triggerType", triggerType) req.QueryParam("from", from) req.QueryParam("to", to) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1099,6 +1017,7 @@ The test is run on a maximum of 10 nodes present in the cluster, chosen at rando req.QueryParam("to", to) req.QueryParam("deviceType", deviceType) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -1143,13 +1062,6 @@ The test is run on a maximum of 10 nodes present in the cluster, chosen at rando req.QueryParam("from", from) req.QueryParam("to", to) req.QueryParam("deviceType", deviceType) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err @@ -1181,6 +1093,7 @@ The test is run on a maximum of 10 nodes present in the cluster, chosen at rando req.QueryParam("orgId", orgId) req.QueryParam("eventScope", eventScope) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -1238,13 +1151,6 @@ The test is run on a maximum of 10 nodes present in the cluster, chosen at rando RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/videoMesh/eventThresholds/{eventThresholdId}") req.PathParam("eventThresholdId", eventThresholdId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/meetings/webhooks.go b/cmd/meetings/webhooks.go index 996263b..5ad90e0 100644 --- a/cmd/meetings/webhooks.go +++ b/cmd/meetings/webhooks.go @@ -37,6 +37,7 @@ func init() { req.QueryParam("max", max) req.QueryParam("ownedBy", ownedBy) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -116,13 +117,6 @@ To learn more about how to create and use webhooks, see The [Webhooks Guide](/do RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/webhooks/{webhookId}") req.PathParam("webhookId", webhookId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/messaging/attachment_actions.go b/cmd/messaging/attachment_actions.go index 234c228..90b868c 100644 --- a/cmd/messaging/attachment_actions.go +++ b/cmd/messaging/attachment_actions.go @@ -62,13 +62,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/attachment/actions/{id}") req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/messaging/ecm_folder_linking.go b/cmd/messaging/ecm_folder_linking.go index 47c02d8..d86809c 100644 --- a/cmd/messaging/ecm_folder_linking.go +++ b/cmd/messaging/ecm_folder_linking.go @@ -35,6 +35,7 @@ func init() { req := client.NewRequest(config.CallingBaseURL, "GET", "/room/linkedFolders") req.QueryParam("roomId", roomId) if config.Paginate() { + req.OffsetPaging("", "", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -108,13 +109,6 @@ func init() { RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/room/linkedFolders/{id}") req.PathParam("id", id) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/messaging/events.go b/cmd/messaging/events.go index b9a5300..bc47bb2 100644 --- a/cmd/messaging/events.go +++ b/cmd/messaging/events.go @@ -59,6 +59,7 @@ Long result sets will be split into [pages](/docs/basics#pagination).`, req.QueryParam("max", max) req.QueryParam("serviceType", serviceType) if config.Paginate() { + req.OffsetPaging("", "max", 0) resp, statusCode, err := req.DoPaginated(true) if err != nil { return err @@ -92,13 +93,6 @@ Long result sets will be split into [pages](/docs/basics#pagination).`, RunE: func(cmd *cobra.Command, args []string) error { req := client.NewRequest(config.CallingBaseURL, "GET", "/events/{eventId}") req.PathParam("eventId", eventId) - if config.Paginate() { - resp, statusCode, err := req.DoPaginated(true) - if err != nil { - return err - } - return output.Print(resp, statusCode) - } resp, statusCode, err := req.Do() if err != nil { return err diff --git a/cmd/messaging/hds.go b/cmd/messaging/hds.go index c8fa3e4..b32cddf 100644 --- a/cmd/messaging/hds.go +++ b/cmd/messaging/hds.go @@ -41,13 +41,6 @@ To obtain the Node ID needed for this API, use the [Get cluster details API](= maxRetry { - return body, status, fmt.Errorf("rate limited (429): retry limit reached after %d attempts — try again after %s", retries, wait.Round(time.Second)) + return body, status, headers, fmt.Errorf("rate limited (429): retry limit reached after %d attempts — try again after %s", retries, wait.Round(time.Second)) } if maxTimer > 0 && cumulativeWait+wait > maxTimer { - return body, status, fmt.Errorf("rate limited (429): retry wait of %s would exceed max-retry-timer of %s — try again after %s", (cumulativeWait + wait).Round(time.Second), maxTimer.Round(time.Second), wait.Round(time.Second)) + return body, status, headers, fmt.Errorf("rate limited (429): retry wait of %s would exceed max-retry-timer of %s — try again after %s", (cumulativeWait + wait).Round(time.Second), maxTimer.Round(time.Second), wait.Round(time.Second)) } fmt.Fprintf(os.Stderr, "Rate limited (429). Retrying in %s (attempt %d/%d)...\n", wait.Round(time.Second), retries+1, maxRetry) @@ -62,10 +68,10 @@ func Do(req *Request) ([]byte, int, error) { } if status == 451 { - return body, status, wrongRegionError(body) + return body, status, headers, wrongRegionError(body) } - return body, status, err + return body, status, headers, err } // endpointURLPattern finds the regional endpoint Webex returns in a 451 body. @@ -120,7 +126,9 @@ func doOnce(req *Request) ([]byte, int, http.Header, error) { } // Add query params - if len(req.queryParams) > 0 { + if req.rawURL != "" { + url = req.rawURL + } else if len(req.queryParams) > 0 { params := urlpkg.Values{} for k, v := range req.queryParams { if v != "" { diff --git a/internal/client/pagination.go b/internal/client/pagination.go index dd5b327..7ee53c8 100644 --- a/internal/client/pagination.go +++ b/internal/client/pagination.go @@ -1,9 +1,14 @@ package client import ( + "bytes" "encoding/json" "fmt" + "net/http" + urlpkg "net/url" + "sort" "strconv" + "strings" "github.com/Cloverhound/webex-cli/internal/config" ) @@ -11,9 +16,19 @@ import ( // PaginateCalling auto-paginates a Calling API list endpoint. // Calling uses startIndex/itemsPerPage with items array. func PaginateCalling(baseURL, method, path string, pathParams, queryParams, headers map[string]string) ([]json.RawMessage, error) { + return paginateOffset(baseURL, method, path, "start", "max", 0, pathParams, queryParams, headers) +} + +// paginateOffset pages a non-CC list endpoint. A Link rel="next" header is +// followed whenever present, since most core Webex APIs page only that way and +// ignore offsets. Without one, it advances startParam by the items received, +// or stops when startParam is empty. +func paginateOffset(baseURL, method, path, startParam, sizeParam string, firstIndex int, pathParams, queryParams, headers map[string]string) ([]json.RawMessage, error) { var allItems []json.RawMessage - start := 0 - max := 100 + var prevFirst json.RawMessage + start := firstIndex + pageSize := 100 + next := "" for { r := NewRequest(baseURL, method, path) @@ -26,44 +41,119 @@ func PaginateCalling(baseURL, method, path string, pathParams, queryParams, head for k, v := range headers { r.Header(k, v) } - r.QueryParam("start", strconv.Itoa(start)) - r.QueryParam("max", strconv.Itoa(max)) + if next != "" { + r.rawURL = next + } else { + if startParam != "" { + r.QueryParam(startParam, strconv.Itoa(start)) + } + if sizeParam != "" { + r.QueryParam(sizeParam, strconv.Itoa(pageSize)) + } + } - body, _, err := r.Do() + r.Finalize() + body, _, respHeaders, err := doWithHeaders(r) if err != nil { return allItems, err } - var result map[string]json.RawMessage - if err := json.Unmarshal(body, &result); err != nil { - return allItems, fmt.Errorf("parsing page: %w", err) - } - - // Find the items array (first array field) - found := false - for _, v := range result { - var items []json.RawMessage - if err := json.Unmarshal(v, &items); err == nil && len(items) > 0 { - allItems = append(allItems, items...) - found = true - if len(items) < max { - return allItems, nil - } - break - } + items, total, err := listItems(body) + if err != nil { + return allItems, err } + if len(items) == 0 { + return allItems, nil + } + // An endpoint that ignores the offset returns the same page again. + if prevFirst != nil && bytes.Equal(items[0], prevFirst) { + return allItems, nil + } + prevFirst = items[0] + allItems = append(allItems, items...) - if !found { + if link := nextLink(respHeaders, baseURL); link != "" { + next = link + continue + } + if next != "" || startParam == "" { + return allItems, nil + } + start += len(items) + if len(items) < pageSize || (total > 0 && len(allItems) >= total) { return allItems, nil } + } +} - start += max +// listItems extracts a page's items: a bare array, or the "items" (Webex) or +// "Resources" (SCIM) array, or else the first array field by name. total is +// SCIM's totalResults when present. +func listItems(body []byte) ([]json.RawMessage, int, error) { + var bare []json.RawMessage + if err := json.Unmarshal(body, &bare); err == nil { + return bare, 0, nil } + var result map[string]json.RawMessage + if err := json.Unmarshal(body, &result); err != nil { + return nil, 0, fmt.Errorf("parsing page: %w", err) + } + var total int + if raw, ok := result["totalResults"]; ok { + json.Unmarshal(raw, &total) + } + + keys := make([]string, 0, len(result)) + for k := range result { + keys = append(keys, k) + } + sort.Strings(keys) + keys = append([]string{"items", "Resources"}, keys...) + for _, k := range keys { + var items []json.RawMessage + if v, ok := result[k]; ok && json.Unmarshal(v, &items) == nil && len(items) > 0 { + return items, total, nil + } + } + return nil, total, nil +} + +// nextLink returns the rel="next" URL from a Link header, but only when it +// points at the same host as baseURL, so the bearer token is never sent elsewhere. +func nextLink(h http.Header, baseURL string) string { + base, err := urlpkg.Parse(baseURL) + if err != nil { + return "" + } + for _, value := range h.Values("Link") { + for _, part := range strings.Split(value, ",") { + target, params, ok := strings.Cut(part, ";") + if !ok || !strings.Contains(strings.ReplaceAll(params, " ", ""), `rel="next"`) { + continue + } + target = strings.Trim(strings.TrimSpace(target), "<>") + u, err := urlpkg.Parse(target) + if err != nil || u.Scheme != base.Scheme || u.Host != base.Host { + return "" + } + return target + } + } + return "" } // PaginateCC auto-paginates a Contact Center API list endpoint. // CC uses page/pageSize with meta.totalPages. func PaginateCC(baseURL, method, path string, pathParams, queryParams, headers map[string]string) ([]json.RawMessage, error) { + items, _, err := paginateCC(baseURL, method, path, "pageSize", pathParams, queryParams, headers) + return items, err +} + +// paginateCC pages with page and sizeParam. Most CC endpoints wrap items in +// {data, meta}; the flow store and functions use {data, pageInfo}, and the +// flow store returns a bare array unless includePagination=true. A first +// response that is neither is returned as single, to be printed unchanged. +func paginateCC(baseURL, method, path, sizeParam string, pathParams, queryParams, headers map[string]string) (items []json.RawMessage, single []byte, err error) { var allItems []json.RawMessage page := 0 pageSize := 100 @@ -80,38 +170,49 @@ func PaginateCC(baseURL, method, path string, pathParams, queryParams, headers m r.Header(k, v) } r.QueryParam("page", strconv.Itoa(page)) - r.QueryParam("pageSize", strconv.Itoa(pageSize)) + r.QueryParam(sizeParam, strconv.Itoa(pageSize)) body, _, err := r.Do() if err != nil { - return allItems, err + return allItems, nil, err + } + + // A bare array carries no page metadata, so it is the only page. + var bare []json.RawMessage + if err := json.Unmarshal(body, &bare); err == nil { + return append(allItems, bare...), nil, nil } var result map[string]json.RawMessage if err := json.Unmarshal(body, &result); err != nil { - return allItems, fmt.Errorf("parsing page: %w", err) + return allItems, nil, fmt.Errorf("parsing page: %w", err) } - // Find data array - if data, ok := result["data"]; ok { - var items []json.RawMessage - if err := json.Unmarshal(data, &items); err == nil { - allItems = append(allItems, items...) + var items []json.RawMessage + data, hasData := result["data"] + if hasData && json.Unmarshal(data, &items) != nil { + hasData = false + } + if !hasData { + if page == 0 { + return nil, body, nil } + return allItems, nil, nil } + allItems = append(allItems, items...) - // Check meta for total pages - if metaRaw, ok := result["meta"]; ok { - var meta struct { - TotalPages int `json:"totalPages"` - } - if err := json.Unmarshal(metaRaw, &meta); err == nil { - if page+1 >= meta.TotalPages { - return allItems, nil - } - } - } else { - return allItems, nil + metaRaw, ok := result["meta"] + if !ok { + metaRaw, ok = result["pageInfo"] + } + if !ok || len(items) == 0 { + return allItems, nil, nil + } + var meta struct { + TotalPages int `json:"totalPages"` + } + if err := json.Unmarshal(metaRaw, &meta); err != nil || page+1 >= meta.TotalPages { + return allItems, nil, nil } page++ diff --git a/internal/client/pagination_test.go b/internal/client/pagination_test.go new file mode 100644 index 0000000..c38b33b --- /dev/null +++ b/internal/client/pagination_test.go @@ -0,0 +1,319 @@ +package client + +import ( + "encoding/json" + "fmt" + "net/http" + "net/http/httptest" + "strconv" + "testing" +) + +func names(t *testing.T, body []byte) []string { + t.Helper() + var items []struct { + Name string `json:"name"` + } + if err := json.Unmarshal(body, &items); err != nil { + t.Fatalf("decoding merged items: %v (%s)", err, body) + } + out := make([]string, len(items)) + for i, it := range items { + out[i] = it.Name + } + return out +} + +// flowStore mimics /flows: it pages with page/size (default size 10), ignores +// pageSize, and only returns pageInfo when includePagination=true. +func flowStore(total int, pages *[]string) *httptest.Server { + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + q := r.URL.Query() + *pages = append(*pages, q.Get("page")) + page, _ := strconv.Atoi(q.Get("page")) + size := 10 + if s := q.Get("size"); s != "" { + size, _ = strconv.Atoi(s) + } + var data []map[string]string + for i := page * size; i < (page+1)*size && i < total; i++ { + data = append(data, map[string]string{"name": fmt.Sprintf("f%d", i)}) + } + if q.Get("includePagination") != "true" { + json.NewEncoder(w).Encode(data) + return + } + json.NewEncoder(w).Encode(map[string]any{ + "data": data, + "pageInfo": map[string]int{ + "currentPage": page, + "pageSize": size, + "totalRecords": total, + "totalPages": (total + size - 1) / size, + }, + }) + })) +} + +func TestDoPaginatedFollowsPageInfoWithSizeParam(t *testing.T) { + var pages []string + srv := flowStore(11, &pages) + defer srv.Close() + + req := NewRequest(srv.URL, "GET", "/flows") + req.QueryParam("size", "3") + req.QueryParam("includePagination", "true") + req.PageSizeParam("size") + body, _, err := req.DoPaginated(false) + if err != nil { + t.Fatalf("DoPaginated: %v", err) + } + if got := names(t, body); len(got) != 11 { + t.Fatalf("got %d items %v, want 11", len(got), got) + } + if len(pages) != 1 { + t.Fatalf("requested pages %v, want one page of 100", pages) + } +} + +func TestDoPaginatedFollowsPageInfoAcrossPages(t *testing.T) { + var pages []string + srv := flowStore(250, &pages) + defer srv.Close() + + req := NewRequest(srv.URL, "GET", "/flows") + req.QueryParam("includePagination", "true") + req.PageSizeParam("size") + body, _, err := req.DoPaginated(false) + if err != nil { + t.Fatalf("DoPaginated: %v", err) + } + if got := names(t, body); len(got) != 250 || got[249] != "f249" { + t.Fatalf("got %d items, want 250 ending in f249", len(got)) + } + if fmt.Sprint(pages) != "[0 1 2]" { + t.Fatalf("requested pages %v, want [0 1 2]", pages) + } +} + +func TestDoPaginatedAcceptsPlainArray(t *testing.T) { + var pages []string + srv := flowStore(11, &pages) + defer srv.Close() + + req := NewRequest(srv.URL, "GET", "/flows") + req.PageSizeParam("size") + body, _, err := req.DoPaginated(false) + if err != nil { + t.Fatalf("DoPaginated: %v", err) + } + if got := names(t, body); len(got) != 11 { + t.Fatalf("got %d items %v, want 11", len(got), got) + } +} + +func TestDoPaginatedLeavesNonListResponseAlone(t *testing.T) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte(`{"id":"s1","name":"Language_EN-US"}`)) + })) + defer srv.Close() + + body, _, err := NewRequest(srv.URL, "GET", "/skill/s1").DoPaginated(false) + if err != nil { + t.Fatalf("DoPaginated: %v", err) + } + if string(body) != `{"id":"s1","name":"Language_EN-US"}` { + t.Fatalf("got %s, want the object unchanged", body) + } +} + +// rooms mimics a core Webex list: it pages only through a Link header and +// ignores start. +func rooms(total int, hits *int) *httptest.Server { + var srv *httptest.Server + srv = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + *hits++ + q := r.URL.Query() + max, _ := strconv.Atoi(q.Get("max")) + from, _ := strconv.Atoi(q.Get("cursor")) + var items []map[string]string + for i := from; i < from+max && i < total; i++ { + items = append(items, map[string]string{"name": fmt.Sprintf("r%d", i)}) + } + if from+max < total { + w.Header().Set("Link", fmt.Sprintf(`<%s/rooms?max=%d&cursor=%d>; rel="next"`, srv.URL, max, from+max)) + } + json.NewEncoder(w).Encode(map[string]any{"items": items}) + })) + return srv +} + +func TestDoPaginatedFollowsLinkHeader(t *testing.T) { + var hits int + srv := rooms(250, &hits) + defer srv.Close() + + req := NewRequest(srv.URL, "GET", "/rooms") + req.OffsetPaging("", "max", 0) + body, _, err := req.DoPaginated(true) + if err != nil { + t.Fatalf("DoPaginated: %v", err) + } + if got := names(t, body); len(got) != 250 || got[249] != "r249" { + t.Fatalf("got %d items, want 250 ending in r249", len(got)) + } + if hits != 3 { + t.Fatalf("server hits = %d, want 3", hits) + } +} + +func TestDoPaginatedIgnoresLinkToAnotherHost(t *testing.T) { + var hits int + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + hits++ + w.Header().Set("Link", `; rel="next"`) + json.NewEncoder(w).Encode(map[string]any{"items": []map[string]string{{"name": "r0"}}}) + })) + defer srv.Close() + + req := NewRequest(srv.URL, "GET", "/rooms") + req.OffsetPaging("", "max", 0) + if _, _, err := req.DoPaginated(true); err != nil { + t.Fatalf("DoPaginated: %v", err) + } + if hits != 1 { + t.Fatalf("server hits = %d, want 1", hits) + } +} + +func TestDoPaginatedStopsWithoutLinkWhenNoOffsetParam(t *testing.T) { + var hits int + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + hits++ + if r.URL.Query().Has("start") { + t.Errorf("query %q sent start to an endpoint without it", r.URL.RawQuery) + } + items := make([]map[string]string, 100) + for i := range items { + items[i] = map[string]string{"name": fmt.Sprintf("p%d", i)} + } + json.NewEncoder(w).Encode(map[string]any{"items": items}) + })) + defer srv.Close() + + req := NewRequest(srv.URL, "GET", "/people") + req.OffsetPaging("", "max", 0) + body, _, err := req.DoPaginated(true) + if err != nil { + t.Fatalf("DoPaginated: %v", err) + } + if got := names(t, body); len(got) != 100 || hits != 1 { + t.Fatalf("got %d items in %d requests, want 100 in 1", len(got), hits) + } +} + +func TestDoPaginatedStopsWhenOffsetIsIgnored(t *testing.T) { + var hits int + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + hits++ + items := make([]map[string]string, 100) + for i := range items { + items[i] = map[string]string{"name": fmt.Sprintf("p%d", i)} + } + json.NewEncoder(w).Encode(map[string]any{"items": items}) + })) + defer srv.Close() + + body, _, err := NewRequest(srv.URL, "GET", "/people").DoPaginated(true) + if err != nil { + t.Fatalf("DoPaginated: %v", err) + } + if got := names(t, body); len(got) != 100 || hits != 2 { + t.Fatalf("got %d items in %d requests, want 100 in 2", len(got), hits) + } +} + +func TestDoPaginatedPagesByStartAndMax(t *testing.T) { + var starts []string + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + q := r.URL.Query() + starts = append(starts, q.Get("start")) + start, _ := strconv.Atoi(q.Get("start")) + max, _ := strconv.Atoi(q.Get("max")) + var items []map[string]string + for i := start; i < start+max && i < 150; i++ { + items = append(items, map[string]string{"name": fmt.Sprintf("n%d", i)}) + } + json.NewEncoder(w).Encode(map[string]any{"numbers": items}) + })) + defer srv.Close() + + body, _, err := NewRequest(srv.URL, "GET", "/telephony/config/numbers").DoPaginated(true) + if err != nil { + t.Fatalf("DoPaginated: %v", err) + } + if got := names(t, body); len(got) != 150 || got[149] != "n149" { + t.Fatalf("got %d items, want 150 ending in n149", len(got)) + } + if fmt.Sprint(starts) != "[0 100]" { + t.Fatalf("starts %v, want [0 100]", starts) + } +} + +func TestDoPaginatedPagesSCIM(t *testing.T) { + var starts []string + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + q := r.URL.Query() + starts = append(starts, q.Get("startIndex")) + start, _ := strconv.Atoi(q.Get("startIndex")) + count, _ := strconv.Atoi(q.Get("count")) + var items []map[string]string + for i := start; i < start+count && i <= 120; i++ { + items = append(items, map[string]string{"name": fmt.Sprintf("u%d", i)}) + } + json.NewEncoder(w).Encode(map[string]any{ + "schemas": []string{"urn:ietf:params:scim:api:messages:2.0:ListResponse"}, + "totalResults": 120, "startIndex": start, "itemsPerPage": len(items), + "Resources": items, + }) + })) + defer srv.Close() + + req := NewRequest(srv.URL, "GET", "/Users") + req.OffsetPaging("startIndex", "count", 1) + body, _, err := req.DoPaginated(true) + if err != nil { + t.Fatalf("DoPaginated: %v", err) + } + if got := names(t, body); len(got) != 120 || got[0] != "u1" || got[119] != "u120" { + t.Fatalf("got %d items, want u1..u120", len(got)) + } + if fmt.Sprint(starts) != "[1 101]" { + t.Fatalf("startIndex %v, want [1 101]", starts) + } +} + +func TestDoPaginatedFollowsMetaWithPageSize(t *testing.T) { + var pages []string + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + q := r.URL.Query() + pages = append(pages, q.Get("page")) + if q.Get("pageSize") != "100" || q.Has("size") { + t.Errorf("query %q, want pageSize=100 and no size", r.URL.RawQuery) + } + page, _ := strconv.Atoi(q.Get("page")) + json.NewEncoder(w).Encode(map[string]any{ + "data": []map[string]string{{"name": fmt.Sprintf("s%d", page)}}, + "meta": map[string]int{"page": page, "totalPages": 2}, + }) + })) + defer srv.Close() + + body, _, err := NewRequest(srv.URL, "GET", "/skill").DoPaginated(false) + if err != nil { + t.Fatalf("DoPaginated: %v", err) + } + if got := fmt.Sprint(names(t, body)); got != "[s0 s1]" { + t.Fatalf("got %s, want [s0 s1]", got) + } +} diff --git a/internal/client/request.go b/internal/client/request.go index b92f905..f870496 100644 --- a/internal/client/request.go +++ b/internal/client/request.go @@ -16,6 +16,15 @@ type Request struct { headers map[string]string bodyJSON map[string]any bodyRaw string + // pageSizeParam is the query parameter Contact Center auto-pagination + // sets the page size with; empty means "pageSize". + pageSizeParam string + // offset paging for every other area; see OffsetPaging. + offsetSet bool + offsetStart, offsetSize string + offsetFirst int + // rawURL, when set, is sent verbatim in place of path and query params. + rawURL string } // NewRequest creates a new request with the given method and path. @@ -49,6 +58,21 @@ func (r *Request) Header(key, value string) { } } +// PageSizeParam names the page-size query parameter for Contact Center +// endpoints that do not use "pageSize" (the flow store and functions use "size"). +func (r *Request) PageSizeParam(name string) { + r.pageSizeParam = name +} + +// OffsetPaging names the offset and page-size query parameters for non-CC +// auto-pagination, which otherwise uses start/max. An empty startParam means +// the endpoint pages only through Link headers; firstIndex is the offset of +// the first item (1 for SCIM). +func (r *Request) OffsetPaging(startParam, sizeParam string, firstIndex int) { + r.offsetSet = true + r.offsetStart, r.offsetSize, r.offsetFirst = startParam, sizeParam, firstIndex +} + func (r *Request) BodyString(key, value string) { if value != "" { r.bodyJSON[key] = value @@ -114,17 +138,28 @@ func (r *Request) Do() ([]byte, int, error) { // isCalling selects the pagination strategy (Calling: start/max, CC: page/pageSize). func (r *Request) DoPaginated(isCalling bool) ([]byte, int, error) { if isCalling { - items, err := PaginateCalling(r.baseURL, r.method, r.path, r.pathParams, r.queryParams, r.headers) + start, size, first := "start", "max", 0 + if r.offsetSet { + start, size, first = r.offsetStart, r.offsetSize, r.offsetFirst + } + items, err := paginateOffset(r.baseURL, r.method, r.path, start, size, first, r.pathParams, r.queryParams, r.headers) if err != nil { return nil, 0, err } data, err := json.Marshal(items) return data, 200, err } - items, err := PaginateCC(r.baseURL, r.method, r.path, r.pathParams, r.queryParams, r.headers) + sizeParam := r.pageSizeParam + if sizeParam == "" { + sizeParam = "pageSize" + } + items, single, err := paginateCC(r.baseURL, r.method, r.path, sizeParam, r.pathParams, r.queryParams, r.headers) if err != nil { return nil, 0, err } + if single != nil { + return single, 200, nil + } data, err := json.Marshal(items) return data, 200, err } diff --git a/site/src/content/docs/cc.mdx b/site/src/content/docs/cc.mdx index b0556d4..c8b49a9 100644 --- a/site/src/content/docs/cc.mdx +++ b/site/src/content/docs/cc.mdx @@ -111,6 +111,8 @@ Auto-paginate to get all results: webex cc entry-point list --paginate ``` +`--paginate` requests 100 items per page and overrides `--page-size` or `--size`. Commands that return a single object ignore it. `cc tasks get` returns only the first page because the API does not report a page count. + Manual pagination: ```bash diff --git a/site/src/content/docs/getting-started.mdx b/site/src/content/docs/getting-started.mdx index 2d0af61..3b73777 100644 --- a/site/src/content/docs/getting-started.mdx +++ b/site/src/content/docs/getting-started.mdx @@ -67,7 +67,7 @@ webex messaging [flags] # Webex Messaging APIs | `--organization ` | Override org ID | | `--output json\|table\|csv\|raw` | Output format (default: json) | | `--debug` | Show HTTP request/response details | -| `--paginate` | Auto-paginate list results | +| `--paginate` | Auto-paginate list results (ignored by commands that return one object) | ## Admin Examples diff --git a/skill/SKILL.md b/skill/SKILL.md index efde0e1..72563ad 100644 --- a/skill/SKILL.md +++ b/skill/SKILL.md @@ -270,6 +270,8 @@ webex admin people list --paginate webex meetings recordings list --paginate ``` +`--paginate` sets the page size itself (100 per request), so `--page-size`, `--size` and `--max` have no effect with it. Commands that return a single object ignore it. It follows `Link: rel="next"` headers where the API sends them. Known gaps: `cc tasks get` and the Slido `list-compliance-events` commands return only the first page. + Or paginate manually (CC): ```bash webex cc entry-point list --page=0 --page-size=100