From b350e31ce5c38f38748c106870747483644d9ad8 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 16 Mar 2023 12:47:53 -0500 Subject: [PATCH 01/40] Initial sketch --- Cargo.lock | 3 + docusign/src/account_brands.rs | 30 +- docusign/src/account_consumer_disclosures.rs | 6 +- docusign/src/account_custom_fields.rs | 11 +- docusign/src/account_password_rules.rs | 8 +- docusign/src/account_permission_profiles.rs | 10 +- docusign/src/account_seal_providers.rs | 2 +- docusign/src/account_signature_providers.rs | 2 +- docusign/src/account_signatures.rs | 22 +- docusign/src/account_tab_settings.rs | 4 +- docusign/src/account_watermarks.rs | 9 +- docusign/src/accounts.rs | 38 +- docusign/src/appliance_info.rs | 58 +- docusign/src/bcc_email_archive.rs | 12 +- docusign/src/billing_plans.rs | 18 +- docusign/src/bulk_send.rs | 20 +- docusign/src/chunked_uploads.rs | 10 +- docusign/src/cloud_storage.rs | 4 +- docusign/src/cloud_storage_providers.rs | 10 +- docusign/src/comments.rs | 2 +- docusign/src/connect_configurations.rs | 12 +- docusign/src/connect_events.rs | 23 +- docusign/src/connect_secret.rs | 2 +- docusign/src/contacts.rs | 10 +- docusign/src/custom_tabs.rs | 10 +- .../src/document_responsive_html_preview.rs | 2 +- docusign/src/e_note_configurations.rs | 9 +- docusign/src/envelope_attachments.rs | 10 +- docusign/src/envelope_consumer_disclosures.rs | 4 +- docusign/src/envelope_custom_fields.rs | 8 +- docusign/src/envelope_document_fields.rs | 8 +- .../src/envelope_document_html_definitions.rs | 2 +- docusign/src/envelope_document_tabs.rs | 10 +- docusign/src/envelope_document_visibility.rs | 4 +- docusign/src/envelope_documents.rs | 10 +- docusign/src/envelope_email_settings.rs | 8 +- docusign/src/envelope_form_data.rs | 2 +- docusign/src/envelope_html_definitions.rs | 2 +- docusign/src/envelope_locks.rs | 8 +- docusign/src/envelope_recipient_tabs.rs | 8 +- docusign/src/envelope_recipients.rs | 18 +- docusign/src/envelope_templates.rs | 10 +- docusign/src/envelope_transfer_rules.rs | 10 +- docusign/src/envelope_views.rs | 14 +- docusign/src/envelope_workflow_definition.rs | 20 +- docusign/src/envelopes.rs | 34 +- docusign/src/favorite_templates.rs | 9 +- docusign/src/folders.rs | 8 +- docusign/src/group_brands.rs | 6 +- docusign/src/group_users.rs | 6 +- docusign/src/groups.rs | 8 +- docusign/src/identity_verifications.rs | 2 +- docusign/src/invoices.rs | 6 +- docusign/src/lib.rs | 87 ++- docusign/src/notary.rs | 6 +- docusign/src/notary_journals.rs | 2 +- docusign/src/notary_jurisdiction.rs | 15 +- docusign/src/payment_gateway_accounts.rs | 2 +- docusign/src/payments.rs | 6 +- docusign/src/power_form_data.rs | 2 +- docusign/src/power_forms.rs | 18 +- docusign/src/reports.rs | 14 +- docusign/src/request_logs.rs | 13 +- docusign/src/resources.rs | 4 +- docusign/src/responsive_html_preview.rs | 2 +- docusign/src/services.rs | 4 +- docusign/src/signing_group_users.rs | 6 +- docusign/src/signing_groups.rs | 12 +- docusign/src/tabs_blob.rs | 12 +- docusign/src/template_bulk_recipients.rs | 6 +- docusign/src/template_custom_fields.rs | 8 +- docusign/src/template_document_fields.rs | 8 +- .../src/template_document_html_definitions.rs | 2 +- ...mplate_document_responsive_html_preview.rs | 2 +- docusign/src/template_document_tabs.rs | 10 +- docusign/src/template_document_visibility.rs | 6 +- docusign/src/template_documents.rs | 10 +- docusign/src/template_html_definitions.rs | 2 +- docusign/src/template_locks.rs | 8 +- docusign/src/template_recipient_tabs.rs | 8 +- docusign/src/template_recipients.rs | 12 +- .../src/template_responsive_html_preview.rs | 2 +- docusign/src/template_views.rs | 2 +- docusign/src/templates.rs | 24 +- docusign/src/user_custom_settings.rs | 6 +- docusign/src/user_profiles.rs | 4 +- docusign/src/user_signatures.rs | 18 +- docusign/src/users.rs | 30 +- docusign/src/workspace_items.rs | 12 +- docusign/src/workspaces.rs | 13 +- generator/src/client.rs | 228 ++++--- generator/src/functions.rs | 103 +-- generator/src/main.rs | 34 +- giphy/src/gifs.rs | 21 +- giphy/src/lib.rs | 87 ++- giphy/src/stickers.rs | 11 +- github/Cargo.toml | 3 + github/examples/list_pulls_for_repo.rs | 2 +- github/examples/list_repos_for_org.rs | 2 +- github/src/actions.rs | 195 +++--- github/src/activity.rs | 105 +-- github/src/apps.rs | 119 ++-- github/src/billing.rs | 18 +- github/src/checks.rs | 24 +- github/src/code_scanning.rs | 24 +- github/src/codes_of_conduct.rs | 13 +- github/src/emojis.rs | 2 +- github/src/enterprise_admin.rs | 94 +-- github/src/gists.rs | 64 +- github/src/git.rs | 33 +- github/src/gitignore.rs | 9 +- github/src/interactions.rs | 27 +- github/src/issues.rs | 116 ++-- github/src/lib.rs | 207 +++--- github/src/licenses.rs | 11 +- github/src/markdown.rs | 10 +- github/src/meta.rs | 8 +- github/src/migrations.rs | 71 ++- github/src/oauth_authorizations.rs | 30 +- github/src/orgs.rs | 158 +++-- github/src/packages.rs | 40 +- github/src/projects.rs | 75 ++- github/src/pulls.rs | 68 +- github/src/rate_limit.rs | 2 +- github/src/reactions.rs | 64 +- github/src/repos.rs | 435 +++++++------ github/src/scim.rs | 16 +- github/src/search.rs | 14 +- github/src/secret_scanning.rs | 8 +- github/src/teams.rs | 188 +++--- github/src/traits.rs | 55 ++ github/src/users.rs | 109 ++-- github/tests/tests.rs | 86 ++- google/admin/src/asps.rs | 10 +- google/admin/src/channels.rs | 5 +- google/admin/src/chromeosdevices.rs | 52 +- google/admin/src/customer.rs | 5 +- google/admin/src/customers.rs | 105 ++- google/admin/src/domain_aliases.rs | 12 +- google/admin/src/domains.rs | 15 +- google/admin/src/groups.rs | 68 +- google/admin/src/lib.rs | 87 ++- google/admin/src/members.rs | 58 +- google/admin/src/mobiledevices.rs | 52 +- google/admin/src/orgunits.rs | 16 +- google/admin/src/privileges.rs | 5 +- google/admin/src/resources.rs | 166 +++-- google/admin/src/role_assignments.rs | 52 +- google/admin/src/roles.rs | 59 +- google/admin/src/schemas.rs | 19 +- google/admin/src/tokens.rs | 17 +- google/admin/src/two_step_verification.rs | 2 +- google/admin/src/users.rs | 86 ++- google/admin/src/verification_codes.rs | 9 +- google/calendar/src/acl.rs | 58 +- google/calendar/src/calendar_list.rs | 54 +- google/calendar/src/calendars.rs | 15 +- google/calendar/src/channels.rs | 2 +- google/calendar/src/colors.rs | 2 +- google/calendar/src/events.rs | 102 ++- google/calendar/src/freebusy.rs | 2 +- google/calendar/src/lib.rs | 87 ++- google/calendar/src/settings.rs | 46 +- google/cloud-resource-manager/src/folders.rs | 70 +- google/cloud-resource-manager/src/lib.rs | 87 ++- .../cloud-resource-manager/src/operations.rs | 2 +- google/drive/src/about.rs | 2 +- google/drive/src/changes.rs | 46 +- google/drive/src/channels.rs | 2 +- google/drive/src/comments.rs | 54 +- google/drive/src/drives.rs | 57 +- google/drive/src/files.rs | 64 +- google/drive/src/lib.rs | 87 ++- google/drive/src/permissions.rs | 50 +- google/drive/src/replies.rs | 50 +- google/drive/src/revisions.rs | 55 +- google/drive/src/teamdrives.rs | 50 +- google/drive/src/traits.rs | 66 +- google/groups-settings/src/groups.rs | 6 +- google/groups-settings/src/lib.rs | 87 ++- google/sheets/src/lib.rs | 87 ++- google/sheets/src/spreadsheets.rs | 34 +- google/sheets/src/traits.rs | 7 +- gusto/src/admins_beta.rs | 6 +- gusto/src/benefits.rs | 40 +- gusto/src/companies.rs | 9 +- gusto/src/company_bank_accounts_beta.rs | 8 +- gusto/src/compensations.rs | 17 +- gusto/src/contractor_payments.rs | 8 +- gusto/src/contractors.rs | 13 +- gusto/src/current_user.rs | 2 +- gusto/src/custom_fields.rs | 4 +- gusto/src/earning_type.rs | 8 +- gusto/src/employees.rs | 14 +- gusto/src/federal_tax_details_beta.rs | 4 +- gusto/src/garnishments.rs | 13 +- gusto/src/job_applicants_beta.rs | 12 +- gusto/src/jobs.rs | 17 +- gusto/src/lib.rs | 87 ++- gusto/src/locations.rs | 13 +- gusto/src/pay_schedules.rs | 8 +- gusto/src/payroll.rs | 28 +- gusto/src/terminations.rs | 6 +- gusto/src/time_off_requests.rs | 6 +- mailchimp/src/activity_feed.rs | 2 +- mailchimp/src/authorized_apps.rs | 4 +- mailchimp/src/automations.rs | 42 +- mailchimp/src/batch_webhooks.rs | 10 +- mailchimp/src/batches.rs | 8 +- mailchimp/src/campaign_folders.rs | 10 +- mailchimp/src/campaigns.rs | 57 +- mailchimp/src/connected_sites.rs | 10 +- mailchimp/src/conversations.rs | 8 +- mailchimp/src/customer_journeys.rs | 2 +- mailchimp/src/ecommerce.rs | 124 ++-- mailchimp/src/facebook_ads.rs | 4 +- mailchimp/src/file_manager.rs | 20 +- mailchimp/src/landing_pages.rs | 16 +- mailchimp/src/lib.rs | 87 ++- mailchimp/src/lists.rs | 148 +++-- mailchimp/src/ping.rs | 2 +- mailchimp/src/reporting.rs | 11 +- mailchimp/src/reports.rs | 45 +- mailchimp/src/root.rs | 2 +- mailchimp/src/search_campaigns.rs | 2 +- mailchimp/src/search_members.rs | 2 +- mailchimp/src/template_folders.rs | 10 +- mailchimp/src/templates.rs | 12 +- mailchimp/src/verified_domains.rs | 15 +- okta/src/applications.rs | 111 ++-- okta/src/authorization_servers.rs | 103 +-- okta/src/domains.rs | 21 +- okta/src/event_hooks.rs | 30 +- okta/src/features.rs | 19 +- okta/src/groups.rs | 92 ++- okta/src/identity_providers.rs | 94 ++- okta/src/inline_hooks.rs | 33 +- okta/src/lib.rs | 87 ++- okta/src/linked_objects.rs | 17 +- okta/src/logs.rs | 4 +- okta/src/network_zones.rs | 28 +- okta/src/policies.rs | 44 +- okta/src/profile_mappings.rs | 11 +- okta/src/sessions.rs | 14 +- okta/src/templates.rs | 17 +- okta/src/threat_insights.rs | 4 +- okta/src/trusted_origins.rs | 19 +- okta/src/user_factors.rs | 31 +- okta/src/user_schemas.rs | 11 +- okta/src/user_types.rs | 17 +- okta/src/users.rs | 154 +++-- ramp/src/auths.rs | 2 +- ramp/src/businesses.rs | 6 +- ramp/src/card_programs.rs | 39 +- ramp/src/cards.rs | 48 +- ramp/src/custom_ids.rs | 12 +- ramp/src/departments.rs | 38 +- ramp/src/lib.rs | 87 ++- ramp/src/locations.rs | 38 +- ramp/src/receipts.rs | 34 +- ramp/src/reimbursements.rs | 37 +- ramp/src/transactions.rs | 37 +- ramp/src/users.rs | 42 +- rev.ai/src/account.rs | 2 +- rev.ai/src/captions.rs | 2 +- rev.ai/src/jobs.rs | 10 +- rev.ai/src/lib.rs | 87 ++- rev.ai/src/traits.rs | 6 +- rev.ai/src/transcript.rs | 2 +- sendgrid/src/alerts.rs | 19 +- sendgrid/src/api_key_permissions.rs | 4 +- sendgrid/src/api_keys.rs | 15 +- sendgrid/src/blocks_api.rs | 12 +- sendgrid/src/bounces_api.rs | 12 +- sendgrid/src/campaigns_api.rs | 28 +- sendgrid/src/cancel_scheduled_sends.rs | 26 +- sendgrid/src/categories.rs | 10 +- sendgrid/src/certificates.rs | 12 +- sendgrid/src/contacts.rs | 37 +- sendgrid/src/contacts_api_custom_fields.rs | 10 +- sendgrid/src/contacts_api_lists.rs | 22 +- sendgrid/src/contacts_api_recipients.rs | 26 +- sendgrid/src/contacts_api_segments.rs | 12 +- sendgrid/src/csv_ui_only.rs | 4 +- sendgrid/src/custom_fields.rs | 8 +- sendgrid/src/designs_api.rs | 24 +- sendgrid/src/domain_authentication.rs | 33 +- sendgrid/src/email_address_validation.rs | 2 +- sendgrid/src/email_cname_records.rs | 2 +- sendgrid/src/invalid_emails_api.rs | 12 +- sendgrid/src/ip_access_management.rs | 12 +- sendgrid/src/ip_addresses.rs | 16 +- sendgrid/src/ip_pools.rs | 20 +- sendgrid/src/ip_warmup.rs | 16 +- sendgrid/src/lib.rs | 87 ++- sendgrid/src/link_branding.rs | 25 +- sendgrid/src/lists.rs | 17 +- sendgrid/src/mail_send.rs | 5 +- sendgrid/src/marketing_campaigns_stats.rs | 16 +- sendgrid/src/query.rs | 7 +- sendgrid/src/reverse_dns.rs | 18 +- sendgrid/src/segmenting_contacts.rs | 12 +- sendgrid/src/segmenting_contacts_beta.rs | 13 +- sendgrid/src/send_test_email.rs | 2 +- sendgrid/src/sender_identities_api.rs | 17 +- sendgrid/src/sender_verification.rs | 25 +- sendgrid/src/senders.rs | 2 +- sendgrid/src/settings_enforced_tls.rs | 6 +- sendgrid/src/settings_inbound_parse.rs | 8 +- sendgrid/src/settings_mail.rs | 28 +- sendgrid/src/settings_partner.rs | 6 +- sendgrid/src/settings_tracking.rs | 20 +- sendgrid/src/single_sends.rs | 29 +- sendgrid/src/single_sign_on_settings.rs | 12 +- sendgrid/src/single_sign_on_teammates.rs | 4 +- sendgrid/src/spam_reports_api.rs | 12 +- sendgrid/src/stats.rs | 30 +- sendgrid/src/subuser_monitor_settings.rs | 8 +- sendgrid/src/subuser_statistics.rs | 8 +- sendgrid/src/subusers_api.rs | 16 +- sendgrid/src/suppressions.rs | 26 +- sendgrid/src/suppressions_global.rs | 13 +- .../src/suppressions_unsubscribe_groups.rs | 12 +- sendgrid/src/teammates.rs | 29 +- sendgrid/src/transactional_templates.rs | 12 +- .../src/transactional_templates_versions.rs | 10 +- sendgrid/src/users_api.rs | 26 +- sendgrid/src/webhooks.rs | 20 +- shipbob/src/channels.rs | 4 +- shipbob/src/inventory.rs | 16 +- shipbob/src/lib.rs | 87 ++- shipbob/src/locations.rs | 4 +- shipbob/src/orders.rs | 50 +- shipbob/src/products.rs | 15 +- shipbob/src/receiving.rs | 15 +- shipbob/src/returns.rs | 17 +- shipbob/src/webhooks.rs | 8 +- shopify/src/access.rs | 51 +- shopify/src/analytics.rs | 63 +- shopify/src/billing.rs | 206 +++--- shopify/src/customers.rs | 343 +++++----- shopify/src/deprecated_api_calls.rs | 4 +- shopify/src/discounts.rs | 126 ++-- shopify/src/events.rs | 123 ++-- shopify/src/inventory.rs | 160 ++--- shopify/src/lib.rs | 87 ++- shopify/src/metafield.rs | 106 ++-- shopify/src/online_store.rs | 430 +++++++------ shopify/src/orders.rs | 193 +++--- shopify/src/plus.rs | 157 +++-- shopify/src/products.rs | 438 +++++++------ shopify/src/sales_channels.rs | 246 +++++--- shopify/src/shipping_and_fulfillment.rs | 505 ++++++++------- shopify/src/shopify_payments.rs | 47 +- shopify/src/store_properties.rs | 210 +++--- shopify/src/tendertransaction.rs | 12 +- slack/src/admin_apps.rs | 4 +- slack/src/admin_apps_approved.rs | 2 +- slack/src/admin_apps_requests.rs | 2 +- slack/src/admin_apps_restricted.rs | 2 +- slack/src/admin_conversations.rs | 35 +- slack/src/admin_conversations_ekm.rs | 2 +- .../admin_conversations_restrict_access.rs | 6 +- slack/src/admin_emoji.rs | 14 +- slack/src/admin_invite_requests.rs | 6 +- slack/src/admin_invite_requests_approved.rs | 2 +- slack/src/admin_invite_requests_denied.rs | 2 +- slack/src/admin_teams.rs | 8 +- slack/src/admin_teams_admins.rs | 2 +- slack/src/admin_teams_owners.rs | 2 +- slack/src/admin_teams_settings.rs | 21 +- slack/src/admin_usergroups.rs | 10 +- slack/src/admin_users.rs | 18 +- slack/src/admin_users_session.rs | 4 +- slack/src/api.rs | 6 +- slack/src/apps.rs | 2 +- slack/src/apps_event_authorizations.rs | 2 +- slack/src/apps_permissions.rs | 6 +- slack/src/apps_permissions_resources.rs | 3 +- slack/src/apps_permissions_scopes.rs | 4 +- slack/src/apps_permissions_users.rs | 8 +- slack/src/auth.rs | 7 +- slack/src/bots.rs | 5 +- slack/src/calls.rs | 11 +- slack/src/calls_participants.rs | 4 +- slack/src/chat.rs | 28 +- slack/src/chat_scheduled_messages.rs | 2 +- slack/src/conversations.rs | 54 +- slack/src/dialog.rs | 2 +- slack/src/dnd.rs | 20 +- slack/src/emoji.rs | 2 +- slack/src/files.rs | 16 +- slack/src/files_comments.rs | 2 +- slack/src/files_remote.rs | 12 +- slack/src/lib.rs | 87 ++- slack/src/migration.rs | 2 +- slack/src/oauth.rs | 4 +- slack/src/oauth_v_2.rs | 2 +- slack/src/pins.rs | 8 +- slack/src/reactions.rs | 8 +- slack/src/reminders.rs | 13 +- slack/src/rtm.rs | 2 +- slack/src/search.rs | 2 +- slack/src/stars.rs | 6 +- slack/src/team.rs | 14 +- slack/src/team_profile.rs | 2 +- slack/src/usergroups.rs | 18 +- slack/src/usergroups_users.rs | 6 +- slack/src/users.rs | 26 +- slack/src/users_profile.rs | 4 +- slack/src/views.rs | 8 +- slack/src/workflows.rs | 6 +- stripe/src/account.rs | 234 +++++-- stripe/src/account_links.rs | 2 +- stripe/src/accounts.rs | 279 +++++--- stripe/src/apple_pay.rs | 46 +- stripe/src/application_fees.rs | 96 ++- stripe/src/balance.rs | 44 +- stripe/src/balance_transactions.rs | 45 +- stripe/src/billing_portal.rs | 50 +- stripe/src/bitcoin.rs | 125 ++-- stripe/src/charges.rs | 169 +++-- stripe/src/checkout.rs | 89 ++- stripe/src/country_specs.rs | 45 +- stripe/src/coupons.rs | 57 +- stripe/src/credit_notes.rs | 136 ++-- stripe/src/customers.rs | 456 ++++++++++---- stripe/src/disputes.rs | 52 +- stripe/src/ephemeral_keys.rs | 7 +- stripe/src/events.rs | 42 +- stripe/src/exchange_rates.rs | 45 +- stripe/src/file_links.rs | 52 +- stripe/src/files.rs | 44 +- stripe/src/identity.rs | 92 ++- stripe/src/invoiceitems.rs | 51 +- stripe/src/invoices.rs | 204 ++++-- stripe/src/issuer_fraud_records.rs | 42 +- stripe/src/issuing.rs | 286 ++++++--- stripe/src/lib.rs | 87 ++- stripe/src/mandates.rs | 2 +- stripe/src/order_returns.rs | 42 +- stripe/src/orders.rs | 56 +- stripe/src/payment_intents.rs | 100 ++- stripe/src/payment_links.rs | 95 ++- stripe/src/payment_methods.rs | 50 +- stripe/src/payouts.rs | 59 +- stripe/src/plans.rs | 54 +- stripe/src/prices.rs | 92 ++- stripe/src/products.rs | 97 ++- stripe/src/promotion_codes.rs | 46 +- stripe/src/quotes.rs | 149 +++-- stripe/src/radar.rs | 138 ++-- stripe/src/recipients.rs | 57 +- stripe/src/refunds.rs | 54 +- stripe/src/reporting.rs | 90 ++- stripe/src/reviews.rs | 50 +- stripe/src/setup_attempts.rs | 40 +- stripe/src/setup_intents.rs | 55 +- stripe/src/shipping_rates.rs | 46 +- stripe/src/sigma.rs | 42 +- stripe/src/skus.rs | 54 +- stripe/src/sources.rs | 58 +- stripe/src/subscription_items.rs | 102 ++- stripe/src/subscription_schedules.rs | 50 +- stripe/src/subscriptions.rs | 93 ++- stripe/src/tax_codes.rs | 42 +- stripe/src/tax_rates.rs | 52 +- stripe/src/terminal.rs | 110 ++-- stripe/src/test_helpers.rs | 52 +- stripe/src/three_d_secure.rs | 6 +- stripe/src/tokens.rs | 4 +- stripe/src/topups.rs | 54 +- stripe/src/transfers.rs | 101 ++- stripe/src/webhook_endpoints.rs | 50 +- tripactions/src/booking_data.rs | 42 +- tripactions/src/lib.rs | 87 ++- zoom/src/accounts.rs | 46 +- zoom/src/archiving.rs | 44 +- zoom/src/billing.rs | 32 +- zoom/src/chat_channels.rs | 59 +- zoom/src/chat_channels_account_level.rs | 56 +- zoom/src/chat_messages.rs | 54 +- zoom/src/chatbot_messages.rs | 9 +- zoom/src/cloud_recording.rs | 70 +- zoom/src/common_area_phones.rs | 61 +- zoom/src/contacts.rs | 86 ++- zoom/src/dashboards.rs | 186 ++++-- zoom/src/deprecated_api_endpoints.rs | 4 +- zoom/src/devices.rs | 12 +- zoom/src/groups.rs | 94 ++- zoom/src/im_chat.rs | 48 +- zoom/src/im_groups.rs | 23 +- zoom/src/lib.rs | 87 ++- zoom/src/meetings.rs | 72 ++- zoom/src/pac.rs | 5 +- zoom/src/phone.rs | 596 ++++++++++++------ zoom/src/phone_auto_receptionists.rs | 10 +- zoom/src/phone_blocked_list.rs | 55 +- zoom/src/phone_call_queues.rs | 114 ++-- zoom/src/phone_devices.rs | 53 +- zoom/src/phone_reports.rs | 2 +- zoom/src/phone_shared_line_groups.rs | 71 ++- zoom/src/phone_site.rs | 57 +- zoom/src/reports.rs | 74 ++- zoom/src/roles.rs | 63 +- zoom/src/rooms.rs | 111 ++-- zoom/src/rooms_account.rs | 8 +- zoom/src/rooms_devices.rs | 2 +- zoom/src/rooms_location.rs | 58 +- zoom/src/sip_connected_audio.rs | 69 +- zoom/src/sip_phone.rs | 54 +- zoom/src/tracking_field.rs | 10 +- zoom/src/tsp.rs | 26 +- zoom/src/users.rs | 122 ++-- zoom/src/webinars.rs | 129 ++-- 515 files changed, 13848 insertions(+), 8052 deletions(-) create mode 100644 github/src/traits.rs diff --git a/Cargo.lock b/Cargo.lock index d7c2f5e5..dc8694c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1425,7 +1425,9 @@ name = "octorust" version = "0.3.2" dependencies = [ "async-recursion", + "async-trait", "base64 0.13.0", + "bytes", "chrono", "dirs", "http", @@ -1452,6 +1454,7 @@ dependencies = [ "thiserror", "tokio", "url", + "uuid", "wiremock", ] diff --git a/docusign/src/account_brands.rs b/docusign/src/account_brands.rs index 8d132a38..92b15c58 100644 --- a/docusign/src/account_brands.rs +++ b/docusign/src/account_brands.rs @@ -31,7 +31,7 @@ impl AccountBrands { account_id: &str, exclude_distributor_brand: &str, include_logos: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_distributor_brand.is_empty() { query_args.push(( @@ -82,7 +82,7 @@ impl AccountBrands { &self, account_id: &str, body: &crate::types::Brand, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/brands", @@ -117,7 +117,7 @@ impl AccountBrands { &self, account_id: &str, body: &crate::types::BrandsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/brands", @@ -157,7 +157,7 @@ impl AccountBrands { brand_id: &str, include_external_references: &str, include_logos: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_external_references.is_empty() { query_args.push(( @@ -207,7 +207,7 @@ impl AccountBrands { account_id: &str, brand_id: &str, body: &crate::types::Brand, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/brands/{}", @@ -240,7 +240,11 @@ impl AccountBrands { * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. * * `brand_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn brand_delete(&self, account_id: &str, brand_id: &str) -> ClientResult<()> { + pub async fn brand_delete( + &self, + account_id: &str, + brand_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/brands/{}", @@ -277,7 +281,7 @@ impl AccountBrands { &self, account_id: &str, brand_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/brands/{}/file", @@ -316,7 +320,7 @@ impl AccountBrands { account_id: &str, brand_id: &str, logo_type: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/brands/{}/logos/{}", @@ -361,7 +365,7 @@ impl AccountBrands { brand_id: &str, logo_type: &str, body: bytes::Bytes, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/brands/{}/logos/{}", @@ -401,7 +405,7 @@ impl AccountBrands { account_id: &str, brand_id: &str, logo_type: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/brands/{}/logos/{}", @@ -439,7 +443,7 @@ impl AccountBrands { &self, account_id: &str, brand_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/brands/{}/resources", @@ -491,7 +495,7 @@ impl AccountBrands { resource_content_type: &str, langcode: &str, return_master: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !langcode.is_empty() { query_args.push(("langcode".to_string(), langcode.to_string())); @@ -553,7 +557,7 @@ impl AccountBrands { account_id: &str, brand_id: &str, resource_content_type: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/brands/{}/resources/{}", diff --git a/docusign/src/account_consumer_disclosures.rs b/docusign/src/account_consumer_disclosures.rs index be021742..98024816 100644 --- a/docusign/src/account_consumer_disclosures.rs +++ b/docusign/src/account_consumer_disclosures.rs @@ -77,7 +77,7 @@ impl AccountConsumerDisclosures { &self, account_id: &str, lang_code: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !lang_code.is_empty() { query_args.push(("langCode".to_string(), lang_code.to_string())); @@ -167,7 +167,7 @@ impl AccountConsumerDisclosures { &self, account_id: &str, lang_code: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/consumer_disclosure/{}", @@ -300,7 +300,7 @@ impl AccountConsumerDisclosures { lang_code: &str, include_metadata: &str, body: &crate::types::ConsumerDisclosure, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_metadata.is_empty() { query_args.push(("include_metadata".to_string(), include_metadata.to_string())); diff --git a/docusign/src/account_custom_fields.rs b/docusign/src/account_custom_fields.rs index 746aded2..54c58381 100644 --- a/docusign/src/account_custom_fields.rs +++ b/docusign/src/account_custom_fields.rs @@ -22,7 +22,10 @@ impl AccountCustomFields { * * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn get(&self, account_id: &str) -> ClientResult { + pub async fn get( + &self, + account_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/custom_fields", @@ -57,7 +60,7 @@ impl AccountCustomFields { account_id: &str, apply_to_templates: &str, body: &crate::types::CustomField, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !apply_to_templates.is_empty() { query_args.push(( @@ -103,7 +106,7 @@ impl AccountCustomFields { custom_field_id: &str, apply_to_templates: &str, body: &crate::types::CustomField, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !apply_to_templates.is_empty() { query_args.push(( @@ -149,7 +152,7 @@ impl AccountCustomFields { account_id: &str, custom_field_id: &str, apply_to_templates: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !apply_to_templates.is_empty() { query_args.push(( diff --git a/docusign/src/account_password_rules.rs b/docusign/src/account_password_rules.rs index 52e57db3..bb84fccd 100644 --- a/docusign/src/account_password_rules.rs +++ b/docusign/src/account_password_rules.rs @@ -25,7 +25,7 @@ impl AccountPasswordRules { pub async fn get( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/settings/password_rules", @@ -60,7 +60,7 @@ impl AccountPasswordRules { &self, account_id: &str, body: &crate::types::AccountPasswordRulesData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/settings/password_rules", @@ -85,7 +85,9 @@ impl AccountPasswordRules { * * */ - pub async fn password_rules_get(&self) -> ClientResult { + pub async fn password_rules_get( + &self, + ) -> ClientResult> { let url = self.client.url("/v2.1/current_user/password_rules", None); self.client .get( diff --git a/docusign/src/account_permission_profiles.rs b/docusign/src/account_permission_profiles.rs index b064b469..57374455 100644 --- a/docusign/src/account_permission_profiles.rs +++ b/docusign/src/account_permission_profiles.rs @@ -35,7 +35,7 @@ impl AccountPermissionProfiles { &self, account_id: &str, include: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include.is_empty() { query_args.push(("include".to_string(), include.to_string())); @@ -76,7 +76,7 @@ impl AccountPermissionProfiles { account_id: &str, include: &str, body: &crate::types::PermissionProfile, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include.is_empty() { query_args.push(("include".to_string(), include.to_string())); @@ -124,7 +124,7 @@ impl AccountPermissionProfiles { account_id: &str, permission_profile_id: &str, include: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include.is_empty() { query_args.push(("include".to_string(), include.to_string())); @@ -174,7 +174,7 @@ impl AccountPermissionProfiles { permission_profile_id: &str, include: &str, body: &crate::types::PermissionProfile, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include.is_empty() { query_args.push(("include".to_string(), include.to_string())); @@ -225,7 +225,7 @@ impl AccountPermissionProfiles { account_id: &str, permission_profile_id: &str, move_users_to: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !move_users_to.is_empty() { query_args.push(("move_users_to".to_string(), move_users_to.to_string())); diff --git a/docusign/src/account_seal_providers.rs b/docusign/src/account_seal_providers.rs index a644e146..09e5908e 100644 --- a/docusign/src/account_seal_providers.rs +++ b/docusign/src/account_seal_providers.rs @@ -25,7 +25,7 @@ impl AccountSealProviders { pub async fn account_signature_providers_get_seal( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/seals", diff --git a/docusign/src/account_signature_providers.rs b/docusign/src/account_signature_providers.rs index c890218d..cbf20f8b 100644 --- a/docusign/src/account_signature_providers.rs +++ b/docusign/src/account_signature_providers.rs @@ -25,7 +25,7 @@ impl AccountSignatureProviders { pub async fn get( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/signatureProviders", diff --git a/docusign/src/account_signatures.rs b/docusign/src/account_signatures.rs index a785e051..77d94985 100644 --- a/docusign/src/account_signatures.rs +++ b/docusign/src/account_signatures.rs @@ -31,7 +31,7 @@ impl AccountSignatures { stamp_format: &str, stamp_name: &str, stamp_type: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !stamp_format.is_empty() { query_args.push(("stamp_format".to_string(), stamp_format.to_string())); @@ -77,7 +77,7 @@ impl AccountSignatures { &self, account_id: &str, body: &crate::types::AccountSignaturesInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/signatures", @@ -113,7 +113,7 @@ impl AccountSignatures { account_id: &str, decode_only: &str, body: &crate::types::AccountSignaturesInformation, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !decode_only.is_empty() { query_args.push(("decode_only".to_string(), decode_only.to_string())); @@ -153,7 +153,7 @@ impl AccountSignatures { &self, account_id: &str, signature_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/signatures/{}", @@ -191,7 +191,7 @@ impl AccountSignatures { signature_id: &str, close_existing_signature: &str, body: &crate::types::AccountSignatureDefinition, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !close_existing_signature.is_empty() { query_args.push(( @@ -231,7 +231,11 @@ impl AccountSignatures { * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. * * `signature_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn delete_signature(&self, account_id: &str, signature_id: &str) -> ClientResult<()> { + pub async fn delete_signature( + &self, + account_id: &str, + signature_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/signatures/{}", @@ -273,7 +277,7 @@ impl AccountSignatures { image_type: &str, signature_id: &str, include_chrome: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_chrome.is_empty() { query_args.push(("include_chrome".to_string(), include_chrome.to_string())); @@ -322,7 +326,7 @@ impl AccountSignatures { image_type: &str, signature_id: &str, transparent_png: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !transparent_png.is_empty() { query_args.push(("transparent_png".to_string(), transparent_png.to_string())); @@ -369,7 +373,7 @@ impl AccountSignatures { account_id: &str, image_type: &str, signature_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/signatures/{}/{}", diff --git a/docusign/src/account_tab_settings.rs b/docusign/src/account_tab_settings.rs index 590acc42..387d26b1 100644 --- a/docusign/src/account_tab_settings.rs +++ b/docusign/src/account_tab_settings.rs @@ -25,7 +25,7 @@ impl AccountTabSettings { pub async fn tab_settings_get( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/settings/tabs", @@ -58,7 +58,7 @@ impl AccountTabSettings { &self, account_id: &str, body: &crate::types::TabAccountSettings, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/settings/tabs", diff --git a/docusign/src/account_watermarks.rs b/docusign/src/account_watermarks.rs index 48b9b80b..9174a910 100644 --- a/docusign/src/account_watermarks.rs +++ b/docusign/src/account_watermarks.rs @@ -22,7 +22,10 @@ impl AccountWatermarks { * * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn watermark_get(&self, account_id: &str) -> ClientResult { + pub async fn watermark_get( + &self, + account_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/watermark", @@ -55,7 +58,7 @@ impl AccountWatermarks { &self, account_id: &str, body: &crate::types::Watermark, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/watermark", @@ -88,7 +91,7 @@ impl AccountWatermarks { &self, account_id: &str, body: &crate::types::Watermark, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/watermark/preview", diff --git a/docusign/src/accounts.rs b/docusign/src/accounts.rs index 571884f9..07e6284e 100644 --- a/docusign/src/accounts.rs +++ b/docusign/src/accounts.rs @@ -145,7 +145,7 @@ impl Accounts { pub async fn post( &self, body: &crate::types::NewAccountDefinition, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/v2.1/accounts", None); self.client .post( @@ -164,7 +164,9 @@ impl Accounts { * * Retrieves the account provisioning information for the account. */ - pub async fn get_provisioning(&self) -> ClientResult { + pub async fn get_provisioning( + &self, + ) -> ClientResult> { let url = self.client.url("/v2.1/accounts/provisioning", None); self.client .get( @@ -196,7 +198,7 @@ impl Accounts { &self, account_id: &str, include_account_settings: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_account_settings.is_empty() { query_args.push(( @@ -234,7 +236,7 @@ impl Accounts { * * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn delete(&self, account_id: &str) -> ClientResult<()> { + pub async fn delete(&self, account_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}", @@ -275,7 +277,7 @@ impl Accounts { &self, account_id: &str, include_charges: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_charges.is_empty() { query_args.push(("include_charges".to_string(), include_charges.to_string())); @@ -316,7 +318,7 @@ impl Accounts { account_id: &str, recipient_part: &str, body: &crate::types::CaptiveRecipientInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/captive_recipients/{}", @@ -351,7 +353,7 @@ impl Accounts { &self, account_id: &str, email: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !email.is_empty() { query_args.push(("email".to_string(), email.to_string())); @@ -389,7 +391,7 @@ impl Accounts { pub async fn settings_get( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/settings", @@ -422,7 +424,7 @@ impl Accounts { &self, account_id: &str, body: &crate::types::AccountSettingsInformation, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/settings", @@ -456,7 +458,7 @@ impl Accounts { pub async fn envelope_purge_configuration_get( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/settings/envelope_purge_configuration", @@ -493,7 +495,7 @@ impl Accounts { &self, account_id: &str, body: &crate::types::EnvelopePurgeConfiguration, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/settings/envelope_purge_configuration", @@ -525,7 +527,7 @@ impl Accounts { pub async fn notification_defaults_get( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/settings/notification_defaults", @@ -558,7 +560,7 @@ impl Accounts { &self, account_id: &str, body: &crate::types::NotificationDefaultsData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/settings/notification_defaults", @@ -628,7 +630,7 @@ impl Accounts { shared: &str, start_position: &str, user_ids: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !count.is_empty() { query_args.push(("count".to_string(), count.to_string())); @@ -713,7 +715,7 @@ impl Accounts { preserve_existing_shared_access: &str, user_ids: &str, body: &crate::types::AccountSharedAccess, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !item_type.is_empty() { query_args.push(("item_type".to_string(), item_type.to_string())); @@ -766,7 +768,7 @@ impl Accounts { pub async fn supported_languages_get( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/supported_languages", @@ -798,7 +800,7 @@ impl Accounts { pub async fn unsupported_file_types_get( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/unsupported_file_types", @@ -832,7 +834,7 @@ impl Accounts { &self, organization_id: &str, result_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/organization_exports/{}/account_settings/{}", diff --git a/docusign/src/appliance_info.rs b/docusign/src/appliance_info.rs index ed716a8c..d174f751 100644 --- a/docusign/src/appliance_info.rs +++ b/docusign/src/appliance_info.rs @@ -25,7 +25,7 @@ impl ApplianceInfo { pub async fn envelope_get_dynamic_system_setting( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/display_appliance_info/dynamicsystemsettings", @@ -57,7 +57,7 @@ impl ApplianceInfo { pub async fn envelope_get_template( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/display_appliance_info/templateInfo", @@ -91,7 +91,7 @@ impl ApplianceInfo { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info", @@ -126,7 +126,7 @@ impl ApplianceInfo { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/account_info", @@ -161,7 +161,7 @@ impl ApplianceInfo { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/custom_fields", @@ -196,7 +196,7 @@ impl ApplianceInfo { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/custom_fields/delete", @@ -231,7 +231,7 @@ impl ApplianceInfo { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/date_signed", @@ -268,7 +268,7 @@ impl ApplianceInfo { account_id: &str, document_id: &str, envelope_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/document/{}", @@ -306,7 +306,7 @@ impl ApplianceInfo { account_id: &str, document_id: &str, envelope_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/document/{}", @@ -342,7 +342,7 @@ impl ApplianceInfo { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/document_page_list", @@ -377,7 +377,7 @@ impl ApplianceInfo { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/image", @@ -415,7 +415,7 @@ impl ApplianceInfo { account_id: &str, envelope_id: &str, user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/localepolicy/{}", @@ -447,7 +447,11 @@ impl ApplianceInfo { * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. * * `envelope_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn envelope_put_page(&self, account_id: &str, envelope_id: &str) -> ClientResult<()> { + pub async fn envelope_put_page( + &self, + account_id: &str, + envelope_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/page_info", @@ -482,7 +486,7 @@ impl ApplianceInfo { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/page_info", @@ -517,7 +521,7 @@ impl ApplianceInfo { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/page_info/delete", @@ -552,7 +556,7 @@ impl ApplianceInfo { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/pdf", @@ -591,7 +595,7 @@ impl ApplianceInfo { account_id: &str, envelope_id: &str, pdf_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/pdf/{}", @@ -627,7 +631,7 @@ impl ApplianceInfo { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/pdf_blobs", @@ -662,7 +666,7 @@ impl ApplianceInfo { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/pdf_blobs", @@ -697,7 +701,7 @@ impl ApplianceInfo { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/pdf_blobs", @@ -732,7 +736,7 @@ impl ApplianceInfo { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/recipient_denied_copy", @@ -767,7 +771,7 @@ impl ApplianceInfo { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/recipient_denied_copy", @@ -802,7 +806,7 @@ impl ApplianceInfo { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/signer_attachment_info", @@ -837,7 +841,7 @@ impl ApplianceInfo { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/display_appliance_info/signer_attachment_info", @@ -863,7 +867,7 @@ impl ApplianceInfo { * * */ - pub async fn envelope_post_error(&self) -> ClientResult<()> { + pub async fn envelope_post_error(&self) -> ClientResult> { let url = self.client.url("/v2.1/display_appliance_info/error", None); self.client .post( @@ -882,7 +886,9 @@ impl ApplianceInfo { * * */ - pub async fn envelope_post_redeem(&self) -> ClientResult { + pub async fn envelope_post_redeem( + &self, + ) -> ClientResult> { let url = self.client.url("/v2.1/display_appliance_info/redeem", None); self.client .post( diff --git a/docusign/src/bcc_email_archive.rs b/docusign/src/bcc_email_archive.rs index a9300fc9..57fa9a9b 100644 --- a/docusign/src/bcc_email_archive.rs +++ b/docusign/src/bcc_email_archive.rs @@ -29,7 +29,7 @@ impl BccEmailArchive { account_id: &str, count: &str, start_position: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !count.is_empty() { query_args.push(("count".to_string(), count.to_string())); @@ -76,7 +76,7 @@ impl BccEmailArchive { &self, account_id: &str, body: &crate::types::BccEmailArchiveData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/settings/bcc_email_archives", @@ -114,7 +114,7 @@ impl BccEmailArchive { bcc_email_archive_id: &str, count: &str, start_position: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !count.is_empty() { query_args.push(("count".to_string(), count.to_string())); @@ -157,7 +157,11 @@ impl BccEmailArchive { * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. * * `bcc_email_archive_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn delete(&self, account_id: &str, bcc_email_archive_id: &str) -> ClientResult<()> { + pub async fn delete( + &self, + account_id: &str, + bcc_email_archive_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/settings/bcc_email_archives/{}", diff --git a/docusign/src/billing_plans.rs b/docusign/src/billing_plans.rs index 7f14e299..3503192b 100644 --- a/docusign/src/billing_plans.rs +++ b/docusign/src/billing_plans.rs @@ -40,7 +40,7 @@ impl BillingPlans { include_credit_card_information: &str, include_metadata: &str, include_successor_plans: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_credit_card_information.is_empty() { query_args.push(( @@ -93,7 +93,7 @@ impl BillingPlans { account_id: &str, preview_billing_plan: &str, body: &crate::types::BillingPlanInformation, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !preview_billing_plan.is_empty() { query_args.push(( @@ -134,7 +134,7 @@ impl BillingPlans { pub async fn get_credit_card_info( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/billing_plan/credit_card", @@ -166,7 +166,7 @@ impl BillingPlans { pub async fn get_downgrade_request_info( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/billing_plan/downgrade", @@ -199,7 +199,7 @@ impl BillingPlans { &self, account_id: &str, body: &crate::types::DowngradeBillingPlanInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/billing_plan/downgrade", @@ -232,7 +232,7 @@ impl BillingPlans { &self, account_id: &str, body: &crate::types::PurchasedEnvelopesInformation, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/billing_plan/purchased_envelopes", @@ -257,7 +257,9 @@ impl BillingPlans { * * Retrieves a list of the billing plans associated with a distributor. */ - pub async fn get_billing_plans(&self) -> ClientResult { + pub async fn get_billing_plans( + &self, + ) -> ClientResult> { let url = self.client.url("/v2.1/billing_plans", None); self.client .get( @@ -283,7 +285,7 @@ impl BillingPlans { pub async fn get_plan( &self, billing_plan_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/billing_plans/{}", diff --git a/docusign/src/bulk_send.rs b/docusign/src/bulk_send.rs index 2ec45580..832ef71b 100644 --- a/docusign/src/bulk_send.rs +++ b/docusign/src/bulk_send.rs @@ -42,7 +42,7 @@ impl BulkSend { count: &str, start_position: &str, status: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !batch_ids.is_empty() { query_args.push(("batch_ids".to_string(), batch_ids.to_string())); @@ -97,7 +97,7 @@ impl BulkSend { &self, account_id: &str, bulk_send_batch_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/bulk_send_batch/{}", @@ -133,7 +133,7 @@ impl BulkSend { account_id: &str, bulk_send_batch_id: &str, body: &crate::types::BulkSendBatchRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/bulk_send_batch/{}", @@ -166,7 +166,7 @@ impl BulkSend { pub async fn v_2crud_get_list( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/bulk_send_lists", @@ -225,7 +225,7 @@ impl BulkSend { &self, account_id: &str, body: &crate::types::BulkSendingList, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/bulk_send_lists", @@ -259,7 +259,7 @@ impl BulkSend { &self, account_id: &str, bulk_send_list_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/bulk_send_lists/{}", @@ -295,7 +295,7 @@ impl BulkSend { account_id: &str, bulk_send_list_id: &str, body: &crate::types::BulkSendingList, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/bulk_send_lists/{}", @@ -330,7 +330,7 @@ impl BulkSend { &self, account_id: &str, bulk_send_list_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/bulk_send_lists/{}", @@ -403,7 +403,7 @@ impl BulkSend { account_id: &str, bulk_send_list_id: &str, body: &crate::types::BulkSendRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/bulk_send_lists/{}/send", @@ -476,7 +476,7 @@ impl BulkSend { account_id: &str, bulk_send_list_id: &str, body: &crate::types::BulkSendRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/bulk_send_lists/{}/test", diff --git a/docusign/src/chunked_uploads.rs b/docusign/src/chunked_uploads.rs index 4510089d..caf00141 100644 --- a/docusign/src/chunked_uploads.rs +++ b/docusign/src/chunked_uploads.rs @@ -26,7 +26,7 @@ impl ChunkedUploads { &self, account_id: &str, body: &crate::types::ChunkedUploadRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/chunked_uploads", @@ -64,7 +64,7 @@ impl ChunkedUploads { account_id: &str, chunked_upload_id: &str, include: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include.is_empty() { query_args.push(("include".to_string(), include.to_string())); @@ -111,7 +111,7 @@ impl ChunkedUploads { account_id: &str, chunked_upload_id: &str, action: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !action.is_empty() { query_args.push(("action".to_string(), action.to_string())); @@ -160,7 +160,7 @@ impl ChunkedUploads { &self, account_id: &str, chunked_upload_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/chunked_uploads/{}", @@ -214,7 +214,7 @@ impl ChunkedUploads { chunked_upload_id: &str, chunked_upload_part_seq: &str, body: &crate::types::ChunkedUploadRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/chunked_uploads/{}/{}", diff --git a/docusign/src/cloud_storage.rs b/docusign/src/cloud_storage.rs index 411f50ae..e024e1b9 100644 --- a/docusign/src/cloud_storage.rs +++ b/docusign/src/cloud_storage.rs @@ -57,7 +57,7 @@ impl CloudStorage { order_by: &str, search_text: &str, start_position: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cloud_storage_folder_path.is_empty() { query_args.push(( @@ -153,7 +153,7 @@ impl CloudStorage { order_by: &str, search_text: &str, start_position: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cloud_storage_folder_path.is_empty() { query_args.push(( diff --git a/docusign/src/cloud_storage_providers.rs b/docusign/src/cloud_storage_providers.rs index 6a7c1895..afb7ea0a 100644 --- a/docusign/src/cloud_storage_providers.rs +++ b/docusign/src/cloud_storage_providers.rs @@ -34,7 +34,7 @@ impl CloudStorageProviders { account_id: &str, user_id: &str, redirect_url: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !redirect_url.is_empty() { query_args.push(("redirectUrl".to_string(), redirect_url.to_string())); @@ -77,7 +77,7 @@ impl CloudStorageProviders { account_id: &str, user_id: &str, body: &crate::types::CloudStorageProvidersData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}/cloud_storage", @@ -114,7 +114,7 @@ impl CloudStorageProviders { account_id: &str, user_id: &str, body: &crate::types::CloudStorageProvidersData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}/cloud_storage", @@ -159,7 +159,7 @@ impl CloudStorageProviders { service_id: &str, user_id: &str, redirect_url: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !redirect_url.is_empty() { query_args.push(("redirectUrl".to_string(), redirect_url.to_string())); @@ -206,7 +206,7 @@ impl CloudStorageProviders { account_id: &str, service_id: &str, user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}/cloud_storage/{}", diff --git a/docusign/src/comments.rs b/docusign/src/comments.rs index eb94fb5f..9c6b53e3 100644 --- a/docusign/src/comments.rs +++ b/docusign/src/comments.rs @@ -31,7 +31,7 @@ impl Comments { account_id: &str, envelope_id: &str, encoding: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !encoding.is_empty() { query_args.push(("encoding".to_string(), encoding.to_string())); diff --git a/docusign/src/connect_configurations.rs b/docusign/src/connect_configurations.rs index 9facabb7..f4c20988 100644 --- a/docusign/src/connect_configurations.rs +++ b/docusign/src/connect_configurations.rs @@ -27,7 +27,7 @@ impl ConnectConfigurations { pub async fn connect_get_config( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/connect", @@ -62,7 +62,7 @@ impl ConnectConfigurations { &self, account_id: &str, body: &crate::types::ConnectCustomConfiguration, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/connect", @@ -98,7 +98,7 @@ impl ConnectConfigurations { &self, account_id: &str, body: &crate::types::ConnectCustomConfiguration, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/connect", @@ -135,7 +135,7 @@ impl ConnectConfigurations { &self, account_id: &str, connect_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/connect/{}", @@ -175,7 +175,7 @@ impl ConnectConfigurations { &self, account_id: &str, connect_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/connect/{}", @@ -233,7 +233,7 @@ impl ConnectConfigurations { start_position: &str, status: &str, user_name_substring: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !count.is_empty() { query_args.push(("count".to_string(), count.to_string())); diff --git a/docusign/src/connect_events.rs b/docusign/src/connect_events.rs index feb2707e..c0054728 100644 --- a/docusign/src/connect_events.rs +++ b/docusign/src/connect_events.rs @@ -27,7 +27,7 @@ impl ConnectEvents { &self, account_id: &str, body: &crate::types::ConnectFailureFilter, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/connect/envelopes/retry_queue", @@ -61,7 +61,7 @@ impl ConnectEvents { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/connect/envelopes/{}/retry_queue", @@ -102,7 +102,7 @@ impl ConnectEvents { account_id: &str, from_date: &str, to_date: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from_date.is_empty() { query_args.push(("from_date".to_string(), from_date.to_string())); @@ -145,7 +145,7 @@ impl ConnectEvents { &self, account_id: &str, failure_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/connect/failures/{}", @@ -188,7 +188,7 @@ impl ConnectEvents { account_id: &str, from_date: &str, to_date: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from_date.is_empty() { query_args.push(("from_date".to_string(), from_date.to_string())); @@ -226,7 +226,10 @@ impl ConnectEvents { * * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn connect_log_delete_logs(&self, account_id: &str) -> ClientResult<()> { + pub async fn connect_log_delete_logs( + &self, + account_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/connect/logs", @@ -264,7 +267,7 @@ impl ConnectEvents { account_id: &str, log_id: &str, additional_info: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !additional_info.is_empty() { query_args.push(("additional_info".to_string(), additional_info.to_string())); @@ -302,7 +305,11 @@ impl ConnectEvents { * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. * * `log_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn connect_log_delete(&self, account_id: &str, log_id: &str) -> ClientResult<()> { + pub async fn connect_log_delete( + &self, + account_id: &str, + log_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/connect/logs/{}", diff --git a/docusign/src/connect_secret.rs b/docusign/src/connect_secret.rs index 2330f0ea..ac963a80 100644 --- a/docusign/src/connect_secret.rs +++ b/docusign/src/connect_secret.rs @@ -27,7 +27,7 @@ impl ConnectSecret { &self, account_id: &str, key_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/connect/secret/{}", diff --git a/docusign/src/contacts.rs b/docusign/src/contacts.rs index dd24366c..e287ca5a 100644 --- a/docusign/src/contacts.rs +++ b/docusign/src/contacts.rs @@ -26,7 +26,7 @@ impl Contacts { &self, account_id: &str, body: &crate::types::ContactModRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/contacts", @@ -61,7 +61,7 @@ impl Contacts { &self, account_id: &str, body: &crate::types::ContactModRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/contacts", @@ -94,7 +94,7 @@ impl Contacts { &self, account_id: &str, body: &crate::types::ContactModRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/contacts", @@ -144,7 +144,7 @@ impl Contacts { account_id: &str, contact_id: &str, cloud_provider: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cloud_provider.is_empty() { query_args.push(("cloud_provider".to_string(), cloud_provider.to_string())); @@ -185,7 +185,7 @@ impl Contacts { &self, account_id: &str, contact_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/contacts/{}", diff --git a/docusign/src/custom_tabs.rs b/docusign/src/custom_tabs.rs index f21049e1..f32c5286 100644 --- a/docusign/src/custom_tabs.rs +++ b/docusign/src/custom_tabs.rs @@ -27,7 +27,7 @@ impl CustomTabs { &self, account_id: &str, custom_tab_only: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_tab_only.is_empty() { query_args.push(("custom_tab_only".to_string(), custom_tab_only.to_string())); @@ -68,7 +68,7 @@ impl CustomTabs { &self, account_id: &str, body: &crate::types::TabMetadata, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/tab_definitions", @@ -102,7 +102,7 @@ impl CustomTabs { &self, account_id: &str, custom_tab_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/tab_definitions/{}", @@ -140,7 +140,7 @@ impl CustomTabs { account_id: &str, custom_tab_id: &str, body: &crate::types::TabMetadata, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/tab_definitions/{}", @@ -175,7 +175,7 @@ impl CustomTabs { &self, account_id: &str, custom_tab_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/tab_definitions/{}", diff --git a/docusign/src/document_responsive_html_preview.rs b/docusign/src/document_responsive_html_preview.rs index b366c05d..78fe2b91 100644 --- a/docusign/src/document_responsive_html_preview.rs +++ b/docusign/src/document_responsive_html_preview.rs @@ -36,7 +36,7 @@ impl DocumentResponsiveHtmlPreview { document_id: &str, envelope_id: &str, body: &crate::types::DocumentHtmlDefinition, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/documents/{}/responsive_html_preview", diff --git a/docusign/src/e_note_configurations.rs b/docusign/src/e_note_configurations.rs index 98e4510f..17abe151 100644 --- a/docusign/src/e_note_configurations.rs +++ b/docusign/src/e_note_configurations.rs @@ -22,7 +22,10 @@ impl ENoteConfigurations { * * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn get(&self, account_id: &str) -> ClientResult { + pub async fn get( + &self, + account_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/settings/enote_configuration", @@ -55,7 +58,7 @@ impl ENoteConfigurations { &self, account_id: &str, body: &crate::types::ENoteConfiguration, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/settings/enote_configuration", @@ -84,7 +87,7 @@ impl ENoteConfigurations { * * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn delete(&self, account_id: &str) -> ClientResult<()> { + pub async fn delete(&self, account_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/settings/enote_configuration", diff --git a/docusign/src/envelope_attachments.rs b/docusign/src/envelope_attachments.rs index 6892f2e2..d25262cd 100644 --- a/docusign/src/envelope_attachments.rs +++ b/docusign/src/envelope_attachments.rs @@ -27,7 +27,7 @@ impl EnvelopeAttachments { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/attachments", @@ -63,7 +63,7 @@ impl EnvelopeAttachments { account_id: &str, envelope_id: &str, body: &crate::types::EnvelopeAttachmentsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/attachments", @@ -99,7 +99,7 @@ impl EnvelopeAttachments { account_id: &str, envelope_id: &str, body: &crate::types::EnvelopeAttachmentsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/attachments", @@ -136,7 +136,7 @@ impl EnvelopeAttachments { account_id: &str, attachment_id: &str, envelope_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/attachments/{}", @@ -175,7 +175,7 @@ impl EnvelopeAttachments { attachment_id: &str, envelope_id: &str, body: &crate::types::Attachment, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/attachments/{}", diff --git a/docusign/src/envelope_consumer_disclosures.rs b/docusign/src/envelope_consumer_disclosures.rs index e1554a77..5caa66ab 100644 --- a/docusign/src/envelope_consumer_disclosures.rs +++ b/docusign/src/envelope_consumer_disclosures.rs @@ -81,7 +81,7 @@ impl EnvelopeConsumerDisclosures { envelope_id: &str, recipient_id: &str, lang_code: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !lang_code.is_empty() { query_args.push(("langCode".to_string(), lang_code.to_string())); @@ -222,7 +222,7 @@ impl EnvelopeConsumerDisclosures { envelope_id: &str, lang_code: &str, recipient_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/recipients/{}/consumer_disclosure/{}", diff --git a/docusign/src/envelope_custom_fields.rs b/docusign/src/envelope_custom_fields.rs index 35456ce7..be857750 100644 --- a/docusign/src/envelope_custom_fields.rs +++ b/docusign/src/envelope_custom_fields.rs @@ -29,7 +29,7 @@ impl EnvelopeCustomFields { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/custom_fields", @@ -68,7 +68,7 @@ impl EnvelopeCustomFields { account_id: &str, envelope_id: &str, body: &crate::types::EnvelopeCustomFields, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/custom_fields", @@ -107,7 +107,7 @@ impl EnvelopeCustomFields { account_id: &str, envelope_id: &str, body: &crate::types::EnvelopeCustomFields, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/custom_fields", @@ -143,7 +143,7 @@ impl EnvelopeCustomFields { account_id: &str, envelope_id: &str, body: &crate::types::EnvelopeCustomFields, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/custom_fields", diff --git a/docusign/src/envelope_document_fields.rs b/docusign/src/envelope_document_fields.rs index e01e9ca9..a1a2142f 100644 --- a/docusign/src/envelope_document_fields.rs +++ b/docusign/src/envelope_document_fields.rs @@ -29,7 +29,7 @@ impl EnvelopeDocumentFields { account_id: &str, document_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/documents/{}/fields", @@ -68,7 +68,7 @@ impl EnvelopeDocumentFields { document_id: &str, envelope_id: &str, body: &crate::types::EnvelopeDocumentFields, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/documents/{}/fields", @@ -107,7 +107,7 @@ impl EnvelopeDocumentFields { document_id: &str, envelope_id: &str, body: &crate::types::EnvelopeDocumentFields, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/documents/{}/fields", @@ -146,7 +146,7 @@ impl EnvelopeDocumentFields { document_id: &str, envelope_id: &str, body: &crate::types::EnvelopeDocumentFields, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/documents/{}/fields", diff --git a/docusign/src/envelope_document_html_definitions.rs b/docusign/src/envelope_document_html_definitions.rs index 63f12b26..5b6f66ce 100644 --- a/docusign/src/envelope_document_html_definitions.rs +++ b/docusign/src/envelope_document_html_definitions.rs @@ -30,7 +30,7 @@ impl EnvelopeDocumentHtmlDefinitions { account_id: &str, document_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/documents/{}/html_definitions", diff --git a/docusign/src/envelope_document_tabs.rs b/docusign/src/envelope_document_tabs.rs index 107df83f..8fd11cd7 100644 --- a/docusign/src/envelope_document_tabs.rs +++ b/docusign/src/envelope_document_tabs.rs @@ -31,7 +31,7 @@ impl EnvelopeDocumentTabs { document_id: &str, envelope_id: &str, page_number: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/documents/{}/pages/{}/tabs", @@ -78,7 +78,7 @@ impl EnvelopeDocumentTabs { envelope_id: &str, include_metadata: &str, page_numbers: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_metadata.is_empty() { query_args.push(("include_metadata".to_string(), include_metadata.to_string())); @@ -126,7 +126,7 @@ impl EnvelopeDocumentTabs { document_id: &str, envelope_id: &str, body: &crate::types::Tabs, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/documents/{}/tabs", @@ -165,7 +165,7 @@ impl EnvelopeDocumentTabs { document_id: &str, envelope_id: &str, body: &crate::types::Tabs, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/documents/{}/tabs", @@ -204,7 +204,7 @@ impl EnvelopeDocumentTabs { document_id: &str, envelope_id: &str, body: &crate::types::Tabs, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/documents/{}/tabs", diff --git a/docusign/src/envelope_document_visibility.rs b/docusign/src/envelope_document_visibility.rs index 05c638d6..0f0178f5 100644 --- a/docusign/src/envelope_document_visibility.rs +++ b/docusign/src/envelope_document_visibility.rs @@ -29,7 +29,7 @@ impl EnvelopeDocumentVisibility { account_id: &str, envelope_id: &str, recipient_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/recipients/{}/document_visibility", @@ -70,7 +70,7 @@ impl EnvelopeDocumentVisibility { envelope_id: &str, recipient_id: &str, body: &crate::types::DocumentVisibilityList, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/recipients/{}/document_visibility", diff --git a/docusign/src/envelope_documents.rs b/docusign/src/envelope_documents.rs index 2b8cb52c..2ff3a0bd 100644 --- a/docusign/src/envelope_documents.rs +++ b/docusign/src/envelope_documents.rs @@ -39,7 +39,7 @@ impl EnvelopeDocuments { include_tabs: &str, recipient_id: &str, shared_user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !documents_by_userid.is_empty() { query_args.push(( @@ -111,7 +111,7 @@ impl EnvelopeDocuments { account_id: &str, envelope_id: &str, body: &crate::types::EnvelopeDefinition, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/documents", @@ -170,7 +170,7 @@ impl EnvelopeDocuments { account_id: &str, envelope_id: &str, body: &crate::types::EnvelopeDefinition, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/documents", @@ -229,7 +229,7 @@ impl EnvelopeDocuments { shared_user_id: &str, show_changes: &str, watermark: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !certificate.is_empty() { query_args.push(("certificate".to_string(), certificate.to_string())); @@ -316,7 +316,7 @@ impl EnvelopeDocuments { account_id: &str, document_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/documents/{}", diff --git a/docusign/src/envelope_email_settings.rs b/docusign/src/envelope_email_settings.rs index 2ca517e1..73615e30 100644 --- a/docusign/src/envelope_email_settings.rs +++ b/docusign/src/envelope_email_settings.rs @@ -27,7 +27,7 @@ impl EnvelopeEmailSettings { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/email_settings", @@ -65,7 +65,7 @@ impl EnvelopeEmailSettings { account_id: &str, envelope_id: &str, body: &crate::types::EmailSettings, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/email_settings", @@ -103,7 +103,7 @@ impl EnvelopeEmailSettings { account_id: &str, envelope_id: &str, body: &crate::types::EmailSettings, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/email_settings", @@ -138,7 +138,7 @@ impl EnvelopeEmailSettings { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/email_settings", diff --git a/docusign/src/envelope_form_data.rs b/docusign/src/envelope_form_data.rs index a72d2537..e5d220fd 100644 --- a/docusign/src/envelope_form_data.rs +++ b/docusign/src/envelope_form_data.rs @@ -29,7 +29,7 @@ impl EnvelopeFormData { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/form_data", diff --git a/docusign/src/envelope_html_definitions.rs b/docusign/src/envelope_html_definitions.rs index 6d74f674..c3740ec2 100644 --- a/docusign/src/envelope_html_definitions.rs +++ b/docusign/src/envelope_html_definitions.rs @@ -27,7 +27,7 @@ impl EnvelopeHtmlDefinitions { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/html_definitions", diff --git a/docusign/src/envelope_locks.rs b/docusign/src/envelope_locks.rs index 48768108..e26484bf 100644 --- a/docusign/src/envelope_locks.rs +++ b/docusign/src/envelope_locks.rs @@ -39,7 +39,7 @@ impl EnvelopeLocks { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/lock", @@ -97,7 +97,7 @@ impl EnvelopeLocks { account_id: &str, envelope_id: &str, body: &crate::types::LockRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/lock", @@ -189,7 +189,7 @@ impl EnvelopeLocks { account_id: &str, envelope_id: &str, body: &crate::types::LockRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/lock", @@ -240,7 +240,7 @@ impl EnvelopeLocks { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/lock", diff --git a/docusign/src/envelope_recipient_tabs.rs b/docusign/src/envelope_recipient_tabs.rs index 05141cd7..bc7486ae 100644 --- a/docusign/src/envelope_recipient_tabs.rs +++ b/docusign/src/envelope_recipient_tabs.rs @@ -39,7 +39,7 @@ impl EnvelopeRecipientTabs { recipient_id: &str, include_anchor_tab_locations: &str, include_metadata: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_anchor_tab_locations.is_empty() { query_args.push(( @@ -93,7 +93,7 @@ impl EnvelopeRecipientTabs { envelope_id: &str, recipient_id: &str, body: &crate::types::EnvelopeRecipientTabs, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/recipients/{}/tabs", @@ -132,7 +132,7 @@ impl EnvelopeRecipientTabs { envelope_id: &str, recipient_id: &str, body: &crate::types::EnvelopeRecipientTabs, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/recipients/{}/tabs", @@ -171,7 +171,7 @@ impl EnvelopeRecipientTabs { envelope_id: &str, recipient_id: &str, body: &crate::types::EnvelopeRecipientTabs, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/recipients/{}/tabs", diff --git a/docusign/src/envelope_recipients.rs b/docusign/src/envelope_recipients.rs index d7b58f36..5bafc4f3 100644 --- a/docusign/src/envelope_recipients.rs +++ b/docusign/src/envelope_recipients.rs @@ -37,7 +37,7 @@ impl EnvelopeRecipients { include_extended: &str, include_metadata: &str, include_tabs: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_anchor_tab_locations.is_empty() { query_args.push(( @@ -126,7 +126,7 @@ impl EnvelopeRecipients { offline_signing: &str, resend_envelope: &str, body: &crate::types::EnvelopeRecipients, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !combine_same_order_recipients.is_empty() { query_args.push(( @@ -181,7 +181,7 @@ impl EnvelopeRecipients { envelope_id: &str, resend_envelope: &str, body: &crate::types::EnvelopeRecipients, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !resend_envelope.is_empty() { query_args.push(("resend_envelope".to_string(), resend_envelope.to_string())); @@ -225,7 +225,7 @@ impl EnvelopeRecipients { account_id: &str, envelope_id: &str, body: &crate::types::EnvelopeRecipients, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/recipients", @@ -263,7 +263,7 @@ impl EnvelopeRecipients { account_id: &str, envelope_id: &str, body: &crate::types::DocumentVisibilityList, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/recipients/document_visibility", @@ -302,7 +302,7 @@ impl EnvelopeRecipients { account_id: &str, envelope_id: &str, recipient_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/recipients/{}", @@ -340,7 +340,7 @@ impl EnvelopeRecipients { account_id: &str, envelope_id: &str, recipient_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/recipients/{}/identity_proof_token", @@ -391,7 +391,7 @@ impl EnvelopeRecipients { account_id: &str, envelope_id: &str, recipient_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/recipients/{}/views/identity_manual_review", @@ -430,7 +430,7 @@ impl EnvelopeRecipients { account_id: &str, envelope_id: &str, body: &crate::types::RecipientPreviewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/views/recipient_preview", diff --git a/docusign/src/envelope_templates.rs b/docusign/src/envelope_templates.rs index 720c6579..42e07f46 100644 --- a/docusign/src/envelope_templates.rs +++ b/docusign/src/envelope_templates.rs @@ -36,7 +36,7 @@ impl EnvelopeTemplates { document_id: &str, envelope_id: &str, include: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include.is_empty() { query_args.push(("include".to_string(), include.to_string())); @@ -83,7 +83,7 @@ impl EnvelopeTemplates { envelope_id: &str, preserve_template_recipient: &str, body: &crate::types::DocumentTemplateList, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !preserve_template_recipient.is_empty() { query_args.push(( @@ -132,7 +132,7 @@ impl EnvelopeTemplates { document_id: &str, envelope_id: &str, template_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/documents/{}/templates/{}", @@ -172,7 +172,7 @@ impl EnvelopeTemplates { account_id: &str, envelope_id: &str, include: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include.is_empty() { query_args.push(("include".to_string(), include.to_string())); @@ -216,7 +216,7 @@ impl EnvelopeTemplates { envelope_id: &str, preserve_template_recipient: &str, body: &crate::types::DocumentTemplateList, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !preserve_template_recipient.is_empty() { query_args.push(( diff --git a/docusign/src/envelope_transfer_rules.rs b/docusign/src/envelope_transfer_rules.rs index bb9fe8aa..3f7d1c48 100644 --- a/docusign/src/envelope_transfer_rules.rs +++ b/docusign/src/envelope_transfer_rules.rs @@ -31,7 +31,7 @@ impl EnvelopeTransferRules { account_id: &str, count: &str, start_position: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !count.is_empty() { query_args.push(("count".to_string(), count.to_string())); @@ -75,7 +75,7 @@ impl EnvelopeTransferRules { &self, account_id: &str, body: &crate::types::EnvelopeTransferRuleInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/transfer_rules", @@ -119,7 +119,7 @@ impl EnvelopeTransferRules { &self, account_id: &str, body: &crate::types::EnvelopeTransferRuleRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/transfer_rules", @@ -158,7 +158,7 @@ impl EnvelopeTransferRules { account_id: &str, envelope_transfer_rule_id: &str, body: &crate::types::EnvelopeTransferRule, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/transfer_rules/{}", @@ -195,7 +195,7 @@ impl EnvelopeTransferRules { &self, account_id: &str, envelope_transfer_rule_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/transfer_rules/{}", diff --git a/docusign/src/envelope_views.rs b/docusign/src/envelope_views.rs index b0275614..855965c3 100644 --- a/docusign/src/envelope_views.rs +++ b/docusign/src/envelope_views.rs @@ -43,7 +43,7 @@ impl EnvelopeViews { account_id: &str, envelope_id: &str, body: &crate::types::CorrectViewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/views/correct", @@ -79,7 +79,7 @@ impl EnvelopeViews { account_id: &str, envelope_id: &str, body: &crate::types::CorrectViewRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/views/correct", @@ -132,7 +132,7 @@ impl EnvelopeViews { account_id: &str, envelope_id: &str, body: &crate::types::ReturnUrlRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/views/edit", @@ -194,7 +194,7 @@ impl EnvelopeViews { account_id: &str, envelope_id: &str, body: &crate::types::RecipientViewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/views/recipient", @@ -258,7 +258,7 @@ impl EnvelopeViews { account_id: &str, envelope_id: &str, body: &crate::types::ReturnUrlRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/views/sender", @@ -299,7 +299,7 @@ impl EnvelopeViews { account_id: &str, envelope_id: &str, body: &crate::types::RecipientViewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/views/shared", @@ -338,7 +338,7 @@ impl EnvelopeViews { &self, account_id: &str, body: &crate::types::ConsoleViewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/views/console", diff --git a/docusign/src/envelope_workflow_definition.rs b/docusign/src/envelope_workflow_definition.rs index 323766d2..c410a8a3 100644 --- a/docusign/src/envelope_workflow_definition.rs +++ b/docusign/src/envelope_workflow_definition.rs @@ -27,7 +27,7 @@ impl EnvelopeWorkflowDefinition { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/workflow", @@ -63,7 +63,7 @@ impl EnvelopeWorkflowDefinition { account_id: &str, envelope_id: &str, body: &crate::types::Workflow, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/workflow", @@ -95,7 +95,11 @@ impl EnvelopeWorkflowDefinition { * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. * * `envelope_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn delete(&self, account_id: &str, envelope_id: &str) -> ClientResult<()> { + pub async fn delete( + &self, + account_id: &str, + envelope_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/workflow", @@ -130,7 +134,7 @@ impl EnvelopeWorkflowDefinition { &self, account_id: &str, template_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/workflow", @@ -166,7 +170,7 @@ impl EnvelopeWorkflowDefinition { account_id: &str, template_id: &str, body: &crate::types::Workflow, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/workflow", @@ -197,7 +201,11 @@ impl EnvelopeWorkflowDefinition { * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. * * `template_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn delete_template(&self, account_id: &str, template_id: &str) -> ClientResult<()> { + pub async fn delete_template( + &self, + account_id: &str, + template_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/workflow", diff --git a/docusign/src/envelopes.rs b/docusign/src/envelopes.rs index 14a94751..a5e5c6ab 100644 --- a/docusign/src/envelopes.rs +++ b/docusign/src/envelopes.rs @@ -301,7 +301,7 @@ impl Envelopes { user_filter: &str, user_id: &str, user_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !ac_status.is_empty() { query_args.push(("ac_status".to_string(), ac_status.to_string())); @@ -521,7 +521,7 @@ impl Envelopes { completed_documents_only: &str, merge_roles_on_draft: &str, body: &crate::types::EnvelopeDefinition, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cdse_mode.is_empty() { query_args.push(("cdse_mode".to_string(), cdse_mode.to_string())); @@ -692,7 +692,7 @@ impl Envelopes { transaction_ids: &str, user_name: &str, body: &crate::types::EnvelopeIdsRequest, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !ac_status.is_empty() { query_args.push(("ac_status".to_string(), ac_status.to_string())); @@ -782,7 +782,7 @@ impl Envelopes { envelope_id: &str, advanced_update: &str, include: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !advanced_update.is_empty() { query_args.push(("advanced_update".to_string(), advanced_update.to_string())); @@ -995,7 +995,7 @@ impl Envelopes { advanced_update: &str, resend_envelope: &str, body: &crate::types::Envelope, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !advanced_update.is_empty() { query_args.push(("advanced_update".to_string(), advanced_update.to_string())); @@ -1039,7 +1039,7 @@ impl Envelopes { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/audit_events", @@ -1090,7 +1090,7 @@ impl Envelopes { nocache: &str, show_changes: &str, start_position: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !count.is_empty() { query_args.push(("count".to_string(), count.to_string())); @@ -1154,7 +1154,7 @@ impl Envelopes { document_id: &str, envelope_id: &str, page_number: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/documents/{}/pages/{}", @@ -1203,7 +1203,7 @@ impl Envelopes { max_height: &str, max_width: &str, show_changes: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !dpi.is_empty() { query_args.push(("dpi".to_string(), dpi.to_string())); @@ -1260,7 +1260,7 @@ impl Envelopes { envelope_id: &str, page_number: &str, body: &crate::types::PageRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/documents/{}/pages/{}/page_image", @@ -1297,7 +1297,7 @@ impl Envelopes { &self, account_id: &str, envelope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/notification", @@ -1335,7 +1335,7 @@ impl Envelopes { account_id: &str, envelope_id: &str, body: &crate::types::EnvelopeNotificationRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/notification", @@ -1382,7 +1382,7 @@ impl Envelopes { envelope_id: &str, recipient_id: &str, include_chrome: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_chrome.is_empty() { query_args.push(("include_chrome".to_string(), include_chrome.to_string())); @@ -1428,7 +1428,7 @@ impl Envelopes { account_id: &str, envelope_id: &str, recipient_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/recipients/{}/initials_image", @@ -1466,7 +1466,7 @@ impl Envelopes { account_id: &str, envelope_id: &str, recipient_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/recipients/{}/signature", @@ -1514,7 +1514,7 @@ impl Envelopes { envelope_id: &str, recipient_id: &str, include_chrome: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_chrome.is_empty() { query_args.push(("include_chrome".to_string(), include_chrome.to_string())); @@ -1560,7 +1560,7 @@ impl Envelopes { account_id: &str, envelope_id: &str, recipient_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/recipients/{}/signature_image", diff --git a/docusign/src/favorite_templates.rs b/docusign/src/favorite_templates.rs index 65f65c2b..0aa6536f 100644 --- a/docusign/src/favorite_templates.rs +++ b/docusign/src/favorite_templates.rs @@ -22,7 +22,10 @@ impl FavoriteTemplates { * * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn get(&self, account_id: &str) -> ClientResult { + pub async fn get( + &self, + account_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/favorite_templates", @@ -56,7 +59,7 @@ impl FavoriteTemplates { &self, account_id: &str, body: &crate::types::FavoriteTemplatesInfo, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/favorite_templates", @@ -89,7 +92,7 @@ impl FavoriteTemplates { &self, account_id: &str, body: &crate::types::FavoriteTemplatesInfo, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/favorite_templates", diff --git a/docusign/src/folders.rs b/docusign/src/folders.rs index ecc65336..e4f3afba 100644 --- a/docusign/src/folders.rs +++ b/docusign/src/folders.rs @@ -46,7 +46,7 @@ impl Folders { start_position: &str, template: &str, user_filter: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include.is_empty() { query_args.push(("include".to_string(), include.to_string())); @@ -114,7 +114,7 @@ impl Folders { start_position: &str, status: &str, to_date: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from_date.is_empty() { query_args.push(("from_date".to_string(), from_date.to_string())); @@ -182,7 +182,7 @@ impl Folders { account_id: &str, folder_id: &str, body: &crate::types::FoldersRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/folders/{}", @@ -239,7 +239,7 @@ impl Folders { order_by: &str, start_position: &str, to_date: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !all.is_empty() { query_args.push(("all".to_string(), all.to_string())); diff --git a/docusign/src/group_brands.rs b/docusign/src/group_brands.rs index e287e0ca..6dcbd812 100644 --- a/docusign/src/group_brands.rs +++ b/docusign/src/group_brands.rs @@ -27,7 +27,7 @@ impl GroupBrands { &self, account_id: &str, group_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/groups/{}/brands", @@ -63,7 +63,7 @@ impl GroupBrands { account_id: &str, group_id: &str, body: &crate::types::BrandsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/groups/{}/brands", @@ -99,7 +99,7 @@ impl GroupBrands { account_id: &str, group_id: &str, body: &crate::types::BrandsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/groups/{}/brands", diff --git a/docusign/src/group_users.rs b/docusign/src/group_users.rs index e6e6516e..7b652bb8 100644 --- a/docusign/src/group_users.rs +++ b/docusign/src/group_users.rs @@ -31,7 +31,7 @@ impl GroupUsers { group_id: &str, count: &str, start_position: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !count.is_empty() { query_args.push(("count".to_string(), count.to_string())); @@ -76,7 +76,7 @@ impl GroupUsers { account_id: &str, group_id: &str, body: &crate::types::UserInfoList, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/groups/{}/users", @@ -113,7 +113,7 @@ impl GroupUsers { account_id: &str, group_id: &str, body: &crate::types::UserInfoList, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/groups/{}/users", diff --git a/docusign/src/groups.rs b/docusign/src/groups.rs index 7c584b1e..d5483fe2 100644 --- a/docusign/src/groups.rs +++ b/docusign/src/groups.rs @@ -35,7 +35,7 @@ impl Groups { include_usercount: &str, search_text: &str, start_position: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !count.is_empty() { query_args.push(("count".to_string(), count.to_string())); @@ -89,7 +89,7 @@ impl Groups { &self, account_id: &str, body: &crate::types::GroupInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/groups", @@ -124,7 +124,7 @@ impl Groups { &self, account_id: &str, body: &crate::types::GroupInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/groups", @@ -171,7 +171,7 @@ impl Groups { &self, account_id: &str, body: &crate::types::GroupInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/groups", diff --git a/docusign/src/identity_verifications.rs b/docusign/src/identity_verifications.rs index ac2d23aa..b6b81ba0 100644 --- a/docusign/src/identity_verifications.rs +++ b/docusign/src/identity_verifications.rs @@ -27,7 +27,7 @@ impl IdentityVerifications { pub async fn account_get( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/identity_verification", diff --git a/docusign/src/invoices.rs b/docusign/src/invoices.rs index 1fe35d13..efb097ce 100644 --- a/docusign/src/invoices.rs +++ b/docusign/src/invoices.rs @@ -31,7 +31,7 @@ impl Invoices { account_id: &str, from_date: &str, to_date: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from_date.is_empty() { query_args.push(("from_date".to_string(), from_date.to_string())); @@ -107,7 +107,7 @@ impl Invoices { &self, account_id: &str, invoice_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/billing_invoices/{}", @@ -142,7 +142,7 @@ impl Invoices { pub async fn billing_get_past_due( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/billing_invoices_past_due", diff --git a/docusign/src/lib.rs b/docusign/src/lib.rs index 5f7915e1..708f780c 100644 --- a/docusign/src/lib.rs +++ b/docusign/src/lib.rs @@ -2181,9 +2181,27 @@ pub mod workspace_items; ///**Note**: Documents in a template are not individually listed as files. pub mod workspaces; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -2688,13 +2706,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -2707,7 +2726,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -2730,13 +2749,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -2757,7 +2777,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -2776,7 +2796,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -2801,6 +2825,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -2817,7 +2842,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -2842,7 +2867,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -2865,6 +2890,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -2881,7 +2907,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -2907,7 +2933,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -2950,6 +2976,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -2962,7 +2989,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -2985,7 +3012,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -2994,7 +3021,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -3002,7 +3029,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -3012,32 +3039,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -3049,7 +3080,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -3058,7 +3089,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -3066,7 +3097,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -3074,7 +3105,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -3082,7 +3113,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/docusign/src/notary.rs b/docusign/src/notary.rs index bbcca516..965f745d 100644 --- a/docusign/src/notary.rs +++ b/docusign/src/notary.rs @@ -26,7 +26,7 @@ impl Notary { pub async fn get( &self, include_jurisdictions: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_jurisdictions.is_empty() { query_args.push(( @@ -58,7 +58,7 @@ impl Notary { pub async fn put( &self, body: &crate::types::NotaryData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/v2.1/current_user/notary", None); self.client .put( @@ -80,7 +80,7 @@ impl Notary { pub async fn post( &self, body: &crate::types::NotaryData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/v2.1/current_user/notary", None); self.client .post( diff --git a/docusign/src/notary_journals.rs b/docusign/src/notary_journals.rs index 39c7ff5d..093b52e0 100644 --- a/docusign/src/notary_journals.rs +++ b/docusign/src/notary_journals.rs @@ -29,7 +29,7 @@ impl NotaryJournals { count: &str, search_text: &str, start_position: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !count.is_empty() { query_args.push(("count".to_string(), count.to_string())); diff --git a/docusign/src/notary_jurisdiction.rs b/docusign/src/notary_jurisdiction.rs index e1f5e4b8..ec5aab95 100644 --- a/docusign/src/notary_jurisdiction.rs +++ b/docusign/src/notary_jurisdiction.rs @@ -19,7 +19,9 @@ impl NotaryJurisdiction { * Returns a list of jurisdictions that the notary is registered in. * The current user must be a notary. */ - pub async fn s_get(&self) -> ClientResult { + pub async fn s_get( + &self, + ) -> ClientResult> { let url = self .client .url("/v2.1/current_user/notary/jurisdictions", None); @@ -43,7 +45,7 @@ impl NotaryJurisdiction { pub async fn s_post( &self, body: &crate::types::NotaryJurisdictionData, - ) -> ClientResult { + ) -> ClientResult> { let url = self .client .url("/v2.1/current_user/notary/jurisdictions", None); @@ -103,7 +105,7 @@ impl NotaryJurisdiction { pub async fn s_get_jurisdiction( &self, jurisdiction_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/current_user/notary/jurisdictions/{}", @@ -222,7 +224,7 @@ impl NotaryJurisdiction { &self, jurisdiction_id: &str, body: &crate::types::NotaryJurisdictionData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/current_user/notary/jurisdictions/{}", @@ -279,7 +281,10 @@ impl NotaryJurisdiction { * - `62 - Florida Commissioner of Deeds` * . */ - pub async fn s_delete_jurisdiction(&self, jurisdiction_id: &str) -> ClientResult<()> { + pub async fn s_delete_jurisdiction( + &self, + jurisdiction_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/current_user/notary/jurisdictions/{}", diff --git a/docusign/src/payment_gateway_accounts.rs b/docusign/src/payment_gateway_accounts.rs index 5ffc5de8..d53c7160 100644 --- a/docusign/src/payment_gateway_accounts.rs +++ b/docusign/src/payment_gateway_accounts.rs @@ -25,7 +25,7 @@ impl PaymentGatewayAccounts { pub async fn get_all( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/payment_gateway_accounts", diff --git a/docusign/src/payments.rs b/docusign/src/payments.rs index 3195ae71..6e69d0f6 100644 --- a/docusign/src/payments.rs +++ b/docusign/src/payments.rs @@ -31,7 +31,7 @@ impl Payments { account_id: &str, from_date: &str, to_date: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from_date.is_empty() { query_args.push(("from_date".to_string(), from_date.to_string())); @@ -80,7 +80,7 @@ impl Payments { &self, account_id: &str, body: &crate::types::BillingPaymentRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/billing_payments", @@ -116,7 +116,7 @@ impl Payments { &self, account_id: &str, payment_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/billing_payments/{}", diff --git a/docusign/src/power_form_data.rs b/docusign/src/power_form_data.rs index 4bb5f240..3e9139a3 100644 --- a/docusign/src/power_form_data.rs +++ b/docusign/src/power_form_data.rs @@ -49,7 +49,7 @@ impl PowerFormData { data_layout: &str, from_date: &str, to_date: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !data_layout.is_empty() { query_args.push(("data_layout".to_string(), data_layout.to_string())); diff --git a/docusign/src/power_forms.rs b/docusign/src/power_forms.rs index b56ac92e..7843e922 100644 --- a/docusign/src/power_forms.rs +++ b/docusign/src/power_forms.rs @@ -48,7 +48,7 @@ impl PowerForms { order: &str, order_by: &str, to_date: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from_date.is_empty() { query_args.push(("from_date".to_string(), from_date.to_string())); @@ -135,7 +135,7 @@ impl PowerForms { &self, account_id: &str, body: &crate::types::PowerForm, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/powerforms", @@ -168,7 +168,7 @@ impl PowerForms { &self, account_id: &str, body: &crate::types::PowerFormsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/powerforms", @@ -202,7 +202,7 @@ impl PowerForms { &self, account_id: &str, start_position: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !start_position.is_empty() { query_args.push(("start_position".to_string(), start_position.to_string())); @@ -242,7 +242,7 @@ impl PowerForms { &self, account_id: &str, power_form_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/powerforms/{}", @@ -278,7 +278,7 @@ impl PowerForms { account_id: &str, power_form_id: &str, body: &crate::types::PowerForm, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/powerforms/{}", @@ -309,7 +309,11 @@ impl PowerForms { * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. * * `power_form_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn delete_form(&self, account_id: &str, power_form_id: &str) -> ClientResult<()> { + pub async fn delete_form( + &self, + account_id: &str, + power_form_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/powerforms/{}", diff --git a/docusign/src/reports.rs b/docusign/src/reports.rs index 4697ce78..fe84d6c0 100644 --- a/docusign/src/reports.rs +++ b/docusign/src/reports.rs @@ -26,7 +26,7 @@ impl Reports { pub async fn product_get_list( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/reports", @@ -59,7 +59,7 @@ impl Reports { &self, account_id: &str, body: &crate::types::ReportInProductRunRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/reports", @@ -92,7 +92,7 @@ impl Reports { &self, account_id: &str, body: &crate::types::ReportInProductRunRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/reports/report_results", @@ -125,7 +125,7 @@ impl Reports { &self, account_id: &str, body: &crate::types::ReportInProductCsvRunRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/reports/report_results_csv", @@ -159,7 +159,7 @@ impl Reports { &self, account_id: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/reports/{}", @@ -195,7 +195,7 @@ impl Reports { account_id: &str, id: &str, body: &crate::types::ReportInProductRunRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/reports/{}", @@ -230,7 +230,7 @@ impl Reports { &self, account_id: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/reports/{}", diff --git a/docusign/src/request_logs.rs b/docusign/src/request_logs.rs index bea606b4..b3e31ab0 100644 --- a/docusign/src/request_logs.rs +++ b/docusign/src/request_logs.rs @@ -29,7 +29,7 @@ impl RequestLogs { pub async fn api_get_log( &self, encoding: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !encoding.is_empty() { query_args.push(("encoding".to_string(), encoding.to_string())); @@ -55,7 +55,7 @@ impl RequestLogs { * * Deletes the request log files. */ - pub async fn api_delete_logs(&self) -> ClientResult<()> { + pub async fn api_delete_logs(&self) -> ClientResult> { let url = self.client.url("/v2.1/diagnostics/request_logs", None); self.client .delete( @@ -84,7 +84,10 @@ impl RequestLogs { * * * `request_log_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn api_get(&self, request_log_id: &str) -> ClientResult { + pub async fn api_get( + &self, + request_log_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/diagnostics/request_logs/{}", @@ -114,7 +117,7 @@ impl RequestLogs { */ pub async fn api_get_setting( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/v2.1/diagnostics/settings", None); self.client .get( @@ -147,7 +150,7 @@ impl RequestLogs { pub async fn api_put_settings( &self, body: &crate::types::DiagnosticsSettingsInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/v2.1/diagnostics/settings", None); self.client .put( diff --git a/docusign/src/resources.rs b/docusign/src/resources.rs index 6e18ad97..b78662a9 100644 --- a/docusign/src/resources.rs +++ b/docusign/src/resources.rs @@ -26,7 +26,9 @@ impl Resources { * * Example: https://demo.docusign.net/restapi/help lists the REST API operations on the DocuSign Demo system with XML and JSON request and response samples. */ - pub async fn service_information_get(&self) -> ClientResult { + pub async fn service_information_get( + &self, + ) -> ClientResult> { let url = self.client.url("/v2.1", None); self.client .get( diff --git a/docusign/src/responsive_html_preview.rs b/docusign/src/responsive_html_preview.rs index def2e829..bfad0257 100644 --- a/docusign/src/responsive_html_preview.rs +++ b/docusign/src/responsive_html_preview.rs @@ -39,7 +39,7 @@ impl ResponsiveHtmlPreview { account_id: &str, envelope_id: &str, body: &crate::types::DocumentHtmlDefinition, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/responsive_html_preview", diff --git a/docusign/src/services.rs b/docusign/src/services.rs index 765e9f4b..fec2fb19 100644 --- a/docusign/src/services.rs +++ b/docusign/src/services.rs @@ -23,7 +23,9 @@ impl Services { * * You do not need an integrator key to view the REST API versions and resources. */ - pub async fn information_get(&self) -> ClientResult { + pub async fn information_get( + &self, + ) -> ClientResult> { let url = self.client.url("/service_information", None); self.client .get( diff --git a/docusign/src/signing_group_users.rs b/docusign/src/signing_group_users.rs index d95c61ef..1a7a34df 100644 --- a/docusign/src/signing_group_users.rs +++ b/docusign/src/signing_group_users.rs @@ -29,7 +29,7 @@ impl SigningGroupUsers { &self, account_id: &str, signing_group_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/signing_groups/{}/users", @@ -67,7 +67,7 @@ impl SigningGroupUsers { account_id: &str, signing_group_id: &str, body: &crate::types::SigningGroupUsersData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/signing_groups/{}/users", @@ -105,7 +105,7 @@ impl SigningGroupUsers { account_id: &str, signing_group_id: &str, body: &crate::types::SigningGroupUsersData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/signing_groups/{}/users", diff --git a/docusign/src/signing_groups.rs b/docusign/src/signing_groups.rs index 95153721..a578ce25 100644 --- a/docusign/src/signing_groups.rs +++ b/docusign/src/signing_groups.rs @@ -29,7 +29,7 @@ impl SigningGroups { account_id: &str, group_type: &str, include_users: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !group_type.is_empty() { query_args.push(("group_type".to_string(), group_type.to_string())); @@ -71,7 +71,7 @@ impl SigningGroups { &self, account_id: &str, body: &crate::types::SigningGroupInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/signing_groups", @@ -110,7 +110,7 @@ impl SigningGroups { &self, account_id: &str, body: &crate::types::SigningGroupInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/signing_groups", @@ -143,7 +143,7 @@ impl SigningGroups { &self, account_id: &str, body: &crate::types::SigningGroupInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/signing_groups", @@ -179,7 +179,7 @@ impl SigningGroups { &self, account_id: &str, signing_group_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/signing_groups/{}", @@ -217,7 +217,7 @@ impl SigningGroups { account_id: &str, signing_group_id: &str, body: &crate::types::SigningGroup, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/signing_groups/{}", diff --git a/docusign/src/tabs_blob.rs b/docusign/src/tabs_blob.rs index 2c76bf73..5f45b026 100644 --- a/docusign/src/tabs_blob.rs +++ b/docusign/src/tabs_blob.rs @@ -23,7 +23,11 @@ impl TabsBlob { * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. * * `envelope_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn get(&self, account_id: &str, envelope_id: &str) -> ClientResult<()> { + pub async fn get( + &self, + account_id: &str, + envelope_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/tabs_blob", @@ -54,7 +58,11 @@ impl TabsBlob { * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. * * `envelope_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn put(&self, account_id: &str, envelope_id: &str) -> ClientResult<()> { + pub async fn put( + &self, + account_id: &str, + envelope_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/envelopes/{}/tabs_blob", diff --git a/docusign/src/template_bulk_recipients.rs b/docusign/src/template_bulk_recipients.rs index 4fb919a7..042426f1 100644 --- a/docusign/src/template_bulk_recipients.rs +++ b/docusign/src/template_bulk_recipients.rs @@ -33,7 +33,7 @@ impl TemplateBulkRecipients { template_id: &str, include_tabs: &str, start_position: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_tabs.is_empty() { query_args.push(("include_tabs".to_string(), include_tabs.to_string())); @@ -83,7 +83,7 @@ impl TemplateBulkRecipients { recipient_id: &str, template_id: &str, body: &crate::types::BulkRecipientsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/recipients/{}/bulk_recipients", @@ -121,7 +121,7 @@ impl TemplateBulkRecipients { account_id: &str, recipient_id: &str, template_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/recipients/{}/bulk_recipients", diff --git a/docusign/src/template_custom_fields.rs b/docusign/src/template_custom_fields.rs index b6462007..b00cd498 100644 --- a/docusign/src/template_custom_fields.rs +++ b/docusign/src/template_custom_fields.rs @@ -27,7 +27,7 @@ impl TemplateCustomFields { &self, account_id: &str, template_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/custom_fields", @@ -65,7 +65,7 @@ impl TemplateCustomFields { account_id: &str, template_id: &str, body: &crate::types::TemplateCustomFieldsData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/custom_fields", @@ -101,7 +101,7 @@ impl TemplateCustomFields { account_id: &str, template_id: &str, body: &crate::types::TemplateCustomFieldsData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/custom_fields", @@ -137,7 +137,7 @@ impl TemplateCustomFields { account_id: &str, template_id: &str, body: &crate::types::TemplateCustomFieldsData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/custom_fields", diff --git a/docusign/src/template_document_fields.rs b/docusign/src/template_document_fields.rs index 39513ba4..3103b17a 100644 --- a/docusign/src/template_document_fields.rs +++ b/docusign/src/template_document_fields.rs @@ -29,7 +29,7 @@ impl TemplateDocumentFields { account_id: &str, document_id: &str, template_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/documents/{}/fields", @@ -68,7 +68,7 @@ impl TemplateDocumentFields { document_id: &str, template_id: &str, body: &crate::types::DocumentFieldsInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/documents/{}/fields", @@ -107,7 +107,7 @@ impl TemplateDocumentFields { document_id: &str, template_id: &str, body: &crate::types::DocumentFieldsInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/documents/{}/fields", @@ -146,7 +146,7 @@ impl TemplateDocumentFields { document_id: &str, template_id: &str, body: &crate::types::DocumentFieldsInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/documents/{}/fields", diff --git a/docusign/src/template_document_html_definitions.rs b/docusign/src/template_document_html_definitions.rs index c5ae8d0d..fd36ef7c 100644 --- a/docusign/src/template_document_html_definitions.rs +++ b/docusign/src/template_document_html_definitions.rs @@ -29,7 +29,7 @@ impl TemplateDocumentHtmlDefinitions { account_id: &str, document_id: &str, template_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/documents/{}/html_definitions", diff --git a/docusign/src/template_document_responsive_html_preview.rs b/docusign/src/template_document_responsive_html_preview.rs index d56a971f..7d2bd411 100644 --- a/docusign/src/template_document_responsive_html_preview.rs +++ b/docusign/src/template_document_responsive_html_preview.rs @@ -40,7 +40,7 @@ impl TemplateDocumentResponsiveHtmlPreview { document_id: &str, template_id: &str, body: &crate::types::DocumentHtmlDefinition, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/documents/{}/responsive_html_preview", diff --git a/docusign/src/template_document_tabs.rs b/docusign/src/template_document_tabs.rs index 3cb0a371..dbf00acb 100644 --- a/docusign/src/template_document_tabs.rs +++ b/docusign/src/template_document_tabs.rs @@ -31,7 +31,7 @@ impl TemplateDocumentTabs { document_id: &str, page_number: &str, template_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/documents/{}/pages/{}/tabs", @@ -74,7 +74,7 @@ impl TemplateDocumentTabs { document_id: &str, template_id: &str, page_numbers: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !page_numbers.is_empty() { query_args.push(("page_numbers".to_string(), page_numbers.to_string())); @@ -119,7 +119,7 @@ impl TemplateDocumentTabs { document_id: &str, template_id: &str, body: &crate::types::TemplateTabs, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/documents/{}/tabs", @@ -158,7 +158,7 @@ impl TemplateDocumentTabs { document_id: &str, template_id: &str, body: &crate::types::TemplateTabs, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/documents/{}/tabs", @@ -197,7 +197,7 @@ impl TemplateDocumentTabs { document_id: &str, template_id: &str, body: &crate::types::TemplateTabs, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/documents/{}/tabs", diff --git a/docusign/src/template_document_visibility.rs b/docusign/src/template_document_visibility.rs index dbcf1f6a..ae1427e5 100644 --- a/docusign/src/template_document_visibility.rs +++ b/docusign/src/template_document_visibility.rs @@ -31,7 +31,7 @@ impl TemplateDocumentVisibility { account_id: &str, template_id: &str, body: &crate::types::TemplateDocumentVisibilityList, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/recipients/document_visibility", @@ -68,7 +68,7 @@ impl TemplateDocumentVisibility { account_id: &str, recipient_id: &str, template_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/recipients/{}/document_visibility", @@ -109,7 +109,7 @@ impl TemplateDocumentVisibility { recipient_id: &str, template_id: &str, body: &crate::types::TemplateDocumentVisibilityList, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/recipients/{}/document_visibility", diff --git a/docusign/src/template_documents.rs b/docusign/src/template_documents.rs index db34c67e..6e8a6c93 100644 --- a/docusign/src/template_documents.rs +++ b/docusign/src/template_documents.rs @@ -29,7 +29,7 @@ impl TemplateDocuments { account_id: &str, template_id: &str, include_tabs: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_tabs.is_empty() { query_args.push(("include_tabs".to_string(), include_tabs.to_string())); @@ -71,7 +71,7 @@ impl TemplateDocuments { account_id: &str, template_id: &str, body: &crate::types::EnvelopeDefinition, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/documents", @@ -121,7 +121,7 @@ impl TemplateDocuments { account_id: &str, template_id: &str, body: &crate::types::EnvelopeDefinition, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/documents", @@ -164,7 +164,7 @@ impl TemplateDocuments { template_id: &str, encrypt: &str, show_changes: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !encrypt.is_empty() { query_args.push(("encrypt".to_string(), encrypt.to_string())); @@ -214,7 +214,7 @@ impl TemplateDocuments { template_id: &str, is_envelope_definition: &str, body: &crate::types::EnvelopeDefinition, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !is_envelope_definition.is_empty() { query_args.push(( diff --git a/docusign/src/template_html_definitions.rs b/docusign/src/template_html_definitions.rs index 13e783f8..f9cbab9a 100644 --- a/docusign/src/template_html_definitions.rs +++ b/docusign/src/template_html_definitions.rs @@ -27,7 +27,7 @@ impl TemplateHtmlDefinitions { &self, account_id: &str, template_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/html_definitions", diff --git a/docusign/src/template_locks.rs b/docusign/src/template_locks.rs index c77d7d73..e9abab2c 100644 --- a/docusign/src/template_locks.rs +++ b/docusign/src/template_locks.rs @@ -40,7 +40,7 @@ impl TemplateLocks { &self, account_id: &str, template_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/lock", @@ -98,7 +98,7 @@ impl TemplateLocks { account_id: &str, template_id: &str, body: &crate::types::LockRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/lock", @@ -190,7 +190,7 @@ impl TemplateLocks { account_id: &str, template_id: &str, body: &crate::types::LockRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/lock", @@ -243,7 +243,7 @@ impl TemplateLocks { account_id: &str, template_id: &str, body: &crate::types::LockRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/lock", diff --git a/docusign/src/template_recipient_tabs.rs b/docusign/src/template_recipient_tabs.rs index d0205d29..e0129c55 100644 --- a/docusign/src/template_recipient_tabs.rs +++ b/docusign/src/template_recipient_tabs.rs @@ -33,7 +33,7 @@ impl TemplateRecipientTabs { template_id: &str, include_anchor_tab_locations: &str, include_metadata: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_anchor_tab_locations.is_empty() { query_args.push(( @@ -84,7 +84,7 @@ impl TemplateRecipientTabs { recipient_id: &str, template_id: &str, body: &crate::types::TemplateTabs, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/recipients/{}/tabs", @@ -123,7 +123,7 @@ impl TemplateRecipientTabs { recipient_id: &str, template_id: &str, body: &crate::types::TemplateTabs, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/recipients/{}/tabs", @@ -162,7 +162,7 @@ impl TemplateRecipientTabs { recipient_id: &str, template_id: &str, body: &crate::types::TemplateTabs, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/recipients/{}/tabs", diff --git a/docusign/src/template_recipients.rs b/docusign/src/template_recipients.rs index 6fa1ee77..0e03b162 100644 --- a/docusign/src/template_recipients.rs +++ b/docusign/src/template_recipients.rs @@ -33,7 +33,7 @@ impl TemplateRecipients { include_anchor_tab_locations: &str, include_extended: &str, include_tabs: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_anchor_tab_locations.is_empty() { query_args.push(( @@ -90,7 +90,7 @@ impl TemplateRecipients { template_id: &str, resend_envelope: &str, body: &crate::types::TemplateRecipientsData, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !resend_envelope.is_empty() { query_args.push(("resend_envelope".to_string(), resend_envelope.to_string())); @@ -136,7 +136,7 @@ impl TemplateRecipients { template_id: &str, resend_envelope: &str, body: &crate::types::TemplateRecipientsData, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !resend_envelope.is_empty() { query_args.push(("resend_envelope".to_string(), resend_envelope.to_string())); @@ -178,7 +178,7 @@ impl TemplateRecipients { account_id: &str, template_id: &str, body: &crate::types::TemplateRecipientsData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/recipients", @@ -216,7 +216,7 @@ impl TemplateRecipients { recipient_id: &str, template_id: &str, body: &crate::types::TemplateRecipientsData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/recipients/{}", @@ -255,7 +255,7 @@ impl TemplateRecipients { account_id: &str, template_id: &str, body: &crate::types::RecipientPreviewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/views/recipient_preview", diff --git a/docusign/src/template_responsive_html_preview.rs b/docusign/src/template_responsive_html_preview.rs index 89e430b7..f8b9c043 100644 --- a/docusign/src/template_responsive_html_preview.rs +++ b/docusign/src/template_responsive_html_preview.rs @@ -38,7 +38,7 @@ impl TemplateResponsiveHtmlPreview { account_id: &str, template_id: &str, body: &crate::types::DocumentHtmlDefinition, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/responsive_html_preview", diff --git a/docusign/src/template_views.rs b/docusign/src/template_views.rs index 45bfcb8e..94dc9c51 100644 --- a/docusign/src/template_views.rs +++ b/docusign/src/template_views.rs @@ -28,7 +28,7 @@ impl TemplateViews { account_id: &str, template_id: &str, body: &crate::types::ReturnUrlRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/views/edit", diff --git a/docusign/src/templates.rs b/docusign/src/templates.rs index 33363f68..c9c135b6 100644 --- a/docusign/src/templates.rs +++ b/docusign/src/templates.rs @@ -116,7 +116,7 @@ impl Templates { used_to_date: &str, user_filter: &str, user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !count.is_empty() { query_args.push(("count".to_string(), count.to_string())); @@ -280,7 +280,7 @@ impl Templates { &self, account_id: &str, body: &crate::types::EnvelopeTemplate, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates", @@ -324,7 +324,7 @@ impl Templates { account_id: &str, template_id: &str, include: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include.is_empty() { query_args.push(("include".to_string(), include.to_string())); @@ -366,7 +366,7 @@ impl Templates { account_id: &str, template_id: &str, body: &crate::types::EnvelopeTemplate, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}", @@ -417,7 +417,7 @@ impl Templates { nocache: &str, show_changes: &str, start_position: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !count.is_empty() { query_args.push(("count".to_string(), count.to_string())); @@ -482,7 +482,7 @@ impl Templates { page_number: &str, template_id: &str, body: &crate::types::PageRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/documents/{}/pages/{}", @@ -531,7 +531,7 @@ impl Templates { max_height: &str, max_width: &str, show_changes: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !dpi.is_empty() { query_args.push(("dpi".to_string(), dpi.to_string())); @@ -588,7 +588,7 @@ impl Templates { page_number: &str, template_id: &str, body: &crate::types::PageRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/documents/{}/pages/{}/page_image", @@ -625,7 +625,7 @@ impl Templates { &self, account_id: &str, template_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/notification", @@ -661,7 +661,7 @@ impl Templates { account_id: &str, template_id: &str, body: &crate::types::TemplateNotificationRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/notification", @@ -701,7 +701,7 @@ impl Templates { template_id: &str, template_part: &str, body: &crate::types::GroupInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/{}", @@ -740,7 +740,7 @@ impl Templates { template_id: &str, template_part: &str, body: &crate::types::GroupInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/templates/{}/{}", diff --git a/docusign/src/user_custom_settings.rs b/docusign/src/user_custom_settings.rs index f11fca6a..709b9a08 100644 --- a/docusign/src/user_custom_settings.rs +++ b/docusign/src/user_custom_settings.rs @@ -42,7 +42,7 @@ impl UserCustomSettings { &self, account_id: &str, user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}/custom_settings", @@ -99,7 +99,7 @@ impl UserCustomSettings { account_id: &str, user_id: &str, body: &crate::types::CustomSettingsInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}/custom_settings", @@ -146,7 +146,7 @@ impl UserCustomSettings { account_id: &str, user_id: &str, body: &crate::types::CustomSettingsInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}/custom_settings", diff --git a/docusign/src/user_profiles.rs b/docusign/src/user_profiles.rs index 998f5593..08fe7078 100644 --- a/docusign/src/user_profiles.rs +++ b/docusign/src/user_profiles.rs @@ -30,7 +30,7 @@ impl UserProfiles { &self, account_id: &str, user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}/profile", @@ -69,7 +69,7 @@ impl UserProfiles { account_id: &str, user_id: &str, body: &crate::types::UserProfile, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}/profile", diff --git a/docusign/src/user_signatures.rs b/docusign/src/user_signatures.rs index 627a8964..095dcebf 100644 --- a/docusign/src/user_signatures.rs +++ b/docusign/src/user_signatures.rs @@ -40,7 +40,7 @@ impl UserSignatures { account_id: &str, user_id: &str, stamp_type: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !stamp_type.is_empty() { query_args.push(("stamp_type".to_string(), stamp_type.to_string())); @@ -83,7 +83,7 @@ impl UserSignatures { account_id: &str, user_id: &str, body: &crate::types::UserSignaturesInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}/signatures", @@ -138,7 +138,7 @@ impl UserSignatures { account_id: &str, user_id: &str, body: &crate::types::UserSignaturesInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}/signatures", @@ -182,7 +182,7 @@ impl UserSignatures { account_id: &str, signature_id: &str, user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}/signatures/{}", @@ -232,7 +232,7 @@ impl UserSignatures { user_id: &str, close_existing_signature: &str, body: &crate::types::UserSignatureDefinition, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !close_existing_signature.is_empty() { query_args.push(( @@ -286,7 +286,7 @@ impl UserSignatures { account_id: &str, signature_id: &str, user_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}/signatures/{}", @@ -340,7 +340,7 @@ impl UserSignatures { signature_id: &str, user_id: &str, include_chrome: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_chrome.is_empty() { query_args.push(("include_chrome".to_string(), include_chrome.to_string())); @@ -400,7 +400,7 @@ impl UserSignatures { signature_id: &str, user_id: &str, transparent_png: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !transparent_png.is_empty() { query_args.push(("transparent_png".to_string(), transparent_png.to_string())); @@ -459,7 +459,7 @@ impl UserSignatures { image_type: &str, signature_id: &str, user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}/signatures/{}/{}", diff --git a/docusign/src/users.rs b/docusign/src/users.rs index 8f81a7e0..69df8d22 100644 --- a/docusign/src/users.rs +++ b/docusign/src/users.rs @@ -62,7 +62,7 @@ impl Users { start_position: &str, status: &str, user_name_substring: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !additional_info.is_empty() { query_args.push(("additional_info".to_string(), additional_info.to_string())); @@ -137,7 +137,7 @@ impl Users { &self, account_id: &str, body: &crate::types::UserInformationList, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users", @@ -228,7 +228,7 @@ impl Users { &self, account_id: &str, body: &crate::types::NewUsersDefinition, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users", @@ -265,7 +265,7 @@ impl Users { account_id: &str, delete: &str, body: &crate::types::UserInfoList, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !delete.is_empty() { query_args.push(("delete".to_string(), delete.to_string())); @@ -312,7 +312,7 @@ impl Users { user_id: &str, additional_info: &str, email: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !additional_info.is_empty() { query_args.push(("additional_info".to_string(), additional_info.to_string())); @@ -358,7 +358,7 @@ impl Users { account_id: &str, user_id: &str, body: &crate::types::UserInformation, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}", @@ -400,7 +400,7 @@ impl Users { account_id: &str, user_id: &str, encoding: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !encoding.is_empty() { query_args.push(("encoding".to_string(), encoding.to_string())); @@ -440,7 +440,11 @@ impl Users { * * `user_id: &str` -- The ID of the user to access. Generally this is the ID of the current authenticated user, but if the authenticated user is an Administrator on the account, `userId` can represent another user whom the Administrator is accessing. * . */ - pub async fn profile_image_put(&self, account_id: &str, user_id: &str) -> ClientResult<()> { + pub async fn profile_image_put( + &self, + account_id: &str, + user_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}/profile/image", @@ -474,7 +478,11 @@ impl Users { * * `user_id: &str` -- The ID of the user to access. Generally this is the ID of the current authenticated user, but if the authenticated user is an Administrator on the account, `userId` can represent another user whom the Administrator is accessing. * . */ - pub async fn profile_image_delete(&self, account_id: &str, user_id: &str) -> ClientResult<()> { + pub async fn profile_image_delete( + &self, + account_id: &str, + user_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}/profile/image", @@ -520,7 +528,7 @@ impl Users { &self, account_id: &str, user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}/settings", @@ -557,7 +565,7 @@ impl Users { account_id: &str, user_id: &str, body: &crate::types::UserSettingsInformation, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/users/{}/settings", diff --git a/docusign/src/workspace_items.rs b/docusign/src/workspace_items.rs index 84b68cf6..fa0889dd 100644 --- a/docusign/src/workspace_items.rs +++ b/docusign/src/workspace_items.rs @@ -43,7 +43,7 @@ impl WorkspaceItems { include_user_detail: &str, start_position: &str, workspace_user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !count.is_empty() { query_args.push(("count".to_string(), count.to_string())); @@ -120,7 +120,7 @@ impl WorkspaceItems { folder_id: &str, workspace_id: &str, body: &crate::types::WorkspaceItemList, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/workspaces/{}/folders/{}", @@ -158,7 +158,7 @@ impl WorkspaceItems { account_id: &str, folder_id: &str, workspace_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/workspaces/{}/folders/{}/files", @@ -202,7 +202,7 @@ impl WorkspaceItems { workspace_id: &str, is_download: &str, pdf_version: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !is_download.is_empty() { query_args.push(("is_download".to_string(), is_download.to_string())); @@ -252,7 +252,7 @@ impl WorkspaceItems { file_id: &str, folder_id: &str, workspace_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/workspaces/{}/folders/{}/files/{}", @@ -303,7 +303,7 @@ impl WorkspaceItems { max_height: &str, max_width: &str, start_position: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !count.is_empty() { query_args.push(("count".to_string(), count.to_string())); diff --git a/docusign/src/workspaces.rs b/docusign/src/workspaces.rs index 603b3db7..b44dd85a 100644 --- a/docusign/src/workspaces.rs +++ b/docusign/src/workspaces.rs @@ -22,7 +22,10 @@ impl Workspaces { * * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. */ - pub async fn get(&self, account_id: &str) -> ClientResult { + pub async fn get( + &self, + account_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/workspaces", @@ -55,7 +58,7 @@ impl Workspaces { &self, account_id: &str, body: &crate::types::Workspace, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/workspaces", @@ -89,7 +92,7 @@ impl Workspaces { &self, account_id: &str, workspace_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/workspaces/{}", @@ -125,7 +128,7 @@ impl Workspaces { account_id: &str, workspace_id: &str, body: &crate::types::Workspace, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/workspaces/{}", @@ -160,7 +163,7 @@ impl Workspaces { &self, account_id: &str, workspace_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2.1/accounts/{}/workspaces/{}", diff --git a/generator/src/client.rs b/generator/src/client.rs index d5ab2532..dc15737f 100644 --- a/generator/src/client.rs +++ b/generator/src/client.rs @@ -23,7 +23,7 @@ impl Client { A: Into, C: Into>, { - let http = reqwest::Client::builder().build()?; + let http = reqwest::Client::builder().redirect(reqwest::redirect::Policy::none()).build()?; let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); let client = reqwest_middleware::ClientBuilder::new(http) // Trace HTTP requests. See the tracing crate to make use of these traces. @@ -181,10 +181,10 @@ impl Client { ) .await?; *token_guard = Some(crate::auth::ExpiringInstallationToken::new( - token.token.clone(), + token.body.token.clone(), created_at, )); - token.token + token.body.token } }; let auth = format!("token {}", token); @@ -194,47 +194,24 @@ impl Client { } } - async fn request( + async fn make_request( &self, method: http::Method, uri: &str, message: Message, media_type: crate::utils::MediaType, authentication: crate::auth::AuthenticationConstraint, - ) -> ClientResult<(Option, Out)> - where - Out: serde::de::DeserializeOwned + 'static + Send, - { - #[cfg(feature = "httpcache")] - let uri2 = uri.to_string(); - + ) -> ClientResult { let (url, auth) = self.url_and_auth(uri, authentication).await?; - let instance = <&Client>::clone(&self); - - #[cfg(not(feature = "httpcache"))] - let mut req = instance.client.request(method, url); - - #[cfg(feature = "httpcache")] - let mut req = { - let mut req = instance.client.request(method.clone(), url); - if method == http::Method::GET { - if let Ok(etag) = instance.http_cache.lookup_etag(&uri2) { - req = req.header(http::header::IF_NONE_MATCH, etag); - } - } - req - }; + let mut req = self.client.request(method, url); if let Some(content_type) = &message.content_type { req = req.header(http::header::CONTENT_TYPE, content_type.clone()); } - req = req.header(http::header::USER_AGENT, &*instance.agent); - req = req.header( - http::header::ACCEPT, - &media_type.to_string() - ); + req = req.header(http::header::USER_AGENT, &*self.agent); + req = req.header(http::header::ACCEPT, &media_type.to_string()); if let Some(auth_str) = auth { req = req.header(http::header::AUTHORIZATION, &*auth_str); @@ -243,13 +220,38 @@ impl Client { if let Some(body) = message.body { req = req.body(body); } - let response = req.send().await?; - #[cfg(feature = "httpcache")] - let instance2 = <&Client>::clone(&self); + Ok(req) + } + + async fn request( + &self, + method: http::Method, + uri: &str, + message: Message, + media_type: crate::utils::MediaType, + authentication: crate::auth::AuthenticationConstraint, + ) -> ClientResult<(Option, crate::Response)> + where + Out: serde::de::DeserializeOwned + 'static + Send, + { + #[cfg(not(feature = "httpcache"))] + let req = self.make_request(method.clone(), uri, message, media_type, authentication).await?; #[cfg(feature = "httpcache")] - let uri3 = uri.to_string(); + let req = { + let mut req = self.make_request(method.clone(), uri, message, media_type, authentication).await?; + + if method == http::Method::GET { + if let Ok(etag) = self.http_cache.lookup_etag(&uri) { + req = req.header(http::header::IF_NONE_MATCH, etag); + } + } + + req + }; + + let response = req.send().await?; #[cfg(not(feature = "httpcache"))] let (remaining, reset) = crate::utils::get_header_values(response.headers()); @@ -258,6 +260,7 @@ impl Client { let (remaining, reset, etag) = crate::utils::get_header_values(response.headers()); let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -272,8 +275,8 @@ impl Client { #[cfg(feature = "httpcache")] { if let Some(etag) = etag { - if let Err(e) = instance2.http_cache.cache_response( - &uri3, + if let Err(e) = self.http_cache.cache_response( + &uri, &response_body, &etag, &next_link.as_ref().map(|n| n.0.clone()), @@ -289,25 +292,43 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((next_link, parsed_response)) - } else if status == http::StatusCode::NOT_MODIFIED { - // only supported case is when client provides if-none-match - // header when cargo builds with --cfg feature="httpcache" - #[cfg(feature = "httpcache")] - { - let body = instance2.http_cache.lookup_body(&uri3).unwrap(); - let out = serde_json::from_str::(&body).unwrap(); - let link = match next_link { - Some(next_link) => Ok(Some(next_link)), - None => instance2.http_cache.lookup_next_link(&uri3) - .map(|next_link| next_link.map(crate::utils::NextLink)) - }; - link.map(|link| (link, out)) + Ok((next_link, crate::Response::new(status, headers, parsed_response))) + } else if status.is_redirection() { + match status { + http::StatusCode::NOT_MODIFIED => { + // only supported case is when client provides if-none-match + // header when cargo builds with --cfg feature="httpcache" + #[cfg(feature = "httpcache")] + { + let body = self.http_cache.lookup_body(&uri).unwrap(); + let out = serde_json::from_str::(&body).unwrap(); + let link = match next_link { + Some(next_link) => Ok(Some(next_link)), + None => self + .http_cache + .lookup_next_link(&uri) + .map(|next_link| next_link.map(crate::utils::NextLink)), + }; + link.map(|link| (link, Response::new(status, headers, out))) + } + #[cfg(not(feature = "httpcache"))] + { + unreachable!("this should not be reachable without the httpcache feature enabled") + } } - #[cfg(not(feature = "httpcache"))] - { - unreachable!("this should not be reachable without the httpcache feature enabled") + _ => { + // The body still needs to be parsed. Except in the case of 304 (handled above), + // returning a body in the response is allowed. + let body = if std::any::TypeId::of::() == std::any::TypeId::of::<()>() + { + serde_json::from_str("null")? + } else { + serde_json::from_slice::(&response_body)? + }; + + Ok((None, crate::Response::new(status, headers, body))) } + } } else { let error = match (remaining, reset) { (Some(remaining), Some(reset)) if remaining == 0 => { @@ -336,7 +357,7 @@ impl Client { message: Message, media_type: crate::utils::MediaType, authentication: crate::auth::AuthenticationConstraint, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -344,14 +365,14 @@ impl Client { Ok(r) } - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { self.get_media(uri, crate::utils::MediaType::Json, message).await } - async fn get_media(&self, uri: &str, media: crate::utils::MediaType, message: Message) -> ClientResult + async fn get_media(&self, uri: &str, media: crate::utils::MediaType, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -364,14 +385,14 @@ impl Client { ).await } - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { self.unfold(uri).await } - async fn get_pages(&self, uri: &str) -> ClientResult<(Option, Vec)> + async fn get_pages(&self, uri: &str) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -384,7 +405,7 @@ impl Client { ).await } - async fn get_pages_url(&self, url: &reqwest::Url) -> ClientResult<(Option, Vec)> + async fn get_pages_url(&self, url: &reqwest::Url) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -397,7 +418,7 @@ impl Client { ).await } - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -415,7 +436,7 @@ impl Client { message: Message, media: crate::utils::MediaType, authentication: crate::auth::AuthenticationConstraint, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -428,7 +449,7 @@ impl Client { ).await } - async fn patch_media(&self, uri: &str, message: Message, media: crate::utils::MediaType) -> ClientResult + async fn patch_media(&self, uri: &str, message: Message, media: crate::utils::MediaType) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -441,21 +462,21 @@ impl Client { ).await } - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { self.patch_media(uri, message, crate::utils::MediaType::Json).await } - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { self.put_media(uri, message, crate::utils::MediaType::Json).await } - async fn put_media(&self, uri: &str, message: Message, media: crate::utils::MediaType) -> ClientResult + async fn put_media(&self, uri: &str, message: Message, media: crate::utils::MediaType) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -468,7 +489,7 @@ impl Client { ).await } - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -485,25 +506,25 @@ impl Client { async fn unfold( &self, uri: &str, - ) -> ClientResult> + ) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new(response.status, response.headers, global_items)) }"#; pub fn generate_client_generic_token( @@ -1054,13 +1075,14 @@ async fn request( method: reqwest::Method, uri: &str, message: Message, -) -> ClientResult +) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, {{ let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -1071,7 +1093,7 @@ async fn request( }} else {{ serde_json::from_slice::(&response_body)? }}; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) }} else {{ let error = if response_body.is_empty() {{ ClientError::HttpError{{status: status, error: "empty response".into()}} @@ -1088,13 +1110,14 @@ async fn request_with_links( method: http::Method, uri: &str, message: Message, -) -> ClientResult<(Option, Out)> +) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, {{ let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -1113,7 +1136,7 @@ where }} else {{ serde_json::from_slice::(&response_body)? }}; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) }} else {{ let error = if response_body.is_empty() {{ ClientError::HttpError{{status: status, error: "empty response".into()}} @@ -1130,7 +1153,7 @@ async fn post_form( &self, uri: &str, form: reqwest::multipart::Form, -) -> ClientResult +) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, {{ @@ -1155,6 +1178,7 @@ async fn post_form( let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -1169,7 +1193,7 @@ async fn post_form( }} else {{ serde_json::from_slice::(&response_body)? }}; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) }} else {{ let error = if response_body.is_empty() {{ ClientError::HttpError{{status: status, error: "empty response".into()}} @@ -1188,7 +1212,7 @@ async fn request_with_accept_mime( method: reqwest::Method, uri: &str, accept_mime_type: &str, -) -> ClientResult +) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, {{ @@ -1211,6 +1235,7 @@ async fn request_with_accept_mime( let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -1225,7 +1250,7 @@ async fn request_with_accept_mime( }} else {{ serde_json::from_slice::(&response_body)? }}; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) }} else {{ let error = if response_body.is_empty() {{ ClientError::HttpError{{status: status, error: "empty response".into()}} @@ -1245,7 +1270,7 @@ async fn request_with_mime( uri: &str, content: &[u8], mime_type: &str, -) -> ClientResult +) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, {{ @@ -1287,6 +1312,7 @@ async fn request_with_mime( let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -1297,7 +1323,7 @@ async fn request_with_mime( }} else {{ serde_json::from_slice::(&response_body)? }}; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) }} else {{ let error = if response_body.is_empty() {{ ClientError::HttpError{{status: status, error: "empty response".into()}} @@ -1314,7 +1340,7 @@ async fn request_entity( method: http::Method, uri: &str, message: Message, -) -> ClientResult +) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, {{ @@ -1325,7 +1351,7 @@ where }} #[allow(dead_code)] -async fn get(&self, uri: &str, message: Message) -> ClientResult +async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, {{ @@ -1337,7 +1363,7 @@ where }} #[allow(dead_code)] -async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> +async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, {{ @@ -1350,29 +1376,29 @@ where async fn unfold( &self, uri: &str, -) -> ClientResult> +) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, {{ let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() {{ - global_items.append(&mut items); + while !response.body.is_empty() {{ + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() {{ + if let Some(url) = &link {{ let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; }} }} - Ok(global_items) + Ok(Response::new(response.status, response.headers, global_items)) }} #[allow(dead_code)] -async fn get_pages(&self, uri: &str) -> ClientResult<(Option, Vec)> +async fn get_pages(&self, uri: &str) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, {{ @@ -1384,7 +1410,7 @@ where }} #[allow(dead_code)] -async fn get_pages_url(&self, url: &reqwest::Url) -> ClientResult<(Option, Vec)> +async fn get_pages_url(&self, url: &reqwest::Url) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, {{ @@ -1396,7 +1422,7 @@ where }} #[allow(dead_code)] -async fn post(&self, uri: &str, message: Message) -> ClientResult +async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, {{ @@ -1408,7 +1434,7 @@ where }} #[allow(dead_code)] -async fn patch(&self, uri: &str, message: Message) -> ClientResult +async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, {{ @@ -1420,7 +1446,7 @@ where }} #[allow(dead_code)] -async fn put(&self, uri: &str, message: Message) -> ClientResult +async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, {{ @@ -1432,7 +1458,7 @@ where }} #[allow(dead_code)] -async fn delete(&self, uri: &str, message: Message) -> ClientResult +async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, {{ diff --git a/generator/src/functions.rs b/generator/src/functions.rs index 591e73e4..9e8c4093 100644 --- a/generator/src/functions.rs +++ b/generator/src/functions.rs @@ -126,7 +126,10 @@ pub fn generate_files( content.push_str(&format!("body: {}", bp)); } - content.push_str(&format!(") -> ClientResult<{}> {{", response_type)); + content.push_str(&format!( + ") -> ClientResult> {{", + response_type + )); content.push_str(template); @@ -856,10 +859,10 @@ fn get_fn_inner( } else if all_pages && proper_name.starts_with("Stripe") { // We will do a custom function here. let inner = format!( - r#"let mut resp: {} = self.client.{}(&url, crate::Message {{ body: {}, content_type: None }}).await?; + r#"let crate::Response::<{}> {{ mut status, mut headers, mut body }} = self.client.{}(&url, crate::Message {{ body: {}, content_type: None }}).await?; - let mut {} = resp.{}; - let mut has_more = resp.has_more; + let mut {} = body.{}; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -875,19 +878,19 @@ fn get_fn_inner( }} if !url.contains('?') {{ - resp = self.client.{}(&format!("{{}}?startng_after={{}}", url, page), crate::Message {{ body: {}, content_type: None }}).await?; + crate::Response::<{}> {{ status, headers, body }} = self.client.{}(&format!("{{}}?startng_after={{}}", url, page), crate::Message {{ body: {}, content_type: None }}).await?; }} else {{ - resp = self.client.{}(&format!("{{}}&starting_after={{}}", url, page), crate::Message {{ body: {}, content_type: None }}).await?; + crate::Response::<{}> {{ status, headers, body }} = self.client.{}(&format!("{{}}&starting_after={{}}", url, page), crate::Message {{ body: {}, content_type: None }}).await?; }} - {}.append(&mut resp.{}); + {}.append(&mut body.{}); - has_more = resp.has_more; + has_more = body.has_more; }} // Return our response data. - Ok({}.to_vec())"#, + Ok(crate::Response::new(status, headers, {}.to_vec()))"#, response_type, m.to_lowercase(), body, @@ -895,8 +898,10 @@ fn get_fn_inner( pagination_property, pagination_property, pagination_property, + response_type, m.to_lowercase(), body, + response_type, m.to_lowercase(), body, pagination_property, @@ -908,38 +913,40 @@ fn get_fn_inner( } else if all_pages && proper_name.starts_with("Google") { // We will do a custom function here. let inner = format!( - r#"let mut resp: {} = self.client.{}(&url, crate::Message {{ body: {}, content_type: None }}).await?; + r#"let crate::Response::<{}> {{ mut status, mut headers, mut body }} = self.client.{}(&url, crate::Message {{ body: {}, content_type: None }}).await?; - let mut {} = resp.{}; - let mut page = resp.next_page_token; + let mut {} = body.{}; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() {{ if !url.contains('?') {{ - resp = self.client.{}(&format!("{{}}?pageToken={{}}", url, page), crate::Message {{ body: {}, content_type: None }}).await?; + crate::Response::<{}> {{ status, headers, body }} = self.client.{}(&format!("{{}}?pageToken={{}}", url, page), crate::Message {{ body: {}, content_type: None }}).await?; }} else {{ - resp = self.client.{}(&format!("{{}}&pageToken={{}}", url, page), crate::Message {{ body: {}, content_type: None }}).await?; + crate::Response::<{}> {{ status, headers, body }} = self.client.{}(&format!("{{}}&pageToken={{}}", url, page), crate::Message {{ body: {}, content_type: None }}).await?; }} - {}.append(&mut resp.{}); + {}.append(&mut body.{}); - if !resp.next_page_token.is_empty() && resp.next_page_token != page {{ - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page {{ + page = body.next_page_token.to_string(); }} else {{ page = "".to_string(); }} }} // Return our response data. - Ok({})"#, + Ok(crate::Response::new(status, headers, {}))"#, response_type, m.to_lowercase(), body, pagination_property, pagination_property, + response_type, m.to_lowercase(), body, + response_type, m.to_lowercase(), body, pagination_property, @@ -951,19 +958,21 @@ fn get_fn_inner( } else if all_pages && proper_name == "Ramp" { // We will do a custom function here. let inner = format!( - r#"let resp: {} = self.client.{}(&url, crate::Message {{ body: {}, content_type: None }}).await?; + r#"let crate::Response::<{}> {{ mut status, mut headers, body }} = self.client.{}(&url, crate::Message {{ body: {}, content_type: None }}).await?; - let mut {} = resp.{}; - let mut page = resp.page.next.to_string(); + let mut {} = body.{}; + let mut page = body.page.next.to_string(); // Paginate if we should. while !page.is_empty() {{ match self.client.{}::<{}>(page.trim_start_matches(&self.client.host), crate::Message {{ body: {}, content_type: None }}).await {{ Ok(mut resp) => {{ - {}.append(&mut resp.{}); + {}.append(&mut resp.body.{}); + status = resp.status; + headers = resp.headers; - page = if resp.page.next != page {{ - resp.page.next.to_string() + page = if body.page.next != page {{ + body.page.next.to_string() }} else {{ "".to_string() }}; @@ -979,7 +988,7 @@ fn get_fn_inner( }} // Return our response data. - Ok({})"#, + Ok(crate::Response::new(status, headers, {}))"#, response_type, m.to_lowercase(), body, @@ -998,30 +1007,30 @@ fn get_fn_inner( // We will do a custom function here. let inner = format!( r#" - let mut resp: {} = if !url.contains('?') {{ + let crate::Response::<{}> {{ mut status, mut headers, mut body }} = if !url.contains('?') {{ self.client.{}(&format!("{{}}?page=0&size=100", url), crate::Message {{ body: {}, content_type: None }}).await? }} else {{ self.client.{}(&format!("{{}}&page=0&size=100", url), crate::Message {{ body: {}, content_type: None }}).await? }}; - let mut {} = resp.{}; - let mut page = resp.page.current_page + 1; + let mut {} = body.{}; + let mut page = body.page.current_page + 1; // Paginate if we should. - while page <= (resp.page.total_pages - 1) {{ + while page <= (body.page.total_pages - 1) {{ if !url.contains('?') {{ - resp = self.client.{}(&format!("{{}}?page={{}}&size=100", url, page), crate::Message {{ body: {}, content_type: None }}).await?; + crate::Response::<{}> {{ status, headers, body }} = self.client.{}(&format!("{{}}?page={{}}&size=100", url, page), crate::Message {{ body: {}, content_type: None }}).await?; }} else {{ - resp = self.client.{}(&format!("{{}}&page={{}}&size=100", url, page), crate::Message {{ body: {}, content_type: None }}).await?; + crate::Response::<{}> {{ status, headers, body }} = self.client.{}(&format!("{{}}&page={{}}&size=100", url, page), crate::Message {{ body: {}, content_type: None }}).await?; }} - {}.append(&mut resp.{}); + {}.append(&mut body.{}); - page = resp.page.current_page + 1; + page = body.page.current_page + 1; }} // Return our response data. - Ok({})"#, + Ok(crate::Response::new(status, headers, {}))"#, response_type, m.to_lowercase(), body, @@ -1029,8 +1038,10 @@ fn get_fn_inner( body, pagination_property, pagination_property, + response_type, m.to_lowercase(), body, + response_type, m.to_lowercase(), body, pagination_property, @@ -1042,38 +1053,40 @@ fn get_fn_inner( } else if all_pages && proper_name == "Zoom" { // We will do a custom function here. let inner = format!( - r#"let mut resp: {} = self.client.{}(&url, crate::Message {{ body: {}, content_type: None }}).await?; + r#"let crate::Response::<{}> {{ mut status, mut headers, mut body }} = self.client.{}(&url, crate::Message {{ body: {}, content_type: None }}).await?; - let mut {} = resp.{}; - let mut page = resp.next_page_token; + let mut {} = body.{}; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() {{ // Check if we already have URL params and need to concat the token. if !url.contains('?') {{ - resp = self.client.{}(&format!("{{}}?next_page_token={{}}", url, page), crate::Message {{ body: {}, content_type: None }}).await?; + crate::Response::<{}> {{ status, headers, body }} = self.client.{}(&format!("{{}}?next_page_token={{}}", url, page), crate::Message {{ body: {}, content_type: None }}).await?; }} else {{ - resp = self.client.{}(&format!("{{}}&next_page_token={{}}", url, page), crate::Message {{ body: {}, content_type: None }}).await?; + crate::Response::<{}> {{ status, headers, body }} = self.client.{}(&format!("{{}}&next_page_token={{}}", url, page), crate::Message {{ body: {}, content_type: None }}).await?; }} - {}.append(&mut resp.{}); + {}.append(&mut body.{}); - if !resp.next_page_token.is_empty() && resp.next_page_token != page {{ - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page {{ + page = body.next_page_token.to_string(); }} else {{ page = "".to_string(); }} }} // Return our response data. - Ok({})"#, + Ok(crate::Response::new(status, headers, {}))"#, response_type, m.to_lowercase(), body, pagination_property, pagination_property, + response_type, m.to_lowercase(), body, + response_type, m.to_lowercase(), body, pagination_property, @@ -1113,10 +1126,10 @@ fn get_fn_inner( // Okay we have an inner response type, let's return that instead. return Ok(format!( - r#"let resp: {} = self.client.{}(&url, crate::Message {{ body: {}, content_type: {content_type} }}).await?; + r#"let resp: crate::Response<{}> = self.client.{}(&url, crate::Message {{ body: {}, content_type: {content_type} }}).await?; // Return our response data. - Ok(resp.{}{})"#, + Ok(crate::Response::new(resp.status, resp.headers, resp.body.{}{}))"#, response_type, m.to_lowercase(), body, diff --git a/generator/src/main.rs b/generator/src/main.rs index bbacbc4c..3770e3e1 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -2314,7 +2314,8 @@ fn gen( a(r#"#[cfg_attr(docsrs, doc(cfg(feature = "httpcache")))]"#); a("pub mod http_cache;"); } - if proper_name == "Google Drive" + if proper_name == "GitHub" + || proper_name == "Google Drive" || proper_name == "Google Sheets" || proper_name == "SendGrid" || proper_name == "Rev.ai" @@ -2372,9 +2373,30 @@ fn gen( a(""); - a("use thiserror::Error;"); + a(r#" +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +}"#); + a(""); + a("type ClientResult = Result;"); a(""); + + a("use thiserror::Error;"); + a(""); a(r#" /// Errors returned by the client #[derive(Debug, Error)] @@ -3317,15 +3339,13 @@ fn main() -> Result<()> { /* * Write the Cargo.toml file: */ - let mut uuid_lib = "".to_string(); let mut yup_oauth2_lib = "".to_string(); - if proper_name != "GitHub" { - uuid_lib = r#" + + let uuid_lib = r#" bytes = { version = "1", features = ["serde"] } async-trait = "^0.1.51" uuid = { version = "1.1", features = ["serde", "v4"] }"# - .to_string(); - } + .to_string(); if proper_name.starts_with("Google") { yup_oauth2_lib = r#" diff --git a/giphy/src/gifs.rs b/giphy/src/gifs.rs index 331e6b61..2d2abc14 100644 --- a/giphy/src/gifs.rs +++ b/giphy/src/gifs.rs @@ -23,7 +23,10 @@ impl Gifs { * * * `ids: &str` -- Filters results by specified GIF IDs, separated by commas. */ - pub async fn get(&self, ids: &str) -> ClientResult { + pub async fn get( + &self, + ids: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !ids.is_empty() { query_args.push(("ids".to_string(), ids.to_string())); @@ -57,7 +60,7 @@ impl Gifs { &self, tag: &str, rating: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !rating.is_empty() { query_args.push(("rating".to_string(), rating.to_string())); @@ -100,7 +103,7 @@ impl Gifs { offset: i64, rating: &str, lang: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !lang.is_empty() { query_args.push(("lang".to_string(), lang.to_string())); @@ -141,7 +144,10 @@ impl Gifs { * * * `s: &str` -- The unique bit.ly URL for this GIF. */ - pub async fn translate(&self, s: &str) -> ClientResult { + pub async fn translate( + &self, + s: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !s.is_empty() { query_args.push(("s".to_string(), s.to_string())); @@ -179,7 +185,7 @@ impl Gifs { limit: i64, offset: i64, rating: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); @@ -214,7 +220,10 @@ impl Gifs { * * * `gif_id: i64` -- Filters results by specified GIF ID. */ - pub async fn get_gifs(&self, gif_id: i64) -> ClientResult { + pub async fn get_gifs( + &self, + gif_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/gifs/{}", diff --git a/giphy/src/lib.rs b/giphy/src/lib.rs index 24688bc0..171f35be 100644 --- a/giphy/src/lib.rs +++ b/giphy/src/lib.rs @@ -72,9 +72,27 @@ pub mod types; #[doc(hidden)] pub mod utils; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -278,13 +296,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -297,7 +316,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -320,13 +339,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -347,7 +367,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -366,7 +386,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -391,6 +415,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -407,7 +432,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -432,7 +457,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -455,6 +480,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -471,7 +497,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -497,7 +523,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -540,6 +566,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -552,7 +579,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -575,7 +602,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -584,7 +611,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -592,7 +619,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -602,32 +629,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -639,7 +670,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -648,7 +679,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -656,7 +687,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -664,7 +695,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -672,7 +703,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/giphy/src/stickers.rs b/giphy/src/stickers.rs index 08d283ec..d91368a8 100644 --- a/giphy/src/stickers.rs +++ b/giphy/src/stickers.rs @@ -28,7 +28,7 @@ impl Stickers { &self, tag: &str, rating: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !rating.is_empty() { query_args.push(("rating".to_string(), rating.to_string())); @@ -73,7 +73,7 @@ impl Stickers { offset: i64, rating: &str, lang: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !lang.is_empty() { query_args.push(("lang".to_string(), lang.to_string())); @@ -116,7 +116,10 @@ impl Stickers { * * * `s: &str` -- The unique bit.ly URL for this GIF. */ - pub async fn translate(&self, s: &str) -> ClientResult { + pub async fn translate( + &self, + s: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !s.is_empty() { query_args.push(("s".to_string(), s.to_string())); @@ -154,7 +157,7 @@ impl Stickers { limit: i64, offset: i64, rating: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); diff --git a/github/Cargo.toml b/github/Cargo.toml index 64e47327..5c38b0a0 100644 --- a/github/Cargo.toml +++ b/github/Cargo.toml @@ -38,6 +38,9 @@ serde = { version = "1", features = ["derive"] } serde_json = "1" serde_urlencoded = "^0.7" url = { version = "2", features = ["serde"] } +bytes = { version = "1", features = ["serde"] } +async-trait = "^0.1.51" +uuid = { version = "1.1", features = ["serde", "v4"] } thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } diff --git a/github/examples/list_pulls_for_repo.rs b/github/examples/list_pulls_for_repo.rs index d013215e..23df42ab 100644 --- a/github/examples/list_pulls_for_repo.rs +++ b/github/examples/list_pulls_for_repo.rs @@ -76,7 +76,7 @@ async fn main() -> Result<(), Box> { ) .await .unwrap(); - println!("length: {}", repos.len()); + println!("length: {}", repos.body.len()); Ok(()) } diff --git a/github/examples/list_repos_for_org.rs b/github/examples/list_repos_for_org.rs index 24679f81..69308c1e 100644 --- a/github/examples/list_repos_for_org.rs +++ b/github/examples/list_repos_for_org.rs @@ -73,7 +73,7 @@ async fn main() -> Result<(), Box> { ) .await .unwrap(); - println!("length: {}", repos.len()); + println!("length: {}", repos.body.len()); Ok(()) } diff --git a/github/src/actions.rs b/github/src/actions.rs index ddc132fc..7f6fc1fa 100644 --- a/github/src/actions.rs +++ b/github/src/actions.rs @@ -29,7 +29,7 @@ impl Actions { pub async fn get_github_actions_permissions_organization( &self, org: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/permissions", @@ -68,7 +68,7 @@ impl Actions { &self, org: &str, body: &crate::types::ActionsSetGithubPermissionsOrganizationRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/permissions", @@ -108,8 +108,11 @@ impl Actions { org: &str, per_page: i64, page: i64, - ) -> ClientResult - { + ) -> ClientResult< + crate::Response< + crate::types::ActionsListSelectedRepositoriesEnabledGithubOrganizationResponse, + >, + > { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -155,7 +158,7 @@ impl Actions { &self, org: &str, body: &crate::types::ActionsSetRepoAccessSelfHostedRunnerGroupInOrgRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/permissions/repositories", @@ -193,7 +196,7 @@ impl Actions { &self, org: &str, repository_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/permissions/repositories/{}", @@ -232,7 +235,7 @@ impl Actions { &self, org: &str, repository_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/permissions/repositories/{}", @@ -269,7 +272,7 @@ impl Actions { pub async fn get_allowed_actions_organization( &self, org: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/permissions/selected-actions", @@ -310,7 +313,7 @@ impl Actions { &self, org: &str, body: &crate::types::SelectedActions, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/permissions/selected-actions", @@ -352,7 +355,8 @@ impl Actions { org: &str, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> + { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -400,7 +404,7 @@ impl Actions { &self, org: &str, body: &crate::types::ActionsCreateSelfHostedRunnerGroupOrgRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/runner-groups", @@ -440,7 +444,7 @@ impl Actions { &self, org: &str, runner_group_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/runner-groups/{}", @@ -481,7 +485,7 @@ impl Actions { &self, org: &str, runner_group_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/runner-groups/{}", @@ -523,7 +527,7 @@ impl Actions { org: &str, runner_group_id: i64, body: &crate::types::ActionsUpdateSelfHostedRunnerGroupOrgRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/runner-groups/{}", @@ -568,7 +572,9 @@ impl Actions { runner_group_id: i64, page: i64, per_page: i64, - ) -> ClientResult { + ) -> ClientResult< + crate::Response, + > { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -619,7 +625,7 @@ impl Actions { org: &str, runner_group_id: i64, body: &crate::types::ActionsSetRepoAccessSelfHostedRunnerGroupInOrgRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/runner-groups/{}/repositories", @@ -664,7 +670,7 @@ impl Actions { org: &str, runner_group_id: i64, repository_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/runner-groups/{}/repositories/{}", @@ -709,7 +715,7 @@ impl Actions { org: &str, runner_group_id: i64, repository_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/runner-groups/{}/repositories/{}", @@ -755,7 +761,8 @@ impl Actions { runner_group_id: i64, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> + { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -806,7 +813,7 @@ impl Actions { org: &str, runner_group_id: i64, body: &crate::types::ActionsSetSelfHostedRunnersInGroupOrgRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/runner-groups/{}/runners", @@ -851,7 +858,7 @@ impl Actions { org: &str, runner_group_id: i64, runner_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/runner-groups/{}/runners/{}", @@ -896,7 +903,7 @@ impl Actions { org: &str, runner_group_id: i64, runner_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/runner-groups/{}/runners/{}", @@ -938,7 +945,7 @@ impl Actions { org: &str, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -983,7 +990,7 @@ impl Actions { pub async fn list_runner_applications_for_org( &self, org: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/actions/runners/downloads", @@ -1017,7 +1024,7 @@ impl Actions { pub async fn list_all_runner_applications_for_org( &self, org: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/actions/runners/downloads", @@ -1061,7 +1068,7 @@ impl Actions { pub async fn create_registration_token_for_org( &self, org: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/runners/registration-token", @@ -1106,7 +1113,7 @@ impl Actions { pub async fn create_remove_token_for_org( &self, org: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/runners/remove-token", @@ -1144,7 +1151,7 @@ impl Actions { &self, org: &str, runner_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/runners/{}", @@ -1183,7 +1190,7 @@ impl Actions { &self, org: &str, runner_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/runners/{}", @@ -1222,7 +1229,7 @@ impl Actions { org: &str, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1265,7 +1272,7 @@ impl Actions { pub async fn get_org_public_key( &self, org: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/secrets/public-key", @@ -1301,7 +1308,7 @@ impl Actions { &self, org: &str, secret_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/secrets/{}", @@ -1413,7 +1420,7 @@ impl Actions { org: &str, secret_name: &str, body: &crate::types::ActionsCreateUpdateOrgSecretRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/secrets/{}", @@ -1446,7 +1453,11 @@ impl Actions { * * `org: &str` * * `secret_name: &str` -- secret_name parameter. */ - pub async fn delete_org_secret(&self, org: &str, secret_name: &str) -> ClientResult<()> { + pub async fn delete_org_secret( + &self, + org: &str, + secret_name: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/secrets/{}", @@ -1487,7 +1498,8 @@ impl Actions { secret_name: &str, page: i64, per_page: i64, - ) -> ClientResult { + ) -> ClientResult> + { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1534,7 +1546,7 @@ impl Actions { org: &str, secret_name: &str, body: &crate::types::ActionsSetSelectedReposOrgSecretRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/secrets/{}/repositories", @@ -1573,7 +1585,7 @@ impl Actions { org: &str, secret_name: &str, repository_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/secrets/{}/repositories/{}", @@ -1613,7 +1625,7 @@ impl Actions { org: &str, secret_name: &str, repository_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/actions/secrets/{}/repositories/{}", @@ -1655,7 +1667,7 @@ impl Actions { repo: &str, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1703,7 +1715,7 @@ impl Actions { owner: &str, repo: &str, artifact_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/artifacts/{}", @@ -1743,7 +1755,7 @@ impl Actions { owner: &str, repo: &str, artifact_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/artifacts/{}", @@ -1788,7 +1800,7 @@ impl Actions { repo: &str, artifact_id: i64, archive_format: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/artifacts/{}/{}", @@ -1829,7 +1841,7 @@ impl Actions { owner: &str, repo: &str, job_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/jobs/{}", @@ -1872,7 +1884,7 @@ impl Actions { owner: &str, repo: &str, job_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/jobs/{}/logs", @@ -1913,7 +1925,7 @@ impl Actions { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/permissions", @@ -1955,7 +1967,7 @@ impl Actions { owner: &str, repo: &str, body: &crate::types::ActionsSetGithubPermissionsRepositoryRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/permissions", @@ -1994,7 +2006,7 @@ impl Actions { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/permissions/selected-actions", @@ -2038,7 +2050,7 @@ impl Actions { owner: &str, repo: &str, body: &crate::types::SelectedActions, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/permissions/selected-actions", @@ -2079,7 +2091,7 @@ impl Actions { repo: &str, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -2127,7 +2139,7 @@ impl Actions { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runners/downloads", @@ -2163,7 +2175,7 @@ impl Actions { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runners/downloads", @@ -2209,7 +2221,7 @@ impl Actions { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runners/registration-token", @@ -2255,7 +2267,7 @@ impl Actions { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runners/remove-token", @@ -2297,7 +2309,7 @@ impl Actions { owner: &str, repo: &str, runner_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runners/{}", @@ -2340,7 +2352,7 @@ impl Actions { owner: &str, repo: &str, runner_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runners/{}", @@ -2394,7 +2406,7 @@ impl Actions { per_page: i64, page: i64, created: Option>, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !actor.is_empty() { query_args.push(("actor".to_string(), actor.to_string())); @@ -2457,7 +2469,7 @@ impl Actions { owner: &str, repo: &str, run_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runs/{}", @@ -2499,7 +2511,7 @@ impl Actions { owner: &str, repo: &str, run_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runs/{}", @@ -2539,7 +2551,7 @@ impl Actions { owner: &str, repo: &str, run_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runs/{}/approvals", @@ -2575,7 +2587,7 @@ impl Actions { owner: &str, repo: &str, run_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runs/{}/approvals", @@ -2617,7 +2629,7 @@ impl Actions { owner: &str, repo: &str, run_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runs/{}/approve", @@ -2661,7 +2673,7 @@ impl Actions { run_id: i64, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -2710,7 +2722,7 @@ impl Actions { owner: &str, repo: &str, run_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runs/{}/cancel", @@ -2758,7 +2770,7 @@ impl Actions { filter: crate::types::ActionsListJobsWorkflowRunFilter, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !filter.to_string().is_empty() { query_args.push(("filter".to_string(), filter.to_string())); @@ -2813,7 +2825,7 @@ impl Actions { owner: &str, repo: &str, run_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runs/{}/logs", @@ -2853,7 +2865,7 @@ impl Actions { owner: &str, repo: &str, run_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runs/{}/logs", @@ -2895,7 +2907,7 @@ impl Actions { owner: &str, repo: &str, run_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runs/{}/pending_deployments", @@ -2933,7 +2945,7 @@ impl Actions { owner: &str, repo: &str, run_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runs/{}/pending_deployments", @@ -2976,7 +2988,7 @@ impl Actions { repo: &str, run_id: i64, body: &crate::types::ActionsReviewPendingDeploymentsRunRequest, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runs/{}/pending_deployments", @@ -3011,7 +3023,12 @@ impl Actions { * * `repo: &str` * * `run_id: i64` -- The id of the workflow run. */ - pub async fn re_run_workflow(&self, owner: &str, repo: &str, run_id: i64) -> ClientResult<()> { + pub async fn re_run_workflow( + &self, + owner: &str, + repo: &str, + run_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runs/{}/rerun", @@ -3051,7 +3068,7 @@ impl Actions { owner: &str, repo: &str, run_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runs/{}/rerun-failed-jobs", @@ -3093,7 +3110,7 @@ impl Actions { owner: &str, repo: &str, run_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/runs/{}/timing", @@ -3135,7 +3152,7 @@ impl Actions { repo: &str, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -3181,7 +3198,7 @@ impl Actions { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/secrets/public-key", @@ -3220,7 +3237,7 @@ impl Actions { owner: &str, repo: &str, secret_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/secrets/{}", @@ -3335,7 +3352,7 @@ impl Actions { repo: &str, secret_name: &str, body: &crate::types::ActionsCreateUpdateRepoSecretRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/secrets/{}", @@ -3375,7 +3392,7 @@ impl Actions { owner: &str, repo: &str, secret_name: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/secrets/{}", @@ -3417,7 +3434,7 @@ impl Actions { repo: &str, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -3465,7 +3482,7 @@ impl Actions { owner: &str, repo: &str, workflow_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/workflows/{}", @@ -3507,7 +3524,7 @@ impl Actions { owner: &str, repo: &str, workflow_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/workflows/{}/disable", @@ -3552,7 +3569,7 @@ impl Actions { repo: &str, workflow_id: &str, body: &crate::types::ActionsCreateWorkflowDispatchRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/workflows/{}/dispatches", @@ -3594,7 +3611,7 @@ impl Actions { owner: &str, repo: &str, workflow_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/workflows/{}/enable", @@ -3650,7 +3667,7 @@ impl Actions { per_page: i64, page: i64, created: Option>, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !actor.is_empty() { query_args.push(("actor".to_string(), actor.to_string())); @@ -3716,7 +3733,7 @@ impl Actions { owner: &str, repo: &str, workflow_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/actions/workflows/{}/timing", @@ -3758,7 +3775,7 @@ impl Actions { environment_name: &str, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -3804,7 +3821,7 @@ impl Actions { &self, repository_id: i64, environment_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repositories/{}/environments/{}/secrets/public-key", @@ -3843,7 +3860,7 @@ impl Actions { repository_id: i64, environment_name: &str, secret_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repositories/{}/environments/{}/secrets/{}", @@ -3958,7 +3975,7 @@ impl Actions { environment_name: &str, secret_name: &str, body: &crate::types::ActionsCreateUpdateRepoSecretRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repositories/{}/environments/{}/secrets/{}", @@ -3998,7 +4015,7 @@ impl Actions { repository_id: i64, environment_name: &str, secret_name: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repositories/{}/environments/{}/secrets/{}", diff --git a/github/src/activity.rs b/github/src/activity.rs index 27303ea3..6d5e7b3a 100644 --- a/github/src/activity.rs +++ b/github/src/activity.rs @@ -29,7 +29,7 @@ impl Activity { &self, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -60,7 +60,9 @@ impl Activity { * * FROM: */ - pub async fn list_all_public_events(&self) -> ClientResult> { + pub async fn list_all_public_events( + &self, + ) -> ClientResult>> { let url = self.client.url("/events", None); self.client .get_all_pages( @@ -91,7 +93,7 @@ impl Activity { * * FROM: */ - pub async fn get_feeds(&self) -> ClientResult { + pub async fn get_feeds(&self) -> ClientResult> { let url = self.client.url("/feeds", None); self.client .get( @@ -125,7 +127,7 @@ impl Activity { repo: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -168,7 +170,7 @@ impl Activity { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/networks/{}/{}/events", @@ -213,7 +215,7 @@ impl Activity { before: Option>, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if all { query_args.push(("all".to_string(), all.to_string())); @@ -262,7 +264,7 @@ impl Activity { participating: bool, since: Option>, before: Option>, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if all { query_args.push(("all".to_string(), all.to_string())); @@ -300,7 +302,7 @@ impl Activity { pub async fn mark_notifications_as_read( &self, body: &crate::types::ActivityMarkNotificationsAsReadRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/notifications", None); self.client .put( @@ -325,7 +327,10 @@ impl Activity { * * * `thread_id: i64` -- thread_id parameter. */ - pub async fn get_thread(&self, thread_id: i64) -> ClientResult { + pub async fn get_thread( + &self, + thread_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/notifications/threads/{}", @@ -356,7 +361,7 @@ impl Activity { * * * `thread_id: i64` -- thread_id parameter. */ - pub async fn mark_thread_as_read(&self, thread_id: i64) -> ClientResult<()> { + pub async fn mark_thread_as_read(&self, thread_id: i64) -> ClientResult> { let url = self.client.url( &format!( "/notifications/threads/{}", @@ -392,7 +397,7 @@ impl Activity { pub async fn get_thread_subscription_for_authenticated_user( &self, thread_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/notifications/threads/{}/subscription", @@ -431,7 +436,7 @@ impl Activity { &self, thread_id: i64, body: &crate::types::ActivitySetThreadSubscriptionRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/notifications/threads/{}/subscription", @@ -462,7 +467,10 @@ impl Activity { * * * `thread_id: i64` -- thread_id parameter. */ - pub async fn delete_thread_subscription(&self, thread_id: i64) -> ClientResult<()> { + pub async fn delete_thread_subscription( + &self, + thread_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/notifications/threads/{}/subscription", @@ -500,7 +508,7 @@ impl Activity { org: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -541,7 +549,7 @@ impl Activity { pub async fn list_all_public_org_events( &self, org: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/events", @@ -581,7 +589,7 @@ impl Activity { repo: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -624,7 +632,7 @@ impl Activity { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/events", @@ -673,7 +681,7 @@ impl Activity { before: Option>, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if all { query_args.push(("all".to_string(), all.to_string())); @@ -732,7 +740,7 @@ impl Activity { participating: bool, since: Option>, before: Option>, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if all { query_args.push(("all".to_string(), all.to_string())); @@ -785,7 +793,7 @@ impl Activity { owner: &str, repo: &str, body: &crate::types::ActivityMarkRepoNotificationsAsReadRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/notifications", @@ -828,7 +836,7 @@ impl Activity { repo: &str, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -878,7 +886,7 @@ impl Activity { repo: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -921,7 +929,7 @@ impl Activity { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/subscribers", @@ -958,7 +966,7 @@ impl Activity { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/subscription", @@ -996,7 +1004,7 @@ impl Activity { owner: &str, repo: &str, body: &crate::types::ActivitySetRepoSubscriptionRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/subscription", @@ -1029,7 +1037,11 @@ impl Activity { * * `owner: &str` * * `repo: &str` */ - pub async fn delete_repo_subscription(&self, owner: &str, repo: &str) -> ClientResult<()> { + pub async fn delete_repo_subscription( + &self, + owner: &str, + repo: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/subscription", @@ -1074,7 +1086,7 @@ impl Activity { direction: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -1117,7 +1129,7 @@ impl Activity { &self, sort: crate::types::Sort, direction: crate::types::Order, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -1155,7 +1167,7 @@ impl Activity { &self, owner: &str, repo: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/starred/{}/{}", @@ -1192,7 +1204,7 @@ impl Activity { &self, owner: &str, repo: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/starred/{}/{}", @@ -1229,7 +1241,7 @@ impl Activity { &self, owner: &str, repo: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/starred/{}/{}", @@ -1266,7 +1278,7 @@ impl Activity { &self, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1301,7 +1313,7 @@ impl Activity { */ pub async fn list_all_watched_repos_for_authenticated_user( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/subscriptions", None); self.client .get_all_pages( @@ -1333,7 +1345,7 @@ impl Activity { username: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1374,7 +1386,7 @@ impl Activity { pub async fn list_all_events_for_authenticated_user( &self, username: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/users/{}/events", @@ -1414,7 +1426,7 @@ impl Activity { org: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1457,7 +1469,7 @@ impl Activity { &self, username: &str, org: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/users/{}/events/orgs/{}", @@ -1496,7 +1508,7 @@ impl Activity { username: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1537,7 +1549,7 @@ impl Activity { pub async fn list_all_public_events_for_user( &self, username: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/users/{}/events/public", @@ -1575,7 +1587,7 @@ impl Activity { username: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1616,7 +1628,7 @@ impl Activity { pub async fn list_all_received_events_for_user( &self, username: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/users/{}/received_events", @@ -1654,7 +1666,7 @@ impl Activity { username: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1695,7 +1707,7 @@ impl Activity { pub async fn list_all_received_public_events_for_user( &self, username: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/users/{}/received_events/public", @@ -1741,7 +1753,8 @@ impl Activity { direction: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> + { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -1794,7 +1807,7 @@ impl Activity { username: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1835,7 +1848,7 @@ impl Activity { pub async fn list_all_repos_watched_by_user( &self, username: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/users/{}/subscriptions", diff --git a/github/src/apps.rs b/github/src/apps.rs index 89f495bc..89e2ee47 100644 --- a/github/src/apps.rs +++ b/github/src/apps.rs @@ -22,7 +22,9 @@ impl Apps { * * FROM: */ - pub async fn get_authenticated(&self) -> ClientResult { + pub async fn get_authenticated( + &self, + ) -> ClientResult> { let url = self.client.url("/app", None); self.client .get( @@ -50,7 +52,7 @@ impl Apps { pub async fn create_from_manifest( &self, code: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/app-manifests/{}/conversions", @@ -79,7 +81,9 @@ impl Apps { * * FROM: */ - pub async fn get_webhook_config_for_app(&self) -> ClientResult { + pub async fn get_webhook_config_for_app( + &self, + ) -> ClientResult> { let url = self.client.url("/app/hook/config", None); self.client .get( @@ -105,7 +109,7 @@ impl Apps { pub async fn update_webhook_config_for_app( &self, body: &crate::types::AppsUpdateWebhookConfigAppRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/app/hook/config", None); self.client .patch( @@ -137,7 +141,7 @@ impl Apps { &self, per_page: i64, cursor: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); @@ -175,7 +179,7 @@ impl Apps { pub async fn list_all_webhook_deliveries( &self, cursor: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); @@ -212,7 +216,7 @@ impl Apps { pub async fn get_webhook_delivery( &self, delivery_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/app/hook/deliveries/{}", @@ -245,7 +249,10 @@ impl Apps { * * * `delivery_id: i64` */ - pub async fn redeliver_webhook_delivery(&self, delivery_id: i64) -> ClientResult<()> { + pub async fn redeliver_webhook_delivery( + &self, + delivery_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/app/hook/deliveries/{}/attempts", @@ -287,7 +294,7 @@ impl Apps { page: i64, since: Option>, outdated: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !outdated.is_empty() { query_args.push(("outdated".to_string(), outdated.to_string())); @@ -332,7 +339,7 @@ impl Apps { &self, since: Option>, outdated: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !outdated.is_empty() { query_args.push(("outdated".to_string(), outdated.to_string())); @@ -372,7 +379,7 @@ impl Apps { pub async fn get_installation( &self, installation_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/app/installations/{}", @@ -405,7 +412,10 @@ impl Apps { * * * `installation_id: i64` -- installation_id parameter. */ - pub async fn delete_installation(&self, installation_id: i64) -> ClientResult<()> { + pub async fn delete_installation( + &self, + installation_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/app/installations/{}", @@ -443,7 +453,7 @@ impl Apps { &self, installation_id: i64, body: &crate::types::AppsCreateInstallationAccessTokenRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/app/installations/{}/access_tokens", @@ -478,7 +488,10 @@ impl Apps { * * * `installation_id: i64` -- installation_id parameter. */ - pub async fn suspend_installation(&self, installation_id: i64) -> ClientResult<()> { + pub async fn suspend_installation( + &self, + installation_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/app/installations/{}/suspended", @@ -511,7 +524,10 @@ impl Apps { * * * `installation_id: i64` -- installation_id parameter. */ - pub async fn unsuspend_installation(&self, installation_id: i64) -> ClientResult<()> { + pub async fn unsuspend_installation( + &self, + installation_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/app/installations/{}/suspended", @@ -547,7 +563,7 @@ impl Apps { &self, client_id: &str, body: &crate::types::AppsCheckTokenRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/applications/{}/grant", @@ -587,7 +603,7 @@ impl Apps { &self, client_id: &str, access_token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/applications/{}/grants/{}", @@ -623,7 +639,7 @@ impl Apps { &self, client_id: &str, body: &crate::types::AppsCheckTokenRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/applications/{}/token", @@ -658,7 +674,7 @@ impl Apps { &self, client_id: &str, body: &crate::types::AppsCheckTokenRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/applications/{}/token", @@ -693,7 +709,7 @@ impl Apps { &self, client_id: &str, body: &crate::types::AppsCheckTokenRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/applications/{}/token", @@ -728,7 +744,7 @@ impl Apps { &self, client_id: &str, body: &crate::types::AppsScopeTokenRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/applications/{}/token/scoped", @@ -766,7 +782,7 @@ impl Apps { &self, client_id: &str, access_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/applications/{}/tokens/{}", @@ -805,7 +821,7 @@ impl Apps { &self, client_id: &str, access_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/applications/{}/tokens/{}", @@ -844,7 +860,7 @@ impl Apps { &self, client_id: &str, access_token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/applications/{}/tokens/{}", @@ -878,7 +894,10 @@ impl Apps { * * * `app_slug: &str` */ - pub async fn get_by_slug(&self, app_slug: &str) -> ClientResult { + pub async fn get_by_slug( + &self, + app_slug: &str, + ) -> ClientResult> { let url = self.client.url( &format!("/apps/{}", crate::progenitor_support::encode_path(app_slug),), None, @@ -913,7 +932,7 @@ impl Apps { &self, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -948,7 +967,7 @@ impl Apps { * * FROM: */ - pub async fn revoke_installation_access_token(&self) -> ClientResult<()> { + pub async fn revoke_installation_access_token(&self) -> ClientResult> { let url = self.client.url("/installation/token", None); self.client .delete( @@ -978,7 +997,7 @@ impl Apps { pub async fn get_subscription_plan_for_account( &self, account_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/marketplace_listing/accounts/{}", @@ -1016,7 +1035,7 @@ impl Apps { &self, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1051,7 +1070,9 @@ impl Apps { * * FROM: */ - pub async fn list_all_plans(&self) -> ClientResult> { + pub async fn list_all_plans( + &self, + ) -> ClientResult>> { let url = self.client.url("/marketplace_listing/plans", None); self.client .get_all_pages( @@ -1091,7 +1112,7 @@ impl Apps { direction: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -1142,7 +1163,7 @@ impl Apps { plan_id: i64, sort: crate::types::Sort, direction: crate::types::Order, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -1187,7 +1208,7 @@ impl Apps { pub async fn get_subscription_plan_for_account_stubbed( &self, account_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/marketplace_listing/stubbed/accounts/{}", @@ -1225,7 +1246,7 @@ impl Apps { &self, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1263,7 +1284,7 @@ impl Apps { */ pub async fn list_all_plans_stubbed( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/marketplace_listing/stubbed/plans", None); self.client .get_all_pages( @@ -1303,7 +1324,7 @@ impl Apps { direction: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -1354,7 +1375,7 @@ impl Apps { plan_id: i64, sort: crate::types::Sort, direction: crate::types::Order, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -1399,7 +1420,7 @@ impl Apps { pub async fn get_org_installation( &self, org: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/installation", @@ -1442,7 +1463,7 @@ impl Apps { repo: &str, content_reference_id: i64, body: &crate::types::TeamsUpdateDiscussionInOrgRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/content_references/{}/attachments", @@ -1482,7 +1503,7 @@ impl Apps { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/installation", @@ -1525,7 +1546,7 @@ impl Apps { &self, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1573,7 +1594,7 @@ impl Apps { installation_id: i64, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1620,7 +1641,7 @@ impl Apps { &self, installation_id: i64, repository_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/installations/{}/repositories/{}", @@ -1659,7 +1680,7 @@ impl Apps { &self, installation_id: i64, repository_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/installations/{}/repositories/{}", @@ -1696,7 +1717,7 @@ impl Apps { &self, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1731,7 +1752,7 @@ impl Apps { */ pub async fn list_all_subscriptions_for_authenticated_user( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/marketplace_purchases", None); self.client .get_all_pages( @@ -1761,7 +1782,7 @@ impl Apps { &self, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1797,7 +1818,7 @@ impl Apps { */ pub async fn list_all_subscriptions_for_authenticated_user_stubbed( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/marketplace_purchases/stubbed", None); self.client .get_all_pages( @@ -1827,7 +1848,7 @@ impl Apps { pub async fn get_user_installation( &self, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/installation", diff --git a/github/src/billing.rs b/github/src/billing.rs index 536e446a..8cf5434d 100644 --- a/github/src/billing.rs +++ b/github/src/billing.rs @@ -31,7 +31,7 @@ impl Billing { pub async fn get_github_actions_billing_ghe( &self, enterprise: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/settings/billing/actions", @@ -69,7 +69,7 @@ impl Billing { pub async fn get_github_packages_billing_ghe( &self, enterprise: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/settings/billing/packages", @@ -107,7 +107,7 @@ impl Billing { pub async fn get_shared_storage_billing_ghe( &self, enterprise: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/settings/billing/shared-storage", @@ -145,7 +145,7 @@ impl Billing { pub async fn get_github_actions_billing_org( &self, org: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/settings/billing/actions", @@ -183,7 +183,7 @@ impl Billing { pub async fn get_github_packages_billing_org( &self, org: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/settings/billing/packages", @@ -221,7 +221,7 @@ impl Billing { pub async fn get_shared_storage_billing_org( &self, org: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/settings/billing/shared-storage", @@ -259,7 +259,7 @@ impl Billing { pub async fn get_github_actions_billing_user( &self, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/settings/billing/actions", @@ -297,7 +297,7 @@ impl Billing { pub async fn get_github_packages_billing_user( &self, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/settings/billing/packages", @@ -335,7 +335,7 @@ impl Billing { pub async fn get_shared_storage_billing_user( &self, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/settings/billing/shared-storage", diff --git a/github/src/checks.rs b/github/src/checks.rs index ded2bd62..6d73a0ee 100644 --- a/github/src/checks.rs +++ b/github/src/checks.rs @@ -34,7 +34,7 @@ impl Checks { owner: &str, repo: &str, body: &crate::types::ChecksCreateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/check-runs", @@ -75,7 +75,7 @@ impl Checks { owner: &str, repo: &str, check_run_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/check-runs/{}", @@ -118,7 +118,7 @@ impl Checks { repo: &str, check_run_id: i64, body: &crate::types::ChecksUpdateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/check-runs/{}", @@ -162,7 +162,7 @@ impl Checks { check_run_id: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -207,7 +207,7 @@ impl Checks { owner: &str, repo: &str, check_run_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/check-runs/{}/annotations", @@ -248,7 +248,7 @@ impl Checks { owner: &str, repo: &str, body: &crate::types::ChecksCreateSuiteRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/check-suites", @@ -286,7 +286,7 @@ impl Checks { owner: &str, repo: &str, body: &crate::types::Preferences, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/check-suites/preferences", @@ -327,7 +327,7 @@ impl Checks { owner: &str, repo: &str, check_suite_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/check-suites/{}", @@ -381,7 +381,7 @@ impl Checks { filter: crate::types::ActionsListJobsWorkflowRunFilter, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !check_name.is_empty() { query_args.push(("check_name".to_string(), check_name.to_string())); @@ -441,7 +441,7 @@ impl Checks { owner: &str, repo: &str, check_suite_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/check-suites/{}/rerequest", @@ -497,7 +497,7 @@ impl Checks { per_page: i64, page: i64, app_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if app_id > 0 { query_args.push(("app_id".to_string(), app_id.to_string())); @@ -568,7 +568,7 @@ impl Checks { check_name: &str, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if app_id > 0 { query_args.push(("app_id".to_string(), app_id.to_string())); diff --git a/github/src/code_scanning.rs b/github/src/code_scanning.rs index a67919c5..0c399a42 100644 --- a/github/src/code_scanning.rs +++ b/github/src/code_scanning.rs @@ -49,7 +49,7 @@ impl CodeScanning { per_page: i64, ref_: &str, state: crate::types::CodeScanningAlertState, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -116,7 +116,7 @@ impl CodeScanning { tool_guid: &str, ref_: &str, state: crate::types::CodeScanningAlertState, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ref_.is_empty() { query_args.push(("ref".to_string(), ref_.to_string())); @@ -173,7 +173,7 @@ impl CodeScanning { owner: &str, repo: &str, alert_number: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/code-scanning/alerts/{}", @@ -214,7 +214,7 @@ impl CodeScanning { repo: &str, alert_number: i64, body: &crate::types::CodeScanningUpdateAlertRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/code-scanning/alerts/{}", @@ -260,7 +260,7 @@ impl CodeScanning { page: i64, per_page: i64, ref_: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -309,7 +309,7 @@ impl CodeScanning { repo: &str, alert_number: i64, ref_: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ref_.is_empty() { query_args.push(("ref".to_string(), ref_.to_string())); @@ -380,7 +380,7 @@ impl CodeScanning { per_page: i64, ref_: &str, sarif_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -454,7 +454,7 @@ impl CodeScanning { tool_guid: &str, ref_: &str, sarif_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ref_.is_empty() { query_args.push(("ref".to_string(), ref_.to_string())); @@ -528,7 +528,7 @@ impl CodeScanning { owner: &str, repo: &str, analysis_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/code-scanning/analyses/{}", @@ -633,7 +633,7 @@ impl CodeScanning { repo: &str, analysis_id: i64, confirm_delete: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !confirm_delete.is_empty() { query_args.push(("confirm_delete".to_string(), confirm_delete.to_string())); @@ -694,7 +694,7 @@ impl CodeScanning { owner: &str, repo: &str, body: &crate::types::CodeScanningUploadSarifRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/code-scanning/sarifs", @@ -733,7 +733,7 @@ impl CodeScanning { owner: &str, repo: &str, sarif_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/code-scanning/sarifs/{}", diff --git a/github/src/codes_of_conduct.rs b/github/src/codes_of_conduct.rs index e1786cf4..9a290b03 100644 --- a/github/src/codes_of_conduct.rs +++ b/github/src/codes_of_conduct.rs @@ -20,7 +20,9 @@ impl CodesOfConduct { * * FROM: */ - pub async fn get_all_codes_of_conduct(&self) -> ClientResult> { + pub async fn get_all_codes_of_conduct( + &self, + ) -> ClientResult>> { let url = self.client.url("/codes_of_conduct", None); self.client .get( @@ -45,7 +47,7 @@ impl CodesOfConduct { */ pub async fn get_all_all_codes_of_conduct( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/codes_of_conduct", None); self.client .get_all_pages( @@ -70,7 +72,10 @@ impl CodesOfConduct { * * * `key: &str` */ - pub async fn get_conduct_code(&self, key: &str) -> ClientResult { + pub async fn get_conduct_code( + &self, + key: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/codes_of_conduct/{}", @@ -108,7 +113,7 @@ impl CodesOfConduct { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/community/code_of_conduct", diff --git a/github/src/emojis.rs b/github/src/emojis.rs index c7868ecb..bb4098fb 100644 --- a/github/src/emojis.rs +++ b/github/src/emojis.rs @@ -20,7 +20,7 @@ impl Emojis { * * FROM: */ - pub async fn get(&self) -> ClientResult { + pub async fn get(&self) -> ClientResult> { let url = self.client.url("/emojis", None); self.client .get( diff --git a/github/src/enterprise_admin.rs b/github/src/enterprise_admin.rs index b59efc57..3a97867b 100644 --- a/github/src/enterprise_admin.rs +++ b/github/src/enterprise_admin.rs @@ -29,7 +29,7 @@ impl EnterpriseAdmin { pub async fn get_github_actions_permissions_enterprise( &self, enterprise: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/permissions", @@ -66,7 +66,7 @@ impl EnterpriseAdmin { &self, enterprise: &str, body: &crate::types::EnterpriseAdminSetGithubActionsPermissionsRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/permissions", @@ -106,8 +106,9 @@ impl EnterpriseAdmin { enterprise: &str, per_page: i64, page: i64, - ) -> ClientResult - { + ) -> ClientResult< + crate::Response, + > { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -153,7 +154,7 @@ impl EnterpriseAdmin { &self, enterprise: &str, body: &crate::types::EnterpriseAdminSetOrgAccessSelfHostedRunnerGroupInRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/permissions/organizations", @@ -191,7 +192,7 @@ impl EnterpriseAdmin { &self, enterprise: &str, org_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/permissions/organizations/{}", @@ -230,7 +231,7 @@ impl EnterpriseAdmin { &self, enterprise: &str, org_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/permissions/organizations/{}", @@ -267,7 +268,7 @@ impl EnterpriseAdmin { pub async fn get_allowed_actions_enterprise( &self, enterprise: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/permissions/selected-actions", @@ -304,7 +305,7 @@ impl EnterpriseAdmin { &self, enterprise: &str, body: &crate::types::SelectedActions, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/permissions/selected-actions", @@ -344,7 +345,9 @@ impl EnterpriseAdmin { enterprise: &str, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult< + crate::Response, + > { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -390,7 +393,7 @@ impl EnterpriseAdmin { &self, enterprise: &str, body: &crate::types::EnterpriseAdminCreateSelfHostedRunnerGroupRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/runner-groups", @@ -428,7 +431,7 @@ impl EnterpriseAdmin { &self, enterprise: &str, runner_group_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/runner-groups/{}", @@ -467,7 +470,7 @@ impl EnterpriseAdmin { &self, enterprise: &str, runner_group_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/runner-groups/{}", @@ -507,7 +510,7 @@ impl EnterpriseAdmin { enterprise: &str, runner_group_id: i64, body: &crate::types::EnterpriseAdminUpdateSelfHostedRunnerGroupRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/runner-groups/{}", @@ -550,8 +553,9 @@ impl EnterpriseAdmin { runner_group_id: i64, per_page: i64, page: i64, - ) -> ClientResult - { + ) -> ClientResult< + crate::Response, + > { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -600,7 +604,7 @@ impl EnterpriseAdmin { enterprise: &str, runner_group_id: i64, body: &crate::types::EnterpriseAdminSetOrgAccessSelfHostedRunnerGroupInRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/runner-groups/{}/organizations", @@ -641,7 +645,7 @@ impl EnterpriseAdmin { enterprise: &str, runner_group_id: i64, org_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/runner-groups/{}/organizations/{}", @@ -683,7 +687,7 @@ impl EnterpriseAdmin { enterprise: &str, runner_group_id: i64, org_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/runner-groups/{}/organizations/{}", @@ -727,7 +731,8 @@ impl EnterpriseAdmin { runner_group_id: i64, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> + { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -776,7 +781,7 @@ impl EnterpriseAdmin { enterprise: &str, runner_group_id: i64, body: &crate::types::ActionsSetSelfHostedRunnersInGroupOrgRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/runner-groups/{}/runners", @@ -818,7 +823,7 @@ impl EnterpriseAdmin { enterprise: &str, runner_group_id: i64, runner_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/runner-groups/{}/runners/{}", @@ -860,7 +865,7 @@ impl EnterpriseAdmin { enterprise: &str, runner_group_id: i64, runner_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/runner-groups/{}/runners/{}", @@ -902,7 +907,8 @@ impl EnterpriseAdmin { enterprise: &str, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> + { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -947,7 +953,7 @@ impl EnterpriseAdmin { pub async fn list_runner_applications_for_enterprise( &self, enterprise: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/enterprises/{}/actions/runners/downloads", @@ -981,7 +987,7 @@ impl EnterpriseAdmin { pub async fn list_all_runner_applications_for_enterprise( &self, enterprise: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/enterprises/{}/actions/runners/downloads", @@ -1025,7 +1031,7 @@ impl EnterpriseAdmin { pub async fn create_registration_token_for_enterprise( &self, enterprise: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/runners/registration-token", @@ -1070,7 +1076,7 @@ impl EnterpriseAdmin { pub async fn create_remove_token_for_enterprise( &self, enterprise: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/runners/remove-token", @@ -1108,7 +1114,7 @@ impl EnterpriseAdmin { &self, enterprise: &str, runner_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/runners/{}", @@ -1147,7 +1153,7 @@ impl EnterpriseAdmin { &self, enterprise: &str, runner_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/enterprises/{}/actions/runners/{}", @@ -1204,7 +1210,7 @@ impl EnterpriseAdmin { order: crate::types::Order, page: i64, per_page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -1265,7 +1271,7 @@ impl EnterpriseAdmin { after: &str, before: &str, order: crate::types::Order, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -1325,7 +1331,7 @@ impl EnterpriseAdmin { count: i64, filter: &str, excluded_attributes: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -1380,7 +1386,7 @@ impl EnterpriseAdmin { &self, enterprise: &str, body: &crate::types::EnterpriseAdminProvisionInviteGroupRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/scim/v2/enterprises/{}/Groups", @@ -1418,7 +1424,7 @@ impl EnterpriseAdmin { enterprise: &str, scim_group_id: &str, excluded_attributes: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !excluded_attributes.is_empty() { query_args.push(( @@ -1467,7 +1473,7 @@ impl EnterpriseAdmin { enterprise: &str, scim_group_id: &str, body: &crate::types::EnterpriseAdminProvisionInviteGroupRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/scim/v2/enterprises/{}/Groups/{}", @@ -1504,7 +1510,7 @@ impl EnterpriseAdmin { &self, enterprise: &str, scim_group_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/scim/v2/enterprises/{}/Groups/{}", @@ -1544,7 +1550,7 @@ impl EnterpriseAdmin { enterprise: &str, scim_group_id: &str, body: &crate::types::EnterpriseAdminUpdateAttributeGroupRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/scim/v2/enterprises/{}/Groups/{}", @@ -1602,7 +1608,7 @@ impl EnterpriseAdmin { start_index: i64, count: i64, filter: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -1653,7 +1659,7 @@ impl EnterpriseAdmin { &self, enterprise: &str, body: &crate::types::EnterpriseAdminProvisionInviteUserRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/scim/v2/enterprises/{}/Users", @@ -1689,7 +1695,7 @@ impl EnterpriseAdmin { &self, enterprise: &str, scim_user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/scim/v2/enterprises/{}/Users/{}", @@ -1733,7 +1739,7 @@ impl EnterpriseAdmin { enterprise: &str, scim_user_id: &str, body: &crate::types::EnterpriseAdminProvisionInviteUserRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/scim/v2/enterprises/{}/Users/{}", @@ -1770,7 +1776,7 @@ impl EnterpriseAdmin { &self, enterprise: &str, scim_user_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/scim/v2/enterprises/{}/Users/{}", @@ -1825,7 +1831,7 @@ impl EnterpriseAdmin { enterprise: &str, scim_user_id: &str, body: &crate::types::EnterpriseAdminUpdateAttributeUserRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/scim/v2/enterprises/{}/Users/{}", diff --git a/github/src/gists.rs b/github/src/gists.rs index 8e1ba068..13e885aa 100644 --- a/github/src/gists.rs +++ b/github/src/gists.rs @@ -31,7 +31,7 @@ impl Gists { since: Option>, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -68,7 +68,7 @@ impl Gists { pub async fn list_all( &self, since: Option>, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if let Some(date) = since { query_args.push(("since".to_string(), date.to_rfc3339())); @@ -99,7 +99,7 @@ impl Gists { pub async fn create( &self, body: &crate::types::GistsCreateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/gists", None); self.client .post( @@ -133,7 +133,7 @@ impl Gists { since: Option>, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -172,7 +172,7 @@ impl Gists { pub async fn list_all_public( &self, since: Option>, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if let Some(date) = since { query_args.push(("since".to_string(), date.to_rfc3339())); @@ -209,7 +209,7 @@ impl Gists { since: Option>, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -246,7 +246,7 @@ impl Gists { pub async fn list_all_starred( &self, since: Option>, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if let Some(date) = since { query_args.push(("since".to_string(), date.to_rfc3339())); @@ -276,7 +276,10 @@ impl Gists { * * * `gist_id: &str` -- gist_id parameter. */ - pub async fn get(&self, gist_id: &str) -> ClientResult { + pub async fn get( + &self, + gist_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!("/gists/{}", crate::progenitor_support::encode_path(gist_id),), None, @@ -304,7 +307,7 @@ impl Gists { * * * `gist_id: &str` -- gist_id parameter. */ - pub async fn delete(&self, gist_id: &str) -> ClientResult<()> { + pub async fn delete(&self, gist_id: &str) -> ClientResult> { let url = self.client.url( &format!("/gists/{}", crate::progenitor_support::encode_path(gist_id),), None, @@ -336,7 +339,7 @@ impl Gists { &self, gist_id: &str, body: &crate::types::GistsUpdateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!("/gists/{}", crate::progenitor_support::encode_path(gist_id),), None, @@ -371,7 +374,7 @@ impl Gists { gist_id: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -412,7 +415,7 @@ impl Gists { pub async fn list_all_comments( &self, gist_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/gists/{}/comments", @@ -447,7 +450,7 @@ impl Gists { &self, gist_id: &str, body: &crate::types::PullsUpdateReviewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/gists/{}/comments", @@ -483,7 +486,7 @@ impl Gists { &self, gist_id: &str, comment_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/gists/{}/comments/{}", @@ -516,7 +519,11 @@ impl Gists { * * `gist_id: &str` -- gist_id parameter. * * `comment_id: i64` -- comment_id parameter. */ - pub async fn delete_comment(&self, gist_id: &str, comment_id: i64) -> ClientResult<()> { + pub async fn delete_comment( + &self, + gist_id: &str, + comment_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/gists/{}/comments/{}", @@ -554,7 +561,7 @@ impl Gists { gist_id: &str, comment_id: i64, body: &crate::types::PullsUpdateReviewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/gists/{}/comments/{}", @@ -593,7 +600,7 @@ impl Gists { gist_id: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -634,7 +641,7 @@ impl Gists { pub async fn list_all_commits( &self, gist_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/gists/{}/commits", @@ -672,7 +679,7 @@ impl Gists { gist_id: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -713,7 +720,7 @@ impl Gists { pub async fn list_all_forks( &self, gist_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/gists/{}/forks", @@ -744,7 +751,10 @@ impl Gists { * * * `gist_id: &str` -- gist_id parameter. */ - pub async fn fork(&self, gist_id: &str) -> ClientResult { + pub async fn fork( + &self, + gist_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/gists/{}/forks", @@ -775,7 +785,7 @@ impl Gists { * * * `gist_id: &str` -- gist_id parameter. */ - pub async fn check_is_starred(&self, gist_id: &str) -> ClientResult<()> { + pub async fn check_is_starred(&self, gist_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/gists/{}/star", @@ -806,7 +816,7 @@ impl Gists { * * * `gist_id: &str` -- gist_id parameter. */ - pub async fn star(&self, gist_id: &str) -> ClientResult<()> { + pub async fn star(&self, gist_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/gists/{}/star", @@ -837,7 +847,7 @@ impl Gists { * * * `gist_id: &str` -- gist_id parameter. */ - pub async fn unstar(&self, gist_id: &str) -> ClientResult<()> { + pub async fn unstar(&self, gist_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/gists/{}/star", @@ -873,7 +883,7 @@ impl Gists { &self, gist_id: &str, sha: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/gists/{}/{}", @@ -914,7 +924,7 @@ impl Gists { since: Option>, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -959,7 +969,7 @@ impl Gists { &self, username: &str, since: Option>, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if let Some(date) = since { query_args.push(("since".to_string(), date.to_rfc3339())); diff --git a/github/src/git.rs b/github/src/git.rs index 53ba5b96..c5651fa6 100644 --- a/github/src/git.rs +++ b/github/src/git.rs @@ -30,7 +30,7 @@ impl Git { owner: &str, repo: &str, body: &crate::types::GitCreateBlobRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/git/blobs", @@ -71,7 +71,7 @@ impl Git { owner: &str, repo: &str, file_sha: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/git/blobs/{}", @@ -139,7 +139,7 @@ impl Git { owner: &str, repo: &str, body: &crate::types::GitCreateCommitRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/git/commits", @@ -207,7 +207,7 @@ impl Git { owner: &str, repo: &str, commit_sha: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/git/commits/{}", @@ -257,7 +257,7 @@ impl Git { ref_: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -308,7 +308,7 @@ impl Git { owner: &str, repo: &str, ref_: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/git/matching-refs/{}", @@ -350,7 +350,7 @@ impl Git { owner: &str, repo: &str, ref_: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/git/ref/{}", @@ -389,7 +389,7 @@ impl Git { owner: &str, repo: &str, body: &crate::types::GitCreateRefRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/git/refs", @@ -423,7 +423,12 @@ impl Git { * * `repo: &str` * * `ref_: &str` -- ref parameter. */ - pub async fn delete_ref(&self, owner: &str, repo: &str, ref_: &str) -> ClientResult<()> { + pub async fn delete_ref( + &self, + owner: &str, + repo: &str, + ref_: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/git/refs/{}", @@ -464,7 +469,7 @@ impl Git { repo: &str, ref_: &str, body: &crate::types::GitUpdateRefRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/git/refs/{}", @@ -532,7 +537,7 @@ impl Git { owner: &str, repo: &str, body: &crate::types::GitCreateTagRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/git/tags", @@ -598,7 +603,7 @@ impl Git { owner: &str, repo: &str, tag_sha: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/git/tags/{}", @@ -639,7 +644,7 @@ impl Git { owner: &str, repo: &str, body: &crate::types::GitCreateTreeRequestData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/git/trees", @@ -682,7 +687,7 @@ impl Git { repo: &str, tree_sha: &str, recursive: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !recursive.is_empty() { query_args.push(("recursive".to_string(), recursive.to_string())); diff --git a/github/src/gitignore.rs b/github/src/gitignore.rs index 9cfab672..77d335b4 100644 --- a/github/src/gitignore.rs +++ b/github/src/gitignore.rs @@ -20,7 +20,7 @@ impl Gitignore { * * FROM: */ - pub async fn get_all_templates(&self) -> ClientResult> { + pub async fn get_all_templates(&self) -> ClientResult>> { let url = self.client.url("/gitignore/templates", None); self.client .get( @@ -43,7 +43,7 @@ impl Gitignore { * * FROM: */ - pub async fn get_all_all_templates(&self) -> ClientResult> { + pub async fn get_all_all_templates(&self) -> ClientResult>> { let url = self.client.url("/gitignore/templates", None); self.client .get_all_pages( @@ -69,7 +69,10 @@ impl Gitignore { * * * `name: &str` */ - pub async fn get_template(&self, name: &str) -> ClientResult { + pub async fn get_template( + &self, + name: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/gitignore/templates/{}", diff --git a/github/src/interactions.rs b/github/src/interactions.rs index b43a8f84..19c739a0 100644 --- a/github/src/interactions.rs +++ b/github/src/interactions.rs @@ -27,7 +27,7 @@ impl Interactions { pub async fn get_restrictions_for_org( &self, org: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/interaction-limits", @@ -62,7 +62,7 @@ impl Interactions { &self, org: &str, body: &crate::types::InteractionLimit, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/interaction-limits", @@ -93,7 +93,10 @@ impl Interactions { * * * `org: &str` */ - pub async fn remove_restrictions_for_org(&self, org: &str) -> ClientResult<()> { + pub async fn remove_restrictions_for_org( + &self, + org: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/interaction-limits", @@ -129,7 +132,7 @@ impl Interactions { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/interaction-limits", @@ -167,7 +170,7 @@ impl Interactions { owner: &str, repo: &str, body: &crate::types::InteractionLimit, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/interaction-limits", @@ -200,7 +203,11 @@ impl Interactions { * * `owner: &str` * * `repo: &str` */ - pub async fn remove_restrictions_for_repo(&self, owner: &str, repo: &str) -> ClientResult<()> { + pub async fn remove_restrictions_for_repo( + &self, + owner: &str, + repo: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/interaction-limits", @@ -230,7 +237,7 @@ impl Interactions { */ pub async fn get_restrictions_for_authenticated_user( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user/interaction-limits", None); self.client .get( @@ -254,7 +261,7 @@ impl Interactions { pub async fn set_restrictions_for_authenticated_user( &self, body: &crate::types::InteractionLimit, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user/interaction-limits", None); self.client .put( @@ -275,7 +282,9 @@ impl Interactions { * * FROM: */ - pub async fn remove_restrictions_for_authenticated_user(&self) -> ClientResult<()> { + pub async fn remove_restrictions_for_authenticated_user( + &self, + ) -> ClientResult> { let url = self.client.url("/user/interaction-limits", None); self.client .delete( diff --git a/github/src/issues.rs b/github/src/issues.rs index 6cc00c89..72669aa2 100644 --- a/github/src/issues.rs +++ b/github/src/issues.rs @@ -64,7 +64,7 @@ impl Issues { pulls: bool, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if collab { query_args.push(("collab".to_string(), collab.to_string())); @@ -145,7 +145,7 @@ impl Issues { orgs: bool, owned: bool, pulls: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if collab { query_args.push(("collab".to_string(), collab.to_string())); @@ -233,7 +233,7 @@ impl Issues { since: Option>, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -303,7 +303,7 @@ impl Issues { sort: crate::types::IssuesListSort, direction: crate::types::Order, since: Option>, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -364,7 +364,7 @@ impl Issues { repo: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -407,7 +407,7 @@ impl Issues { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/assignees", @@ -450,7 +450,7 @@ impl Issues { owner: &str, repo: &str, assignee: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/assignees/{}", @@ -517,7 +517,7 @@ impl Issues { since: Option>, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !assignee.is_empty() { query_args.push(("assignee".to_string(), assignee.to_string())); @@ -601,7 +601,7 @@ impl Issues { sort: crate::types::IssuesListSort, direction: crate::types::Order, since: Option>, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !assignee.is_empty() { query_args.push(("assignee".to_string(), assignee.to_string())); @@ -671,7 +671,7 @@ impl Issues { owner: &str, repo: &str, body: &crate::types::IssuesCreateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/issues", @@ -720,7 +720,7 @@ impl Issues { since: Option>, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -775,7 +775,7 @@ impl Issues { sort: crate::types::Sort, direction: crate::types::Order, since: Option>, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -826,7 +826,7 @@ impl Issues { owner: &str, repo: &str, comment_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/issues/comments/{}", @@ -866,7 +866,7 @@ impl Issues { owner: &str, repo: &str, comment_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/issues/comments/{}", @@ -907,7 +907,7 @@ impl Issues { repo: &str, comment_id: i64, body: &crate::types::PullsUpdateReviewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/issues/comments/{}", @@ -949,7 +949,7 @@ impl Issues { repo: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -992,7 +992,7 @@ impl Issues { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/issues/events", @@ -1031,7 +1031,7 @@ impl Issues { owner: &str, repo: &str, event_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/issues/events/{}", @@ -1081,7 +1081,7 @@ impl Issues { owner: &str, repo: &str, issue_number: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/issues/{}", @@ -1122,7 +1122,7 @@ impl Issues { repo: &str, issue_number: i64, body: &crate::types::IssuesUpdateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/issues/{}", @@ -1163,7 +1163,7 @@ impl Issues { repo: &str, issue_number: i64, body: &crate::types::IssuesAddAssigneesRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/issues/{}/assignees", @@ -1204,7 +1204,7 @@ impl Issues { repo: &str, issue_number: i64, body: &crate::types::IssuesAddAssigneesRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/issues/{}/assignees", @@ -1250,7 +1250,7 @@ impl Issues { since: Option>, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1299,7 +1299,7 @@ impl Issues { repo: &str, issue_number: i64, since: Option>, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if let Some(date) = since { query_args.push(("since".to_string(), date.to_rfc3339())); @@ -1346,7 +1346,7 @@ impl Issues { repo: &str, issue_number: i64, body: &crate::types::PullsUpdateReviewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/issues/{}/comments", @@ -1390,7 +1390,7 @@ impl Issues { issue_number: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1435,7 +1435,7 @@ impl Issues { owner: &str, repo: &str, issue_number: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/issues/{}/events", @@ -1479,7 +1479,7 @@ impl Issues { issue_number: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1524,7 +1524,7 @@ impl Issues { owner: &str, repo: &str, issue_number: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/issues/{}/labels", @@ -1565,7 +1565,7 @@ impl Issues { repo: &str, issue_number: i64, body: &crate::types::IssuesSetLabelsRequestAnyOf, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/issues/{}/labels", @@ -1606,7 +1606,7 @@ impl Issues { repo: &str, issue_number: i64, body: &crate::types::IssuesAddLabelsRequestOneOf, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/issues/{}/labels", @@ -1646,7 +1646,7 @@ impl Issues { owner: &str, repo: &str, issue_number: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/issues/{}/labels", @@ -1688,7 +1688,7 @@ impl Issues { repo: &str, issue_number: i64, name: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/issues/{}/labels/{}", @@ -1732,7 +1732,7 @@ impl Issues { repo: &str, issue_number: i64, body: &crate::types::IssuesLockRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/issues/{}/lock", @@ -1767,7 +1767,12 @@ impl Issues { * * `repo: &str` * * `issue_number: i64` -- issue_number parameter. */ - pub async fn unlock(&self, owner: &str, repo: &str, issue_number: i64) -> ClientResult<()> { + pub async fn unlock( + &self, + owner: &str, + repo: &str, + issue_number: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/issues/{}/lock", @@ -1811,7 +1816,7 @@ impl Issues { issue_number: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1856,7 +1861,7 @@ impl Issues { owner: &str, repo: &str, issue_number: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/issues/{}/timeline", @@ -1898,7 +1903,7 @@ impl Issues { repo: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1941,7 +1946,7 @@ impl Issues { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/labels", @@ -1979,7 +1984,7 @@ impl Issues { owner: &str, repo: &str, body: &crate::types::IssuesCreateLabelRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/labels", @@ -2018,7 +2023,7 @@ impl Issues { owner: &str, repo: &str, name: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/labels/{}", @@ -2053,7 +2058,12 @@ impl Issues { * * `repo: &str` * * `name: &str` */ - pub async fn delete_label(&self, owner: &str, repo: &str, name: &str) -> ClientResult<()> { + pub async fn delete_label( + &self, + owner: &str, + repo: &str, + name: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/labels/{}", @@ -2094,7 +2104,7 @@ impl Issues { repo: &str, name: &str, body: &crate::types::IssuesUpdateLabelRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/labels/{}", @@ -2144,7 +2154,7 @@ impl Issues { direction: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -2199,7 +2209,7 @@ impl Issues { state: crate::types::IssuesListState, sort: crate::types::IssuesListMilestonesSort, direction: crate::types::Order, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -2249,7 +2259,7 @@ impl Issues { owner: &str, repo: &str, body: &crate::types::IssuesCreateMilestoneRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/milestones", @@ -2288,7 +2298,7 @@ impl Issues { owner: &str, repo: &str, milestone_number: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/milestones/{}", @@ -2328,7 +2338,7 @@ impl Issues { owner: &str, repo: &str, milestone_number: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/milestones/{}", @@ -2369,7 +2379,7 @@ impl Issues { repo: &str, milestone_number: i64, body: &crate::types::IssuesCreateMilestoneRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/milestones/{}", @@ -2413,7 +2423,7 @@ impl Issues { milestone_number: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -2458,7 +2468,7 @@ impl Issues { owner: &str, repo: &str, milestone_number: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/milestones/{}/labels", @@ -2520,7 +2530,7 @@ impl Issues { since: Option>, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -2582,7 +2592,7 @@ impl Issues { sort: crate::types::IssuesListSort, direction: crate::types::Order, since: Option>, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); diff --git a/github/src/lib.rs b/github/src/lib.rs index d218fa49..5c42c772 100644 --- a/github/src/lib.rs +++ b/github/src/lib.rs @@ -236,15 +236,34 @@ pub mod search; pub mod secret_scanning; /// Interact with GitHub Teams. pub mod teams; +pub mod traits; pub mod types; /// Interact with and view information about users and also current user. pub mod users; #[doc(hidden)] pub mod utils; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -338,7 +357,9 @@ impl Client { A: Into, C: Into>, { - let http = reqwest::Client::builder().build()?; + let http = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build()?; let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); let client = reqwest_middleware::ClientBuilder::new(http) @@ -511,10 +532,10 @@ impl Client { ) .await?; *token_guard = Some(crate::auth::ExpiringInstallationToken::new( - token.token.clone(), + token.body.token.clone(), created_at, )); - token.token + token.body.token } }; let auth = format!("token {}", token); @@ -524,43 +545,23 @@ impl Client { } } - async fn request( + async fn make_request( &self, method: http::Method, uri: &str, message: Message, media_type: crate::utils::MediaType, authentication: crate::auth::AuthenticationConstraint, - ) -> ClientResult<(Option, Out)> - where - Out: serde::de::DeserializeOwned + 'static + Send, - { - #[cfg(feature = "httpcache")] - let uri2 = uri.to_string(); - + ) -> ClientResult { let (url, auth) = self.url_and_auth(uri, authentication).await?; - let instance = <&Client>::clone(&self); - - #[cfg(not(feature = "httpcache"))] - let mut req = instance.client.request(method, url); - - #[cfg(feature = "httpcache")] - let mut req = { - let mut req = instance.client.request(method.clone(), url); - if method == http::Method::GET { - if let Ok(etag) = instance.http_cache.lookup_etag(&uri2) { - req = req.header(http::header::IF_NONE_MATCH, etag); - } - } - req - }; + let mut req = self.client.request(method, url); if let Some(content_type) = &message.content_type { req = req.header(http::header::CONTENT_TYPE, content_type.clone()); } - req = req.header(http::header::USER_AGENT, &*instance.agent); + req = req.header(http::header::USER_AGENT, &*self.agent); req = req.header(http::header::ACCEPT, &media_type.to_string()); if let Some(auth_str) = auth { @@ -570,13 +571,42 @@ impl Client { if let Some(body) = message.body { req = req.body(body); } - let response = req.send().await?; - #[cfg(feature = "httpcache")] - let instance2 = <&Client>::clone(&self); + Ok(req) + } + + async fn request( + &self, + method: http::Method, + uri: &str, + message: Message, + media_type: crate::utils::MediaType, + authentication: crate::auth::AuthenticationConstraint, + ) -> ClientResult<(Option, crate::Response)> + where + Out: serde::de::DeserializeOwned + 'static + Send, + { + #[cfg(not(feature = "httpcache"))] + let req = self + .make_request(method.clone(), uri, message, media_type, authentication) + .await?; #[cfg(feature = "httpcache")] - let uri3 = uri.to_string(); + let req = { + let mut req = self + .make_request(method.clone(), uri, message, media_type, authentication) + .await?; + + if method == http::Method::GET { + if let Ok(etag) = self.http_cache.lookup_etag(&uri) { + req = req.header(http::header::IF_NONE_MATCH, etag); + } + } + + req + }; + + let response = req.send().await?; #[cfg(not(feature = "httpcache"))] let (remaining, reset) = crate::utils::get_header_values(response.headers()); @@ -585,6 +615,7 @@ impl Client { let (remaining, reset, etag) = crate::utils::get_header_values(response.headers()); let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -599,8 +630,8 @@ impl Client { #[cfg(feature = "httpcache")] { if let Some(etag) = etag { - if let Err(e) = instance2.http_cache.cache_response( - &uri3, + if let Err(e) = self.http_cache.cache_response( + &uri, &response_body, &etag, &next_link.as_ref().map(|n| n.0.clone()), @@ -618,26 +649,46 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((next_link, parsed_response)) - } else if status == http::StatusCode::NOT_MODIFIED { - // only supported case is when client provides if-none-match - // header when cargo builds with --cfg feature="httpcache" - #[cfg(feature = "httpcache")] - { - let body = instance2.http_cache.lookup_body(&uri3).unwrap(); - let out = serde_json::from_str::(&body).unwrap(); - let link = match next_link { - Some(next_link) => Ok(Some(next_link)), - None => instance2 - .http_cache - .lookup_next_link(&uri3) - .map(|next_link| next_link.map(crate::utils::NextLink)), - }; - link.map(|link| (link, out)) - } - #[cfg(not(feature = "httpcache"))] - { - unreachable!("this should not be reachable without the httpcache feature enabled") + Ok(( + next_link, + crate::Response::new(status, headers, parsed_response), + )) + } else if status.is_redirection() { + match status { + http::StatusCode::NOT_MODIFIED => { + // only supported case is when client provides if-none-match + // header when cargo builds with --cfg feature="httpcache" + #[cfg(feature = "httpcache")] + { + let body = self.http_cache.lookup_body(&uri).unwrap(); + let out = serde_json::from_str::(&body).unwrap(); + let link = match next_link { + Some(next_link) => Ok(Some(next_link)), + None => self + .http_cache + .lookup_next_link(&uri) + .map(|next_link| next_link.map(crate::utils::NextLink)), + }; + link.map(|link| (link, Response::new(status, headers, out))) + } + #[cfg(not(feature = "httpcache"))] + { + unreachable!( + "this should not be reachable without the httpcache feature enabled" + ) + } + } + _ => { + // The body still needs to be parsed. Except in the case of 304 (handled above), + // returning a body in the response is allowed. + let body = if std::any::TypeId::of::() == std::any::TypeId::of::<()>() { + serde_json::from_str("null")? + } else { + serde_json::from_slice::(&response_body)? + }; + + Ok((None, crate::Response::new(status, headers, body))) + } } } else { let error = match (remaining, reset) { @@ -675,7 +726,7 @@ impl Client { message: Message, media_type: crate::utils::MediaType, authentication: crate::auth::AuthenticationConstraint, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -685,7 +736,7 @@ impl Client { Ok(r) } - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -698,7 +749,7 @@ impl Client { uri: &str, media: crate::utils::MediaType, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -712,7 +763,11 @@ impl Client { .await } - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages( + &self, + uri: &str, + _message: Message, + ) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -722,7 +777,7 @@ impl Client { async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -739,7 +794,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -753,7 +808,7 @@ impl Client { .await } - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -772,7 +827,7 @@ impl Client { message: Message, media: crate::utils::MediaType, authentication: crate::auth::AuthenticationConstraint, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -785,7 +840,7 @@ impl Client { uri: &str, message: Message, media: crate::utils::MediaType, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -799,7 +854,7 @@ impl Client { .await } - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -807,7 +862,7 @@ impl Client { .await } - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -820,7 +875,7 @@ impl Client { uri: &str, message: Message, media: crate::utils::MediaType, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -834,7 +889,7 @@ impl Client { .await } - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -849,25 +904,29 @@ impl Client { } /// "unfold" paginated results of a vector of items - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } /// Endpoints to manage GitHub Actions using the REST API. diff --git a/github/src/licenses.rs b/github/src/licenses.rs index 4ce1c8d9..64be31f3 100644 --- a/github/src/licenses.rs +++ b/github/src/licenses.rs @@ -31,7 +31,7 @@ impl Licenses { featured: bool, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if featured { query_args.push(("featured".to_string(), featured.to_string())); @@ -68,7 +68,7 @@ impl Licenses { pub async fn get_all_all_commonly_used( &self, featured: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if featured { query_args.push(("featured".to_string(), featured.to_string())); @@ -98,7 +98,10 @@ impl Licenses { * * * `license: &str` */ - pub async fn get(&self, license: &str) -> ClientResult { + pub async fn get( + &self, + license: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/licenses/{}", @@ -136,7 +139,7 @@ impl Licenses { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/license", diff --git a/github/src/markdown.rs b/github/src/markdown.rs index c7178baf..5912e2d6 100644 --- a/github/src/markdown.rs +++ b/github/src/markdown.rs @@ -20,7 +20,10 @@ impl Markdown { * * FROM: */ - pub async fn render(&self, body: &crate::types::MarkdownRenderRequest) -> ClientResult { + pub async fn render( + &self, + body: &crate::types::MarkdownRenderRequest, + ) -> ClientResult> { let url = self.client.url("/markdown", None); self.client .post( @@ -41,7 +44,10 @@ impl Markdown { * * FROM: */ - pub async fn render_raw>(&self, body: T) -> ClientResult { + pub async fn render_raw>( + &self, + body: T, + ) -> ClientResult> { let url = self.client.url("/markdown/raw", None); self.client .post( diff --git a/github/src/meta.rs b/github/src/meta.rs index 306c8ac2..920dd93f 100644 --- a/github/src/meta.rs +++ b/github/src/meta.rs @@ -20,7 +20,7 @@ impl Meta { * * FROM: */ - pub async fn root(&self) -> ClientResult { + pub async fn root(&self) -> ClientResult> { let url = self.client.url("", None); self.client .get( @@ -43,7 +43,7 @@ impl Meta { * * FROM: */ - pub async fn get(&self) -> ClientResult { + pub async fn get(&self) -> ClientResult> { let url = self.client.url("/meta", None); self.client .get( @@ -68,7 +68,7 @@ impl Meta { * * * `s: &str` -- The words to show in Octocat's speech bubble. */ - pub async fn get_octocat(&self, s: &str) -> ClientResult { + pub async fn get_octocat(&self, s: &str) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !s.is_empty() { query_args.push(("s".to_string(), s.to_string())); @@ -92,7 +92,7 @@ impl Meta { * * Get a random sentence from the Zen of GitHub */ - pub async fn get_zen(&self) -> ClientResult { + pub async fn get_zen(&self) -> ClientResult> { let url = self.client.url("/zen", None); self.client .get( diff --git a/github/src/migrations.rs b/github/src/migrations.rs index e1b0abd6..7f9fdd74 100644 --- a/github/src/migrations.rs +++ b/github/src/migrations.rs @@ -33,7 +33,7 @@ impl Migrations { per_page: i64, page: i64, exclude: &[String], - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude.is_empty() { query_args.push(("exclude".to_string(), exclude.join(" "))); @@ -78,7 +78,7 @@ impl Migrations { &self, org: &str, exclude: &[String], - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude.is_empty() { query_args.push(("exclude".to_string(), exclude.join(" "))); @@ -119,7 +119,7 @@ impl Migrations { &self, org: &str, body: &crate::types::MigrationsStartRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/migrations", @@ -164,7 +164,7 @@ impl Migrations { org: &str, migration_id: i64, exclude: &[String], - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude.is_empty() { query_args.push(("exclude".to_string(), exclude.join(" "))); @@ -203,7 +203,11 @@ impl Migrations { * * `org: &str` * * `migration_id: i64` -- migration_id parameter. */ - pub async fn download_archive_for_org(&self, org: &str, migration_id: i64) -> ClientResult<()> { + pub async fn download_archive_for_org( + &self, + org: &str, + migration_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/migrations/{}/archive", @@ -236,7 +240,11 @@ impl Migrations { * * `org: &str` * * `migration_id: i64` -- migration_id parameter. */ - pub async fn delete_archive_for_org(&self, org: &str, migration_id: i64) -> ClientResult<()> { + pub async fn delete_archive_for_org( + &self, + org: &str, + migration_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/migrations/{}/archive", @@ -275,7 +283,7 @@ impl Migrations { org: &str, migration_id: i64, repo_name: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/migrations/{}/repos/{}/lock", @@ -317,7 +325,7 @@ impl Migrations { migration_id: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -360,7 +368,7 @@ impl Migrations { &self, org: &str, migration_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/migrations/{}/repositories", @@ -430,7 +438,7 @@ impl Migrations { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/import", @@ -468,7 +476,7 @@ impl Migrations { owner: &str, repo: &str, body: &crate::types::MigrationsStartImportRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/import", @@ -501,7 +509,11 @@ impl Migrations { * * `owner: &str` * * `repo: &str` */ - pub async fn cancel_import(&self, owner: &str, repo: &str) -> ClientResult<()> { + pub async fn cancel_import( + &self, + owner: &str, + repo: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/import", @@ -540,7 +552,7 @@ impl Migrations { owner: &str, repo: &str, body: &crate::types::MigrationsUpdateImportRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/import", @@ -581,7 +593,7 @@ impl Migrations { owner: &str, repo: &str, since: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if since > 0 { query_args.push(("since".to_string(), since.to_string())); @@ -624,7 +636,7 @@ impl Migrations { owner: &str, repo: &str, since: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if since > 0 { query_args.push(("since".to_string(), since.to_string())); @@ -670,7 +682,7 @@ impl Migrations { repo: &str, author_id: i64, body: &crate::types::Author, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/import/authors/{}", @@ -708,7 +720,7 @@ impl Migrations { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/import/large_files", @@ -742,7 +754,7 @@ impl Migrations { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/import/large_files", @@ -780,7 +792,7 @@ impl Migrations { owner: &str, repo: &str, body: &crate::types::MigrationsSetLfsPreferenceRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/import/lfs", @@ -817,7 +829,7 @@ impl Migrations { &self, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -852,7 +864,7 @@ impl Migrations { */ pub async fn list_all_for_authenticated_user( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/migrations", None); self.client .get_all_pages( @@ -876,7 +888,7 @@ impl Migrations { pub async fn start_for_authenticated_user( &self, body: &crate::types::MigrationsStartRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user/migrations", None); self.client .post( @@ -913,7 +925,7 @@ impl Migrations { &self, migration_id: i64, exclude: &[String], - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude.is_empty() { query_args.push(("exclude".to_string(), exclude.join(" "))); @@ -970,7 +982,10 @@ impl Migrations { * * * `migration_id: i64` -- migration_id parameter. */ - pub async fn get_archive_for_authenticated_user(&self, migration_id: i64) -> ClientResult<()> { + pub async fn get_archive_for_authenticated_user( + &self, + migration_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/user/migrations/{}/archive", @@ -1004,7 +1019,7 @@ impl Migrations { pub async fn delete_archive_for_authenticated_user( &self, migration_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/migrations/{}/archive", @@ -1040,7 +1055,7 @@ impl Migrations { &self, migration_id: i64, repo_name: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/migrations/{}/repos/{}/lock", @@ -1079,7 +1094,7 @@ impl Migrations { migration_id: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1120,7 +1135,7 @@ impl Migrations { pub async fn list_all_repos_for_user( &self, migration_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/user/migrations/{}/repositories", diff --git a/github/src/oauth_authorizations.rs b/github/src/oauth_authorizations.rs index fd6d5142..9978f4cb 100644 --- a/github/src/oauth_authorizations.rs +++ b/github/src/oauth_authorizations.rs @@ -33,7 +33,7 @@ impl OauthAuthorizations { per_page: i64, page: i64, client_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !client_id.is_empty() { query_args.push(("client_id".to_string(), client_id.to_string())); @@ -74,7 +74,7 @@ impl OauthAuthorizations { pub async fn list_all_grants( &self, client_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !client_id.is_empty() { query_args.push(("client_id".to_string(), client_id.to_string())); @@ -106,7 +106,10 @@ impl OauthAuthorizations { * * * `grant_id: i64` -- grant_id parameter. */ - pub async fn get_grant(&self, grant_id: i64) -> ClientResult { + pub async fn get_grant( + &self, + grant_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/applications/grants/{}", @@ -139,7 +142,7 @@ impl OauthAuthorizations { * * * `grant_id: i64` -- grant_id parameter. */ - pub async fn delete_grant(&self, grant_id: i64) -> ClientResult<()> { + pub async fn delete_grant(&self, grant_id: i64) -> ClientResult> { let url = self.client.url( &format!( "/applications/grants/{}", @@ -177,7 +180,7 @@ impl OauthAuthorizations { per_page: i64, page: i64, client_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !client_id.is_empty() { query_args.push(("client_id".to_string(), client_id.to_string())); @@ -216,7 +219,7 @@ impl OauthAuthorizations { pub async fn list_all_authorizations( &self, client_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !client_id.is_empty() { query_args.push(("client_id".to_string(), client_id.to_string())); @@ -257,7 +260,7 @@ impl OauthAuthorizations { pub async fn create_authorization( &self, body: &crate::types::OauthAuthorizationsCreateAuthorizationRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/authorizations", None); self.client .post( @@ -294,7 +297,7 @@ impl OauthAuthorizations { &self, client_id: &str, body: &crate::types::OauthAuthorizationsGetCreateAuthorizationAppRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/authorizations/clients/{}", @@ -337,7 +340,7 @@ impl OauthAuthorizations { client_id: &str, fingerprint: &str, body: &crate::types::OauthAuthorizationsGetCreateAuthorizationAppFingerprintRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/authorizations/clients/{}/{}", @@ -372,7 +375,7 @@ impl OauthAuthorizations { pub async fn get_authorization( &self, authorization_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/authorizations/{}", @@ -403,7 +406,10 @@ impl OauthAuthorizations { * * * `authorization_id: i64` -- authorization_id parameter. */ - pub async fn delete_authorization(&self, authorization_id: i64) -> ClientResult<()> { + pub async fn delete_authorization( + &self, + authorization_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/authorizations/{}", @@ -442,7 +448,7 @@ impl OauthAuthorizations { &self, authorization_id: i64, body: &crate::types::OauthAuthorizationsUpdateAuthorizationRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/authorizations/{}", diff --git a/github/src/orgs.rs b/github/src/orgs.rs index 8d321612..e9ea56e5 100644 --- a/github/src/orgs.rs +++ b/github/src/orgs.rs @@ -31,7 +31,7 @@ impl Orgs { &self, since: i64, per_page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if per_page > 0 { query_args.push(("per_page".to_string(), per_page.to_string())); @@ -67,7 +67,7 @@ impl Orgs { pub async fn list_all( &self, since: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if since > 0 { query_args.push(("since".to_string(), since.to_string())); @@ -99,7 +99,10 @@ impl Orgs { * * * `org: &str` */ - pub async fn get(&self, org: &str) -> ClientResult { + pub async fn get( + &self, + org: &str, + ) -> ClientResult> { let url = self.client.url( &format!("/orgs/{}", crate::progenitor_support::encode_path(org),), None, @@ -133,7 +136,7 @@ impl Orgs { &self, org: &str, body: &crate::types::OrgsUpdateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!("/orgs/{}", crate::progenitor_support::encode_path(org),), None, @@ -188,7 +191,7 @@ impl Orgs { order: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -251,7 +254,7 @@ impl Orgs { after: &str, before: &str, order: crate::types::Order, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -303,7 +306,7 @@ impl Orgs { pub async fn list_blocked_users( &self, org: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/blocks", @@ -335,7 +338,7 @@ impl Orgs { pub async fn list_all_blocked_users( &self, org: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/blocks", @@ -367,7 +370,11 @@ impl Orgs { * * `org: &str` * * `username: &str` */ - pub async fn check_blocked_user(&self, org: &str, username: &str) -> ClientResult<()> { + pub async fn check_blocked_user( + &self, + org: &str, + username: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/blocks/{}", @@ -400,7 +407,7 @@ impl Orgs { * * `org: &str` * * `username: &str` */ - pub async fn block_user(&self, org: &str, username: &str) -> ClientResult<()> { + pub async fn block_user(&self, org: &str, username: &str) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/blocks/{}", @@ -433,7 +440,11 @@ impl Orgs { * * `org: &str` * * `username: &str` */ - pub async fn unblock_user(&self, org: &str, username: &str) -> ClientResult<()> { + pub async fn unblock_user( + &self, + org: &str, + username: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/blocks/{}", @@ -470,7 +481,7 @@ impl Orgs { pub async fn list_saml_sso_authorizations( &self, org: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/credential-authorizations", @@ -504,7 +515,7 @@ impl Orgs { pub async fn list_all_saml_sso_authorizations( &self, org: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/credential-authorizations", @@ -542,7 +553,7 @@ impl Orgs { &self, org: &str, credential_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/credential-authorizations/{}", @@ -581,7 +592,7 @@ impl Orgs { org: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -622,7 +633,7 @@ impl Orgs { pub async fn list_all_failed_invitations( &self, org: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/failed_invitations", @@ -660,7 +671,7 @@ impl Orgs { org: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -698,7 +709,10 @@ impl Orgs { * * FROM: */ - pub async fn list_all_webhooks(&self, org: &str) -> ClientResult> { + pub async fn list_all_webhooks( + &self, + org: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/hooks", @@ -733,7 +747,7 @@ impl Orgs { &self, org: &str, body: &crate::types::OrgsCreateWebhookRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/hooks", @@ -769,7 +783,7 @@ impl Orgs { &self, org: &str, hook_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/hooks/{}", @@ -802,7 +816,11 @@ impl Orgs { * * `org: &str` * * `hook_id: i64` */ - pub async fn delete_webhook(&self, org: &str, hook_id: i64) -> ClientResult<()> { + pub async fn delete_webhook( + &self, + org: &str, + hook_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/hooks/{}", @@ -840,7 +858,7 @@ impl Orgs { org: &str, hook_id: i64, body: &crate::types::OrgsUpdateWebhookRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/hooks/{}", @@ -879,7 +897,7 @@ impl Orgs { &self, org: &str, hook_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/hooks/{}/config", @@ -919,7 +937,7 @@ impl Orgs { org: &str, hook_id: i64, body: &crate::types::AppsUpdateWebhookConfigAppRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/hooks/{}/config", @@ -960,7 +978,7 @@ impl Orgs { hook_id: i64, per_page: i64, cursor: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); @@ -1004,7 +1022,7 @@ impl Orgs { org: &str, hook_id: i64, cursor: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); @@ -1049,7 +1067,7 @@ impl Orgs { org: &str, hook_id: i64, delivery_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/hooks/{}/deliveries/{}", @@ -1089,7 +1107,7 @@ impl Orgs { org: &str, hook_id: i64, delivery_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/hooks/{}/deliveries/{}/attempts", @@ -1123,7 +1141,7 @@ impl Orgs { * * `org: &str` * * `hook_id: i64` */ - pub async fn ping_webhook(&self, org: &str, hook_id: i64) -> ClientResult<()> { + pub async fn ping_webhook(&self, org: &str, hook_id: i64) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/hooks/{}/pings", @@ -1162,7 +1180,7 @@ impl Orgs { org: &str, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1209,7 +1227,7 @@ impl Orgs { org: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1250,7 +1268,7 @@ impl Orgs { pub async fn list_all_pending_invitations( &self, org: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/invitations", @@ -1287,7 +1305,7 @@ impl Orgs { &self, org: &str, body: &crate::types::OrgsCreateInvitationRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/invitations", @@ -1321,7 +1339,11 @@ impl Orgs { * * `org: &str` * * `invitation_id: i64` -- invitation_id parameter. */ - pub async fn cancel_invitation(&self, org: &str, invitation_id: i64) -> ClientResult<()> { + pub async fn cancel_invitation( + &self, + org: &str, + invitation_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/invitations/{}", @@ -1362,7 +1384,7 @@ impl Orgs { invitation_id: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1405,7 +1427,7 @@ impl Orgs { &self, org: &str, invitation_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/invitations/{}/teams", @@ -1453,7 +1475,7 @@ impl Orgs { role: crate::types::OrgsListMembersRole, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !filter.to_string().is_empty() { query_args.push(("filter".to_string(), filter.to_string())); @@ -1502,7 +1524,7 @@ impl Orgs { org: &str, filter: crate::types::OrgsListMembersFilter, role: crate::types::OrgsListMembersRole, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !filter.to_string().is_empty() { query_args.push(("filter".to_string(), filter.to_string())); @@ -1543,7 +1565,11 @@ impl Orgs { * * `org: &str` * * `username: &str` */ - pub async fn check_membership_for_user(&self, org: &str, username: &str) -> ClientResult<()> { + pub async fn check_membership_for_user( + &self, + org: &str, + username: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/members/{}", @@ -1576,7 +1602,11 @@ impl Orgs { * * `org: &str` * * `username: &str` */ - pub async fn remove_member(&self, org: &str, username: &str) -> ClientResult<()> { + pub async fn remove_member( + &self, + org: &str, + username: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/members/{}", @@ -1613,7 +1643,7 @@ impl Orgs { &self, org: &str, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/memberships/{}", @@ -1659,7 +1689,7 @@ impl Orgs { org: &str, username: &str, body: &crate::types::OrgsSetMembershipUserRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/memberships/{}", @@ -1694,7 +1724,11 @@ impl Orgs { * * `org: &str` * * `username: &str` */ - pub async fn remove_membership_for_user(&self, org: &str, username: &str) -> ClientResult<()> { + pub async fn remove_membership_for_user( + &self, + org: &str, + username: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/memberships/{}", @@ -1737,7 +1771,7 @@ impl Orgs { filter: crate::types::OrgsListMembersFilter, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !filter.to_string().is_empty() { query_args.push(("filter".to_string(), filter.to_string())); @@ -1782,7 +1816,7 @@ impl Orgs { &self, org: &str, filter: crate::types::OrgsListMembersFilter, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !filter.to_string().is_empty() { query_args.push(("filter".to_string(), filter.to_string())); @@ -1824,7 +1858,7 @@ impl Orgs { &self, org: &str, username: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/outside_collaborators/{}", @@ -1857,7 +1891,11 @@ impl Orgs { * * `org: &str` * * `username: &str` */ - pub async fn remove_outside_collaborator(&self, org: &str, username: &str) -> ClientResult<()> { + pub async fn remove_outside_collaborator( + &self, + org: &str, + username: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/outside_collaborators/{}", @@ -1896,7 +1934,7 @@ impl Orgs { org: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1937,7 +1975,7 @@ impl Orgs { pub async fn list_all_public_members( &self, org: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/public_members", @@ -1973,7 +2011,7 @@ impl Orgs { &self, org: &str, username: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/public_members/{}", @@ -2012,7 +2050,7 @@ impl Orgs { &self, org: &str, username: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/public_members/{}", @@ -2049,7 +2087,7 @@ impl Orgs { &self, org: &str, username: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/public_members/{}", @@ -2088,7 +2126,7 @@ impl Orgs { state: crate::types::OrgMembershipState, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -2127,7 +2165,7 @@ impl Orgs { pub async fn list_all_memberships_for_authenticated_user( &self, state: crate::types::OrgMembershipState, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !state.to_string().is_empty() { query_args.push(("state".to_string(), state.to_string())); @@ -2162,7 +2200,7 @@ impl Orgs { pub async fn get_membership_for_authenticated_user( &self, org: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/memberships/orgs/{}", @@ -2197,7 +2235,7 @@ impl Orgs { &self, org: &str, body: &crate::types::OrgsUpdateMembershipRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/memberships/orgs/{}", @@ -2237,7 +2275,7 @@ impl Orgs { &self, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -2274,7 +2312,7 @@ impl Orgs { */ pub async fn list_all_for_authenticated_user( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/orgs", None); self.client .get_all_pages( @@ -2308,7 +2346,7 @@ impl Orgs { username: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -2351,7 +2389,7 @@ impl Orgs { pub async fn list_all_for_user( &self, username: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/users/{}/orgs", diff --git a/github/src/packages.rs b/github/src/packages.rs index 3f1cc572..90f57d36 100644 --- a/github/src/packages.rs +++ b/github/src/packages.rs @@ -34,7 +34,7 @@ impl Packages { package_type: crate::types::PackageType, package_name: &str, org: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/packages/{}/{}", @@ -78,7 +78,7 @@ impl Packages { package_type: crate::types::PackageType, package_name: &str, org: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/packages/{}/{}", @@ -128,7 +128,7 @@ impl Packages { package_name: &str, org: &str, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !token.is_empty() { query_args.push(("token".to_string(), token.to_string())); @@ -183,7 +183,7 @@ impl Packages { page: i64, per_page: i64, state: crate::types::PackagesGetAllPackageVersionsOwnedByOrgState, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -235,7 +235,7 @@ impl Packages { package_name: &str, org: &str, state: crate::types::PackagesGetAllPackageVersionsOwnedByOrgState, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !state.to_string().is_empty() { query_args.push(("state".to_string(), state.to_string())); @@ -286,7 +286,7 @@ impl Packages { package_name: &str, org: &str, package_version_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/packages/{}/{}/versions/{}", @@ -333,7 +333,7 @@ impl Packages { package_name: &str, org: &str, package_version_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/packages/{}/{}/versions/{}", @@ -384,7 +384,7 @@ impl Packages { package_name: &str, org: &str, package_version_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/packages/{}/{}/versions/{}/restore", @@ -426,7 +426,7 @@ impl Packages { &self, package_type: crate::types::PackageType, package_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/packages/{}/{}", @@ -466,7 +466,7 @@ impl Packages { &self, package_type: crate::types::PackageType, package_name: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/packages/{}/{}", @@ -511,7 +511,7 @@ impl Packages { package_type: crate::types::PackageType, package_name: &str, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !token.is_empty() { query_args.push(("token".to_string(), token.to_string())); @@ -563,7 +563,7 @@ impl Packages { page: i64, per_page: i64, state: crate::types::PackagesGetAllPackageVersionsOwnedByOrgState, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -613,7 +613,7 @@ impl Packages { package_type: crate::types::PackageType, package_name: &str, state: crate::types::PackagesGetAllPackageVersionsOwnedByOrgState, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !state.to_string().is_empty() { query_args.push(("state".to_string(), state.to_string())); @@ -661,7 +661,7 @@ impl Packages { package_type: crate::types::PackageType, package_name: &str, package_version_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/packages/{}/{}/versions/{}", @@ -704,7 +704,7 @@ impl Packages { package_type: crate::types::PackageType, package_name: &str, package_version_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/packages/{}/{}/versions/{}", @@ -750,7 +750,7 @@ impl Packages { package_type: crate::types::PackageType, package_name: &str, package_version_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/packages/{}/{}/versions/{}/restore", @@ -793,7 +793,7 @@ impl Packages { package_type: crate::types::PackageType, package_name: &str, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/packages/{}/{}", @@ -836,7 +836,7 @@ impl Packages { package_type: crate::types::PackageType, package_name: &str, username: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/users/{}/packages/{}/{}/versions", @@ -875,7 +875,7 @@ impl Packages { package_type: crate::types::PackageType, package_name: &str, username: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/users/{}/packages/{}/{}/versions", @@ -920,7 +920,7 @@ impl Packages { package_name: &str, package_version_id: i64, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/packages/{}/{}/versions/{}", diff --git a/github/src/projects.rs b/github/src/projects.rs index b7887435..08a241ca 100644 --- a/github/src/projects.rs +++ b/github/src/projects.rs @@ -33,7 +33,7 @@ impl Projects { state: crate::types::IssuesListState, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -78,7 +78,7 @@ impl Projects { &self, org: &str, state: crate::types::IssuesListState, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !state.to_string().is_empty() { query_args.push(("state".to_string(), state.to_string())); @@ -119,7 +119,7 @@ impl Projects { &self, org: &str, body: &crate::types::ProjectsCreateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/projects", @@ -150,7 +150,10 @@ impl Projects { * * * `card_id: i64` -- card_id parameter. */ - pub async fn get_card(&self, card_id: i64) -> ClientResult { + pub async fn get_card( + &self, + card_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/projects/columns/cards/{}", @@ -181,7 +184,7 @@ impl Projects { * * * `card_id: i64` -- card_id parameter. */ - pub async fn delete_card(&self, card_id: i64) -> ClientResult<()> { + pub async fn delete_card(&self, card_id: i64) -> ClientResult> { let url = self.client.url( &format!( "/projects/columns/cards/{}", @@ -216,7 +219,7 @@ impl Projects { &self, card_id: i64, body: &crate::types::ProjectsUpdateCardRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/projects/columns/cards/{}", @@ -251,7 +254,7 @@ impl Projects { &self, card_id: i64, body: &crate::types::ProjectsMoveCardRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/projects/columns/cards/{}/moves", @@ -282,7 +285,10 @@ impl Projects { * * * `column_id: i64` -- column_id parameter. */ - pub async fn get_column(&self, column_id: i64) -> ClientResult { + pub async fn get_column( + &self, + column_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/projects/columns/{}", @@ -313,7 +319,7 @@ impl Projects { * * * `column_id: i64` -- column_id parameter. */ - pub async fn delete_column(&self, column_id: i64) -> ClientResult<()> { + pub async fn delete_column(&self, column_id: i64) -> ClientResult> { let url = self.client.url( &format!( "/projects/columns/{}", @@ -348,7 +354,7 @@ impl Projects { &self, column_id: i64, body: &crate::types::ProjectsUpdateColumnRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/projects/columns/{}", @@ -388,7 +394,7 @@ impl Projects { archived_state: crate::types::ArchivedState, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !archived_state.to_string().is_empty() { query_args.push(("archived_state".to_string(), archived_state.to_string())); @@ -433,7 +439,7 @@ impl Projects { &self, column_id: i64, archived_state: crate::types::ArchivedState, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !archived_state.to_string().is_empty() { query_args.push(("archived_state".to_string(), archived_state.to_string())); @@ -474,7 +480,7 @@ impl Projects { &self, column_id: i64, body: &crate::types::ProjectsCreateCardRequestOneOf, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/projects/columns/{}/cards", @@ -509,7 +515,7 @@ impl Projects { &self, column_id: i64, body: &crate::types::ProjectsMoveColumnRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/projects/columns/{}/moves", @@ -540,7 +546,10 @@ impl Projects { * * * `project_id: i64` */ - pub async fn get(&self, project_id: i64) -> ClientResult { + pub async fn get( + &self, + project_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/projects/{}", @@ -571,7 +580,7 @@ impl Projects { * * * `project_id: i64` */ - pub async fn delete(&self, project_id: i64) -> ClientResult<()> { + pub async fn delete(&self, project_id: i64) -> ClientResult> { let url = self.client.url( &format!( "/projects/{}", @@ -606,7 +615,7 @@ impl Projects { &self, project_id: i64, body: &crate::types::ProjectsUpdateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/projects/{}", @@ -649,7 +658,7 @@ impl Projects { affiliation: crate::types::Affiliation, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !affiliation.to_string().is_empty() { query_args.push(("affiliation".to_string(), affiliation.to_string())); @@ -694,7 +703,7 @@ impl Projects { &self, project_id: i64, affiliation: crate::types::Affiliation, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !affiliation.to_string().is_empty() { query_args.push(("affiliation".to_string(), affiliation.to_string())); @@ -737,7 +746,7 @@ impl Projects { project_id: i64, username: &str, body: &crate::types::ProjectsAddCollaboratorRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/projects/{}/collaborators/{}", @@ -770,7 +779,11 @@ impl Projects { * * `project_id: i64` * * `username: &str` */ - pub async fn remove_collaborator(&self, project_id: i64, username: &str) -> ClientResult<()> { + pub async fn remove_collaborator( + &self, + project_id: i64, + username: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/projects/{}/collaborators/{}", @@ -807,7 +820,7 @@ impl Projects { &self, project_id: i64, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/projects/{}/collaborators/{}/permission", @@ -846,7 +859,7 @@ impl Projects { project_id: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -887,7 +900,7 @@ impl Projects { pub async fn list_all_columns( &self, project_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/projects/{}/columns", @@ -922,7 +935,7 @@ impl Projects { &self, project_id: i64, body: &crate::types::ProjectsUpdateColumnRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/projects/{}/columns", @@ -964,7 +977,7 @@ impl Projects { state: crate::types::IssuesListState, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1011,7 +1024,7 @@ impl Projects { owner: &str, repo: &str, state: crate::types::IssuesListState, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !state.to_string().is_empty() { query_args.push(("state".to_string(), state.to_string())); @@ -1055,7 +1068,7 @@ impl Projects { owner: &str, repo: &str, body: &crate::types::ProjectsCreateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/projects", @@ -1086,7 +1099,7 @@ impl Projects { pub async fn create_for_authenticated_user( &self, body: &crate::types::ProjectsCreateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user/projects", None); self.client .post( @@ -1120,7 +1133,7 @@ impl Projects { state: crate::types::IssuesListState, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1165,7 +1178,7 @@ impl Projects { &self, username: &str, state: crate::types::IssuesListState, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !state.to_string().is_empty() { query_args.push(("state".to_string(), state.to_string())); diff --git a/github/src/pulls.rs b/github/src/pulls.rs index 4549f036..184e7f5e 100644 --- a/github/src/pulls.rs +++ b/github/src/pulls.rs @@ -45,7 +45,7 @@ impl Pulls { direction: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !base.is_empty() { query_args.push(("base".to_string(), base.to_string())); @@ -108,7 +108,7 @@ impl Pulls { base: &str, sort: crate::types::PullsListSort, direction: crate::types::Order, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !base.is_empty() { query_args.push(("base".to_string(), base.to_string())); @@ -170,7 +170,7 @@ impl Pulls { owner: &str, repo: &str, body: &crate::types::PullsCreateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls", @@ -219,7 +219,7 @@ impl Pulls { since: Option>, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -274,7 +274,7 @@ impl Pulls { sort: crate::types::PullsListReviewCommentsRepoSort, direction: crate::types::Order, since: Option>, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -325,7 +325,7 @@ impl Pulls { owner: &str, repo: &str, comment_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/comments/{}", @@ -365,7 +365,7 @@ impl Pulls { owner: &str, repo: &str, comment_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/comments/{}", @@ -406,7 +406,7 @@ impl Pulls { repo: &str, comment_id: i64, body: &crate::types::PullsUpdateReviewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/comments/{}", @@ -460,7 +460,7 @@ impl Pulls { owner: &str, repo: &str, pull_number: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}", @@ -503,7 +503,7 @@ impl Pulls { repo: &str, pull_number: i64, body: &crate::types::PullsUpdateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}", @@ -555,7 +555,7 @@ impl Pulls { since: Option>, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -612,7 +612,7 @@ impl Pulls { sort: crate::types::Sort, direction: crate::types::Order, since: Option>, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -672,7 +672,7 @@ impl Pulls { repo: &str, pull_number: i64, body: &crate::types::PullsCreateReviewCommentRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}/comments", @@ -717,7 +717,7 @@ impl Pulls { pull_number: i64, comment_id: i64, body: &crate::types::PullsUpdateReviewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}/comments/{}/replies", @@ -762,7 +762,7 @@ impl Pulls { pull_number: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -807,7 +807,7 @@ impl Pulls { owner: &str, repo: &str, pull_number: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}/commits", @@ -851,7 +851,7 @@ impl Pulls { pull_number: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -896,7 +896,7 @@ impl Pulls { owner: &str, repo: &str, pull_number: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}/files", @@ -936,7 +936,7 @@ impl Pulls { owner: &str, repo: &str, pull_number: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}/merge", @@ -977,7 +977,7 @@ impl Pulls { repo: &str, pull_number: i64, body: &crate::types::PullsMergeRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}/merge", @@ -1021,7 +1021,7 @@ impl Pulls { pull_number: i64, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1071,7 +1071,7 @@ impl Pulls { repo: &str, pull_number: i64, body: &crate::types::PullsRequestReviewers, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}/requested_reviewers", @@ -1112,7 +1112,7 @@ impl Pulls { repo: &str, pull_number: i64, body: &crate::types::PullsRemoveRequestedReviewersRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}/requested_reviewers", @@ -1156,7 +1156,7 @@ impl Pulls { pull_number: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1201,7 +1201,7 @@ impl Pulls { owner: &str, repo: &str, pull_number: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}/reviews", @@ -1248,7 +1248,7 @@ impl Pulls { repo: &str, pull_number: i64, body: &crate::types::PullsCreateReviewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}/reviews", @@ -1290,7 +1290,7 @@ impl Pulls { repo: &str, pull_number: i64, review_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}/reviews/{}", @@ -1334,7 +1334,7 @@ impl Pulls { pull_number: i64, review_id: i64, body: &crate::types::PullsUpdateReviewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}/reviews/{}", @@ -1377,7 +1377,7 @@ impl Pulls { repo: &str, pull_number: i64, review_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}/reviews/{}", @@ -1424,7 +1424,7 @@ impl Pulls { review_id: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1471,7 +1471,7 @@ impl Pulls { repo: &str, pull_number: i64, review_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}/reviews/{}/comments", @@ -1515,7 +1515,7 @@ impl Pulls { pull_number: i64, review_id: i64, body: &crate::types::PullsDismissReviewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}/reviews/{}/dismissals", @@ -1559,7 +1559,7 @@ impl Pulls { pull_number: i64, review_id: i64, body: &crate::types::PullsSubmitReviewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}/reviews/{}/events", @@ -1601,7 +1601,7 @@ impl Pulls { repo: &str, pull_number: i64, body: &crate::types::PullsUpdateBranchRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/{}/update-branch", diff --git a/github/src/rate_limit.rs b/github/src/rate_limit.rs index 1330695b..918cdc2a 100644 --- a/github/src/rate_limit.rs +++ b/github/src/rate_limit.rs @@ -22,7 +22,7 @@ impl RateLimit { * * FROM: */ - pub async fn get(&self) -> ClientResult { + pub async fn get(&self) -> ClientResult> { let url = self.client.url("/rate_limit", None); self.client .get( diff --git a/github/src/reactions.rs b/github/src/reactions.rs index b98a452f..b94dd1f5 100644 --- a/github/src/reactions.rs +++ b/github/src/reactions.rs @@ -41,7 +41,7 @@ impl Reactions { content: crate::types::Content, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !content.to_string().is_empty() { query_args.push(("content".to_string(), content.to_string())); @@ -94,7 +94,7 @@ impl Reactions { discussion_number: i64, comment_number: i64, content: crate::types::Content, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !content.to_string().is_empty() { query_args.push(("content".to_string(), content.to_string())); @@ -146,7 +146,7 @@ impl Reactions { discussion_number: i64, comment_number: i64, body: &crate::types::ReactionsCreateIssueRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/discussions/{}/comments/{}/reactions", @@ -193,7 +193,7 @@ impl Reactions { discussion_number: i64, comment_number: i64, reaction_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/discussions/{}/comments/{}/reactions/{}", @@ -243,7 +243,7 @@ impl Reactions { content: crate::types::Content, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !content.to_string().is_empty() { query_args.push(("content".to_string(), content.to_string())); @@ -294,7 +294,7 @@ impl Reactions { team_slug: &str, discussion_number: i64, content: crate::types::Content, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !content.to_string().is_empty() { query_args.push(("content".to_string(), content.to_string())); @@ -343,7 +343,7 @@ impl Reactions { team_slug: &str, discussion_number: i64, body: &crate::types::ReactionsCreateIssueRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/discussions/{}/reactions", @@ -387,7 +387,7 @@ impl Reactions { team_slug: &str, discussion_number: i64, reaction_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/discussions/{}/reactions/{}", @@ -423,7 +423,7 @@ impl Reactions { * * * `reaction_id: i64` */ - pub async fn delete_legacy(&self, reaction_id: i64) -> ClientResult<()> { + pub async fn delete_legacy(&self, reaction_id: i64) -> ClientResult> { let url = self.client.url( &format!( "/reactions/{}", @@ -467,7 +467,7 @@ impl Reactions { content: crate::types::Content, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !content.to_string().is_empty() { query_args.push(("content".to_string(), content.to_string())); @@ -516,7 +516,7 @@ impl Reactions { repo: &str, comment_id: i64, content: crate::types::Content, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !content.to_string().is_empty() { query_args.push(("content".to_string(), content.to_string())); @@ -563,7 +563,7 @@ impl Reactions { repo: &str, comment_id: i64, body: &crate::types::ReactionsCreateIssueRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/comments/{}/reactions", @@ -607,7 +607,7 @@ impl Reactions { repo: &str, comment_id: i64, reaction_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/comments/{}/reactions/{}", @@ -654,7 +654,7 @@ impl Reactions { content: crate::types::Content, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !content.to_string().is_empty() { query_args.push(("content".to_string(), content.to_string())); @@ -703,7 +703,7 @@ impl Reactions { repo: &str, comment_id: i64, content: crate::types::Content, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !content.to_string().is_empty() { query_args.push(("content".to_string(), content.to_string())); @@ -750,7 +750,7 @@ impl Reactions { repo: &str, comment_id: i64, body: &crate::types::ReactionsCreateIssueRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/issues/comments/{}/reactions", @@ -794,7 +794,7 @@ impl Reactions { repo: &str, comment_id: i64, reaction_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/issues/comments/{}/reactions/{}", @@ -841,7 +841,7 @@ impl Reactions { content: crate::types::Content, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !content.to_string().is_empty() { query_args.push(("content".to_string(), content.to_string())); @@ -890,7 +890,7 @@ impl Reactions { repo: &str, issue_number: i64, content: crate::types::Content, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !content.to_string().is_empty() { query_args.push(("content".to_string(), content.to_string())); @@ -937,7 +937,7 @@ impl Reactions { repo: &str, issue_number: i64, body: &crate::types::ReactionsCreateIssueRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/issues/{}/reactions", @@ -981,7 +981,7 @@ impl Reactions { repo: &str, issue_number: i64, reaction_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/issues/{}/reactions/{}", @@ -1028,7 +1028,7 @@ impl Reactions { content: crate::types::Content, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !content.to_string().is_empty() { query_args.push(("content".to_string(), content.to_string())); @@ -1077,7 +1077,7 @@ impl Reactions { repo: &str, comment_id: i64, content: crate::types::Content, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !content.to_string().is_empty() { query_args.push(("content".to_string(), content.to_string())); @@ -1124,7 +1124,7 @@ impl Reactions { repo: &str, comment_id: i64, body: &crate::types::ReactionsCreateIssueRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/comments/{}/reactions", @@ -1168,7 +1168,7 @@ impl Reactions { repo: &str, comment_id: i64, reaction_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pulls/comments/{}/reactions/{}", @@ -1210,7 +1210,7 @@ impl Reactions { repo: &str, release_id: i64, body: &crate::types::ReactionsCreateReleaseRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/releases/{}/reactions", @@ -1258,7 +1258,7 @@ impl Reactions { content: crate::types::Content, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !content.to_string().is_empty() { query_args.push(("content".to_string(), content.to_string())); @@ -1309,7 +1309,7 @@ impl Reactions { discussion_number: i64, comment_number: i64, content: crate::types::Content, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !content.to_string().is_empty() { query_args.push(("content".to_string(), content.to_string())); @@ -1358,7 +1358,7 @@ impl Reactions { discussion_number: i64, comment_number: i64, body: &crate::types::ReactionsCreateIssueRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/discussions/{}/comments/{}/reactions", @@ -1404,7 +1404,7 @@ impl Reactions { content: crate::types::Content, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !content.to_string().is_empty() { query_args.push(("content".to_string(), content.to_string())); @@ -1453,7 +1453,7 @@ impl Reactions { team_id: i64, discussion_number: i64, content: crate::types::Content, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !content.to_string().is_empty() { query_args.push(("content".to_string(), content.to_string())); @@ -1499,7 +1499,7 @@ impl Reactions { team_id: i64, discussion_number: i64, body: &crate::types::ReactionsCreateIssueRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/discussions/{}/reactions", diff --git a/github/src/repos.rs b/github/src/repos.rs index 87b42f3e..483d2927 100644 --- a/github/src/repos.rs +++ b/github/src/repos.rs @@ -48,7 +48,7 @@ impl Repos { direction: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -101,7 +101,7 @@ impl Repos { type_: crate::types::ReposListOrgType, sort: crate::types::ReposListOrgSort, direction: crate::types::Order, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -155,7 +155,7 @@ impl Repos { &self, org: &str, body: &crate::types::ReposCreateInOrgRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/repos", @@ -189,7 +189,11 @@ impl Repos { * * `owner: &str` * * `repo: &str` */ - pub async fn get(&self, owner: &str, repo: &str) -> ClientResult { + pub async fn get( + &self, + owner: &str, + repo: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}", @@ -225,7 +229,7 @@ impl Repos { * * `owner: &str` * * `repo: &str` */ - pub async fn delete(&self, owner: &str, repo: &str) -> ClientResult<()> { + pub async fn delete(&self, owner: &str, repo: &str) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}", @@ -263,7 +267,7 @@ impl Repos { owner: &str, repo: &str, body: &crate::types::ReposUpdateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}", @@ -304,7 +308,7 @@ impl Repos { owner: &str, repo: &str, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -346,7 +350,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/autolinks", @@ -384,7 +388,7 @@ impl Repos { owner: &str, repo: &str, body: &crate::types::ReposCreateAutolinkRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/autolinks", @@ -425,7 +429,7 @@ impl Repos { owner: &str, repo: &str, autolink_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/autolinks/{}", @@ -467,7 +471,7 @@ impl Repos { owner: &str, repo: &str, autolink_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/autolinks/{}", @@ -505,7 +509,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/automated-security-fixes", @@ -542,7 +546,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/automated-security-fixes", @@ -585,7 +589,7 @@ impl Repos { protected: bool, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -632,7 +636,7 @@ impl Repos { owner: &str, repo: &str, protected: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if protected { query_args.push(("protected".to_string(), protected.to_string())); @@ -677,7 +681,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}", @@ -717,7 +721,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection", @@ -764,7 +768,7 @@ impl Repos { repo: &str, branch: &str, body: &crate::types::ReposUpdateBranchProtectionRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection", @@ -804,7 +808,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection", @@ -844,7 +848,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/enforce_admins", @@ -886,7 +890,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/enforce_admins", @@ -928,7 +932,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/enforce_admins", @@ -968,7 +972,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/required_pull_request_reviews", @@ -1008,7 +1012,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/required_pull_request_reviews", @@ -1053,7 +1057,7 @@ impl Repos { repo: &str, branch: &str, body: &crate::types::ReposUpdatePullRequestReviewProtection, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/required_pull_request_reviews", @@ -1097,7 +1101,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/required_signatures", @@ -1139,7 +1143,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/required_signatures", @@ -1181,7 +1185,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/required_signatures", @@ -1221,7 +1225,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/required_status_checks", @@ -1261,7 +1265,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/required_status_checks", @@ -1304,7 +1308,7 @@ impl Repos { repo: &str, branch: &str, body: &crate::types::ReposUpdateStatusCheckProtectionRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/required_status_checks", @@ -1344,7 +1348,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/required_status_checks/contexts", @@ -1380,7 +1384,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/required_status_checks/contexts", @@ -1421,7 +1425,7 @@ impl Repos { repo: &str, branch: &str, body: &crate::types::ReposAddStatusCheckContextsRequestOneOf, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/required_status_checks/contexts", @@ -1462,7 +1466,7 @@ impl Repos { repo: &str, branch: &str, body: &crate::types::ReposAddStatusCheckContextsRequestOneOf, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/required_status_checks/contexts", @@ -1503,7 +1507,7 @@ impl Repos { repo: &str, branch: &str, body: &crate::types::ReposAddStatusCheckContextsRequestOneOf, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/required_status_checks/contexts", @@ -1547,7 +1551,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/restrictions", @@ -1589,7 +1593,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/restrictions", @@ -1631,7 +1635,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/restrictions/apps", @@ -1669,7 +1673,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/restrictions/apps", @@ -1716,7 +1720,7 @@ impl Repos { repo: &str, branch: &str, body: &crate::types::ReposAddAppAccessRestrictionsRequestOneOf, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/restrictions/apps", @@ -1763,7 +1767,7 @@ impl Repos { repo: &str, branch: &str, body: &crate::types::ReposAddAppAccessRestrictionsRequestOneOf, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/restrictions/apps", @@ -1810,7 +1814,7 @@ impl Repos { repo: &str, branch: &str, body: &crate::types::ReposAddAppAccessRestrictionsRequestOneOf, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/restrictions/apps", @@ -1852,7 +1856,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/restrictions/teams", @@ -1890,7 +1894,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/restrictions/teams", @@ -1937,7 +1941,7 @@ impl Repos { repo: &str, branch: &str, body: &crate::types::ReposAddTeamAccessRestrictionsRequestOneOf, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/restrictions/teams", @@ -1984,7 +1988,7 @@ impl Repos { repo: &str, branch: &str, body: &crate::types::ReposAddTeamAccessRestrictionsRequestOneOf, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/restrictions/teams", @@ -2031,7 +2035,7 @@ impl Repos { repo: &str, branch: &str, body: &crate::types::ReposAddTeamAccessRestrictionsRequestOneOf, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/restrictions/teams", @@ -2073,7 +2077,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/restrictions/users", @@ -2111,7 +2115,7 @@ impl Repos { owner: &str, repo: &str, branch: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/restrictions/users", @@ -2158,7 +2162,7 @@ impl Repos { repo: &str, branch: &str, body: &crate::types::ReposAddUserAccessRestrictionsRequestOneOf, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/restrictions/users", @@ -2205,7 +2209,7 @@ impl Repos { repo: &str, branch: &str, body: &crate::types::ReposAddUserAccessRestrictionsRequestOneOf, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/restrictions/users", @@ -2252,7 +2256,7 @@ impl Repos { repo: &str, branch: &str, body: &crate::types::ReposAddUserAccessRestrictionsRequestOneOf, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/protection/restrictions/users", @@ -2307,7 +2311,7 @@ impl Repos { repo: &str, branch: &str, body: &crate::types::ReposRenameBranchRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/branches/{}/rename", @@ -2356,7 +2360,7 @@ impl Repos { affiliation: crate::types::Affiliation, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !affiliation.to_string().is_empty() { query_args.push(("affiliation".to_string(), affiliation.to_string())); @@ -2405,7 +2409,7 @@ impl Repos { owner: &str, repo: &str, affiliation: crate::types::Affiliation, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !affiliation.to_string().is_empty() { query_args.push(("affiliation".to_string(), affiliation.to_string())); @@ -2452,7 +2456,7 @@ impl Repos { owner: &str, repo: &str, username: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/collaborators/{}", @@ -2503,7 +2507,7 @@ impl Repos { repo: &str, username: &str, body: &crate::types::ReposAddCollaboratorRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/collaborators/{}", @@ -2543,7 +2547,7 @@ impl Repos { owner: &str, repo: &str, username: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/collaborators/{}", @@ -2583,7 +2587,7 @@ impl Repos { owner: &str, repo: &str, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/collaborators/{}/permission", @@ -2627,7 +2631,7 @@ impl Repos { repo: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -2672,7 +2676,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/comments", @@ -2711,7 +2715,7 @@ impl Repos { owner: &str, repo: &str, comment_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/comments/{}", @@ -2751,7 +2755,7 @@ impl Repos { owner: &str, repo: &str, comment_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/comments/{}", @@ -2792,7 +2796,7 @@ impl Repos { repo: &str, comment_id: i64, body: &crate::types::PullsUpdateReviewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/comments/{}", @@ -2871,7 +2875,7 @@ impl Repos { until: Option>, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !author.is_empty() { query_args.push(("author".to_string(), author.to_string())); @@ -2961,7 +2965,7 @@ impl Repos { author: &str, since: Option>, until: Option>, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !author.is_empty() { query_args.push(("author".to_string(), author.to_string())); @@ -3020,7 +3024,7 @@ impl Repos { owner: &str, repo: &str, commit_sha: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/commits/{}/branches-where-head", @@ -3058,7 +3062,7 @@ impl Repos { owner: &str, repo: &str, commit_sha: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/commits/{}/branches-where-head", @@ -3102,7 +3106,7 @@ impl Repos { commit_sha: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -3147,7 +3151,7 @@ impl Repos { owner: &str, repo: &str, commit_sha: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/commits/{}/comments", @@ -3190,7 +3194,7 @@ impl Repos { repo: &str, commit_sha: &str, body: &crate::types::ReposCreateCommitCommentRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/commits/{}/comments", @@ -3234,7 +3238,7 @@ impl Repos { commit_sha: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -3279,7 +3283,7 @@ impl Repos { owner: &str, repo: &str, commit_sha: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/commits/{}/pulls", @@ -3358,7 +3362,7 @@ impl Repos { page: i64, per_page: i64, ref_: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -3419,7 +3423,7 @@ impl Repos { ref_: &str, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -3474,7 +3478,7 @@ impl Repos { ref_: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -3521,7 +3525,7 @@ impl Repos { owner: &str, repo: &str, ref_: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/commits/{}/statuses", @@ -3570,7 +3574,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/community/profile", @@ -3652,7 +3656,7 @@ impl Repos { page: i64, per_page: i64, basehead: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -3734,7 +3738,7 @@ impl Repos { repo: &str, path: &str, ref_: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ref_.is_empty() { query_args.push(("ref".to_string(), ref_.to_string())); @@ -3813,7 +3817,7 @@ impl Repos { repo: &str, path: &str, ref_: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !ref_.is_empty() { query_args.push(("ref".to_string(), ref_.to_string())); @@ -3892,7 +3896,7 @@ impl Repos { repo: &str, path: &str, ref_: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !ref_.is_empty() { query_args.push(("ref".to_string(), ref_.to_string())); @@ -3971,7 +3975,7 @@ impl Repos { repo: &str, path: &str, ref_: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !ref_.is_empty() { query_args.push(("ref".to_string(), ref_.to_string())); @@ -4050,7 +4054,7 @@ impl Repos { repo: &str, path: &str, ref_: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !ref_.is_empty() { query_args.push(("ref".to_string(), ref_.to_string())); @@ -4097,7 +4101,7 @@ impl Repos { repo: &str, path: &str, body: &crate::types::ReposCreateUpdateFileContentsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/contents/{}", @@ -4144,7 +4148,7 @@ impl Repos { repo: &str, path: &str, body: &crate::types::ReposDeleteFileRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/contents/{}", @@ -4190,7 +4194,7 @@ impl Repos { anon: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !anon.is_empty() { query_args.push(("anon".to_string(), anon.to_string())); @@ -4239,7 +4243,7 @@ impl Repos { owner: &str, repo: &str, anon: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !anon.is_empty() { query_args.push(("anon".to_string(), anon.to_string())); @@ -4294,7 +4298,7 @@ impl Repos { environment: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !environment.is_empty() { query_args.push(("environment".to_string(), environment.to_string())); @@ -4353,7 +4357,7 @@ impl Repos { ref_: &str, task: &str, environment: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !environment.is_empty() { query_args.push(("environment".to_string(), environment.to_string())); @@ -4450,7 +4454,7 @@ impl Repos { owner: &str, repo: &str, body: &crate::types::ReposCreateDeploymentRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/deployments", @@ -4489,7 +4493,7 @@ impl Repos { owner: &str, repo: &str, deployment_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/deployments/{}", @@ -4536,7 +4540,7 @@ impl Repos { owner: &str, repo: &str, deployment_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/deployments/{}", @@ -4580,7 +4584,7 @@ impl Repos { deployment_id: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -4625,7 +4629,7 @@ impl Repos { owner: &str, repo: &str, deployment_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/deployments/{}/statuses", @@ -4668,7 +4672,7 @@ impl Repos { repo: &str, deployment_id: i64, body: &crate::types::ReposCreateDeploymentStatusRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/deployments/{}/statuses", @@ -4710,7 +4714,7 @@ impl Repos { repo: &str, deployment_id: i64, status_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/deployments/{}/statuses/{}", @@ -4759,7 +4763,7 @@ impl Repos { owner: &str, repo: &str, body: &crate::types::ReposCreateDispatchEventRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/dispatches", @@ -4798,7 +4802,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/environments", @@ -4837,7 +4841,7 @@ impl Repos { owner: &str, repo: &str, environment_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/environments/{}", @@ -4884,7 +4888,7 @@ impl Repos { repo: &str, environment_name: &str, body: &crate::types::ReposCreateUpdateEnvironmentRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/environments/{}", @@ -4924,7 +4928,7 @@ impl Repos { owner: &str, repo: &str, environment_name: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/environments/{}", @@ -4968,7 +4972,7 @@ impl Repos { sort: crate::types::ReposListForksSort, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -5015,7 +5019,7 @@ impl Repos { owner: &str, repo: &str, sort: crate::types::ReposListForksSort, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !sort.to_string().is_empty() { query_args.push(("sort".to_string(), sort.to_string())); @@ -5061,7 +5065,7 @@ impl Repos { owner: &str, repo: &str, body: &crate::types::ReposCreateForkRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/forks", @@ -5102,7 +5106,7 @@ impl Repos { repo: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -5145,7 +5149,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/hooks", @@ -5184,7 +5188,7 @@ impl Repos { owner: &str, repo: &str, body: &crate::types::ReposCreateWebhookRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/hooks", @@ -5223,7 +5227,7 @@ impl Repos { owner: &str, repo: &str, hook_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/hooks/{}", @@ -5258,7 +5262,12 @@ impl Repos { * * `repo: &str` * * `hook_id: i64` */ - pub async fn delete_webhook(&self, owner: &str, repo: &str, hook_id: i64) -> ClientResult<()> { + pub async fn delete_webhook( + &self, + owner: &str, + repo: &str, + hook_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/hooks/{}", @@ -5299,7 +5308,7 @@ impl Repos { repo: &str, hook_id: i64, body: &crate::types::ReposUpdateWebhookRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/hooks/{}", @@ -5341,7 +5350,7 @@ impl Repos { owner: &str, repo: &str, hook_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/hooks/{}/config", @@ -5384,7 +5393,7 @@ impl Repos { repo: &str, hook_id: i64, body: &crate::types::AppsUpdateWebhookConfigAppRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/hooks/{}/config", @@ -5428,7 +5437,7 @@ impl Repos { hook_id: i64, per_page: i64, cursor: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); @@ -5474,7 +5483,7 @@ impl Repos { repo: &str, hook_id: i64, cursor: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); @@ -5522,7 +5531,7 @@ impl Repos { repo: &str, hook_id: i64, delivery_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/hooks/{}/deliveries/{}", @@ -5565,7 +5574,7 @@ impl Repos { repo: &str, hook_id: i64, delivery_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/hooks/{}/deliveries/{}/attempts", @@ -5601,7 +5610,12 @@ impl Repos { * * `repo: &str` * * `hook_id: i64` */ - pub async fn ping_webhook(&self, owner: &str, repo: &str, hook_id: i64) -> ClientResult<()> { + pub async fn ping_webhook( + &self, + owner: &str, + repo: &str, + hook_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/hooks/{}/pings", @@ -5643,7 +5657,7 @@ impl Repos { owner: &str, repo: &str, hook_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/hooks/{}/tests", @@ -5685,7 +5699,7 @@ impl Repos { repo: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -5728,7 +5742,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/invitations", @@ -5767,7 +5781,7 @@ impl Repos { owner: &str, repo: &str, invitation_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/invitations/{}", @@ -5808,7 +5822,7 @@ impl Repos { repo: &str, invitation_id: i64, body: &crate::types::ReposUpdateInvitationRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/invitations/{}", @@ -5850,7 +5864,7 @@ impl Repos { repo: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -5893,7 +5907,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/keys", @@ -5931,7 +5945,7 @@ impl Repos { owner: &str, repo: &str, body: &crate::types::ReposCreateDeployKeyRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/keys", @@ -5970,7 +5984,7 @@ impl Repos { owner: &str, repo: &str, key_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/keys/{}", @@ -6010,7 +6024,7 @@ impl Repos { owner: &str, repo: &str, key_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/keys/{}", @@ -6044,7 +6058,11 @@ impl Repos { * * `owner: &str` * * `repo: &str` */ - pub async fn list_languages(&self, owner: &str, repo: &str) -> ClientResult { + pub async fn list_languages( + &self, + owner: &str, + repo: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/languages", @@ -6082,7 +6100,7 @@ impl Repos { owner: &str, repo: &str, body: &crate::types::ReposMergeRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/merges", @@ -6115,7 +6133,11 @@ impl Repos { * * `owner: &str` * * `repo: &str` */ - pub async fn get_pages(&self, owner: &str, repo: &str) -> ClientResult { + pub async fn get_pages( + &self, + owner: &str, + repo: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pages", @@ -6153,7 +6175,7 @@ impl Repos { owner: &str, repo: &str, body: &crate::types::ReposUpdateInformationAboutPagesSiteRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pages", @@ -6191,7 +6213,7 @@ impl Repos { owner: &str, repo: &str, body: &crate::types::ReposCreatePagesSiteRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pages", @@ -6224,7 +6246,11 @@ impl Repos { * * `owner: &str` * * `repo: &str` */ - pub async fn delete_pages_site(&self, owner: &str, repo: &str) -> ClientResult<()> { + pub async fn delete_pages_site( + &self, + owner: &str, + repo: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pages", @@ -6265,7 +6291,7 @@ impl Repos { repo: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -6308,7 +6334,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/pages/builds", @@ -6347,7 +6373,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pages/builds", @@ -6384,7 +6410,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pages/builds/latest", @@ -6423,7 +6449,7 @@ impl Repos { owner: &str, repo: &str, build_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pages/builds/{}", @@ -6465,7 +6491,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/pages/health", @@ -6506,7 +6532,7 @@ impl Repos { owner: &str, repo: &str, ref_: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !ref_.is_empty() { query_args.push(("ref".to_string(), ref_.to_string())); @@ -6555,7 +6581,7 @@ impl Repos { repo: &str, dir: &str, ref_: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !ref_.is_empty() { query_args.push(("ref".to_string(), ref_.to_string())); @@ -6605,7 +6631,7 @@ impl Repos { repo: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -6650,7 +6676,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/releases", @@ -6690,7 +6716,7 @@ impl Repos { owner: &str, repo: &str, body: &crate::types::ReposCreateReleaseRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/releases", @@ -6729,7 +6755,7 @@ impl Repos { owner: &str, repo: &str, asset_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/releases/assets/{}", @@ -6769,7 +6795,7 @@ impl Repos { owner: &str, repo: &str, asset_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/releases/assets/{}", @@ -6810,7 +6836,7 @@ impl Repos { repo: &str, asset_id: i64, body: &crate::types::ReposUpdateReleaseAssetRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/releases/assets/{}", @@ -6850,7 +6876,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/releases/latest", @@ -6889,7 +6915,7 @@ impl Repos { owner: &str, repo: &str, tag: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/releases/tags/{}", @@ -6929,7 +6955,7 @@ impl Repos { owner: &str, repo: &str, release_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/releases/{}", @@ -6969,7 +6995,7 @@ impl Repos { owner: &str, repo: &str, release_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/releases/{}", @@ -7010,7 +7036,7 @@ impl Repos { repo: &str, release_id: i64, body: &crate::types::ReposCreateReleaseRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/releases/{}", @@ -7054,7 +7080,7 @@ impl Repos { release_id: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -7099,7 +7125,7 @@ impl Repos { owner: &str, repo: &str, release_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/releases/{}/assets", @@ -7161,7 +7187,7 @@ impl Repos { name: &str, label: &str, body: B, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !label.is_empty() { query_args.push(("label".to_string(), label.to_string())); @@ -7208,7 +7234,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult>> { + ) -> ClientResult>>> { let url = self.client.url( &format!( "/repos/{}/{}/stats/code_frequency", @@ -7242,7 +7268,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult>> { + ) -> ClientResult>>> { let url = self.client.url( &format!( "/repos/{}/{}/stats/code_frequency", @@ -7279,7 +7305,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/stats/commit_activity", @@ -7313,7 +7339,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/stats/commit_activity", @@ -7356,7 +7382,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/stats/contributors", @@ -7396,7 +7422,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/stats/contributors", @@ -7435,7 +7461,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/stats/participation", @@ -7478,7 +7504,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult>> { + ) -> ClientResult>>> { let url = self.client.url( &format!( "/repos/{}/{}/stats/punch_card", @@ -7518,7 +7544,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult>> { + ) -> ClientResult>>> { let url = self.client.url( &format!( "/repos/{}/{}/stats/punch_card", @@ -7560,7 +7586,7 @@ impl Repos { repo: &str, sha: &str, body: &crate::types::ReposCreateCommitStatusRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/statuses/{}", @@ -7602,7 +7628,7 @@ impl Repos { repo: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -7645,7 +7671,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/tags", @@ -7687,7 +7713,7 @@ impl Repos { owner: &str, repo: &str, ref_: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/tarball/{}", @@ -7729,7 +7755,7 @@ impl Repos { repo: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -7772,7 +7798,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/teams", @@ -7813,7 +7839,7 @@ impl Repos { repo: &str, page: i64, per_page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -7860,7 +7886,7 @@ impl Repos { owner: &str, repo: &str, body: &crate::types::Topic, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/topics", @@ -7899,7 +7925,7 @@ impl Repos { owner: &str, repo: &str, per: crate::types::Per, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !per.to_string().is_empty() { query_args.push(("per".to_string(), per.to_string())); @@ -7942,7 +7968,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/traffic/popular/paths", @@ -7976,7 +8002,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/traffic/popular/paths", @@ -8013,7 +8039,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/traffic/popular/referrers", @@ -8047,7 +8073,7 @@ impl Repos { &self, owner: &str, repo: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/repos/{}/{}/traffic/popular/referrers", @@ -8086,7 +8112,7 @@ impl Repos { owner: &str, repo: &str, per: crate::types::Per, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !per.to_string().is_empty() { query_args.push(("per".to_string(), per.to_string())); @@ -8130,7 +8156,7 @@ impl Repos { owner: &str, repo: &str, body: &crate::types::ReposTransferRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/transfer", @@ -8163,7 +8189,11 @@ impl Repos { * * `owner: &str` * * `repo: &str` */ - pub async fn check_vulnerability_alerts(&self, owner: &str, repo: &str) -> ClientResult<()> { + pub async fn check_vulnerability_alerts( + &self, + owner: &str, + repo: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/vulnerability-alerts", @@ -8196,7 +8226,11 @@ impl Repos { * * `owner: &str` * * `repo: &str` */ - pub async fn enable_vulnerability_alerts(&self, owner: &str, repo: &str) -> ClientResult<()> { + pub async fn enable_vulnerability_alerts( + &self, + owner: &str, + repo: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/vulnerability-alerts", @@ -8229,7 +8263,11 @@ impl Repos { * * `owner: &str` * * `repo: &str` */ - pub async fn disable_vulnerability_alerts(&self, owner: &str, repo: &str) -> ClientResult<()> { + pub async fn disable_vulnerability_alerts( + &self, + owner: &str, + repo: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/vulnerability-alerts", @@ -8271,7 +8309,7 @@ impl Repos { owner: &str, repo: &str, ref_: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/zipball/{}", @@ -8317,7 +8355,7 @@ impl Repos { template_owner: &str, template_repo: &str, body: &crate::types::ReposCreateUsingTemplateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/generate", @@ -8356,7 +8394,7 @@ impl Repos { pub async fn list_public( &self, since: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if since > 0 { query_args.push(("since".to_string(), since.to_string())); @@ -8391,7 +8429,7 @@ impl Repos { pub async fn list_all_public( &self, since: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if since > 0 { query_args.push(("since".to_string(), since.to_string())); @@ -8449,7 +8487,7 @@ impl Repos { page: i64, since: Option>, before: Option>, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !affiliation.is_empty() { query_args.push(("affiliation".to_string(), affiliation.to_string())); @@ -8512,7 +8550,7 @@ impl Repos { direction: crate::types::Order, since: Option>, before: Option>, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !affiliation.is_empty() { query_args.push(("affiliation".to_string(), affiliation.to_string())); @@ -8566,7 +8604,7 @@ impl Repos { pub async fn create_for_authenticated_user( &self, body: &crate::types::ReposCreateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user/repos", None); self.client .post( @@ -8596,7 +8634,7 @@ impl Repos { &self, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -8631,7 +8669,7 @@ impl Repos { */ pub async fn list_all_invitations_for_authenticated_user( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/repository_invitations", None); self.client .get_all_pages( @@ -8656,7 +8694,10 @@ impl Repos { * * * `invitation_id: i64` -- invitation_id parameter. */ - pub async fn decline_invitation(&self, invitation_id: i64) -> ClientResult<()> { + pub async fn decline_invitation( + &self, + invitation_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/user/repository_invitations/{}", @@ -8687,7 +8728,7 @@ impl Repos { * * * `invitation_id: i64` -- invitation_id parameter. */ - pub async fn accept_invitation(&self, invitation_id: i64) -> ClientResult<()> { + pub async fn accept_invitation(&self, invitation_id: i64) -> ClientResult> { let url = self.client.url( &format!( "/user/repository_invitations/{}", @@ -8733,7 +8774,7 @@ impl Repos { direction: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -8786,7 +8827,7 @@ impl Repos { type_: crate::types::ReposListUserType, sort: crate::types::ReposListOrgSort, direction: crate::types::Order, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); diff --git a/github/src/scim.rs b/github/src/scim.rs index 556820ea..30d76ff4 100644 --- a/github/src/scim.rs +++ b/github/src/scim.rs @@ -54,7 +54,7 @@ impl Scim { start_index: i64, count: i64, filter: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -101,7 +101,7 @@ impl Scim { &self, org: &str, body: &crate::types::ScimProvisionInviteUserRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/scim/v2/organizations/{}/Users", @@ -137,7 +137,7 @@ impl Scim { &self, org: &str, scim_user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/scim/v2/organizations/{}/Users/{}", @@ -179,7 +179,7 @@ impl Scim { org: &str, scim_user_id: &str, body: &crate::types::ScimProvisionInviteUserRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/scim/v2/organizations/{}/Users/{}", @@ -212,7 +212,11 @@ impl Scim { * * `org: &str` * * `scim_user_id: &str` -- scim_user_id parameter. */ - pub async fn delete_user_from_org(&self, org: &str, scim_user_id: &str) -> ClientResult<()> { + pub async fn delete_user_from_org( + &self, + org: &str, + scim_user_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/scim/v2/organizations/{}/Users/{}", @@ -265,7 +269,7 @@ impl Scim { org: &str, scim_user_id: &str, body: &crate::types::ScimUpdateAttributeUserRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/scim/v2/organizations/{}/Users/{}", diff --git a/github/src/search.rs b/github/src/search.rs index cacb21c9..1b50a0fe 100644 --- a/github/src/search.rs +++ b/github/src/search.rs @@ -52,7 +52,7 @@ impl Search { order: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !order.to_string().is_empty() { query_args.push(("order".to_string(), order.to_string())); @@ -112,7 +112,7 @@ impl Search { order: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !order.to_string().is_empty() { query_args.push(("order".to_string(), order.to_string())); @@ -178,7 +178,7 @@ impl Search { order: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !order.to_string().is_empty() { query_args.push(("order".to_string(), order.to_string())); @@ -241,7 +241,7 @@ impl Search { order: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !order.to_string().is_empty() { query_args.push(("order".to_string(), order.to_string())); @@ -309,7 +309,7 @@ impl Search { order: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !order.to_string().is_empty() { query_args.push(("order".to_string(), order.to_string())); @@ -368,7 +368,7 @@ impl Search { q: &str, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -423,7 +423,7 @@ impl Search { order: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !order.to_string().is_empty() { query_args.push(("order".to_string(), order.to_string())); diff --git a/github/src/secret_scanning.rs b/github/src/secret_scanning.rs index 685f1b56..3e86d4fe 100644 --- a/github/src/secret_scanning.rs +++ b/github/src/secret_scanning.rs @@ -39,7 +39,7 @@ impl SecretScanning { secret_type: &str, page: i64, per_page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -92,7 +92,7 @@ impl SecretScanning { repo: &str, state: crate::types::SecretScanningAlertState, secret_type: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !secret_type.is_empty() { query_args.push(("secret_type".to_string(), secret_type.to_string())); @@ -142,7 +142,7 @@ impl SecretScanning { owner: &str, repo: &str, alert_number: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/secret-scanning/alerts/{}", @@ -185,7 +185,7 @@ impl SecretScanning { repo: &str, alert_number: i64, body: &crate::types::SecretScanningUpdateAlertRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/repos/{}/{}/secret-scanning/alerts/{}", diff --git a/github/src/teams.rs b/github/src/teams.rs index cdd22346..5bfe8ac8 100644 --- a/github/src/teams.rs +++ b/github/src/teams.rs @@ -35,7 +35,7 @@ impl Teams { org: &str, per_page: i64, page: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !page.is_empty() { query_args.push(("page".to_string(), page.to_string())); @@ -82,7 +82,7 @@ impl Teams { org: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -120,7 +120,10 @@ impl Teams { * * FROM: */ - pub async fn list_all(&self, org: &str) -> ClientResult> { + pub async fn list_all( + &self, + org: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/teams", @@ -157,7 +160,7 @@ impl Teams { &self, org: &str, body: &crate::types::TeamsCreateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams", @@ -195,7 +198,7 @@ impl Teams { &self, org: &str, team_slug: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}", @@ -232,7 +235,11 @@ impl Teams { * * `org: &str` * * `team_slug: &str` -- team_slug parameter. */ - pub async fn delete_in_org(&self, org: &str, team_slug: &str) -> ClientResult<()> { + pub async fn delete_in_org( + &self, + org: &str, + team_slug: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}", @@ -272,7 +279,7 @@ impl Teams { org: &str, team_slug: &str, body: &crate::types::TeamsUpdateInOrgRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}", @@ -321,7 +328,7 @@ impl Teams { per_page: i64, page: i64, pinned: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -374,7 +381,7 @@ impl Teams { team_slug: &str, direction: crate::types::Order, pinned: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -425,7 +432,7 @@ impl Teams { org: &str, team_slug: &str, body: &crate::types::TeamsCreateDiscussionInOrgRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/discussions", @@ -466,7 +473,7 @@ impl Teams { org: &str, team_slug: &str, discussion_number: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/discussions/{}", @@ -508,7 +515,7 @@ impl Teams { org: &str, team_slug: &str, discussion_number: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/discussions/{}", @@ -551,7 +558,7 @@ impl Teams { team_slug: &str, discussion_number: i64, body: &crate::types::TeamsUpdateDiscussionInOrgRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/discussions/{}", @@ -601,7 +608,7 @@ impl Teams { direction: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -652,7 +659,7 @@ impl Teams { team_slug: &str, discussion_number: i64, direction: crate::types::Order, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -703,7 +710,7 @@ impl Teams { team_slug: &str, discussion_number: i64, body: &crate::types::PullsUpdateReviewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/discussions/{}/comments", @@ -747,7 +754,7 @@ impl Teams { team_slug: &str, discussion_number: i64, comment_number: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/discussions/{}/comments/{}", @@ -792,7 +799,7 @@ impl Teams { team_slug: &str, discussion_number: i64, comment_number: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/discussions/{}/comments/{}", @@ -838,7 +845,7 @@ impl Teams { discussion_number: i64, comment_number: i64, body: &crate::types::PullsUpdateReviewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/discussions/{}/comments/{}", @@ -883,7 +890,7 @@ impl Teams { team_slug: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -928,7 +935,7 @@ impl Teams { &self, org: &str, team_slug: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/invitations", @@ -976,7 +983,7 @@ impl Teams { role: crate::types::TeamsListMembersInOrgRole, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1025,7 +1032,7 @@ impl Teams { org: &str, team_slug: &str, role: crate::types::TeamsListMembersInOrgRole, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !role.to_string().is_empty() { query_args.push(("role".to_string(), role.to_string())); @@ -1079,7 +1086,7 @@ impl Teams { org: &str, team_slug: &str, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/memberships/{}", @@ -1130,7 +1137,7 @@ impl Teams { team_slug: &str, username: &str, body: &crate::types::TeamsAddUpdateMembershipUserInOrgRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/memberships/{}", @@ -1176,7 +1183,7 @@ impl Teams { org: &str, team_slug: &str, username: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/memberships/{}", @@ -1220,7 +1227,7 @@ impl Teams { team_slug: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1265,7 +1272,7 @@ impl Teams { &self, org: &str, team_slug: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/projects", @@ -1306,7 +1313,7 @@ impl Teams { org: &str, team_slug: &str, project_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/projects/{}", @@ -1349,7 +1356,7 @@ impl Teams { team_slug: &str, project_id: i64, body: &crate::types::ProjectsAddCollaboratorRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/projects/{}", @@ -1391,7 +1398,7 @@ impl Teams { org: &str, team_slug: &str, project_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/projects/{}", @@ -1435,7 +1442,7 @@ impl Teams { team_slug: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1480,7 +1487,7 @@ impl Teams { &self, org: &str, team_slug: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/repos", @@ -1527,7 +1534,7 @@ impl Teams { team_slug: &str, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/repos/{}/{}", @@ -1575,7 +1582,7 @@ impl Teams { owner: &str, repo: &str, body: &crate::types::TeamsAddUpdateRepoPermissionsInOrgRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/repos/{}/{}", @@ -1620,7 +1627,7 @@ impl Teams { team_slug: &str, owner: &str, repo: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/repos/{}/{}", @@ -1663,7 +1670,7 @@ impl Teams { &self, org: &str, team_slug: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/team-sync/group-mappings", @@ -1705,7 +1712,7 @@ impl Teams { org: &str, team_slug: &str, body: &crate::types::TeamsCreateUpdateIdpGroupConnectionsInOrgRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/team-sync/group-mappings", @@ -1748,7 +1755,7 @@ impl Teams { team_slug: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1793,7 +1800,7 @@ impl Teams { &self, org: &str, team_slug: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/orgs/{}/teams/{}/teams", @@ -1825,7 +1832,10 @@ impl Teams { * * * `team_id: i64` */ - pub async fn get_legacy(&self, team_id: i64) -> ClientResult { + pub async fn get_legacy( + &self, + team_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}", @@ -1860,7 +1870,7 @@ impl Teams { * * * `team_id: i64` */ - pub async fn delete_legacy(&self, team_id: i64) -> ClientResult<()> { + pub async fn delete_legacy(&self, team_id: i64) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}", @@ -1899,7 +1909,7 @@ impl Teams { &self, team_id: i64, body: &crate::types::TeamsUpdateInOrgRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}", @@ -1943,7 +1953,7 @@ impl Teams { direction: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -1990,7 +2000,7 @@ impl Teams { &self, team_id: i64, direction: crate::types::Order, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -2035,7 +2045,7 @@ impl Teams { &self, team_id: i64, body: &crate::types::TeamsCreateDiscussionInOrgRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/discussions", @@ -2073,7 +2083,7 @@ impl Teams { &self, team_id: i64, discussion_number: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/discussions/{}", @@ -2112,7 +2122,7 @@ impl Teams { &self, team_id: i64, discussion_number: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/discussions/{}", @@ -2152,7 +2162,7 @@ impl Teams { team_id: i64, discussion_number: i64, body: &crate::types::TeamsUpdateDiscussionInOrgRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/discussions/{}", @@ -2199,7 +2209,7 @@ impl Teams { direction: crate::types::Order, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -2248,7 +2258,7 @@ impl Teams { team_id: i64, discussion_number: i64, direction: crate::types::Order, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !direction.to_string().is_empty() { query_args.push(("direction".to_string(), direction.to_string())); @@ -2296,7 +2306,7 @@ impl Teams { team_id: i64, discussion_number: i64, body: &crate::types::PullsUpdateReviewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/discussions/{}/comments", @@ -2337,7 +2347,7 @@ impl Teams { team_id: i64, discussion_number: i64, comment_number: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/discussions/{}/comments/{}", @@ -2379,7 +2389,7 @@ impl Teams { team_id: i64, discussion_number: i64, comment_number: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/discussions/{}/comments/{}", @@ -2422,7 +2432,7 @@ impl Teams { discussion_number: i64, comment_number: i64, body: &crate::types::PullsUpdateReviewRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/discussions/{}/comments/{}", @@ -2464,7 +2474,7 @@ impl Teams { team_id: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -2507,7 +2517,7 @@ impl Teams { pub async fn list_all_pending_invitations_legacy( &self, team_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/teams/{}/invitations", @@ -2552,7 +2562,7 @@ impl Teams { role: crate::types::TeamsListMembersInOrgRole, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -2599,7 +2609,7 @@ impl Teams { &self, team_id: i64, role: crate::types::TeamsListMembersInOrgRole, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !role.to_string().is_empty() { query_args.push(("role".to_string(), role.to_string())); @@ -2641,7 +2651,11 @@ impl Teams { * * `team_id: i64` * * `username: &str` */ - pub async fn get_member_legacy(&self, team_id: i64, username: &str) -> ClientResult<()> { + pub async fn get_member_legacy( + &self, + team_id: i64, + username: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/members/{}", @@ -2684,7 +2698,11 @@ impl Teams { * * `team_id: i64` * * `username: &str` */ - pub async fn add_member_legacy(&self, team_id: i64, username: &str) -> ClientResult<()> { + pub async fn add_member_legacy( + &self, + team_id: i64, + username: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/members/{}", @@ -2725,7 +2743,11 @@ impl Teams { * * `team_id: i64` * * `username: &str` */ - pub async fn remove_member_legacy(&self, team_id: i64, username: &str) -> ClientResult<()> { + pub async fn remove_member_legacy( + &self, + team_id: i64, + username: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/members/{}", @@ -2771,7 +2793,7 @@ impl Teams { &self, team_id: i64, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/memberships/{}", @@ -2819,7 +2841,7 @@ impl Teams { team_id: i64, username: &str, body: &crate::types::TeamsAddUpdateMembershipUserInOrgRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/memberships/{}", @@ -2862,7 +2884,7 @@ impl Teams { &self, team_id: i64, username: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/memberships/{}", @@ -2903,7 +2925,7 @@ impl Teams { team_id: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -2946,7 +2968,7 @@ impl Teams { pub async fn list_all_projects_legacy( &self, team_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/teams/{}/projects", @@ -2984,7 +3006,7 @@ impl Teams { &self, team_id: i64, project_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/projects/{}", @@ -3024,7 +3046,7 @@ impl Teams { team_id: i64, project_id: i64, body: &crate::types::TeamsAddUpdateProjectPermissionsLegacyRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/projects/{}", @@ -3059,7 +3081,11 @@ impl Teams { * * `team_id: i64` * * `project_id: i64` */ - pub async fn remove_project_legacy(&self, team_id: i64, project_id: i64) -> ClientResult<()> { + pub async fn remove_project_legacy( + &self, + team_id: i64, + project_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/projects/{}", @@ -3098,7 +3124,7 @@ impl Teams { team_id: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -3139,7 +3165,7 @@ impl Teams { pub async fn list_all_repos_legacy( &self, team_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/teams/{}/repos", @@ -3181,7 +3207,7 @@ impl Teams { team_id: i64, owner: &str, repo: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/repos/{}/{}", @@ -3226,7 +3252,7 @@ impl Teams { owner: &str, repo: &str, body: &crate::types::TeamsAddUpdateRepoPermissionsLegacyRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/repos/{}/{}", @@ -3268,7 +3294,7 @@ impl Teams { team_id: i64, owner: &str, repo: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/repos/{}/{}", @@ -3308,7 +3334,7 @@ impl Teams { pub async fn list_idp_groups_for_legacy( &self, team_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/team-sync/group-mappings", @@ -3347,7 +3373,7 @@ impl Teams { &self, team_id: i64, body: &crate::types::TeamsCreateUpdateIdpGroupConnectionsLegacyRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teams/{}/team-sync/group-mappings", @@ -3385,7 +3411,7 @@ impl Teams { team_id: i64, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -3426,7 +3452,7 @@ impl Teams { pub async fn list_all_child_legacy( &self, team_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/teams/{}/teams", @@ -3462,7 +3488,7 @@ impl Teams { &self, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -3495,7 +3521,7 @@ impl Teams { */ pub async fn list_all_for_authenticated_user( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/teams", None); self.client .get_all_pages( diff --git a/github/src/traits.rs b/github/src/traits.rs new file mode 100644 index 00000000..dcc9e15e --- /dev/null +++ b/github/src/traits.rs @@ -0,0 +1,55 @@ +use async_trait::async_trait; +use bytes::Bytes; + +use crate::{actions::Actions, ClientResult, Response}; + +#[async_trait] +pub trait ActionsExt { + async fn download_contents( + &self, + owner: &str, + repo: &str, + artifact_id: i64, + archive_format: &str, + ) -> ClientResult>; +} + +#[async_trait] +impl ActionsExt for Actions { + async fn download_contents( + &self, + owner: &str, + repo: &str, + artifact_id: i64, + archive_format: &str, + ) -> ClientResult> { + let response = self + .download_artifact(owner, repo, artifact_id, archive_format) + .await?; + + let location = response + .headers + .get("Location") + .map(|v| v.to_str().unwrap()) + .unwrap(); + + let download = self + .client + .make_request( + http::Method::GET, + location, + crate::Message::default(), + crate::utils::MediaType::Json, + crate::auth::AuthenticationConstraint::Unconstrained, + ) + .await? + .send() + .await?; + + Ok(Response::new( + download.status(), + download.headers().clone(), + download.bytes().await?, + )) + } +} diff --git a/github/src/users.rs b/github/src/users.rs index dc375899..337bcc23 100644 --- a/github/src/users.rs +++ b/github/src/users.rs @@ -22,7 +22,9 @@ impl Users { * * FROM: */ - pub async fn get_authenticated_public_user(&self) -> ClientResult { + pub async fn get_authenticated_public_user( + &self, + ) -> ClientResult> { let url = self.client.url("/user", None); self.client .get( @@ -45,7 +47,9 @@ impl Users { * * FROM: */ - pub async fn get_authenticated_private_user(&self) -> ClientResult { + pub async fn get_authenticated_private_user( + &self, + ) -> ClientResult> { let url = self.client.url("/user", None); self.client .get( @@ -70,7 +74,7 @@ impl Users { */ pub async fn get_authenticated( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user", None); self.client .get( @@ -94,7 +98,7 @@ impl Users { pub async fn update_authenticated( &self, body: &crate::types::UsersUpdateAuthenticatedRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user", None); self.client .patch( @@ -117,7 +121,7 @@ impl Users { */ pub async fn list_blocked_by_authenticated( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/blocks", None); self.client .get( @@ -142,7 +146,7 @@ impl Users { */ pub async fn list_all_blocked_by_authenticated( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/blocks", None); self.client .get_all_pages( @@ -167,7 +171,7 @@ impl Users { * * * `username: &str` */ - pub async fn check_blocked(&self, username: &str) -> ClientResult<()> { + pub async fn check_blocked(&self, username: &str) -> ClientResult> { let url = self.client.url( &format!( "/user/blocks/{}", @@ -198,7 +202,7 @@ impl Users { * * * `username: &str` */ - pub async fn block(&self, username: &str) -> ClientResult<()> { + pub async fn block(&self, username: &str) -> ClientResult> { let url = self.client.url( &format!( "/user/blocks/{}", @@ -229,7 +233,7 @@ impl Users { * * * `username: &str` */ - pub async fn unblock(&self, username: &str) -> ClientResult<()> { + pub async fn unblock(&self, username: &str) -> ClientResult> { let url = self.client.url( &format!( "/user/blocks/{}", @@ -259,7 +263,7 @@ impl Users { pub async fn set_primary_email_visibility_for_authenticated( &self, body: &crate::types::UsersSetPrimaryEmailVisibilityAuthenticatedRequest, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/email/visibility", None); self.client .patch( @@ -289,7 +293,7 @@ impl Users { &self, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -322,7 +326,7 @@ impl Users { */ pub async fn list_all_emails_for_authenticated( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/emails", None); self.client .get_all_pages( @@ -346,7 +350,7 @@ impl Users { pub async fn add_email_for_authenticated( &self, body: &crate::types::UsersAddEmailAuthenticatedRequestOneOf, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/emails", None); self.client .post( @@ -370,7 +374,7 @@ impl Users { pub async fn delete_email_for_authenticated( &self, body: &crate::types::UsersAddEmailAuthenticatedRequestOneOf, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/user/emails", None); self.client .delete( @@ -400,7 +404,7 @@ impl Users { &self, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -435,7 +439,7 @@ impl Users { */ pub async fn list_all_followers_for_authenticated_user( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/followers", None); self.client .get_all_pages( @@ -465,7 +469,7 @@ impl Users { &self, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -500,7 +504,7 @@ impl Users { */ pub async fn list_all_followed_by_authenticated( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/following", None); self.client .get_all_pages( @@ -528,7 +532,7 @@ impl Users { pub async fn check_person_is_followed_by_authenticated( &self, username: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/following/{}", @@ -561,7 +565,7 @@ impl Users { * * * `username: &str` */ - pub async fn follow(&self, username: &str) -> ClientResult<()> { + pub async fn follow(&self, username: &str) -> ClientResult> { let url = self.client.url( &format!( "/user/following/{}", @@ -592,7 +596,7 @@ impl Users { * * * `username: &str` */ - pub async fn unfollow(&self, username: &str) -> ClientResult<()> { + pub async fn unfollow(&self, username: &str) -> ClientResult> { let url = self.client.url( &format!( "/user/following/{}", @@ -628,7 +632,7 @@ impl Users { &self, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -661,7 +665,7 @@ impl Users { */ pub async fn list_all_gpg_keys_for_authenticated( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/gpg_keys", None); self.client .get_all_pages( @@ -685,7 +689,7 @@ impl Users { pub async fn create_gpg_key_for_authenticated( &self, body: &crate::types::UsersCreateGpgKeyAuthenticatedRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user/gpg_keys", None); self.client .post( @@ -713,7 +717,7 @@ impl Users { pub async fn get_gpg_key_for_authenticated( &self, gpg_key_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/gpg_keys/{}", @@ -744,7 +748,10 @@ impl Users { * * * `gpg_key_id: i64` -- gpg_key_id parameter. */ - pub async fn delete_gpg_key_for_authenticated(&self, gpg_key_id: i64) -> ClientResult<()> { + pub async fn delete_gpg_key_for_authenticated( + &self, + gpg_key_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/user/gpg_keys/{}", @@ -780,7 +787,7 @@ impl Users { &self, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -813,7 +820,7 @@ impl Users { */ pub async fn list_all_public_ssh_keys_for_authenticated( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/keys", None); self.client .get_all_pages( @@ -837,7 +844,7 @@ impl Users { pub async fn create_public_ssh_key_for_authenticated( &self, body: &crate::types::UsersCreatePublicSshKeyAuthenticatedRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user/keys", None); self.client .post( @@ -865,7 +872,7 @@ impl Users { pub async fn get_public_ssh_key_for_authenticated( &self, key_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/keys/{}", @@ -896,7 +903,10 @@ impl Users { * * * `key_id: i64` -- key_id parameter. */ - pub async fn delete_public_ssh_key_for_authenticated(&self, key_id: i64) -> ClientResult<()> { + pub async fn delete_public_ssh_key_for_authenticated( + &self, + key_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/user/keys/{}", @@ -932,7 +942,7 @@ impl Users { &self, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -967,7 +977,7 @@ impl Users { */ pub async fn list_all_public_emails_for_authenticated( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/public_emails", None); self.client .get_all_pages( @@ -999,7 +1009,7 @@ impl Users { &self, since: i64, per_page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if per_page > 0 { query_args.push(("per_page".to_string(), per_page.to_string())); @@ -1032,7 +1042,10 @@ impl Users { * * FROM: */ - pub async fn list_all(&self, since: i64) -> ClientResult> { + pub async fn list_all( + &self, + since: i64, + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if since > 0 { query_args.push(("since".to_string(), since.to_string())); @@ -1071,7 +1084,7 @@ impl Users { pub async fn get_by_username_public_user( &self, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}", @@ -1111,7 +1124,7 @@ impl Users { pub async fn get_by_username_private_user( &self, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}", @@ -1151,7 +1164,7 @@ impl Users { pub async fn get_by_username( &self, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}", @@ -1189,7 +1202,7 @@ impl Users { username: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1230,7 +1243,7 @@ impl Users { pub async fn list_all_followers_for_user( &self, username: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/users/{}/followers", @@ -1268,7 +1281,7 @@ impl Users { username: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1309,7 +1322,7 @@ impl Users { pub async fn list_all_following_for_user( &self, username: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/users/{}/following", @@ -1345,7 +1358,7 @@ impl Users { &self, username: &str, target_user: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/following/{}", @@ -1384,7 +1397,7 @@ impl Users { username: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1425,7 +1438,7 @@ impl Users { pub async fn list_all_gpg_keys_for_user( &self, username: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/users/{}/gpg_keys", @@ -1470,7 +1483,7 @@ impl Users { username: &str, subject_type: crate::types::SubjectType, subject_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !subject_id.is_empty() { query_args.push(("subject_id".to_string(), subject_id.to_string())); @@ -1517,7 +1530,7 @@ impl Users { username: &str, per_page: i64, page: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -1558,7 +1571,7 @@ impl Users { pub async fn list_all_public_keys_for_user( &self, username: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/users/{}/keys", diff --git a/github/tests/tests.rs b/github/tests/tests.rs index b9238d59..e7cbc76f 100644 --- a/github/tests/tests.rs +++ b/github/tests/tests.rs @@ -162,7 +162,7 @@ async fn test_follows_next_links_during_unfold() { mem::drop(server); - assert_eq!(res.unwrap().len(), 3) + assert_eq!(res.unwrap().body.len(), 3) } #[tokio::test] @@ -303,3 +303,87 @@ async fn test_ratelimit_error() { unreachable!("Expected Ratelimiting error, got {:?}", err) } } + +#[tokio::test] +async fn test_downloads_artifact() { + use octorust::traits::ActionsExt; + + let installation_id = installation_id(); + let jwt = JWTCredentials::new(app_id(), private_key()).expect("JWT creation should succeed"); + + let server = MockServer::start().await; + let auth_response = ResponseTemplate::new(200) + .set_delay(Duration::from_secs(1)) + .set_body_json(InstallationToken { + token: "test-token".to_owned(), + expires_at: Default::default(), + has_multiple_single_files: Default::default(), + permissions: Default::default(), + repositories: Default::default(), + repository_selection: Default::default(), + single_file: Default::default(), + single_file_paths: Default::default(), + }); + + Mock::given(method("POST")) + .and(path(format!( + "/app/installations/{installation_id}/access_tokens" + ))) + .and(bearer_token(jwt.token())) + .respond_with(auth_response) + .expect(1) + .mount(&server) + .await; + + let download_path = "/fake-download-path"; + + Mock::given(method("GET")) + .and(path( + "/repos/test_owner/test_repo/actions/artifacts/12345/test_fmt".to_string(), + )) + .respond_with( + ResponseTemplate::new(302) + .set_delay(Duration::from_secs(1)) + .append_header( + HeaderName::from_bytes("Location".as_bytes().to_vec()).unwrap(), + HeaderValue::from_bytes( + format!("{}{}", server.uri(), download_path).into_bytes(), + ) + .unwrap(), + ) + .set_body_bytes(vec![]), + ) + .expect(1) + .named("Get artifact location") + .mount(&server) + .await; + + Mock::given(method("GET")) + .and(path(download_path.to_string())) + .respond_with( + ResponseTemplate::new(200) + .set_delay(Duration::from_secs(1)) + .set_body_bytes(vec![1, 1, 1, 1, 1, 1, 1, 1]), + ) + .expect(1) + .named("Download location") + .mount(&server) + .await; + + let token_generator = InstallationTokenGenerator::new(installation_id, jwt); + let mut client = Client::new( + concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), + Credentials::InstallationToken(token_generator), + ) + .expect("Client creation should succeed"); + client.with_host_override(server.uri()); + + let res = client + .actions() + .download_contents("test_owner", "test_repo", 12345, "test_fmt") + .await; + + mem::drop(server); + + assert_eq!(res.unwrap().body.len(), 8) +} diff --git a/google/admin/src/asps.rs b/google/admin/src/asps.rs index 0463cb8c..aa4e70ab 100644 --- a/google/admin/src/asps.rs +++ b/google/admin/src/asps.rs @@ -20,7 +20,7 @@ impl Asps { * * * `user_key: &str` -- Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. */ - pub async fn list(&self, user_key: &str) -> ClientResult { + pub async fn list(&self, user_key: &str) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/asps", @@ -48,7 +48,11 @@ impl Asps { * * `user_key: &str` -- Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. * * `code_id: i64` -- The unique ID of the ASP. */ - pub async fn get(&self, user_key: &str, code_id: i64) -> ClientResult { + pub async fn get( + &self, + user_key: &str, + code_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/asps/{}", @@ -77,7 +81,7 @@ impl Asps { * * `user_key: &str` -- Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. * * `code_id: i64` -- The unique ID of the ASP to be deleted. */ - pub async fn delete(&self, user_key: &str, code_id: i64) -> ClientResult<()> { + pub async fn delete(&self, user_key: &str, code_id: i64) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/asps/{}", diff --git a/google/admin/src/channels.rs b/google/admin/src/channels.rs index 06386466..a7fb04ef 100644 --- a/google/admin/src/channels.rs +++ b/google/admin/src/channels.rs @@ -16,7 +16,10 @@ impl Channels { * * Stops watching resources through this channel. */ - pub async fn admin_stop(&self, body: &crate::types::Channel) -> ClientResult<()> { + pub async fn admin_stop( + &self, + body: &crate::types::Channel, + ) -> ClientResult> { let url = self.client.url("/admin/directory_v1/channels/stop", None); self.client .post( diff --git a/google/admin/src/chromeosdevices.rs b/google/admin/src/chromeosdevices.rs index 3aa2bec2..4f1107a4 100644 --- a/google/admin/src/chromeosdevices.rs +++ b/google/admin/src/chromeosdevices.rs @@ -37,7 +37,7 @@ impl Chromeosdevices { projection: crate::types::Projection, query: &str, sort_order: crate::types::SortOrder, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if max_results > 0 { query_args.push(("maxResults".to_string(), max_results.to_string())); @@ -69,7 +69,7 @@ impl Chromeosdevices { ), None, ); - let resp: crate::types::ChromeOsDevices = self + let resp: crate::Response = self .client .get( &url, @@ -81,7 +81,11 @@ impl Chromeosdevices { .await?; // Return our response data. - Ok(resp.chromeosdevices.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.chromeosdevices.to_vec(), + )) } /** * This function performs a `GET` to the `/admin/directory/v1/customer/{customerId}/devices/chromeos` endpoint. @@ -98,7 +102,7 @@ impl Chromeosdevices { projection: crate::types::Projection, query: &str, sort_order: crate::types::SortOrder, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !order_by.to_string().is_empty() { query_args.push(("orderBy".to_string(), order_by.to_string())); @@ -124,7 +128,11 @@ impl Chromeosdevices { ), None, ); - let mut resp: crate::types::ChromeOsDevices = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -135,13 +143,17 @@ impl Chromeosdevices { ) .await?; - let mut chromeosdevices = resp.chromeosdevices; - let mut page = resp.next_page_token; + let mut chromeosdevices = body.chromeosdevices; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -152,7 +164,11 @@ impl Chromeosdevices { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -164,17 +180,17 @@ impl Chromeosdevices { .await?; } - chromeosdevices.append(&mut resp.chromeosdevices); + chromeosdevices.append(&mut body.chromeosdevices); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(chromeosdevices) + Ok(crate::Response::new(status, headers, chromeosdevices)) } /** * This function performs a `POST` to the `/admin/directory/v1/customer/{customerId}/devices/chromeos/moveDevicesToOu` endpoint. @@ -191,7 +207,7 @@ impl Chromeosdevices { customer_id: &str, org_unit_path: &str, body: &crate::types::ChromeOsMoveDevicesOu, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !org_unit_path.is_empty() { query_args.push(("orgUnitPath".to_string(), org_unit_path.to_string())); @@ -231,7 +247,7 @@ impl Chromeosdevices { customer_id: &str, device_id: &str, projection: crate::types::Projection, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !projection.to_string().is_empty() { query_args.push(("projection".to_string(), projection.to_string())); @@ -273,7 +289,7 @@ impl Chromeosdevices { device_id: &str, projection: crate::types::Projection, body: &crate::types::ChromeOsDevice, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !projection.to_string().is_empty() { query_args.push(("projection".to_string(), projection.to_string())); @@ -315,7 +331,7 @@ impl Chromeosdevices { device_id: &str, projection: crate::types::Projection, body: &crate::types::ChromeOsDevice, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !projection.to_string().is_empty() { query_args.push(("projection".to_string(), projection.to_string())); @@ -355,7 +371,7 @@ impl Chromeosdevices { customer_id: &str, resource_id: &str, body: &crate::types::ChromeOsDeviceAction, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/devices/chromeos/{}/action", diff --git a/google/admin/src/customer.rs b/google/admin/src/customer.rs index 844df5d7..eb53bdc6 100644 --- a/google/admin/src/customer.rs +++ b/google/admin/src/customer.rs @@ -27,7 +27,7 @@ impl Customer { customer_id: &str, device_id: &str, command_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/devices/chromeos/{}/commands/{}", @@ -62,7 +62,8 @@ impl Customer { customer_id: &str, device_id: &str, body: &crate::types::DirectoryChromeosdevicesIssueCommandRequest, - ) -> ClientResult { + ) -> ClientResult> + { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/devices/chromeos/{}/issueCommand", diff --git a/google/admin/src/customers.rs b/google/admin/src/customers.rs index 1ae12a62..c871ea7d 100644 --- a/google/admin/src/customers.rs +++ b/google/admin/src/customers.rs @@ -20,7 +20,10 @@ impl Customers { * * * `customer_key: &str` -- Id of the customer to be retrieved. */ - pub async fn get(&self, customer_key: &str) -> ClientResult { + pub async fn get( + &self, + customer_key: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customers/{}", @@ -51,7 +54,7 @@ impl Customers { &self, customer_key: &str, body: &crate::types::Customer, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customers/{}", @@ -82,7 +85,7 @@ impl Customers { &self, customer_key: &str, body: &crate::types::Customer, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customers/{}", @@ -112,7 +115,7 @@ impl Customers { pub async fn admin_chrome_printers_get( &self, name: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/{}", @@ -142,7 +145,7 @@ impl Customers { pub async fn admin_chrome_printers_delete( &self, name: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/{}", @@ -177,7 +180,7 @@ impl Customers { clear_mask: &str, update_mask: &str, body: &crate::types::Printer, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !clear_mask.is_empty() { query_args.push(("clearMask".to_string(), clear_mask.to_string())); @@ -224,7 +227,7 @@ impl Customers { org_unit_id: &str, page_size: i64, page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !filter.is_empty() { query_args.push(("filter".to_string(), filter.to_string())); @@ -247,7 +250,7 @@ impl Customers { ), None, ); - let resp: crate::types::ListPrintersResponse = self + let resp: crate::Response = self .client .get( &url, @@ -259,7 +262,11 @@ impl Customers { .await?; // Return our response data. - Ok(resp.printers.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.printers.to_vec(), + )) } /** * This function performs a `GET` to the `/admin/directory/v1/{parent}/chrome/printers` endpoint. @@ -273,7 +280,7 @@ impl Customers { parent: &str, filter: &str, org_unit_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !filter.is_empty() { query_args.push(("filter".to_string(), filter.to_string())); @@ -290,7 +297,11 @@ impl Customers { ), None, ); - let mut resp: crate::types::ListPrintersResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -301,13 +312,17 @@ impl Customers { ) .await?; - let mut printers = resp.printers; - let mut page = resp.next_page_token; + let mut printers = body.printers; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -318,7 +333,11 @@ impl Customers { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -330,17 +349,17 @@ impl Customers { .await?; } - printers.append(&mut resp.printers); + printers.append(&mut body.printers); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(printers) + Ok(crate::Response::new(status, headers, printers)) } /** * This function performs a `POST` to the `/admin/directory/v1/{parent}/chrome/printers` endpoint. @@ -355,7 +374,7 @@ impl Customers { &self, parent: &str, body: &crate::types::Printer, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/{}/chrome/printers", @@ -386,7 +405,7 @@ impl Customers { &self, parent: &str, body: &crate::types::BatchCreatePrintersRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/{}/chrome/printers:batchCreatePrinters", @@ -417,7 +436,7 @@ impl Customers { &self, parent: &str, body: &crate::types::BatchDeletePrintersRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/{}/chrome/printers:batchDeletePrinters", @@ -453,7 +472,7 @@ impl Customers { filter: &str, page_size: i64, page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !filter.is_empty() { query_args.push(("filter".to_string(), filter.to_string())); @@ -473,7 +492,7 @@ impl Customers { ), None, ); - let resp: crate::types::ListPrinterModelsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -485,7 +504,11 @@ impl Customers { .await?; // Return our response data. - Ok(resp.printer_models.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.printer_models.to_vec(), + )) } /** * This function performs a `GET` to the `/admin/directory/v1/{parent}/chrome/printers:listPrinterModels` endpoint. @@ -498,7 +521,7 @@ impl Customers { &self, parent: &str, filter: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !filter.is_empty() { query_args.push(("filter".to_string(), filter.to_string())); @@ -512,7 +535,11 @@ impl Customers { ), None, ); - let mut resp: crate::types::ListPrinterModelsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -523,13 +550,17 @@ impl Customers { ) .await?; - let mut printer_models = resp.printer_models; - let mut page = resp.next_page_token; + let mut printer_models = body.printer_models; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -540,7 +571,11 @@ impl Customers { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -552,16 +587,16 @@ impl Customers { .await?; } - printer_models.append(&mut resp.printer_models); + printer_models.append(&mut body.printer_models); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(printer_models) + Ok(crate::Response::new(status, headers, printer_models)) } } diff --git a/google/admin/src/domain_aliases.rs b/google/admin/src/domain_aliases.rs index 6f26b50e..9afbfbc5 100644 --- a/google/admin/src/domain_aliases.rs +++ b/google/admin/src/domain_aliases.rs @@ -25,7 +25,7 @@ impl DomainAliases { &self, customer: &str, parent_domain_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !parent_domain_name.is_empty() { query_args.push(( @@ -65,7 +65,7 @@ impl DomainAliases { &self, customer: &str, body: &crate::types::DomainAlias, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/domainaliases", @@ -97,7 +97,7 @@ impl DomainAliases { &self, customer: &str, domain_alias_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/domainaliases/{}", @@ -126,7 +126,11 @@ impl DomainAliases { * * `customer: &str` -- Immutable ID of the Google Workspace account. * * `domain_alias_name: &str` -- Name of domain alias to be retrieved. */ - pub async fn delete(&self, customer: &str, domain_alias_name: &str) -> ClientResult<()> { + pub async fn delete( + &self, + customer: &str, + domain_alias_name: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/domainaliases/{}", diff --git a/google/admin/src/domains.rs b/google/admin/src/domains.rs index c4084837..0fcb58d6 100644 --- a/google/admin/src/domains.rs +++ b/google/admin/src/domains.rs @@ -20,7 +20,10 @@ impl Domains { * * * `customer: &str` -- Immutable ID of the Google Workspace account. */ - pub async fn list(&self, customer: &str) -> ClientResult { + pub async fn list( + &self, + customer: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/domains", @@ -51,7 +54,7 @@ impl Domains { &self, customer: &str, body: &crate::types::Domains, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/domains", @@ -83,7 +86,7 @@ impl Domains { &self, customer: &str, domain_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/domains/{}", @@ -112,7 +115,11 @@ impl Domains { * * `customer: &str` -- Immutable ID of the Google Workspace account. * * `domain_name: &str` -- Name of domain to be deleted. */ - pub async fn delete(&self, customer: &str, domain_name: &str) -> ClientResult<()> { + pub async fn delete( + &self, + customer: &str, + domain_name: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/domains/{}", diff --git a/google/admin/src/groups.rs b/google/admin/src/groups.rs index 9d366f42..01a60b9e 100644 --- a/google/admin/src/groups.rs +++ b/google/admin/src/groups.rs @@ -37,7 +37,7 @@ impl Groups { query: &str, sort_order: crate::types::SortOrder, user_key: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -67,7 +67,7 @@ impl Groups { let url = self .client .url(&format!("/admin/directory/v1/groups?{}", query_), None); - let resp: crate::types::Groups = self + let resp: crate::Response = self .client .get( &url, @@ -79,7 +79,11 @@ impl Groups { .await?; // Return our response data. - Ok(resp.groups.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.groups.to_vec(), + )) } /** * This function performs a `GET` to the `/admin/directory/v1/groups` endpoint. @@ -96,7 +100,7 @@ impl Groups { query: &str, sort_order: crate::types::SortOrder, user_key: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -120,7 +124,11 @@ impl Groups { let url = self .client .url(&format!("/admin/directory/v1/groups?{}", query_), None); - let mut resp: crate::types::Groups = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -131,13 +139,17 @@ impl Groups { ) .await?; - let mut groups = resp.groups; - let mut page = resp.next_page_token; + let mut groups = body.groups; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -148,7 +160,11 @@ impl Groups { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -160,24 +176,27 @@ impl Groups { .await?; } - groups.append(&mut resp.groups); + groups.append(&mut body.groups); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(groups) + Ok(crate::Response::new(status, headers, groups)) } /** * This function performs a `POST` to the `/admin/directory/v1/groups` endpoint. * * Creates a group. */ - pub async fn insert(&self, body: &crate::types::Group) -> ClientResult { + pub async fn insert( + &self, + body: &crate::types::Group, + ) -> ClientResult> { let url = self.client.url("/admin/directory/v1/groups", None); self.client .post( @@ -198,7 +217,7 @@ impl Groups { * * * `group_key: &str` -- Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID. */ - pub async fn get(&self, group_key: &str) -> ClientResult { + pub async fn get(&self, group_key: &str) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/groups/{}", @@ -229,7 +248,7 @@ impl Groups { &self, group_key: &str, body: &crate::types::Group, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/groups/{}", @@ -256,7 +275,7 @@ impl Groups { * * * `group_key: &str` -- Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID. */ - pub async fn delete(&self, group_key: &str) -> ClientResult<()> { + pub async fn delete(&self, group_key: &str) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/groups/{}", @@ -287,7 +306,7 @@ impl Groups { &self, group_key: &str, body: &crate::types::Group, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/groups/{}", @@ -314,7 +333,10 @@ impl Groups { * * * `group_key: &str` -- Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID. */ - pub async fn aliases_list(&self, group_key: &str) -> ClientResult { + pub async fn aliases_list( + &self, + group_key: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/groups/{}/aliases", @@ -345,7 +367,7 @@ impl Groups { &self, group_key: &str, body: &crate::types::Alias, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/groups/{}/aliases", @@ -373,7 +395,11 @@ impl Groups { * * `group_key: &str` -- Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID. * * `alias: &str` -- The alias to be removed. */ - pub async fn aliases_delete(&self, group_key: &str, alias: &str) -> ClientResult<()> { + pub async fn aliases_delete( + &self, + group_key: &str, + alias: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/groups/{}/aliases/{}", diff --git a/google/admin/src/lib.rs b/google/admin/src/lib.rs index 312e4a61..939d245a 100644 --- a/google/admin/src/lib.rs +++ b/google/admin/src/lib.rs @@ -133,9 +133,27 @@ pub mod users; pub mod utils; pub mod verification_codes; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -673,13 +691,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -692,7 +711,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -715,13 +734,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -742,7 +762,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -761,7 +781,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -786,6 +810,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -802,7 +827,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -827,7 +852,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -850,6 +875,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -866,7 +892,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -892,7 +918,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -935,6 +961,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -947,7 +974,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -970,7 +997,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -979,7 +1006,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -987,7 +1014,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -997,32 +1024,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1034,7 +1065,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1043,7 +1074,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1051,7 +1082,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1059,7 +1090,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1067,7 +1098,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/google/admin/src/members.rs b/google/admin/src/members.rs index f46496ee..ecdb32c6 100644 --- a/google/admin/src/members.rs +++ b/google/admin/src/members.rs @@ -25,7 +25,7 @@ impl Members { &self, group_key: &str, member_key: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/groups/{}/hasMember/{}", @@ -64,7 +64,7 @@ impl Members { max_results: i64, page_token: &str, roles: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if include_derived_membership { query_args.push(( @@ -90,7 +90,7 @@ impl Members { ), None, ); - let resp: crate::types::Members = self + let resp: crate::Response = self .client .get( &url, @@ -102,7 +102,11 @@ impl Members { .await?; // Return our response data. - Ok(resp.members.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.members.to_vec(), + )) } /** * This function performs a `GET` to the `/admin/directory/v1/groups/{groupKey}/members` endpoint. @@ -116,7 +120,7 @@ impl Members { group_key: &str, include_derived_membership: bool, roles: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if include_derived_membership { query_args.push(( @@ -136,7 +140,11 @@ impl Members { ), None, ); - let mut resp: crate::types::Members = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -147,13 +155,17 @@ impl Members { ) .await?; - let mut members = resp.members; - let mut page = resp.next_page_token; + let mut members = body.members; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -164,7 +176,11 @@ impl Members { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -176,17 +192,17 @@ impl Members { .await?; } - members.append(&mut resp.members); + members.append(&mut body.members); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(members) + Ok(crate::Response::new(status, headers, members)) } /** * This function performs a `POST` to the `/admin/directory/v1/groups/{groupKey}/members` endpoint. @@ -201,7 +217,7 @@ impl Members { &self, group_key: &str, body: &crate::types::Member, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/groups/{}/members", @@ -233,7 +249,7 @@ impl Members { &self, group_key: &str, member_key: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/groups/{}/members/{}", @@ -267,7 +283,7 @@ impl Members { group_key: &str, member_key: &str, body: &crate::types::Member, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/groups/{}/members/{}", @@ -296,7 +312,11 @@ impl Members { * * `group_key: &str` -- Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID. * * `member_key: &str` -- Identifies the group member in the API request. A group member can be a user or another group. The value can be the member's (group or user) primary email address, alias, or unique ID. */ - pub async fn delete(&self, group_key: &str, member_key: &str) -> ClientResult<()> { + pub async fn delete( + &self, + group_key: &str, + member_key: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/groups/{}/members/{}", @@ -330,7 +350,7 @@ impl Members { group_key: &str, member_key: &str, body: &crate::types::Member, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/groups/{}/members/{}", diff --git a/google/admin/src/mobiledevices.rs b/google/admin/src/mobiledevices.rs index aeb6e7db..4f0b295a 100644 --- a/google/admin/src/mobiledevices.rs +++ b/google/admin/src/mobiledevices.rs @@ -35,7 +35,7 @@ impl Mobiledevices { projection: crate::types::Projection, query: &str, sort_order: crate::types::SortOrder, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if max_results > 0 { query_args.push(("maxResults".to_string(), max_results.to_string())); @@ -64,7 +64,7 @@ impl Mobiledevices { ), None, ); - let resp: crate::types::MobileDevices = self + let resp: crate::Response = self .client .get( &url, @@ -76,7 +76,11 @@ impl Mobiledevices { .await?; // Return our response data. - Ok(resp.mobiledevices.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.mobiledevices.to_vec(), + )) } /** * This function performs a `GET` to the `/admin/directory/v1/customer/{customerId}/devices/mobile` endpoint. @@ -92,7 +96,7 @@ impl Mobiledevices { projection: crate::types::Projection, query: &str, sort_order: crate::types::SortOrder, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !order_by.to_string().is_empty() { query_args.push(("orderBy".to_string(), order_by.to_string())); @@ -115,7 +119,11 @@ impl Mobiledevices { ), None, ); - let mut resp: crate::types::MobileDevices = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -126,13 +134,17 @@ impl Mobiledevices { ) .await?; - let mut mobiledevices = resp.mobiledevices; - let mut page = resp.next_page_token; + let mut mobiledevices = body.mobiledevices; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -143,7 +155,11 @@ impl Mobiledevices { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -155,17 +171,17 @@ impl Mobiledevices { .await?; } - mobiledevices.append(&mut resp.mobiledevices); + mobiledevices.append(&mut body.mobiledevices); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(mobiledevices) + Ok(crate::Response::new(status, headers, mobiledevices)) } /** * This function performs a `GET` to the `/admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}` endpoint. @@ -183,7 +199,7 @@ impl Mobiledevices { customer_id: &str, resource_id: &str, projection: crate::types::Projection, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !projection.to_string().is_empty() { query_args.push(("projection".to_string(), projection.to_string())); @@ -218,7 +234,11 @@ impl Mobiledevices { * * `customer_id: &str` -- The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users). * * `resource_id: &str` -- The unique ID the API service uses to identify the mobile device. */ - pub async fn delete(&self, customer_id: &str, resource_id: &str) -> ClientResult<()> { + pub async fn delete( + &self, + customer_id: &str, + resource_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/devices/mobile/{}", @@ -252,7 +272,7 @@ impl Mobiledevices { customer_id: &str, resource_id: &str, body: &crate::types::MobileDeviceAction, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/devices/mobile/{}/action", diff --git a/google/admin/src/orgunits.rs b/google/admin/src/orgunits.rs index 8aad4606..2ed90ba1 100644 --- a/google/admin/src/orgunits.rs +++ b/google/admin/src/orgunits.rs @@ -27,7 +27,7 @@ impl Orgunits { customer_id: &str, org_unit_path: &str, type_: crate::types::DirectoryOrgunitsListType, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !org_unit_path.is_empty() { query_args.push(("orgUnitPath".to_string(), org_unit_path.to_string())); @@ -67,7 +67,7 @@ impl Orgunits { &self, customer_id: &str, body: &crate::types::OrgUnit, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/orgunits", @@ -99,7 +99,7 @@ impl Orgunits { &self, customer_id: &str, org_unit_path: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/orgunits/{}", @@ -133,7 +133,7 @@ impl Orgunits { customer_id: &str, org_unit_path: &str, body: &crate::types::OrgUnit, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/orgunits/{}", @@ -162,7 +162,11 @@ impl Orgunits { * * `customer_id: &str` -- The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users). * * `org_unit_path: &str` -- The full path of the organizational unit or its unique ID. */ - pub async fn delete(&self, customer_id: &str, org_unit_path: &str) -> ClientResult<()> { + pub async fn delete( + &self, + customer_id: &str, + org_unit_path: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/orgunits/{}", @@ -196,7 +200,7 @@ impl Orgunits { customer_id: &str, org_unit_path: &str, body: &crate::types::OrgUnit, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/orgunits/{}", diff --git a/google/admin/src/privileges.rs b/google/admin/src/privileges.rs index 752e901a..1ceb71ba 100644 --- a/google/admin/src/privileges.rs +++ b/google/admin/src/privileges.rs @@ -20,7 +20,10 @@ impl Privileges { * * * `customer: &str` -- Immutable ID of the Google Workspace account. */ - pub async fn list(&self, customer: &str) -> ClientResult { + pub async fn list( + &self, + customer: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/roles/ALL/privileges", diff --git a/google/admin/src/resources.rs b/google/admin/src/resources.rs index 2c89fdea..ff1aad33 100644 --- a/google/admin/src/resources.rs +++ b/google/admin/src/resources.rs @@ -27,7 +27,7 @@ impl Resources { customer: &str, max_results: i64, page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if max_results > 0 { query_args.push(("maxResults".to_string(), max_results.to_string())); @@ -44,7 +44,7 @@ impl Resources { ), None, ); - let resp: crate::types::Buildings = self + let resp: crate::Response = self .client .get( &url, @@ -56,7 +56,11 @@ impl Resources { .await?; // Return our response data. - Ok(resp.buildings.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.buildings.to_vec(), + )) } /** * This function performs a `GET` to the `/admin/directory/v1/customer/{customer}/resources/buildings` endpoint. @@ -68,7 +72,7 @@ impl Resources { pub async fn buildings_list_all( &self, customer: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/resources/buildings", @@ -76,7 +80,11 @@ impl Resources { ), None, ); - let mut resp: crate::types::Buildings = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -87,13 +95,17 @@ impl Resources { ) .await?; - let mut buildings = resp.buildings; - let mut page = resp.next_page_token; + let mut buildings = body.buildings; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -104,7 +116,11 @@ impl Resources { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -116,17 +132,17 @@ impl Resources { .await?; } - buildings.append(&mut resp.buildings); + buildings.append(&mut body.buildings); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(buildings) + Ok(crate::Response::new(status, headers, buildings)) } /** * This function performs a `POST` to the `/admin/directory/v1/customer/{customer}/resources/buildings` endpoint. @@ -143,7 +159,7 @@ impl Resources { customer: &str, coordinates_source: crate::types::CoordinatesSource, body: &crate::types::Building, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !coordinates_source.to_string().is_empty() { query_args.push(( @@ -184,7 +200,7 @@ impl Resources { &self, customer: &str, building_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/resources/buildings/{}", @@ -220,7 +236,7 @@ impl Resources { building_id: &str, coordinates_source: crate::types::CoordinatesSource, body: &crate::types::Building, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !coordinates_source.to_string().is_empty() { query_args.push(( @@ -258,7 +274,11 @@ impl Resources { * * `customer: &str` -- The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID. * * `building_id: &str` -- The id of the building to delete. */ - pub async fn buildings_delete(&self, customer: &str, building_id: &str) -> ClientResult<()> { + pub async fn buildings_delete( + &self, + customer: &str, + building_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/resources/buildings/{}", @@ -294,7 +314,7 @@ impl Resources { building_id: &str, coordinates_source: crate::types::CoordinatesSource, body: &crate::types::Building, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !coordinates_source.to_string().is_empty() { query_args.push(( @@ -342,7 +362,7 @@ impl Resources { order_by: &str, page_token: &str, query: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if max_results > 0 { query_args.push(("maxResults".to_string(), max_results.to_string())); @@ -365,7 +385,7 @@ impl Resources { ), None, ); - let resp: crate::types::CalendarResources = self + let resp: crate::Response = self .client .get( &url, @@ -377,7 +397,11 @@ impl Resources { .await?; // Return our response data. - Ok(resp.items.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.items.to_vec(), + )) } /** * This function performs a `GET` to the `/admin/directory/v1/customer/{customer}/resources/calendars` endpoint. @@ -391,7 +415,7 @@ impl Resources { customer: &str, order_by: &str, query: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !order_by.is_empty() { query_args.push(("orderBy".to_string(), order_by.to_string())); @@ -408,7 +432,11 @@ impl Resources { ), None, ); - let mut resp: crate::types::CalendarResources = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -419,13 +447,17 @@ impl Resources { ) .await?; - let mut items = resp.items; - let mut page = resp.next_page_token; + let mut items = body.items; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -436,7 +468,11 @@ impl Resources { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -448,17 +484,17 @@ impl Resources { .await?; } - items.append(&mut resp.items); + items.append(&mut body.items); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(items) + Ok(crate::Response::new(status, headers, items)) } /** * This function performs a `POST` to the `/admin/directory/v1/customer/{customer}/resources/calendars` endpoint. @@ -473,7 +509,7 @@ impl Resources { &self, customer: &str, body: &crate::types::CalendarResource, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/resources/calendars", @@ -505,7 +541,7 @@ impl Resources { &self, customer: &str, calendar_resource_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/resources/calendars/{}", @@ -539,7 +575,7 @@ impl Resources { customer: &str, calendar_resource_id: &str, body: &crate::types::CalendarResource, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/resources/calendars/{}", @@ -572,7 +608,7 @@ impl Resources { &self, customer: &str, calendar_resource_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/resources/calendars/{}", @@ -606,7 +642,7 @@ impl Resources { customer: &str, calendar_resource_id: &str, body: &crate::types::CalendarResource, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/resources/calendars/{}", @@ -641,7 +677,7 @@ impl Resources { customer: &str, max_results: i64, page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if max_results > 0 { query_args.push(("maxResults".to_string(), max_results.to_string())); @@ -658,7 +694,7 @@ impl Resources { ), None, ); - let resp: crate::types::Features = self + let resp: crate::Response = self .client .get( &url, @@ -670,7 +706,11 @@ impl Resources { .await?; // Return our response data. - Ok(resp.features.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.features.to_vec(), + )) } /** * This function performs a `GET` to the `/admin/directory/v1/customer/{customer}/resources/features` endpoint. @@ -682,7 +722,7 @@ impl Resources { pub async fn features_list_all( &self, customer: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/resources/features", @@ -690,7 +730,11 @@ impl Resources { ), None, ); - let mut resp: crate::types::Features = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -701,13 +745,17 @@ impl Resources { ) .await?; - let mut features = resp.features; - let mut page = resp.next_page_token; + let mut features = body.features; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -718,7 +766,11 @@ impl Resources { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -730,17 +782,17 @@ impl Resources { .await?; } - features.append(&mut resp.features); + features.append(&mut body.features); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(features) + Ok(crate::Response::new(status, headers, features)) } /** * This function performs a `POST` to the `/admin/directory/v1/customer/{customer}/resources/features` endpoint. @@ -755,7 +807,7 @@ impl Resources { &self, customer: &str, body: &crate::types::Feature, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/resources/features", @@ -787,7 +839,7 @@ impl Resources { &self, customer: &str, feature_key: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/resources/features/{}", @@ -821,7 +873,7 @@ impl Resources { customer: &str, feature_key: &str, body: &crate::types::Feature, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/resources/features/{}", @@ -850,7 +902,11 @@ impl Resources { * * `customer: &str` -- The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID. * * `feature_key: &str` -- The unique ID of the feature to delete. */ - pub async fn features_delete(&self, customer: &str, feature_key: &str) -> ClientResult<()> { + pub async fn features_delete( + &self, + customer: &str, + feature_key: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/resources/features/{}", @@ -884,7 +940,7 @@ impl Resources { customer: &str, feature_key: &str, body: &crate::types::Feature, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/resources/features/{}", @@ -918,7 +974,7 @@ impl Resources { customer: &str, old_name: &str, body: &crate::types::FeatureRename, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/resources/features/{}/rename", diff --git a/google/admin/src/role_assignments.rs b/google/admin/src/role_assignments.rs index 763bd7cd..bc6ebb40 100644 --- a/google/admin/src/role_assignments.rs +++ b/google/admin/src/role_assignments.rs @@ -31,7 +31,7 @@ impl RoleAssignments { page_token: &str, role_id: &str, user_key: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if max_results > 0 { query_args.push(("maxResults".to_string(), max_results.to_string())); @@ -54,7 +54,7 @@ impl RoleAssignments { ), None, ); - let resp: crate::types::RoleAssignments = self + let resp: crate::Response = self .client .get( &url, @@ -66,7 +66,11 @@ impl RoleAssignments { .await?; // Return our response data. - Ok(resp.items.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.items.to_vec(), + )) } /** * This function performs a `GET` to the `/admin/directory/v1/customer/{customer}/roleassignments` endpoint. @@ -80,7 +84,7 @@ impl RoleAssignments { customer: &str, role_id: &str, user_key: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !role_id.is_empty() { query_args.push(("roleId".to_string(), role_id.to_string())); @@ -97,7 +101,11 @@ impl RoleAssignments { ), None, ); - let mut resp: crate::types::RoleAssignments = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -108,13 +116,17 @@ impl RoleAssignments { ) .await?; - let mut items = resp.items; - let mut page = resp.next_page_token; + let mut items = body.items; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -125,7 +137,11 @@ impl RoleAssignments { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -137,17 +153,17 @@ impl RoleAssignments { .await?; } - items.append(&mut resp.items); + items.append(&mut body.items); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(items) + Ok(crate::Response::new(status, headers, items)) } /** * This function performs a `POST` to the `/admin/directory/v1/customer/{customer}/roleassignments` endpoint. @@ -162,7 +178,7 @@ impl RoleAssignments { &self, customer: &str, body: &crate::types::RoleAssignment, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/roleassignments", @@ -194,7 +210,7 @@ impl RoleAssignments { &self, customer: &str, role_assignment_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/roleassignments/{}", @@ -223,7 +239,11 @@ impl RoleAssignments { * * `customer: &str` -- Immutable ID of the Google Workspace account. * * `role_assignment_id: &str` -- Immutable ID of the role assignment. */ - pub async fn delete(&self, customer: &str, role_assignment_id: &str) -> ClientResult<()> { + pub async fn delete( + &self, + customer: &str, + role_assignment_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/roleassignments/{}", diff --git a/google/admin/src/roles.rs b/google/admin/src/roles.rs index 850baded..29121f8d 100644 --- a/google/admin/src/roles.rs +++ b/google/admin/src/roles.rs @@ -27,7 +27,7 @@ impl Roles { customer: &str, max_results: i64, page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if max_results > 0 { query_args.push(("maxResults".to_string(), max_results.to_string())); @@ -44,7 +44,7 @@ impl Roles { ), None, ); - let resp: crate::types::Roles = self + let resp: crate::Response = self .client .get( &url, @@ -56,7 +56,11 @@ impl Roles { .await?; // Return our response data. - Ok(resp.items.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.items.to_vec(), + )) } /** * This function performs a `GET` to the `/admin/directory/v1/customer/{customer}/roles` endpoint. @@ -65,7 +69,10 @@ impl Roles { * * Retrieves a paginated list of all the roles in a domain. */ - pub async fn list_all(&self, customer: &str) -> ClientResult> { + pub async fn list_all( + &self, + customer: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/roles", @@ -73,7 +80,11 @@ impl Roles { ), None, ); - let mut resp: crate::types::Roles = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -84,13 +95,17 @@ impl Roles { ) .await?; - let mut items = resp.items; - let mut page = resp.next_page_token; + let mut items = body.items; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -101,7 +116,11 @@ impl Roles { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -113,17 +132,17 @@ impl Roles { .await?; } - items.append(&mut resp.items); + items.append(&mut body.items); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(items) + Ok(crate::Response::new(status, headers, items)) } /** * This function performs a `POST` to the `/admin/directory/v1/customer/{customer}/roles` endpoint. @@ -138,7 +157,7 @@ impl Roles { &self, customer: &str, body: &crate::types::Role, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/roles", @@ -166,7 +185,11 @@ impl Roles { * * `customer: &str` -- Immutable ID of the Google Workspace account. * * `role_id: &str` -- Immutable ID of the role. */ - pub async fn get(&self, customer: &str, role_id: &str) -> ClientResult { + pub async fn get( + &self, + customer: &str, + role_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/roles/{}", @@ -200,7 +223,7 @@ impl Roles { customer: &str, role_id: &str, body: &crate::types::Role, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/roles/{}", @@ -229,7 +252,7 @@ impl Roles { * * `customer: &str` -- Immutable ID of the Google Workspace account. * * `role_id: &str` -- Immutable ID of the role. */ - pub async fn delete(&self, customer: &str, role_id: &str) -> ClientResult<()> { + pub async fn delete(&self, customer: &str, role_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/roles/{}", @@ -263,7 +286,7 @@ impl Roles { customer: &str, role_id: &str, body: &crate::types::Role, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/roles/{}", diff --git a/google/admin/src/schemas.rs b/google/admin/src/schemas.rs index ba65a362..91468b17 100644 --- a/google/admin/src/schemas.rs +++ b/google/admin/src/schemas.rs @@ -20,7 +20,10 @@ impl Schemas { * * * `customer_id: &str` -- Immutable ID of the Google Workspace account. */ - pub async fn list(&self, customer_id: &str) -> ClientResult { + pub async fn list( + &self, + customer_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/schemas", @@ -51,7 +54,7 @@ impl Schemas { &self, customer_id: &str, body: &crate::types::Schema, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/schemas", @@ -83,7 +86,7 @@ impl Schemas { &self, customer_id: &str, schema_key: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/schemas/{}", @@ -117,7 +120,7 @@ impl Schemas { customer_id: &str, schema_key: &str, body: &crate::types::Schema, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/schemas/{}", @@ -146,7 +149,11 @@ impl Schemas { * * `customer_id: &str` -- Immutable ID of the Google Workspace account. * * `schema_key: &str` -- Name or immutable ID of the schema. */ - pub async fn delete(&self, customer_id: &str, schema_key: &str) -> ClientResult<()> { + pub async fn delete( + &self, + customer_id: &str, + schema_key: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/schemas/{}", @@ -180,7 +187,7 @@ impl Schemas { customer_id: &str, schema_key: &str, body: &crate::types::Schema, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/customer/{}/schemas/{}", diff --git a/google/admin/src/tokens.rs b/google/admin/src/tokens.rs index 00b39711..4ae2d432 100644 --- a/google/admin/src/tokens.rs +++ b/google/admin/src/tokens.rs @@ -20,7 +20,10 @@ impl Tokens { * * * `user_key: &str` -- Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. */ - pub async fn list(&self, user_key: &str) -> ClientResult { + pub async fn list( + &self, + user_key: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/tokens", @@ -48,7 +51,11 @@ impl Tokens { * * `user_key: &str` -- Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. * * `client_id: &str` -- The Client ID of the application the token is issued to. */ - pub async fn get(&self, user_key: &str, client_id: &str) -> ClientResult { + pub async fn get( + &self, + user_key: &str, + client_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/tokens/{}", @@ -77,7 +84,11 @@ impl Tokens { * * `user_key: &str` -- Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. * * `client_id: &str` -- The Client ID of the application the token is issued to. */ - pub async fn delete(&self, user_key: &str, client_id: &str) -> ClientResult<()> { + pub async fn delete( + &self, + user_key: &str, + client_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/tokens/{}", diff --git a/google/admin/src/two_step_verification.rs b/google/admin/src/two_step_verification.rs index 59f19665..a1369735 100644 --- a/google/admin/src/two_step_verification.rs +++ b/google/admin/src/two_step_verification.rs @@ -20,7 +20,7 @@ impl TwoStepVerification { * * * `user_key: &str` -- Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. */ - pub async fn turn_off(&self, user_key: &str) -> ClientResult<()> { + pub async fn turn_off(&self, user_key: &str) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/twoStepVerification/turnOff", diff --git a/google/admin/src/users.rs b/google/admin/src/users.rs index 44c47b8e..4d9e3f89 100644 --- a/google/admin/src/users.rs +++ b/google/admin/src/users.rs @@ -44,7 +44,7 @@ impl Users { show_deleted: &str, sort_order: crate::types::SortOrder, view_type: crate::types::ViewType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -83,7 +83,7 @@ impl Users { let url = self .client .url(&format!("/admin/directory/v1/users?{}", query_), None); - let resp: crate::types::Users = self + let resp: crate::Response = self .client .get( &url, @@ -95,7 +95,11 @@ impl Users { .await?; // Return our response data. - Ok(resp.users.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.users.to_vec(), + )) } /** * This function performs a `GET` to the `/admin/directory/v1/users` endpoint. @@ -115,7 +119,7 @@ impl Users { show_deleted: &str, sort_order: crate::types::SortOrder, view_type: crate::types::ViewType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -148,7 +152,11 @@ impl Users { let url = self .client .url(&format!("/admin/directory/v1/users?{}", query_), None); - let mut resp: crate::types::Users = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -159,13 +167,17 @@ impl Users { ) .await?; - let mut users = resp.users; - let mut page = resp.next_page_token; + let mut users = body.users; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -176,7 +188,11 @@ impl Users { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -188,24 +204,27 @@ impl Users { .await?; } - users.append(&mut resp.users); + users.append(&mut body.users); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(users) + Ok(crate::Response::new(status, headers, users)) } /** * This function performs a `POST` to the `/admin/directory/v1/users` endpoint. * * Creates a user. */ - pub async fn insert(&self, body: &crate::types::User) -> ClientResult { + pub async fn insert( + &self, + body: &crate::types::User, + ) -> ClientResult> { let url = self.client.url("/admin/directory/v1/users", None); self.client .post( @@ -251,7 +270,7 @@ impl Users { sort_order: crate::types::SortOrder, view_type: crate::types::ViewType, body: &crate::types::Channel, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -317,7 +336,7 @@ impl Users { user_key: &str, projection: crate::types::DirectoryUsersListProjection, view_type: crate::types::ViewType, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !projection.to_string().is_empty() { query_args.push(("projection".to_string(), projection.to_string())); @@ -357,7 +376,7 @@ impl Users { &self, user_key: &str, body: &crate::types::User, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}", @@ -384,7 +403,7 @@ impl Users { * * * `user_key: &str` -- Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. */ - pub async fn delete(&self, user_key: &str) -> ClientResult<()> { + pub async fn delete(&self, user_key: &str) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}", @@ -415,7 +434,7 @@ impl Users { &self, user_key: &str, body: &crate::types::User, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}", @@ -447,7 +466,7 @@ impl Users { &self, user_key: &str, event: crate::types::DirectoryUsersAliasesListEvent, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !event.to_string().is_empty() { query_args.push(("event".to_string(), event.to_string())); @@ -484,7 +503,7 @@ impl Users { &self, user_key: &str, body: &crate::types::Alias, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/aliases", @@ -517,7 +536,7 @@ impl Users { user_key: &str, event: crate::types::DirectoryUsersAliasesListEvent, body: &crate::types::Channel, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !event.to_string().is_empty() { query_args.push(("event".to_string(), event.to_string())); @@ -551,7 +570,11 @@ impl Users { * * `user_key: &str` -- Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. * * `alias: &str` -- The alias to be removed. */ - pub async fn aliases_delete(&self, user_key: &str, alias: &str) -> ClientResult<()> { + pub async fn aliases_delete( + &self, + user_key: &str, + alias: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/aliases/{}", @@ -583,7 +606,7 @@ impl Users { &self, user_key: &str, body: &crate::types::UserMakeAdmin, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/makeAdmin", @@ -610,7 +633,10 @@ impl Users { * * * `user_key: &str` -- Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. */ - pub async fn photos_get(&self, user_key: &str) -> ClientResult { + pub async fn photos_get( + &self, + user_key: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/photos/thumbnail", @@ -641,7 +667,7 @@ impl Users { &self, user_key: &str, body: &crate::types::UserPhoto, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/photos/thumbnail", @@ -668,7 +694,7 @@ impl Users { * * * `user_key: &str` -- Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. */ - pub async fn photos_delete(&self, user_key: &str) -> ClientResult<()> { + pub async fn photos_delete(&self, user_key: &str) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/photos/thumbnail", @@ -699,7 +725,7 @@ impl Users { &self, user_key: &str, body: &crate::types::UserPhoto, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/photos/thumbnail", @@ -726,7 +752,7 @@ impl Users { * * * `user_key: &str` -- Identifies the target user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. */ - pub async fn sign_out(&self, user_key: &str) -> ClientResult<()> { + pub async fn sign_out(&self, user_key: &str) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/signOut", @@ -757,7 +783,7 @@ impl Users { &self, user_key: &str, body: &crate::types::UserUndelete, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/undelete", diff --git a/google/admin/src/verification_codes.rs b/google/admin/src/verification_codes.rs index fec96340..e5333749 100644 --- a/google/admin/src/verification_codes.rs +++ b/google/admin/src/verification_codes.rs @@ -20,7 +20,10 @@ impl VerificationCodes { * * * `user_key: &str` -- Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. */ - pub async fn list(&self, user_key: &str) -> ClientResult { + pub async fn list( + &self, + user_key: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/verificationCodes", @@ -47,7 +50,7 @@ impl VerificationCodes { * * * `user_key: &str` -- Email or immutable ID of the user. */ - pub async fn generate(&self, user_key: &str) -> ClientResult<()> { + pub async fn generate(&self, user_key: &str) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/verificationCodes/generate", @@ -74,7 +77,7 @@ impl VerificationCodes { * * * `user_key: &str` -- Email or immutable ID of the user. */ - pub async fn invalidate(&self, user_key: &str) -> ClientResult<()> { + pub async fn invalidate(&self, user_key: &str) -> ClientResult> { let url = self.client.url( &format!( "/admin/directory/v1/users/{}/verificationCodes/invalidate", diff --git a/google/calendar/src/acl.rs b/google/calendar/src/acl.rs index 6600df15..8f452ce5 100644 --- a/google/calendar/src/acl.rs +++ b/google/calendar/src/acl.rs @@ -33,7 +33,7 @@ impl Acl { max_results: i64, page_token: &str, show_deleted: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if max_results > 0 { query_args.push(("maxResults".to_string(), max_results.to_string())); @@ -53,7 +53,7 @@ impl Acl { ), None, ); - let resp: crate::types::Acl = self + let resp: crate::Response = self .client .get( &url, @@ -65,7 +65,11 @@ impl Acl { .await?; // Return our response data. - Ok(resp.items.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.items.to_vec(), + )) } /** * This function performs a `GET` to the `/calendars/{calendarId}/acl` endpoint. @@ -78,7 +82,7 @@ impl Acl { &self, calendar_id: &str, show_deleted: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if show_deleted { query_args.push(("showDeleted".to_string(), show_deleted.to_string())); @@ -92,7 +96,11 @@ impl Acl { ), None, ); - let mut resp: crate::types::Acl = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -103,13 +111,17 @@ impl Acl { ) .await?; - let mut items = resp.items; - let mut page = resp.next_page_token; + let mut items = body.items; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -120,7 +132,11 @@ impl Acl { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -132,17 +148,17 @@ impl Acl { .await?; } - items.append(&mut resp.items); + items.append(&mut body.items); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(items) + Ok(crate::Response::new(status, headers, items)) } /** * This function performs a `POST` to the `/calendars/{calendarId}/acl` endpoint. @@ -159,7 +175,7 @@ impl Acl { calendar_id: &str, send_notifications: bool, body: &crate::types::AclRule, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if send_notifications { query_args.push(( @@ -209,7 +225,7 @@ impl Acl { page_token: &str, show_deleted: bool, body: &crate::types::Channel, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if max_results > 0 { query_args.push(("maxResults".to_string(), max_results.to_string())); @@ -253,7 +269,7 @@ impl Acl { &self, calendar_id: &str, rule_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/calendars/{}/acl/{}", @@ -289,7 +305,7 @@ impl Acl { rule_id: &str, send_notifications: bool, body: &crate::types::AclRule, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if send_notifications { query_args.push(( @@ -327,7 +343,11 @@ impl Acl { * * `calendar_id: &str` -- Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. * * `rule_id: &str` -- ETag of the collection. */ - pub async fn delete(&self, calendar_id: &str, rule_id: &str) -> ClientResult<()> { + pub async fn delete( + &self, + calendar_id: &str, + rule_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/calendars/{}/acl/{}", @@ -363,7 +383,7 @@ impl Acl { rule_id: &str, send_notifications: bool, body: &crate::types::AclRule, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if send_notifications { query_args.push(( diff --git a/google/calendar/src/calendar_list.rs b/google/calendar/src/calendar_list.rs index 94945b6b..e940c288 100644 --- a/google/calendar/src/calendar_list.rs +++ b/google/calendar/src/calendar_list.rs @@ -36,7 +36,7 @@ impl CalendarList { page_token: &str, show_deleted: bool, show_hidden: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if max_results > 0 { query_args.push(("maxResults".to_string(), max_results.to_string())); @@ -57,7 +57,7 @@ impl CalendarList { let url = self .client .url(&format!("/users/me/calendarList?{}", query_), None); - let resp: crate::types::CalendarList = self + let resp: crate::Response = self .client .get( &url, @@ -69,7 +69,11 @@ impl CalendarList { .await?; // Return our response data. - Ok(resp.items.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.items.to_vec(), + )) } /** * This function performs a `GET` to the `/users/me/calendarList` endpoint. @@ -83,7 +87,7 @@ impl CalendarList { min_access_role: crate::types::MinAccessRole, show_deleted: bool, show_hidden: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !min_access_role.to_string().is_empty() { query_args.push(("minAccessRole".to_string(), min_access_role.to_string())); @@ -98,7 +102,11 @@ impl CalendarList { let url = self .client .url(&format!("/users/me/calendarList?{}", query_), None); - let mut resp: crate::types::CalendarList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -109,13 +117,17 @@ impl CalendarList { ) .await?; - let mut items = resp.items; - let mut page = resp.next_page_token; + let mut items = body.items; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -126,7 +138,11 @@ impl CalendarList { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -138,17 +154,17 @@ impl CalendarList { .await?; } - items.append(&mut resp.items); + items.append(&mut body.items); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(items) + Ok(crate::Response::new(status, headers, items)) } /** * This function performs a `POST` to the `/users/me/calendarList` endpoint. @@ -163,7 +179,7 @@ impl CalendarList { &self, color_rgb_format: bool, body: &crate::types::CalendarListEntry, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if color_rgb_format { query_args.push(("colorRgbFormat".to_string(), color_rgb_format.to_string())); @@ -208,7 +224,7 @@ impl CalendarList { show_deleted: bool, show_hidden: bool, body: &crate::types::Channel, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if max_results > 0 { query_args.push(("maxResults".to_string(), max_results.to_string())); @@ -251,7 +267,7 @@ impl CalendarList { pub async fn list_get( &self, calendar_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/me/calendarList/{}", @@ -284,7 +300,7 @@ impl CalendarList { calendar_id: &str, color_rgb_format: bool, body: &crate::types::CalendarListEntry, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if color_rgb_format { query_args.push(("colorRgbFormat".to_string(), color_rgb_format.to_string())); @@ -317,7 +333,7 @@ impl CalendarList { * * * `calendar_id: &str` -- Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. */ - pub async fn list_delete(&self, calendar_id: &str) -> ClientResult<()> { + pub async fn list_delete(&self, calendar_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/users/me/calendarList/{}", @@ -350,7 +366,7 @@ impl CalendarList { calendar_id: &str, color_rgb_format: bool, body: &crate::types::CalendarListEntry, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if color_rgb_format { query_args.push(("colorRgbFormat".to_string(), color_rgb_format.to_string())); diff --git a/google/calendar/src/calendars.rs b/google/calendar/src/calendars.rs index 8f9e16df..bc7c2413 100644 --- a/google/calendar/src/calendars.rs +++ b/google/calendar/src/calendars.rs @@ -19,7 +19,7 @@ impl Calendars { pub async fn insert( &self, body: &crate::types::Calendar, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/calendars", None); self.client .post( @@ -40,7 +40,10 @@ impl Calendars { * * * `calendar_id: &str` -- Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. */ - pub async fn get(&self, calendar_id: &str) -> ClientResult { + pub async fn get( + &self, + calendar_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/calendars/{}", @@ -71,7 +74,7 @@ impl Calendars { &self, calendar_id: &str, body: &crate::types::Calendar, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/calendars/{}", @@ -98,7 +101,7 @@ impl Calendars { * * * `calendar_id: &str` -- Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. */ - pub async fn delete(&self, calendar_id: &str) -> ClientResult<()> { + pub async fn delete(&self, calendar_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/calendars/{}", @@ -129,7 +132,7 @@ impl Calendars { &self, calendar_id: &str, body: &crate::types::Calendar, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/calendars/{}", @@ -156,7 +159,7 @@ impl Calendars { * * * `calendar_id: &str` -- Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. */ - pub async fn clear(&self, calendar_id: &str) -> ClientResult<()> { + pub async fn clear(&self, calendar_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/calendars/{}/clear", diff --git a/google/calendar/src/channels.rs b/google/calendar/src/channels.rs index 9951fa3b..e8cff6fe 100644 --- a/google/calendar/src/channels.rs +++ b/google/calendar/src/channels.rs @@ -16,7 +16,7 @@ impl Channels { * * Stop watching resources through this channel */ - pub async fn stop(&self, body: &crate::types::Channel) -> ClientResult<()> { + pub async fn stop(&self, body: &crate::types::Channel) -> ClientResult> { let url = self.client.url("/channels/stop", None); self.client .post( diff --git a/google/calendar/src/colors.rs b/google/calendar/src/colors.rs index 2f845453..6c204c88 100644 --- a/google/calendar/src/colors.rs +++ b/google/calendar/src/colors.rs @@ -16,7 +16,7 @@ impl Colors { * * Returns the color definitions for calendars and events. */ - pub async fn get(&self) -> ClientResult { + pub async fn get(&self) -> ClientResult> { let url = self.client.url("/colors", None); self.client .get( diff --git a/google/calendar/src/events.rs b/google/calendar/src/events.rs index f12435be..ac15b415 100644 --- a/google/calendar/src/events.rs +++ b/google/calendar/src/events.rs @@ -68,7 +68,7 @@ impl Events { time_min: &str, time_zone: &str, updated_min: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !i_cal_uid.is_empty() { query_args.push(("iCalUID".to_string(), i_cal_uid.to_string())); @@ -133,7 +133,7 @@ impl Events { ), None, ); - let resp: crate::types::Events = self + let resp: crate::Response = self .client .get( &url, @@ -145,7 +145,11 @@ impl Events { .await?; // Return our response data. - Ok(resp.items.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.items.to_vec(), + )) } /** * This function performs a `GET` to the `/calendars/{calendarId}/events` endpoint. @@ -170,7 +174,7 @@ impl Events { time_min: &str, time_zone: &str, updated_min: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !i_cal_uid.is_empty() { query_args.push(("iCalUID".to_string(), i_cal_uid.to_string())); @@ -229,7 +233,11 @@ impl Events { ), None, ); - let mut resp: crate::types::Events = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -240,13 +248,17 @@ impl Events { ) .await?; - let mut items = resp.items; - let mut page = resp.next_page_token; + let mut items = body.items; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -257,7 +269,11 @@ impl Events { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -269,17 +285,17 @@ impl Events { .await?; } - items.append(&mut resp.items); + items.append(&mut body.items); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(items) + Ok(crate::Response::new(status, headers, items)) } /** * This function performs a `POST` to the `/calendars/{calendarId}/events` endpoint. @@ -306,7 +322,7 @@ impl Events { send_updates: crate::types::SendUpdates, supports_attachments: bool, body: &crate::types::Event, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !conference_data_version.to_string().is_empty() { query_args.push(( @@ -368,7 +384,7 @@ impl Events { conference_data_version: u64, supports_attachments: bool, body: &crate::types::Event, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !conference_data_version.to_string().is_empty() { query_args.push(( @@ -421,7 +437,7 @@ impl Events { text: &str, send_notifications: bool, send_updates: crate::types::SendUpdates, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if send_notifications { query_args.push(( @@ -512,7 +528,7 @@ impl Events { time_zone: &str, updated_min: &str, body: &crate::types::Channel, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !i_cal_uid.is_empty() { query_args.push(("iCalUID".to_string(), i_cal_uid.to_string())); @@ -606,7 +622,7 @@ impl Events { event_id: &str, max_attendees: i64, time_zone: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if max_attendees > 0 { query_args.push(("maxAttendees".to_string(), max_attendees.to_string())); @@ -662,7 +678,7 @@ impl Events { send_updates: crate::types::SendUpdates, supports_attachments: bool, body: &crate::types::Event, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !conference_data_version.to_string().is_empty() { query_args.push(( @@ -728,7 +744,7 @@ impl Events { event_id: &str, send_notifications: bool, send_updates: crate::types::SendUpdates, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if send_notifications { query_args.push(( @@ -787,7 +803,7 @@ impl Events { send_updates: crate::types::SendUpdates, supports_attachments: bool, body: &crate::types::Event, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !conference_data_version.to_string().is_empty() { query_args.push(( @@ -864,7 +880,7 @@ impl Events { time_max: &str, time_min: &str, time_zone: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if max_attendees > 0 { query_args.push(("maxAttendees".to_string(), max_attendees.to_string())); @@ -900,7 +916,7 @@ impl Events { ), None, ); - let resp: crate::types::Events = self + let resp: crate::Response = self .client .get( &url, @@ -912,7 +928,11 @@ impl Events { .await?; // Return our response data. - Ok(resp.items.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.items.to_vec(), + )) } /** * This function performs a `GET` to the `/calendars/{calendarId}/events/{eventId}/instances` endpoint. @@ -931,7 +951,7 @@ impl Events { time_max: &str, time_min: &str, time_zone: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if max_attendees > 0 { query_args.push(("maxAttendees".to_string(), max_attendees.to_string())); @@ -961,7 +981,11 @@ impl Events { ), None, ); - let mut resp: crate::types::Events = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -972,13 +996,17 @@ impl Events { ) .await?; - let mut items = resp.items; - let mut page = resp.next_page_token; + let mut items = body.items; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -989,7 +1017,11 @@ impl Events { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -1001,17 +1033,17 @@ impl Events { .await?; } - items.append(&mut resp.items); + items.append(&mut body.items); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(items) + Ok(crate::Response::new(status, headers, items)) } /** * This function performs a `POST` to the `/calendars/{calendarId}/events/{eventId}/move` endpoint. @@ -1035,7 +1067,7 @@ impl Events { destination: &str, send_notifications: bool, send_updates: crate::types::SendUpdates, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !destination.is_empty() { query_args.push(("destination".to_string(), destination.to_string())); diff --git a/google/calendar/src/freebusy.rs b/google/calendar/src/freebusy.rs index 52e862ca..9a24d74c 100644 --- a/google/calendar/src/freebusy.rs +++ b/google/calendar/src/freebusy.rs @@ -19,7 +19,7 @@ impl Freebusy { pub async fn query( &self, body: &crate::types::FreeBusyRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/freeBusy", None); self.client .post( diff --git a/google/calendar/src/lib.rs b/google/calendar/src/lib.rs index 401d194e..6039ffe8 100644 --- a/google/calendar/src/lib.rs +++ b/google/calendar/src/lib.rs @@ -121,9 +121,27 @@ pub mod types; #[doc(hidden)] pub mod utils; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -661,13 +679,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -680,7 +699,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -703,13 +722,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -730,7 +750,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -749,7 +769,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -774,6 +798,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -790,7 +815,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -815,7 +840,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -838,6 +863,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -854,7 +880,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -880,7 +906,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -923,6 +949,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -935,7 +962,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -958,7 +985,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -967,7 +994,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -975,7 +1002,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -985,32 +1012,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1022,7 +1053,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1031,7 +1062,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1039,7 +1070,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1047,7 +1078,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1055,7 +1086,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/google/calendar/src/settings.rs b/google/calendar/src/settings.rs index 481ac077..01adac4f 100644 --- a/google/calendar/src/settings.rs +++ b/google/calendar/src/settings.rs @@ -29,7 +29,7 @@ impl Settings { &self, max_results: i64, page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if max_results > 0 { query_args.push(("maxResults".to_string(), max_results.to_string())); @@ -41,7 +41,7 @@ impl Settings { let url = self .client .url(&format!("/users/me/settings?{}", query_), None); - let resp: crate::types::Settings = self + let resp: crate::Response = self .client .get( &url, @@ -53,7 +53,11 @@ impl Settings { .await?; // Return our response data. - Ok(resp.items.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.items.to_vec(), + )) } /** * This function performs a `GET` to the `/users/me/settings` endpoint. @@ -62,9 +66,13 @@ impl Settings { * * Returns all user settings for the authenticated user. */ - pub async fn list_all(&self) -> ClientResult> { + pub async fn list_all(&self) -> ClientResult>> { let url = self.client.url("/users/me/settings", None); - let mut resp: crate::types::Settings = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -75,13 +83,17 @@ impl Settings { ) .await?; - let mut items = resp.items; - let mut page = resp.next_page_token; + let mut items = body.items; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -92,7 +104,11 @@ impl Settings { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -104,17 +120,17 @@ impl Settings { .await?; } - items.append(&mut resp.items); + items.append(&mut body.items); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(items) + Ok(crate::Response::new(status, headers, items)) } /** * This function performs a `POST` to the `/users/me/settings/watch` endpoint. @@ -135,7 +151,7 @@ impl Settings { max_results: i64, page_token: &str, body: &crate::types::Channel, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if max_results > 0 { query_args.push(("maxResults".to_string(), max_results.to_string())); @@ -166,7 +182,7 @@ impl Settings { * * * `setting: &str` -- The id of the user setting. */ - pub async fn get(&self, setting: &str) -> ClientResult { + pub async fn get(&self, setting: &str) -> ClientResult> { let url = self.client.url( &format!( "/users/me/settings/{}", diff --git a/google/cloud-resource-manager/src/folders.rs b/google/cloud-resource-manager/src/folders.rs index d3e3cf31..c13d377f 100644 --- a/google/cloud-resource-manager/src/folders.rs +++ b/google/cloud-resource-manager/src/folders.rs @@ -29,7 +29,7 @@ impl Folders { page_token: &str, parent: &str, show_deleted: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page_size > 0 { query_args.push(("pageSize".to_string(), page_size.to_string())); @@ -45,7 +45,7 @@ impl Folders { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v2/folders?{}", query_), None); - let resp: crate::types::ListFoldersResponse = self + let resp: crate::Response = self .client .get( &url, @@ -57,7 +57,11 @@ impl Folders { .await?; // Return our response data. - Ok(resp.folders.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.folders.to_vec(), + )) } /** * This function performs a `GET` to the `/v2/folders` endpoint. @@ -70,7 +74,7 @@ impl Folders { &self, parent: &str, show_deleted: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !parent.is_empty() { query_args.push(("parent".to_string(), parent.to_string())); @@ -80,7 +84,11 @@ impl Folders { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v2/folders?{}", query_), None); - let mut resp: crate::types::ListFoldersResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -91,13 +99,17 @@ impl Folders { ) .await?; - let mut folders = resp.folders; - let mut page = resp.next_page_token; + let mut folders = body.folders; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -108,7 +120,11 @@ impl Folders { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -120,17 +136,17 @@ impl Folders { .await?; } - folders.append(&mut resp.folders); + folders.append(&mut body.folders); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(folders) + Ok(crate::Response::new(status, headers, folders)) } /** * This function performs a `POST` to the `/v2/folders` endpoint. @@ -145,7 +161,7 @@ impl Folders { &self, parent: &str, body: &crate::types::Folder, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !parent.is_empty() { query_args.push(("parent".to_string(), parent.to_string())); @@ -170,9 +186,9 @@ impl Folders { pub async fn search( &self, body: &crate::types::SearchFoldersRequest, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/v2/folders:search", None); - let resp: crate::types::SearchFoldersResponse = self + let resp: crate::Response = self .client .post( &url, @@ -184,7 +200,11 @@ impl Folders { .await?; // Return our response data. - Ok(resp.folders.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.folders.to_vec(), + )) } /** * This function performs a `GET` to the `/v2/{name}` endpoint. @@ -195,7 +215,7 @@ impl Folders { * * * `name: &str` -- Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services. */ - pub async fn get(&self, name: &str) -> ClientResult { + pub async fn get(&self, name: &str) -> ClientResult> { let url = self.client.url( &format!("/v2/{}", crate::progenitor_support::encode_path(name),), None, @@ -219,7 +239,7 @@ impl Folders { * * * `name: &str` -- Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services. */ - pub async fn delete(&self, name: &str) -> ClientResult { + pub async fn delete(&self, name: &str) -> ClientResult> { let url = self.client.url( &format!("/v2/{}", crate::progenitor_support::encode_path(name),), None, @@ -249,7 +269,7 @@ impl Folders { name: &str, update_mask: &str, body: &crate::types::Folder, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !update_mask.is_empty() { query_args.push(("updateMask".to_string(), update_mask.to_string())); @@ -286,7 +306,7 @@ impl Folders { &self, name: &str, body: &crate::types::MoveFolderRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!("/v2/{}/move", crate::progenitor_support::encode_path(name),), None, @@ -314,7 +334,7 @@ impl Folders { &self, name: &str, body: &crate::types::MoveProjectMetadata, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2/{}/undelete", @@ -345,7 +365,7 @@ impl Folders { &self, resource: &str, body: &crate::types::GetIamPolicyRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2/{}/getIamPolicy", @@ -376,7 +396,7 @@ impl Folders { &self, resource: &str, body: &crate::types::SetIamPolicyRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2/{}/setIamPolicy", @@ -407,7 +427,7 @@ impl Folders { &self, resource: &str, body: &crate::types::TestIamPermissionsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v2/{}/testIamPermissions", diff --git a/google/cloud-resource-manager/src/lib.rs b/google/cloud-resource-manager/src/lib.rs index 384caa08..75510073 100644 --- a/google/cloud-resource-manager/src/lib.rs +++ b/google/cloud-resource-manager/src/lib.rs @@ -115,9 +115,27 @@ pub mod types; #[doc(hidden)] pub mod utils; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -655,13 +673,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -674,7 +693,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -697,13 +716,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -724,7 +744,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -743,7 +763,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -768,6 +792,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -784,7 +809,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -809,7 +834,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -832,6 +857,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -848,7 +874,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -874,7 +900,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -917,6 +943,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -929,7 +956,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -952,7 +979,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -961,7 +988,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -969,7 +996,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -979,32 +1006,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1016,7 +1047,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1025,7 +1056,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1033,7 +1064,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1041,7 +1072,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1049,7 +1080,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/google/cloud-resource-manager/src/operations.rs b/google/cloud-resource-manager/src/operations.rs index ed0a1fa6..a598649e 100644 --- a/google/cloud-resource-manager/src/operations.rs +++ b/google/cloud-resource-manager/src/operations.rs @@ -20,7 +20,7 @@ impl Operations { * * * `name: &str` -- Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services. */ - pub async fn get(&self, name: &str) -> ClientResult { + pub async fn get(&self, name: &str) -> ClientResult> { let url = self.client.url( &format!("/v1/{}", crate::progenitor_support::encode_path(name),), None, diff --git a/google/drive/src/about.rs b/google/drive/src/about.rs index f0fd18c6..75b2240c 100644 --- a/google/drive/src/about.rs +++ b/google/drive/src/about.rs @@ -16,7 +16,7 @@ impl About { * * Gets information about the user, the user's Drive, and system capabilities. */ - pub async fn get(&self) -> ClientResult { + pub async fn get(&self) -> ClientResult> { let url = self.client.url("/about", None); self.client .get( diff --git a/google/drive/src/changes.rs b/google/drive/src/changes.rs index 7cd3ffea..9c84cc8c 100644 --- a/google/drive/src/changes.rs +++ b/google/drive/src/changes.rs @@ -47,7 +47,7 @@ impl Changes { supports_all_drives: bool, supports_team_drives: bool, team_drive_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !drive_id.is_empty() { query_args.push(("driveId".to_string(), drive_id.to_string())); @@ -111,7 +111,7 @@ impl Changes { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/changes?{}", query_), None); - let resp: crate::types::ChangeList = self + let resp: crate::Response = self .client .get( &url, @@ -123,7 +123,11 @@ impl Changes { .await?; // Return our response data. - Ok(resp.changes.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.changes.to_vec(), + )) } /** * This function performs a `GET` to the `/changes` endpoint. @@ -145,7 +149,7 @@ impl Changes { supports_all_drives: bool, supports_team_drives: bool, team_drive_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !drive_id.is_empty() { query_args.push(("driveId".to_string(), drive_id.to_string())); @@ -203,7 +207,11 @@ impl Changes { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/changes?{}", query_), None); - let mut resp: crate::types::ChangeList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -214,13 +222,17 @@ impl Changes { ) .await?; - let mut changes = resp.changes; - let mut page = resp.next_page_token; + let mut changes = body.changes; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -231,7 +243,11 @@ impl Changes { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -243,17 +259,17 @@ impl Changes { .await?; } - changes.append(&mut resp.changes); + changes.append(&mut body.changes); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(changes) + Ok(crate::Response::new(status, headers, changes)) } /** * This function performs a `GET` to the `/changes/startPageToken` endpoint. @@ -273,7 +289,7 @@ impl Changes { supports_all_drives: bool, supports_team_drives: bool, team_drive_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !drive_id.is_empty() { query_args.push(("driveId".to_string(), drive_id.to_string())); @@ -344,7 +360,7 @@ impl Changes { supports_team_drives: bool, team_drive_id: &str, body: &crate::types::Channel, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !drive_id.is_empty() { query_args.push(("driveId".to_string(), drive_id.to_string())); diff --git a/google/drive/src/channels.rs b/google/drive/src/channels.rs index 9951fa3b..e8cff6fe 100644 --- a/google/drive/src/channels.rs +++ b/google/drive/src/channels.rs @@ -16,7 +16,7 @@ impl Channels { * * Stop watching resources through this channel */ - pub async fn stop(&self, body: &crate::types::Channel) -> ClientResult<()> { + pub async fn stop(&self, body: &crate::types::Channel) -> ClientResult> { let url = self.client.url("/channels/stop", None); self.client .post( diff --git a/google/drive/src/comments.rs b/google/drive/src/comments.rs index b0394bac..a58e028d 100644 --- a/google/drive/src/comments.rs +++ b/google/drive/src/comments.rs @@ -31,7 +31,7 @@ impl Comments { page_size: i64, page_token: &str, start_modified_time: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if include_deleted { query_args.push(("includeDeleted".to_string(), include_deleted.to_string())); @@ -57,7 +57,7 @@ impl Comments { ), None, ); - let resp: crate::types::CommentList = self + let resp: crate::Response = self .client .get( &url, @@ -69,7 +69,11 @@ impl Comments { .await?; // Return our response data. - Ok(resp.comments.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.comments.to_vec(), + )) } /** * This function performs a `GET` to the `/files/{fileId}/comments` endpoint. @@ -83,7 +87,7 @@ impl Comments { file_id: &str, include_deleted: bool, start_modified_time: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if include_deleted { query_args.push(("includeDeleted".to_string(), include_deleted.to_string())); @@ -103,7 +107,11 @@ impl Comments { ), None, ); - let mut resp: crate::types::CommentList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -114,13 +122,17 @@ impl Comments { ) .await?; - let mut comments = resp.comments; - let mut page = resp.next_page_token; + let mut comments = body.comments; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -131,7 +143,11 @@ impl Comments { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -143,17 +159,17 @@ impl Comments { .await?; } - comments.append(&mut resp.comments); + comments.append(&mut body.comments); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(comments) + Ok(crate::Response::new(status, headers, comments)) } /** * This function performs a `POST` to the `/files/{fileId}/comments` endpoint. @@ -168,7 +184,7 @@ impl Comments { &self, file_id: &str, body: &crate::types::Comment, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/files/{}/comments", @@ -202,7 +218,7 @@ impl Comments { file_id: &str, comment_id: &str, include_deleted: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if include_deleted { query_args.push(("includeDeleted".to_string(), include_deleted.to_string())); @@ -237,7 +253,11 @@ impl Comments { * * `file_id: &str` -- A link to this theme's background image. * * `comment_id: &str` -- A link to this theme's background image. */ - pub async fn delete(&self, file_id: &str, comment_id: &str) -> ClientResult<()> { + pub async fn delete( + &self, + file_id: &str, + comment_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/files/{}/comments/{}", @@ -271,7 +291,7 @@ impl Comments { file_id: &str, comment_id: &str, body: &crate::types::Comment, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/files/{}/comments/{}", diff --git a/google/drive/src/drives.rs b/google/drive/src/drives.rs index e6cb3bc3..c9fb31d8 100644 --- a/google/drive/src/drives.rs +++ b/google/drive/src/drives.rs @@ -29,7 +29,7 @@ impl Drives { page_token: &str, q: &str, use_domain_admin_access: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page_size > 0 { query_args.push(("pageSize".to_string(), page_size.to_string())); @@ -48,7 +48,7 @@ impl Drives { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/drives?{}", query_), None); - let resp: crate::types::DriveList = self + let resp: crate::Response = self .client .get( &url, @@ -60,7 +60,11 @@ impl Drives { .await?; // Return our response data. - Ok(resp.drives.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.drives.to_vec(), + )) } /** * This function performs a `GET` to the `/drives` endpoint. @@ -73,7 +77,7 @@ impl Drives { &self, q: &str, use_domain_admin_access: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !q.is_empty() { query_args.push(("q".to_string(), q.to_string())); @@ -86,7 +90,11 @@ impl Drives { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/drives?{}", query_), None); - let mut resp: crate::types::DriveList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -97,13 +105,17 @@ impl Drives { ) .await?; - let mut drives = resp.drives; - let mut page = resp.next_page_token; + let mut drives = body.drives; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -114,7 +126,11 @@ impl Drives { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -126,17 +142,17 @@ impl Drives { .await?; } - drives.append(&mut resp.drives); + drives.append(&mut body.drives); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(drives) + Ok(crate::Response::new(status, headers, drives)) } /** * This function performs a `POST` to the `/drives` endpoint. @@ -151,7 +167,7 @@ impl Drives { &self, request_id: &str, body: &crate::types::Drive, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !request_id.is_empty() { query_args.push(("requestId".to_string(), request_id.to_string())); @@ -182,7 +198,7 @@ impl Drives { &self, drive_id: &str, use_domain_admin_access: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if use_domain_admin_access { query_args.push(( @@ -218,7 +234,7 @@ impl Drives { * * * `drive_id: &str` -- A link to this theme's background image. */ - pub async fn delete(&self, drive_id: &str) -> ClientResult<()> { + pub async fn delete(&self, drive_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/drives/{}", @@ -251,7 +267,7 @@ impl Drives { drive_id: &str, use_domain_admin_access: bool, body: &crate::types::Drive, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if use_domain_admin_access { query_args.push(( @@ -287,7 +303,7 @@ impl Drives { * * * `drive_id: &str` -- A link to this theme's background image. */ - pub async fn hide(&self, drive_id: &str) -> ClientResult { + pub async fn hide(&self, drive_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/drives/{}/hide", @@ -314,7 +330,10 @@ impl Drives { * * * `drive_id: &str` -- A link to this theme's background image. */ - pub async fn unhide(&self, drive_id: &str) -> ClientResult { + pub async fn unhide( + &self, + drive_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/drives/{}/unhide", diff --git a/google/drive/src/files.rs b/google/drive/src/files.rs index d42c1be0..cba8ca9c 100644 --- a/google/drive/src/files.rs +++ b/google/drive/src/files.rs @@ -48,7 +48,7 @@ impl Files { supports_all_drives: bool, supports_team_drives: bool, team_drive_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !corpora.is_empty() { query_args.push(("corpora".to_string(), corpora.to_string())); @@ -106,7 +106,7 @@ impl Files { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/files?{}", query_), None); - let resp: crate::types::FileList = self + let resp: crate::Response = self .client .get( &url, @@ -118,7 +118,11 @@ impl Files { .await?; // Return our response data. - Ok(resp.files.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.files.to_vec(), + )) } /** * This function performs a `GET` to the `/files` endpoint. @@ -140,7 +144,7 @@ impl Files { supports_all_drives: bool, supports_team_drives: bool, team_drive_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !corpora.is_empty() { query_args.push(("corpora".to_string(), corpora.to_string())); @@ -192,7 +196,11 @@ impl Files { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/files?{}", query_), None); - let mut resp: crate::types::FileList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -203,13 +211,17 @@ impl Files { ) .await?; - let mut files = resp.files; - let mut page = resp.next_page_token; + let mut files = body.files; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -220,7 +232,11 @@ impl Files { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -232,17 +248,17 @@ impl Files { .await?; } - files.append(&mut resp.files); + files.append(&mut body.files); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(files) + Ok(crate::Response::new(status, headers, files)) } /** * This function performs a `POST` to the `/files` endpoint. @@ -270,7 +286,7 @@ impl Files { supports_team_drives: bool, use_content_as_indexable_text: bool, body: &crate::types::File, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if ignore_default_visibility { query_args.push(( @@ -339,7 +355,7 @@ impl Files { count: i64, space: &str, type_: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -373,7 +389,7 @@ impl Files { * * * `enforce_single_parent: bool` -- Deprecated. If an item is not in a shared drive and its last parent is deleted but the item itself is not, the item will be placed under its owner's root. */ - pub async fn empty_trash(&self) -> ClientResult<()> { + pub async fn empty_trash(&self) -> ClientResult> { let url = self.client.url("/files/trash", None); self.client .delete( @@ -405,7 +421,7 @@ impl Files { include_permissions_for_view: &str, supports_all_drives: bool, supports_team_drives: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if acknowledge_abuse { query_args.push(( @@ -467,7 +483,7 @@ impl Files { file_id: &str, supports_all_drives: bool, supports_team_drives: bool, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if supports_all_drives { query_args.push(( @@ -530,7 +546,7 @@ impl Files { supports_team_drives: bool, use_content_as_indexable_text: bool, body: &crate::types::File, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !add_parents.is_empty() { query_args.push(("addParents".to_string(), add_parents.to_string())); @@ -616,7 +632,7 @@ impl Files { supports_all_drives: bool, supports_team_drives: bool, body: &crate::types::File, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if ignore_default_visibility { query_args.push(( @@ -680,7 +696,11 @@ impl Files { * * `file_id: &str` -- A link to this theme's background image. * * `mime_type: &str` -- The MIME type of the format requested for this export. */ - pub async fn export(&self, file_id: &str, mime_type: &str) -> ClientResult<()> { + pub async fn export( + &self, + file_id: &str, + mime_type: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !mime_type.is_empty() { query_args.push(("mimeType".to_string(), mime_type.to_string())); @@ -725,7 +745,7 @@ impl Files { supports_all_drives: bool, supports_team_drives: bool, body: &crate::types::Channel, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if acknowledge_abuse { query_args.push(( diff --git a/google/drive/src/lib.rs b/google/drive/src/lib.rs index c72abaa4..411b7c5a 100644 --- a/google/drive/src/lib.rs +++ b/google/drive/src/lib.rs @@ -124,9 +124,27 @@ pub mod types; #[doc(hidden)] pub mod utils; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -671,13 +689,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -690,7 +709,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -713,13 +732,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -740,7 +760,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -759,7 +779,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -784,6 +808,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -800,7 +825,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -825,7 +850,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -848,6 +873,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -864,7 +890,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -890,7 +916,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -933,6 +959,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -945,7 +972,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -968,7 +995,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -977,7 +1004,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -985,7 +1012,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -995,32 +1022,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1032,7 +1063,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1041,7 +1072,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1049,7 +1080,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1057,7 +1088,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1065,7 +1096,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/google/drive/src/permissions.rs b/google/drive/src/permissions.rs index 50624049..19afaf90 100644 --- a/google/drive/src/permissions.rs +++ b/google/drive/src/permissions.rs @@ -35,7 +35,7 @@ impl Permissions { supports_all_drives: bool, supports_team_drives: bool, use_domain_admin_access: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_permissions_for_view.is_empty() { query_args.push(( @@ -76,7 +76,7 @@ impl Permissions { ), None, ); - let resp: crate::types::PermissionList = self + let resp: crate::Response = self .client .get( &url, @@ -88,7 +88,11 @@ impl Permissions { .await?; // Return our response data. - Ok(resp.permissions.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.permissions.to_vec(), + )) } /** * This function performs a `GET` to the `/files/{fileId}/permissions` endpoint. @@ -104,7 +108,7 @@ impl Permissions { supports_all_drives: bool, supports_team_drives: bool, use_domain_admin_access: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_permissions_for_view.is_empty() { query_args.push(( @@ -139,7 +143,11 @@ impl Permissions { ), None, ); - let mut resp: crate::types::PermissionList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -150,13 +158,17 @@ impl Permissions { ) .await?; - let mut permissions = resp.permissions; - let mut page = resp.next_page_token; + let mut permissions = body.permissions; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -167,7 +179,11 @@ impl Permissions { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -179,17 +195,17 @@ impl Permissions { .await?; } - permissions.append(&mut resp.permissions); + permissions.append(&mut body.permissions); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(permissions) + Ok(crate::Response::new(status, headers, permissions)) } /** * This function performs a `POST` to the `/files/{fileId}/permissions` endpoint. @@ -219,7 +235,7 @@ impl Permissions { transfer_ownership: bool, use_domain_admin_access: bool, body: &crate::types::Permission, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !email_message.is_empty() { query_args.push(("emailMessage".to_string(), email_message.to_string())); @@ -297,7 +313,7 @@ impl Permissions { supports_all_drives: bool, supports_team_drives: bool, use_domain_admin_access: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if supports_all_drives { query_args.push(( @@ -357,7 +373,7 @@ impl Permissions { supports_all_drives: bool, supports_team_drives: bool, use_domain_admin_access: bool, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if supports_all_drives { query_args.push(( @@ -422,7 +438,7 @@ impl Permissions { transfer_ownership: bool, use_domain_admin_access: bool, body: &crate::types::Permission, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if remove_expiration { query_args.push(( diff --git a/google/drive/src/replies.rs b/google/drive/src/replies.rs index 99e07906..fa245962 100644 --- a/google/drive/src/replies.rs +++ b/google/drive/src/replies.rs @@ -31,7 +31,7 @@ impl Replies { include_deleted: bool, page_size: i64, page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if include_deleted { query_args.push(("includeDeleted".to_string(), include_deleted.to_string())); @@ -52,7 +52,7 @@ impl Replies { ), None, ); - let resp: crate::types::ReplyList = self + let resp: crate::Response = self .client .get( &url, @@ -64,7 +64,11 @@ impl Replies { .await?; // Return our response data. - Ok(resp.replies.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.replies.to_vec(), + )) } /** * This function performs a `GET` to the `/files/{fileId}/comments/{commentId}/replies` endpoint. @@ -78,7 +82,7 @@ impl Replies { file_id: &str, comment_id: &str, include_deleted: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if include_deleted { query_args.push(("includeDeleted".to_string(), include_deleted.to_string())); @@ -93,7 +97,11 @@ impl Replies { ), None, ); - let mut resp: crate::types::ReplyList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -104,13 +112,17 @@ impl Replies { ) .await?; - let mut replies = resp.replies; - let mut page = resp.next_page_token; + let mut replies = body.replies; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -121,7 +133,11 @@ impl Replies { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -133,17 +149,17 @@ impl Replies { .await?; } - replies.append(&mut resp.replies); + replies.append(&mut body.replies); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(replies) + Ok(crate::Response::new(status, headers, replies)) } /** * This function performs a `POST` to the `/files/{fileId}/comments/{commentId}/replies` endpoint. @@ -160,7 +176,7 @@ impl Replies { file_id: &str, comment_id: &str, body: &crate::types::Reply, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/files/{}/comments/{}/replies", @@ -197,7 +213,7 @@ impl Replies { comment_id: &str, reply_id: &str, include_deleted: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if include_deleted { query_args.push(("includeDeleted".to_string(), include_deleted.to_string())); @@ -239,7 +255,7 @@ impl Replies { file_id: &str, comment_id: &str, reply_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/files/{}/comments/{}/replies/{}", @@ -276,7 +292,7 @@ impl Replies { comment_id: &str, reply_id: &str, body: &crate::types::Reply, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/files/{}/comments/{}/replies/{}", diff --git a/google/drive/src/revisions.rs b/google/drive/src/revisions.rs index fd473d96..cc403187 100644 --- a/google/drive/src/revisions.rs +++ b/google/drive/src/revisions.rs @@ -27,7 +27,7 @@ impl Revisions { file_id: &str, page_size: i64, page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page_size > 0 { query_args.push(("pageSize".to_string(), page_size.to_string())); @@ -44,7 +44,7 @@ impl Revisions { ), None, ); - let resp: crate::types::RevisionList = self + let resp: crate::Response = self .client .get( &url, @@ -56,7 +56,11 @@ impl Revisions { .await?; // Return our response data. - Ok(resp.revisions.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.revisions.to_vec(), + )) } /** * This function performs a `GET` to the `/files/{fileId}/revisions` endpoint. @@ -65,7 +69,10 @@ impl Revisions { * * Lists a file's revisions. */ - pub async fn list_all(&self, file_id: &str) -> ClientResult> { + pub async fn list_all( + &self, + file_id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/files/{}/revisions", @@ -73,7 +80,11 @@ impl Revisions { ), None, ); - let mut resp: crate::types::RevisionList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -84,13 +95,17 @@ impl Revisions { ) .await?; - let mut revisions = resp.revisions; - let mut page = resp.next_page_token; + let mut revisions = body.revisions; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -101,7 +116,11 @@ impl Revisions { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -113,17 +132,17 @@ impl Revisions { .await?; } - revisions.append(&mut resp.revisions); + revisions.append(&mut body.revisions); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(revisions) + Ok(crate::Response::new(status, headers, revisions)) } /** * This function performs a `GET` to the `/files/{fileId}/revisions/{revisionId}` endpoint. @@ -141,7 +160,7 @@ impl Revisions { file_id: &str, revision_id: &str, acknowledge_abuse: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if acknowledge_abuse { query_args.push(( @@ -179,7 +198,11 @@ impl Revisions { * * `file_id: &str` -- A link to this theme's background image. * * `revision_id: &str` -- A link to this theme's background image. */ - pub async fn delete(&self, file_id: &str, revision_id: &str) -> ClientResult<()> { + pub async fn delete( + &self, + file_id: &str, + revision_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/files/{}/revisions/{}", @@ -213,7 +236,7 @@ impl Revisions { file_id: &str, revision_id: &str, body: &crate::types::Revision, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/files/{}/revisions/{}", diff --git a/google/drive/src/teamdrives.rs b/google/drive/src/teamdrives.rs index 75ed1ec3..979da2ae 100644 --- a/google/drive/src/teamdrives.rs +++ b/google/drive/src/teamdrives.rs @@ -29,7 +29,7 @@ impl Teamdrives { page_token: &str, q: &str, use_domain_admin_access: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if page_size > 0 { query_args.push(("pageSize".to_string(), page_size.to_string())); @@ -48,7 +48,7 @@ impl Teamdrives { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/teamdrives?{}", query_), None); - let resp: crate::types::TeamDriveList = self + let resp: crate::Response = self .client .get( &url, @@ -60,7 +60,11 @@ impl Teamdrives { .await?; // Return our response data. - Ok(resp.team_drives.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.team_drives.to_vec(), + )) } /** * This function performs a `GET` to the `/teamdrives` endpoint. @@ -73,7 +77,7 @@ impl Teamdrives { &self, q: &str, use_domain_admin_access: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !q.is_empty() { query_args.push(("q".to_string(), q.to_string())); @@ -86,7 +90,11 @@ impl Teamdrives { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/teamdrives?{}", query_), None); - let mut resp: crate::types::TeamDriveList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -97,13 +105,17 @@ impl Teamdrives { ) .await?; - let mut team_drives = resp.team_drives; - let mut page = resp.next_page_token; + let mut team_drives = body.team_drives; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?pageToken={}", url, page), @@ -114,7 +126,11 @@ impl Teamdrives { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&pageToken={}", url, page), @@ -126,17 +142,17 @@ impl Teamdrives { .await?; } - team_drives.append(&mut resp.team_drives); + team_drives.append(&mut body.team_drives); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(team_drives) + Ok(crate::Response::new(status, headers, team_drives)) } /** * This function performs a `POST` to the `/teamdrives` endpoint. @@ -151,7 +167,7 @@ impl Teamdrives { &self, request_id: &str, body: &crate::types::TeamDrive, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !request_id.is_empty() { query_args.push(("requestId".to_string(), request_id.to_string())); @@ -182,7 +198,7 @@ impl Teamdrives { &self, team_drive_id: &str, use_domain_admin_access: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if use_domain_admin_access { query_args.push(( @@ -218,7 +234,7 @@ impl Teamdrives { * * * `team_drive_id: &str` -- A link to this theme's background image. */ - pub async fn delete(&self, team_drive_id: &str) -> ClientResult<()> { + pub async fn delete(&self, team_drive_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/teamdrives/{}", @@ -251,7 +267,7 @@ impl Teamdrives { team_drive_id: &str, use_domain_admin_access: bool, body: &crate::types::TeamDrive, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if use_domain_admin_access { query_args.push(( diff --git a/google/drive/src/traits.rs b/google/drive/src/traits.rs index 2513c78e..32fcd476 100644 --- a/google/drive/src/traits.rs +++ b/google/drive/src/traits.rs @@ -1,6 +1,5 @@ #![allow(clippy::field_reassign_with_default)] -use crate::ClientError; -use crate::ClientResult; +use crate::{ClientError, ClientResult, Response}; #[async_trait::async_trait] pub trait PermissionOps { @@ -62,7 +61,7 @@ impl PermissionOps for crate::permissions::Permissions { ) -> ClientResult { // First let's check if the permission already exists. // List all the permissions for a file. - let perms = self + let resp = self .list_all( file_id, "", // include_permissions_for_view @@ -73,7 +72,7 @@ impl PermissionOps for crate::permissions::Permissions { .await?; // Iterate over our permissions and see if we have ours. - for perm in perms { + for perm in resp.body { if perm.email_address == email_address && perm.role == role && perm.type_ == type_ { // We found the permission, return it. return Ok(perm); @@ -111,6 +110,7 @@ impl PermissionOps for crate::permissions::Permissions { &perm, ) .await + .map(|resp| resp.body) } } @@ -122,7 +122,7 @@ pub trait FileOps { drive_id: &str, parent_id: &str, name: &str, - ) -> ClientResult>; + ) -> ClientResult>>; /// Create or update a file in a drive. /// If the file already exists, it will update it. @@ -134,10 +134,10 @@ pub trait FileOps { name: &str, mime_type: &str, contents: &[u8], - ) -> ClientResult; + ) -> ClientResult>; /// Download a file by it's ID. - async fn download_by_id(&self, id: &str) -> ClientResult; + async fn download_by_id(&self, id: &str) -> ClientResult>; /// Create a folder, if it doesn't exist, returns the ID of the folder. async fn create_folder( @@ -148,7 +148,7 @@ pub trait FileOps { ) -> ClientResult; /// Get a file's contents by it's ID. Only works for Google Docs. - async fn get_contents_by_id(&self, id: &str) -> ClientResult; + async fn get_contents_by_id(&self, id: &str) -> ClientResult>; /// Delete a file by its name. async fn delete_by_name(&self, drive_id: &str, parent_id: &str, name: &str) @@ -163,7 +163,7 @@ impl FileOps for crate::files::Files { drive_id: &str, parent_id: &str, name: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query = format!("name = '{}'", name); if !parent_id.is_empty() { query = format!("{} and '{}' in parents", query, parent_id); @@ -195,7 +195,7 @@ impl FileOps for crate::files::Files { name: &str, mime_type: &str, contents: &[u8], - ) -> ClientResult { + ) -> ClientResult> { // Create the file. let mut f: crate::types::File = Default::default(); let mut method = reqwest::Method::POST; @@ -205,6 +205,7 @@ impl FileOps for crate::files::Files { let files = self .get_by_name(drive_id, parent_id, name) .await + .map(|resp| resp.body) .unwrap_or_default(); if files.is_empty() { // Set the name, @@ -276,7 +277,7 @@ impl FileOps for crate::files::Files { } /// Download a file by it's ID. - async fn download_by_id(&self, id: &str) -> ClientResult { + async fn download_by_id(&self, id: &str) -> ClientResult> { let resp = self .client .request_raw( @@ -286,7 +287,11 @@ impl FileOps for crate::files::Files { ) .await?; - Ok(resp.bytes().await?) + Ok(Response::new( + resp.status(), + resp.headers().clone(), + resp.bytes().await?, + )) } /// Create a folder, if it doesn't exist, returns the ID of the folder. @@ -316,7 +321,7 @@ impl FileOps for crate::files::Files { } // Check if the folder exists. - let folders = self + let resp = self .list_all( "drive", // corpora drive_id, // drive id @@ -330,15 +335,15 @@ impl FileOps for crate::files::Files { false, // supports_team_drives "", // team_drive_id ) - .await - .unwrap_or_default(); - if !folders.is_empty() { - let f = folders.get(0).unwrap().clone(); + .await?; + + if !resp.body.is_empty() { + let f = resp.body.get(0).unwrap().clone(); return Ok(f.id); } // Make the request and return the ID. - let folder: crate::types::File = self + let resp: Response = self .client .post( "/files?supportsAllDrives=true&includeItemsFromAllDrives=true", @@ -349,12 +354,12 @@ impl FileOps for crate::files::Files { ) .await?; - Ok(folder.id) + Ok(resp.body.id) } /// Get a file's contents by it's ID. Only works for Google Docs. // TODO: make binary content work in the actual library. - async fn get_contents_by_id(&self, id: &str) -> ClientResult { + async fn get_contents_by_id(&self, id: &str) -> ClientResult> { let mut query_ = String::new(); let query_args = vec!["mime_type=text/plain".to_string()]; for (i, n) in query_args.iter().enumerate() { @@ -373,7 +378,11 @@ impl FileOps for crate::files::Files { .request_raw(reqwest::Method::GET, &url, crate::Message::default()) .await?; - Ok(resp.text().await?) + Ok(Response::new( + resp.status(), + resp.headers().clone(), + resp.text().await?, + )) } /// Delete a file by its name. @@ -384,22 +393,21 @@ impl FileOps for crate::files::Files { name: &str, ) -> ClientResult<()> { // Check if the file exists. - let files = self - .get_by_name(drive_id, parent_id, name) - .await - .unwrap_or_default(); - if files.is_empty() { + let resp = self.get_by_name(drive_id, parent_id, name).await?; + + if resp.body.is_empty() { // The file does not exist. return Ok(()); } // Delete the file. self.delete( - &files.get(0).unwrap().id, + &resp.body.get(0).unwrap().id, true, // supports all drives true, // supports team drives ) .await + .map(|resp| resp.body) } } @@ -413,14 +421,14 @@ pub trait DriveOps { impl DriveOps for crate::drives::Drives { /// Get a drive by it's name. async fn get_by_name(&self, name: &str) -> ClientResult { - let drives = self + let resp = self .list_all( //&format!("name = '{}'", name), // query "", true, // use domain admin access ) .await?; - for drive in drives { + for drive in resp.body { if drive.name == name { return Ok(drive); } diff --git a/google/groups-settings/src/groups.rs b/google/groups-settings/src/groups.rs index 02118534..a4d437fb 100644 --- a/google/groups-settings/src/groups.rs +++ b/google/groups-settings/src/groups.rs @@ -26,7 +26,7 @@ impl Groups { &self, alt: crate::types::Alt, group_unique_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !alt.to_string().is_empty() { query_args.push(("alt".to_string(), alt.to_string())); @@ -66,7 +66,7 @@ impl Groups { alt: crate::types::Alt, group_unique_id: &str, body: &crate::types::Groups, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !alt.to_string().is_empty() { query_args.push(("alt".to_string(), alt.to_string())); @@ -106,7 +106,7 @@ impl Groups { alt: crate::types::Alt, group_unique_id: &str, body: &crate::types::Groups, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !alt.to_string().is_empty() { query_args.push(("alt".to_string(), alt.to_string())); diff --git a/google/groups-settings/src/lib.rs b/google/groups-settings/src/lib.rs index 1a28da6f..b9e041b6 100644 --- a/google/groups-settings/src/lib.rs +++ b/google/groups-settings/src/lib.rs @@ -114,9 +114,27 @@ pub mod types; #[doc(hidden)] pub mod utils; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -654,13 +672,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -673,7 +692,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -696,13 +715,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -723,7 +743,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -742,7 +762,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -767,6 +791,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -783,7 +808,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -808,7 +833,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -831,6 +856,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -847,7 +873,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -873,7 +899,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -916,6 +942,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -928,7 +955,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -951,7 +978,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -960,7 +987,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -968,7 +995,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -978,32 +1005,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1015,7 +1046,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1024,7 +1055,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1032,7 +1063,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1040,7 +1071,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1048,7 +1079,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/google/sheets/src/lib.rs b/google/sheets/src/lib.rs index d6a838a0..d8aa7507 100644 --- a/google/sheets/src/lib.rs +++ b/google/sheets/src/lib.rs @@ -115,9 +115,27 @@ pub mod types; #[doc(hidden)] pub mod utils; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -655,13 +673,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -674,7 +693,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -697,13 +716,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -724,7 +744,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -743,7 +763,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -768,6 +792,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -784,7 +809,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -809,7 +834,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -832,6 +857,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -848,7 +874,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -874,7 +900,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -917,6 +943,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -929,7 +956,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -952,7 +979,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -961,7 +988,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -969,7 +996,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -979,32 +1006,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1016,7 +1047,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1025,7 +1056,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1033,7 +1064,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1041,7 +1072,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1049,7 +1080,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/google/sheets/src/spreadsheets.rs b/google/sheets/src/spreadsheets.rs index e96d54dd..c66c27d6 100644 --- a/google/sheets/src/spreadsheets.rs +++ b/google/sheets/src/spreadsheets.rs @@ -19,7 +19,7 @@ impl Spreadsheets { pub async fn create( &self, body: &crate::types::Spreadsheet, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/v4/spreadsheets", None); self.client .post( @@ -47,7 +47,7 @@ impl Spreadsheets { spreadsheet_id: &str, include_grid_data: bool, ranges: &[String], - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if include_grid_data { query_args.push(("includeGridData".to_string(), include_grid_data.to_string())); @@ -88,7 +88,7 @@ impl Spreadsheets { &self, spreadsheet_id: &str, metadata_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v4/spreadsheets/{}/developerMetadata/{}", @@ -120,7 +120,7 @@ impl Spreadsheets { &self, spreadsheet_id: &str, body: &crate::types::SearchDeveloperMetadataRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v4/spreadsheets/{}/developerMetadata:search", @@ -153,7 +153,7 @@ impl Spreadsheets { spreadsheet_id: &str, sheet_id: i64, body: &crate::types::CopySheetAnotherSpreadsheetRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v4/spreadsheets/{}/sheets/{}/copyTo", @@ -192,7 +192,7 @@ impl Spreadsheets { date_time_render_option: crate::types::DateTimeRenderOption, major_dimension: crate::types::Dimension, value_render_option: crate::types::ValueRenderOption, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !date_time_render_option.to_string().is_empty() { query_args.push(( @@ -252,7 +252,7 @@ impl Spreadsheets { response_value_render_option: crate::types::ValueRenderOption, value_input_option: crate::types::ValueInputOption, body: &crate::types::ValueRange, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if include_values_in_response { query_args.push(( @@ -323,7 +323,7 @@ impl Spreadsheets { response_value_render_option: crate::types::ValueRenderOption, value_input_option: crate::types::ValueInputOption, body: &crate::types::ValueRange, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if include_values_in_response { query_args.push(( @@ -390,7 +390,7 @@ impl Spreadsheets { spreadsheet_id: &str, range: &str, body: &crate::types::ClearValuesRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v4/spreadsheets/{}/values/{}/clear", @@ -422,7 +422,7 @@ impl Spreadsheets { &self, spreadsheet_id: &str, body: &crate::types::BatchClearValuesRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v4/spreadsheets/{}/values:batchClear", @@ -453,7 +453,7 @@ impl Spreadsheets { &self, spreadsheet_id: &str, body: &crate::types::BatchClearValuesByDataFilterRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v4/spreadsheets/{}/values:batchClearByDataFilter", @@ -491,7 +491,7 @@ impl Spreadsheets { major_dimension: crate::types::Dimension, ranges: &[String], value_render_option: crate::types::ValueRenderOption, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !date_time_render_option.to_string().is_empty() { query_args.push(( @@ -543,7 +543,7 @@ impl Spreadsheets { &self, spreadsheet_id: &str, body: &crate::types::BatchGetValuesByDataFilterRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v4/spreadsheets/{}/values:batchGetByDataFilter", @@ -574,7 +574,7 @@ impl Spreadsheets { &self, spreadsheet_id: &str, body: &crate::types::BatchUpdateValuesRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v4/spreadsheets/{}/values:batchUpdate", @@ -605,7 +605,7 @@ impl Spreadsheets { &self, spreadsheet_id: &str, body: &crate::types::BatchUpdateValuesByDataFilterRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v4/spreadsheets/{}/values:batchUpdateByDataFilter", @@ -636,7 +636,7 @@ impl Spreadsheets { &self, spreadsheet_id: &str, body: &crate::types::BatchUpdateSpreadsheetRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v4/spreadsheets/{}/batchUpdate", @@ -667,7 +667,7 @@ impl Spreadsheets { &self, spreadsheet_id: &str, body: &crate::types::GetSpreadsheetByDataFilterRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v4/spreadsheets/{}/getByDataFilter", diff --git a/google/sheets/src/traits.rs b/google/sheets/src/traits.rs index 92e4cba0..cc351f7e 100644 --- a/google/sheets/src/traits.rs +++ b/google/sheets/src/traits.rs @@ -14,7 +14,7 @@ impl SpreadsheetOps for crate::spreadsheets::Spreadsheets { /// The `cell_name` is something like `A1` and what is returned is a string representation of /// the cell's value. async fn cell_get(&self, sheet_id: &str, cell_name: &str) -> ClientResult { - let values = self + let resp = self .values_get( sheet_id, cell_name, @@ -22,10 +22,9 @@ impl SpreadsheetOps for crate::spreadsheets::Spreadsheets { crate::types::Dimension::Rows, crate::types::ValueRenderOption::FormattedValue, ) - .await - .unwrap(); + .await?; - if let Some(v) = values.values.get(0) { + if let Some(v) = resp.body.values.get(0) { if let Some(v) = v.get(0) { return Ok(v.to_string()); } diff --git a/gusto/src/admins_beta.rs b/gusto/src/admins_beta.rs index 4df31594..715a8085 100644 --- a/gusto/src/admins_beta.rs +++ b/gusto/src/admins_beta.rs @@ -23,7 +23,7 @@ impl AdminsBeta { pub async fn get_company_admins( &self, company_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/companies/{}/admins", @@ -55,7 +55,7 @@ impl AdminsBeta { pub async fn get_all_company_admins( &self, company_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/companies/{}/admins", @@ -86,7 +86,7 @@ impl AdminsBeta { &self, company_id: &str, body: &crate::types::PostCompanyAdminsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/admins", diff --git a/gusto/src/benefits.rs b/gusto/src/benefits.rs index da91e712..87f3282d 100644 --- a/gusto/src/benefits.rs +++ b/gusto/src/benefits.rs @@ -20,7 +20,9 @@ impl Benefits { * * The benefit object in Gusto contains high level information about a particular benefit type and its tax considerations. When companies choose to offer a benefit, they are creating a Company Benefit object associated with a particular benefit. */ - pub async fn get_page(&self) -> ClientResult> { + pub async fn get_page( + &self, + ) -> ClientResult>> { let url = self.client.url("/v1/benefits", None); self.client .get( @@ -43,7 +45,9 @@ impl Benefits { * * The benefit object in Gusto contains high level information about a particular benefit type and its tax considerations. When companies choose to offer a benefit, they are creating a Company Benefit object associated with a particular benefit. */ - pub async fn get_all(&self) -> ClientResult> { + pub async fn get_all( + &self, + ) -> ClientResult>> { let url = self.client.url("/v1/benefits", None); self.client .get_all_pages( @@ -64,7 +68,10 @@ impl Benefits { * * The benefit object in Gusto contains high level information about a particular benefit type and its tax considerations. When companies choose to offer a benefit, they are creating a Company Benefit object associated with a particular benefit. */ - pub async fn get(&self, benefit_id: &str) -> ClientResult { + pub async fn get( + &self, + benefit_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/benefits/{}", @@ -94,7 +101,7 @@ impl Benefits { pub async fn get_company( &self, company_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/companies/{}/company_benefits", @@ -126,7 +133,7 @@ impl Benefits { pub async fn get_all_company( &self, company_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/companies/{}/company_benefits", @@ -157,7 +164,7 @@ impl Benefits { &self, company_id: &str, body: &crate::types::PostCompanyBenefitsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/company_benefits", @@ -187,7 +194,7 @@ impl Benefits { pub async fn get_company_benefits( &self, company_benefit_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/company_benefits/{}", @@ -218,7 +225,7 @@ impl Benefits { &self, company_benefit_id: &str, body: &crate::types::PutCompanyBenefitRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/company_benefits/{}", @@ -248,7 +255,7 @@ impl Benefits { pub async fn get_employee( &self, employee_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/employees/{}/employee_benefits", @@ -280,7 +287,7 @@ impl Benefits { pub async fn get_all_employee( &self, employee_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/employees/{}/employee_benefits", @@ -309,7 +316,7 @@ impl Benefits { &self, employee_id: &str, body: &crate::types::PostEmployeeBenefitsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/employees/{}/employee_benefits", @@ -338,7 +345,7 @@ impl Benefits { &self, employee_id: &str, body: &crate::types::PostEmployeeYtdBenefitAmountsFromDifferentCompanyRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/employees/{}/ytd_benefit_amounts_from_different_company", @@ -366,7 +373,7 @@ impl Benefits { pub async fn get_employee_benefits( &self, employee_benefit_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/employee_benefits/{}", @@ -395,7 +402,7 @@ impl Benefits { &self, employee_benefit_id: &str, body: &crate::types::PutEmployeeBenefitRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/employee_benefits/{}", @@ -420,7 +427,10 @@ impl Benefits { * * Employee benefits represent an employee enrolled in a particular company benefit. It includes information specific to that employee’s enrollment. */ - pub async fn delete_employee(&self, employee_benefit_id: &str) -> ClientResult<()> { + pub async fn delete_employee( + &self, + employee_benefit_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/employee_benefits/{}", diff --git a/gusto/src/companies.rs b/gusto/src/companies.rs index 5415f80c..a638b0aa 100644 --- a/gusto/src/companies.rs +++ b/gusto/src/companies.rs @@ -18,7 +18,10 @@ impl Companies { * * Get a company. */ - pub async fn get(&self, company_id_or_uuid: &str) -> ClientResult { + pub async fn get( + &self, + company_id_or_uuid: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}", @@ -70,7 +73,7 @@ impl Companies { pub async fn post_partner_managed( &self, body: &crate::types::PostPartnerManagedCompaniesRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/v1/partner_managed_companies", None); self.client .post( @@ -110,7 +113,7 @@ impl Companies { pub async fn post_provision( &self, body: &crate::types::PostProvisionRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/v1/provision", None); self.client .post( diff --git a/gusto/src/company_bank_accounts_beta.rs b/gusto/src/company_bank_accounts_beta.rs index 2f9bd504..cd6ed9db 100644 --- a/gusto/src/company_bank_accounts_beta.rs +++ b/gusto/src/company_bank_accounts_beta.rs @@ -23,7 +23,7 @@ impl CompanyBankAccountsBeta { pub async fn get_company_bank_accounts( &self, company_id_or_uuid: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/companies/{}/bank_accounts", @@ -55,7 +55,7 @@ impl CompanyBankAccountsBeta { pub async fn get_all_company_bank_accounts( &self, company_id_or_uuid: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/companies/{}/bank_accounts", @@ -86,7 +86,7 @@ impl CompanyBankAccountsBeta { &self, company_id_or_uuid: &str, body: &crate::types::PostCompanyBankAccountsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/bank_accounts", @@ -118,7 +118,7 @@ impl CompanyBankAccountsBeta { company_id_or_uuid: &str, bank_account_uuid: &str, body: &crate::types::PutCompanyBankAccountsVerifyRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/bank_accounts/{}/verify", diff --git a/gusto/src/compensations.rs b/gusto/src/compensations.rs index 5003e284..3e9db27f 100644 --- a/gusto/src/compensations.rs +++ b/gusto/src/compensations.rs @@ -21,7 +21,10 @@ impl Compensations { * Note: Currently, jobs are arbitrarily limited to a single compensation as multiple compensations per job are not yet available in Gusto. The API is architected as if multiple compensations may exist, so integrations should integrate under the same assumption. The only exception is that creating a compensation with the same `job_id` as another will fail with a relevant error. * */ - pub async fn get(&self, compensation_id: &str) -> ClientResult { + pub async fn get( + &self, + compensation_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/compensations/{}", @@ -52,7 +55,7 @@ impl Compensations { &self, compensation_id: &str, body: &crate::types::PutCompensationRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/compensations/{}", @@ -81,7 +84,10 @@ impl Compensations { * * Use the `flsa_status` to determine if an employee is elibgle for overtime. */ - pub async fn get_job(&self, job_id: &str) -> ClientResult> { + pub async fn get_job( + &self, + job_id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/jobs/{}/compensations", @@ -112,7 +118,10 @@ impl Compensations { * * Use the `flsa_status` to determine if an employee is elibgle for overtime. */ - pub async fn get_all_job(&self, job_id: &str) -> ClientResult> { + pub async fn get_all_job( + &self, + job_id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/jobs/{}/compensations", diff --git a/gusto/src/contractor_payments.rs b/gusto/src/contractor_payments.rs index 759b5020..076e6d14 100644 --- a/gusto/src/contractor_payments.rs +++ b/gusto/src/contractor_payments.rs @@ -28,7 +28,7 @@ impl ContractorPayments { company_id: &str, start_date: &str, end_date: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !end_date.is_empty() { query_args.push(("end_date".to_string(), end_date.to_string())); @@ -82,7 +82,7 @@ impl ContractorPayments { hours: f64, bonus: f64, reimbursement: f64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !bonus.to_string().is_empty() { query_args.push(("bonus".to_string(), bonus.to_string())); @@ -132,7 +132,7 @@ impl ContractorPayments { &self, company_id: &str, contractor_payment_id_or_uuid: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/contractor_payments/{}", @@ -164,7 +164,7 @@ impl ContractorPayments { &self, company_id: &str, contractor_payment_id_or_uuid: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/contractor_payments/{}", diff --git a/gusto/src/contractors.rs b/gusto/src/contractors.rs index d17ccbb3..6c50c0cf 100644 --- a/gusto/src/contractors.rs +++ b/gusto/src/contractors.rs @@ -18,7 +18,10 @@ impl Contractors { * * Get a contractor. */ - pub async fn get(&self, contractor_id_or_uuid: &str) -> ClientResult { + pub async fn get( + &self, + contractor_id_or_uuid: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/contractors/{}", @@ -47,7 +50,7 @@ impl Contractors { &self, contractor_id_or_uuid: &str, body: &crate::types::PutComntractorRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/contractors/{}", @@ -75,7 +78,7 @@ impl Contractors { pub async fn get_company( &self, company_id_or_uuid: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/companies/{}/contractors", @@ -105,7 +108,7 @@ impl Contractors { pub async fn get_all_company( &self, company_id_or_uuid: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/companies/{}/contractors", @@ -134,7 +137,7 @@ impl Contractors { &self, company_id_or_uuid: &str, body: &crate::types::PostCompanyContractorsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/contractors", diff --git a/gusto/src/current_user.rs b/gusto/src/current_user.rs index 292cef55..ec1ca7f9 100644 --- a/gusto/src/current_user.rs +++ b/gusto/src/current_user.rs @@ -18,7 +18,7 @@ impl CurrentUser { * * Returns information pertaining to the user associated with the provided access token. */ - pub async fn get_me(&self) -> ClientResult { + pub async fn get_me(&self) -> ClientResult> { let url = self.client.url("/v1/me", None); self.client .get( diff --git a/gusto/src/custom_fields.rs b/gusto/src/custom_fields.rs index 9781a4d7..fd9818e2 100644 --- a/gusto/src/custom_fields.rs +++ b/gusto/src/custom_fields.rs @@ -21,7 +21,7 @@ impl CustomFields { pub async fn get_employee( &self, employee_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/employees/{}/custom_fields", @@ -49,7 +49,7 @@ impl CustomFields { pub async fn get_company( &self, company_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/custom_fields", diff --git a/gusto/src/earning_type.rs b/gusto/src/earning_type.rs index 241b146a..92897a97 100644 --- a/gusto/src/earning_type.rs +++ b/gusto/src/earning_type.rs @@ -27,7 +27,7 @@ impl EarningType { pub async fn get_company( &self, company_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/earning_types", @@ -58,7 +58,7 @@ impl EarningType { &self, company_id: &str, body: &crate::types::PostCompanyEarningTypesRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/earning_types", @@ -88,7 +88,7 @@ impl EarningType { company_id: &str, earning_type_uuid: &str, body: &crate::types::PutCompanyEarningTypeRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/earning_types/{}", @@ -118,7 +118,7 @@ impl EarningType { &self, company_id: &str, earning_type_uuid: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/earning_types/{}", diff --git a/gusto/src/employees.rs b/gusto/src/employees.rs index a7ad11c9..64c164ee 100644 --- a/gusto/src/employees.rs +++ b/gusto/src/employees.rs @@ -26,7 +26,7 @@ impl Employees { &self, employee_id_or_uuid: &str, include: &[String], - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include.is_empty() { query_args.push(("include".to_string(), include.join(" "))); @@ -61,7 +61,7 @@ impl Employees { &self, employee_id_or_uuid: &str, body: &crate::types::PutEmployeesRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/employees/{}", @@ -100,7 +100,7 @@ impl Employees { page: f64, per: f64, include: &[String], - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !include.is_empty() { query_args.push(("include".to_string(), include.join(" "))); @@ -147,7 +147,7 @@ impl Employees { company_id_or_uuid: &str, terminated: bool, include: &[String], - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !include.is_empty() { query_args.push(("include".to_string(), include.join(" "))); @@ -185,7 +185,7 @@ impl Employees { &self, company_id_or_uuid: &str, body: &crate::types::PostEmployeesRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/employees", @@ -213,7 +213,7 @@ impl Employees { pub async fn get_home_address( &self, employee_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/employees/{}/home_address", @@ -242,7 +242,7 @@ impl Employees { &self, employee_id: &str, body: &crate::types::PutEmployeeHomeAddressRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/employees/{}/home_address", diff --git a/gusto/src/federal_tax_details_beta.rs b/gusto/src/federal_tax_details_beta.rs index 8e69c0af..835e6477 100644 --- a/gusto/src/federal_tax_details_beta.rs +++ b/gusto/src/federal_tax_details_beta.rs @@ -25,7 +25,7 @@ impl FederalTaxDetailsBeta { * This endpoint is in beta and intended for **[Gusto Embedded Payroll](https://gusto.com/embedded-payroll)** customers. Please [apply for early access](https://gusto-embedded-payroll.typeform.com/to/iomAQIj3?utm_source=docs) if you’d like to learn more and use it for production. Note, this endpoint will require you to enter a different agreement with Gusto. * * Fetches attributes relevant for a company's federal taxes. -*/pub async fn get_company_or_federal_tax_details(&self,company_id_or_uuid: &str,) -> ClientResult {let url = self.client.url( +*/pub async fn get_company_or_federal_tax_details(&self,company_id_or_uuid: &str,) -> ClientResult> {let url = self.client.url( &format!("/v1/companies/{}/federal_tax_details", crate::progenitor_support::encode_path(&company_id_or_uuid.to_string()),), None); self.client.get(&url, crate::Message { body: None, content_type: None } ).await}/** @@ -36,7 +36,7 @@ self.client.get(&url, crate::Message { body: None, content_type: None } ).await} * This endpoint is in beta and intended for **[Gusto Embedded Payroll](https://gusto.com/embedded-payroll)** customers. Please [apply for early access](https://gusto-embedded-payroll.typeform.com/to/iomAQIj3?utm_source=docs) if you’d like to learn more and use it for production. Note, this endpoint will require you to enter a different agreement with Gusto. * * Updates attributes relevant for a company's federal taxes. This information is required is to onboard a company for use with Gusto Embedded Payroll. -*/pub async fn put_company_or_federal_tax_details(&self,company_id_or_uuid: &str,body: &crate::types::PutCompanyFederalTaxDetailsRequest) -> ClientResult {let url = self.client.url( +*/pub async fn put_company_or_federal_tax_details(&self,company_id_or_uuid: &str,body: &crate::types::PutCompanyFederalTaxDetailsRequest) -> ClientResult> {let url = self.client.url( &format!("/v1/companies/{}/federal_tax_details", crate::progenitor_support::encode_path(&company_id_or_uuid.to_string()),), None); self.client.put(&url, crate::Message { body: Some(reqwest::Body::from(serde_json::to_vec(body)?)), content_type: Some("application/json".to_string()) } ).await} diff --git a/gusto/src/garnishments.rs b/gusto/src/garnishments.rs index 60cb3f95..aa3f60d8 100644 --- a/gusto/src/garnishments.rs +++ b/gusto/src/garnishments.rs @@ -21,7 +21,7 @@ impl Garnishments { pub async fn get_employee( &self, employee_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/employees/{}/garnishments", @@ -51,7 +51,7 @@ impl Garnishments { pub async fn get_all_employee( &self, employee_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/employees/{}/garnishments", @@ -80,7 +80,7 @@ impl Garnishments { &self, employee_id: &str, body: &crate::types::PostEmployeeGarnishmentsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/employees/{}/garnishments", @@ -105,7 +105,10 @@ impl Garnishments { * * Garnishments, or employee deductions, are fixed amounts or percentages deducted from an employee’s pay. They can be deducted a specific number of times or on a recurring basis. Garnishments can also have maximum deductions on a yearly or per-pay-period bases. Common uses for garnishments are court-ordered payments for child support or back taxes. Some companies provide loans to their employees that are repaid via garnishments. */ - pub async fn get(&self, garnishment_id: &str) -> ClientResult { + pub async fn get( + &self, + garnishment_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/garnishments/{}", @@ -134,7 +137,7 @@ impl Garnishments { &self, garnishment_id: &str, body: &crate::types::PutGarnishmentRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/garnishments/{}", diff --git a/gusto/src/job_applicants_beta.rs b/gusto/src/job_applicants_beta.rs index c011838f..bca81d68 100644 --- a/gusto/src/job_applicants_beta.rs +++ b/gusto/src/job_applicants_beta.rs @@ -23,7 +23,7 @@ impl JobApplicantsBeta { pub async fn get_company_job_applicants( &self, company_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/companies/{}/job_applicants", @@ -55,7 +55,7 @@ impl JobApplicantsBeta { pub async fn get_all_company_job_applicants( &self, company_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/companies/{}/job_applicants", @@ -86,7 +86,7 @@ impl JobApplicantsBeta { &self, company_id: &str, body: &crate::types::PostCompanyJobApplicantsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/job_applicants", @@ -117,7 +117,7 @@ impl JobApplicantsBeta { &self, company_id: &str, job_applicant_uuid: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/job_applicants/{}", @@ -150,7 +150,7 @@ impl JobApplicantsBeta { company_id: &str, job_applicant_uuid: &str, body: &crate::types::PutCompanyJobApplicantRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/job_applicants/{}", @@ -182,7 +182,7 @@ impl JobApplicantsBeta { &self, company_id: &str, job_applicant_uuid: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/job_applicants/{}", diff --git a/gusto/src/jobs.rs b/gusto/src/jobs.rs index 96d98de2..417b29ab 100644 --- a/gusto/src/jobs.rs +++ b/gusto/src/jobs.rs @@ -18,7 +18,7 @@ impl Jobs { * * Get a job. */ - pub async fn get(&self, job_id: &str) -> ClientResult { + pub async fn get(&self, job_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/jobs/{}", @@ -47,7 +47,7 @@ impl Jobs { &self, job_id: &str, body: &crate::types::PutJobRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/jobs/{}", @@ -72,7 +72,7 @@ impl Jobs { * * Deletes a specific job that an employee holds. */ - pub async fn delete(&self, job_id: &str) -> ClientResult<()> { + pub async fn delete(&self, job_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/jobs/{}", @@ -97,7 +97,10 @@ impl Jobs { * * Get all of the jobs that an employee holds. */ - pub async fn get_employee(&self, employee_id: &str) -> ClientResult> { + pub async fn get_employee( + &self, + employee_id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/employees/{}/jobs", @@ -127,7 +130,7 @@ impl Jobs { pub async fn get_all_employee( &self, employee_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/employees/{}/jobs", @@ -156,7 +159,7 @@ impl Jobs { &self, employee_id: &str, body: &crate::types::PostJobRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/employees/{}/jobs", @@ -187,7 +190,7 @@ impl Jobs { &self, job_id: &str, body: &crate::types::PostJobCompensationsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/jobs/{}/compensations", diff --git a/gusto/src/lib.rs b/gusto/src/lib.rs index 22d7e91d..28a75c51 100644 --- a/gusto/src/lib.rs +++ b/gusto/src/lib.rs @@ -126,9 +126,27 @@ pub mod types; #[doc(hidden)] pub mod utils; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -678,13 +696,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -697,7 +716,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -720,13 +739,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -747,7 +767,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -766,7 +786,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -791,6 +815,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -807,7 +832,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -832,7 +857,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -855,6 +880,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -871,7 +897,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -897,7 +923,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -940,6 +966,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -952,7 +979,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -975,7 +1002,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -984,7 +1011,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -992,7 +1019,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1002,32 +1029,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1039,7 +1070,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1048,7 +1079,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1056,7 +1087,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1064,7 +1095,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1072,7 +1103,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/gusto/src/locations.rs b/gusto/src/locations.rs index c0e880f6..97a232be 100644 --- a/gusto/src/locations.rs +++ b/gusto/src/locations.rs @@ -23,7 +23,7 @@ impl Locations { pub async fn get_company( &self, company_id_or_uuid: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/companies/{}/locations", @@ -55,7 +55,7 @@ impl Locations { pub async fn get_all_company( &self, company_id_or_uuid: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/companies/{}/locations", @@ -86,7 +86,7 @@ impl Locations { &self, company_id_or_uuid: &str, body: &crate::types::PostCompanyLocationsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/locations", @@ -111,7 +111,10 @@ impl Locations { * * Get a location. */ - pub async fn get(&self, location_id: &str) -> ClientResult { + pub async fn get( + &self, + location_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/locations/{}", @@ -140,7 +143,7 @@ impl Locations { &self, location_id: &str, body: &crate::types::PutLocationRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/locations/{}", diff --git a/gusto/src/pay_schedules.rs b/gusto/src/pay_schedules.rs index 7feb5730..9f06d5fd 100644 --- a/gusto/src/pay_schedules.rs +++ b/gusto/src/pay_schedules.rs @@ -21,7 +21,7 @@ impl PaySchedules { pub async fn get_company( &self, company_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/companies/{}/pay_schedules", @@ -51,7 +51,7 @@ impl PaySchedules { pub async fn get_all_company( &self, company_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/companies/{}/pay_schedules", @@ -80,7 +80,7 @@ impl PaySchedules { &self, company_id_or_uuid: &str, pay_schedule_id_or_uuid: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/pay_schedules/{}", @@ -113,7 +113,7 @@ impl PaySchedules { company_id_or_uuid: &str, pay_schedule_id_or_uuid: &str, body: &crate::types::PutCompanyPaySchedulesScheduleRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/pay_schedules/{}", diff --git a/gusto/src/payroll.rs b/gusto/src/payroll.rs index 0d9684d1..53a2c0ce 100644 --- a/gusto/src/payroll.rs +++ b/gusto/src/payroll.rs @@ -31,7 +31,7 @@ impl Payroll { company_id_or_uuid: &str, start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !end_date.is_empty() { query_args.push(("end_date".to_string(), end_date.to_string())); @@ -75,7 +75,7 @@ impl Payroll { company_id_or_uuid: &str, start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !end_date.is_empty() { query_args.push(("end_date".to_string(), end_date.to_string())); @@ -130,7 +130,7 @@ impl Payroll { include: &[String], start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !end_date.is_empty() { query_args.push(("end_date".to_string(), end_date.to_string())); @@ -191,7 +191,7 @@ impl Payroll { include: &[String], start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !end_date.is_empty() { query_args.push(("end_date".to_string(), end_date.to_string())); @@ -243,7 +243,7 @@ impl Payroll { &self, company_id_or_uuid: &str, body: &crate::types::PostCompanyPayrollsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/payrolls", @@ -284,7 +284,7 @@ impl Payroll { payroll_id_or_uuid: &str, include: crate::types::GetCompanyPayrollsInclude, show_calculation: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include.to_string().is_empty() { query_args.push(("include".to_string(), include.to_string())); @@ -324,7 +324,7 @@ impl Payroll { company_id_or_uuid: &str, payroll_id_or_uuid: &str, body: &crate::types::PutCompanyPayrollsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/payrolls/{}", @@ -358,7 +358,7 @@ impl Payroll { pay_period_start_date: &str, pay_period_end_date: &str, body: &crate::types::PutCompanyPayrollsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/payrolls/{}/{}", @@ -393,7 +393,7 @@ impl Payroll { &self, company_id: &str, payroll_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/payrolls/{}/calculate", @@ -421,7 +421,11 @@ impl Payroll { * * Submits an unprocessed payroll to be calculated and run. Upon success, transitions the payroll to the `processed` state. */ - pub async fn put_company_submit(&self, company_id: &str, payroll_id: &str) -> ClientResult<()> { + pub async fn put_company_submit( + &self, + company_id: &str, + payroll_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/payrolls/{}/submit", @@ -454,7 +458,7 @@ impl Payroll { &self, company_id: &str, payroll_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/payrolls/{}/cancel", @@ -483,7 +487,7 @@ impl Payroll { pub async fn get_company_or_reversals( &self, company_id_or_uuid: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/payroll_reversals", diff --git a/gusto/src/terminations.rs b/gusto/src/terminations.rs index 4ccc6694..5f2dd80c 100644 --- a/gusto/src/terminations.rs +++ b/gusto/src/terminations.rs @@ -23,7 +23,7 @@ impl Terminations { pub async fn get_employee( &self, employee_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/employees/{}/terminations", @@ -55,7 +55,7 @@ impl Terminations { pub async fn get_all_employee( &self, employee_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/employees/{}/terminations", @@ -86,7 +86,7 @@ impl Terminations { &self, employee_id: &str, body: &crate::types::PostEmployeeTerminationsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/employees/{}/terminations", diff --git a/gusto/src/time_off_requests.rs b/gusto/src/time_off_requests.rs index 08ab0b24..e0c57f4f 100644 --- a/gusto/src/time_off_requests.rs +++ b/gusto/src/time_off_requests.rs @@ -45,7 +45,7 @@ impl TimeOffRequests { company_id: &str, start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !end_date.is_empty() { query_args.push(("end_date".to_string(), end_date.to_string())); @@ -103,7 +103,7 @@ impl TimeOffRequests { company_id: &str, start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !end_date.is_empty() { query_args.push(("end_date".to_string(), end_date.to_string())); @@ -141,7 +141,7 @@ impl TimeOffRequests { &self, company_id: &str, time_off_request_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/companies/{}/time_off_requests/{}", diff --git a/mailchimp/src/activity_feed.rs b/mailchimp/src/activity_feed.rs index c56c5db5..5f6f1e8f 100644 --- a/mailchimp/src/activity_feed.rs +++ b/mailchimp/src/activity_feed.rs @@ -27,7 +27,7 @@ impl ActivityFeed { &self, count: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); diff --git a/mailchimp/src/authorized_apps.rs b/mailchimp/src/authorized_apps.rs index ac142400..f8bb58a2 100644 --- a/mailchimp/src/authorized_apps.rs +++ b/mailchimp/src/authorized_apps.rs @@ -31,7 +31,7 @@ impl AuthorizedApps { exclude_fields: &[String], count: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -77,7 +77,7 @@ impl AuthorizedApps { fields: &[String], exclude_fields: &[String], app_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); diff --git a/mailchimp/src/automations.rs b/mailchimp/src/automations.rs index 094b7a1d..2ecc348b 100644 --- a/mailchimp/src/automations.rs +++ b/mailchimp/src/automations.rs @@ -41,7 +41,7 @@ impl Automations { before_start_time: Option>, since_start_time: Option>, status: crate::types::Status, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if let Some(date) = before_create_time { query_args.push(("before_create_time".to_string(), date.to_rfc3339())); @@ -92,7 +92,7 @@ impl Automations { pub async fn post( &self, body: &crate::types::AutomationWorkflow, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/automations", None); self.client .post( @@ -122,7 +122,7 @@ impl Automations { fields: &[String], exclude_fields: &[String], workflow_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -160,7 +160,10 @@ impl Automations { * * * `workflow_id: &str` -- The unique id for the Automation workflow. */ - pub async fn post_actions_pause_all_email(&self, workflow_id: &str) -> ClientResult<()> { + pub async fn post_actions_pause_all_email( + &self, + workflow_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/automations/{}/actions/pause-all-emails", @@ -189,7 +192,10 @@ impl Automations { * * * `workflow_id: &str` -- The unique id for the Automation workflow. */ - pub async fn post_actions_start_all_email(&self, workflow_id: &str) -> ClientResult<()> { + pub async fn post_actions_start_all_email( + &self, + workflow_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/automations/{}/actions/start-all-emails", @@ -218,7 +224,7 @@ impl Automations { * * * `workflow_id: &str` -- The unique id for the Automation workflow. */ - pub async fn archive(&self, workflow_id: &str) -> ClientResult<()> { + pub async fn archive(&self, workflow_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/automations/{}/actions/archive", @@ -250,7 +256,7 @@ impl Automations { pub async fn get_email( &self, workflow_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/automations/{}/emails", @@ -284,7 +290,7 @@ impl Automations { &self, workflow_id: &str, workflow_email_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/automations/{}/emails/{}", @@ -319,7 +325,7 @@ impl Automations { &self, workflow_id: &str, workflow_email_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/automations/{}/emails/{}", @@ -355,7 +361,7 @@ impl Automations { workflow_id: &str, workflow_email_id: &str, body: &crate::types::UpdateInformationAboutASpecificWorkflowEmail, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/automations/{}/emails/{}", @@ -390,7 +396,7 @@ impl Automations { &self, workflow_id: &str, workflow_email_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/automations/{}/emails/{}/queue", @@ -426,7 +432,7 @@ impl Automations { workflow_id: &str, workflow_email_id: &str, body: &crate::types::SubscriberInAutomationQueue, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/automations/{}/emails/{}/queue", @@ -463,7 +469,7 @@ impl Automations { workflow_id: &str, workflow_email_id: &str, subscriber_hash: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/automations/{}/emails/{}/queue/{}", @@ -499,7 +505,7 @@ impl Automations { &self, workflow_id: &str, workflow_email_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/automations/{}/emails/{}/actions/pause", @@ -534,7 +540,7 @@ impl Automations { &self, workflow_id: &str, workflow_email_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/automations/{}/emails/{}/actions/start", @@ -567,7 +573,7 @@ impl Automations { pub async fn get_removed_subscriber( &self, workflow_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/automations/{}/removed-subscribers", @@ -600,7 +606,7 @@ impl Automations { &self, workflow_id: &str, body: &crate::types::SubscriberInAutomationQueue, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/automations/{}/removed-subscribers", @@ -634,7 +640,7 @@ impl Automations { &self, workflow_id: &str, subscriber_hash: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/automations/{}/removed-subscribers/{}", diff --git a/mailchimp/src/batch_webhooks.rs b/mailchimp/src/batch_webhooks.rs index 1ba18209..de042395 100644 --- a/mailchimp/src/batch_webhooks.rs +++ b/mailchimp/src/batch_webhooks.rs @@ -31,7 +31,7 @@ impl BatchWebhooks { exclude_fields: &[String], count: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -69,7 +69,7 @@ impl BatchWebhooks { pub async fn post( &self, body: &crate::types::BatchWebhook, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/batch-webhooks", None); self.client .post( @@ -99,7 +99,7 @@ impl BatchWebhooks { fields: &[String], exclude_fields: &[String], batch_webhook_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -137,7 +137,7 @@ impl BatchWebhooks { * * * `batch_webhook_id: &str` -- The unique id for the batch webhook. */ - pub async fn delete(&self, batch_webhook_id: &str) -> ClientResult<()> { + pub async fn delete(&self, batch_webhook_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/batch-webhooks/{}", @@ -170,7 +170,7 @@ impl BatchWebhooks { &self, batch_webhook_id: &str, body: &crate::types::BatchWebhook, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/batch-webhooks/{}", diff --git a/mailchimp/src/batches.rs b/mailchimp/src/batches.rs index 79afb08d..00722184 100644 --- a/mailchimp/src/batches.rs +++ b/mailchimp/src/batches.rs @@ -31,7 +31,7 @@ impl Batches { exclude_fields: &[String], count: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -67,7 +67,7 @@ impl Batches { pub async fn post( &self, body: &crate::types::PostBatchesRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/batches", None); self.client .post( @@ -97,7 +97,7 @@ impl Batches { fields: &[String], exclude_fields: &[String], batch_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -135,7 +135,7 @@ impl Batches { * * * `batch_id: &str` -- The unique id for the batch operation. */ - pub async fn delete(&self, batch_id: &str) -> ClientResult<()> { + pub async fn delete(&self, batch_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/batches/{}", diff --git a/mailchimp/src/campaign_folders.rs b/mailchimp/src/campaign_folders.rs index dfbd0b12..5187c060 100644 --- a/mailchimp/src/campaign_folders.rs +++ b/mailchimp/src/campaign_folders.rs @@ -31,7 +31,7 @@ impl CampaignFolders { exclude_fields: &[String], count: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -69,7 +69,7 @@ impl CampaignFolders { pub async fn post( &self, body: &crate::types::GalleryFolder, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/campaign-folders", None); self.client .post( @@ -99,7 +99,7 @@ impl CampaignFolders { fields: &[String], exclude_fields: &[String], folder_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -137,7 +137,7 @@ impl CampaignFolders { * * * `folder_id: &str` -- The unique id for the campaign folder. */ - pub async fn delete(&self, folder_id: &str) -> ClientResult<()> { + pub async fn delete(&self, folder_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/campaign-folders/{}", @@ -170,7 +170,7 @@ impl CampaignFolders { &self, folder_id: &str, body: &crate::types::GalleryFolder, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/campaign-folders/{}", diff --git a/mailchimp/src/campaigns.rs b/mailchimp/src/campaigns.rs index ad49a11f..0e0a1ba2 100644 --- a/mailchimp/src/campaigns.rs +++ b/mailchimp/src/campaigns.rs @@ -53,7 +53,7 @@ impl Campaigns { member_id: &str, sort_field: crate::types::SortField, sort_dir: crate::types::SortDir, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if let Some(date) = before_create_time { query_args.push(("before_create_time".to_string(), date.to_rfc3339())); @@ -122,7 +122,7 @@ impl Campaigns { pub async fn post( &self, body: &crate::types::CreatedCampaign, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/campaigns", None); self.client .post( @@ -152,7 +152,7 @@ impl Campaigns { fields: &[String], exclude_fields: &[String], campaign_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -190,7 +190,7 @@ impl Campaigns { * * * `campaign_id: &str` -- The unique id for the campaign. */ - pub async fn delete(&self, campaign_id: &str) -> ClientResult<()> { + pub async fn delete(&self, campaign_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}", @@ -223,7 +223,7 @@ impl Campaigns { &self, campaign_id: &str, body: &crate::types::CampaignData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}", @@ -252,7 +252,10 @@ impl Campaigns { * * * `campaign_id: &str` -- The unique id for the campaign. */ - pub async fn post_actions_cancel_send(&self, campaign_id: &str) -> ClientResult<()> { + pub async fn post_actions_cancel_send( + &self, + campaign_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/actions/cancel-send", @@ -284,7 +287,7 @@ impl Campaigns { pub async fn post_actions_replicate( &self, campaign_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/actions/replicate", @@ -313,7 +316,7 @@ impl Campaigns { * * * `campaign_id: &str` -- The unique id for the campaign. */ - pub async fn post_actions_send(&self, campaign_id: &str) -> ClientResult<()> { + pub async fn post_actions_send(&self, campaign_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/actions/send", @@ -346,7 +349,7 @@ impl Campaigns { &self, campaign_id: &str, body: &crate::types::PostCampaignsActionsScheduleRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/actions/schedule", @@ -375,7 +378,10 @@ impl Campaigns { * * * `campaign_id: &str` -- The unique id for the campaign. */ - pub async fn post_actions_unschedule(&self, campaign_id: &str) -> ClientResult<()> { + pub async fn post_actions_unschedule( + &self, + campaign_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/actions/unschedule", @@ -408,7 +414,7 @@ impl Campaigns { &self, campaign_id: &str, body: &crate::types::PostCampaignsActionsTestRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/actions/test", @@ -437,7 +443,7 @@ impl Campaigns { * * * `campaign_id: &str` -- The unique id for the campaign. */ - pub async fn post_actions_pause(&self, campaign_id: &str) -> ClientResult<()> { + pub async fn post_actions_pause(&self, campaign_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/actions/pause", @@ -466,7 +472,10 @@ impl Campaigns { * * * `campaign_id: &str` -- The unique id for the campaign. */ - pub async fn post_actions_resume(&self, campaign_id: &str) -> ClientResult<()> { + pub async fn post_actions_resume( + &self, + campaign_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/actions/resume", @@ -498,7 +507,7 @@ impl Campaigns { pub async fn post_actions_create_resend( &self, campaign_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/actions/create-resend", @@ -534,7 +543,7 @@ impl Campaigns { fields: &[String], exclude_fields: &[String], campaign_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -576,7 +585,7 @@ impl Campaigns { &self, campaign_id: &str, body: &crate::types::CampaignContentData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/content", @@ -612,7 +621,7 @@ impl Campaigns { fields: &[String], exclude_fields: &[String], campaign_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -654,7 +663,7 @@ impl Campaigns { &self, campaign_id: &str, body: &crate::types::CampaignFeedback, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/feedback", @@ -692,7 +701,7 @@ impl Campaigns { exclude_fields: &[String], campaign_id: &str, feedback_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -732,7 +741,11 @@ impl Campaigns { * * `campaign_id: &str` -- The unique id for the campaign. * * `feedback_id: &str` -- The unique id for the feedback message. */ - pub async fn delete_feedback(&self, campaign_id: &str, feedback_id: &str) -> ClientResult<()> { + pub async fn delete_feedback( + &self, + campaign_id: &str, + feedback_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/feedback/{}", @@ -768,7 +781,7 @@ impl Campaigns { campaign_id: &str, feedback_id: &str, body: &crate::types::CampaignFeedbackDataType, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/feedback/{}", @@ -805,7 +818,7 @@ impl Campaigns { fields: &[String], exclude_fields: &[String], campaign_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); diff --git a/mailchimp/src/connected_sites.rs b/mailchimp/src/connected_sites.rs index bbe49a6b..43feea6e 100644 --- a/mailchimp/src/connected_sites.rs +++ b/mailchimp/src/connected_sites.rs @@ -31,7 +31,7 @@ impl ConnectedSites { exclude_fields: &[String], count: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -69,7 +69,7 @@ impl ConnectedSites { pub async fn post( &self, body: &crate::types::ConnectedSite, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/connected-sites", None); self.client .post( @@ -99,7 +99,7 @@ impl ConnectedSites { fields: &[String], exclude_fields: &[String], connected_site_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -137,7 +137,7 @@ impl ConnectedSites { * * * `connected_site_id: &str` -- The unique identifier for the site. */ - pub async fn delete(&self, connected_site_id: &str) -> ClientResult<()> { + pub async fn delete(&self, connected_site_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/connected-sites/{}", @@ -169,7 +169,7 @@ impl ConnectedSites { pub async fn post_actions_verify_script_installation( &self, connected_site_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/connected-sites/{}/actions/verify-script-installation", diff --git a/mailchimp/src/conversations.rs b/mailchimp/src/conversations.rs index c16d7161..7b0b6a96 100644 --- a/mailchimp/src/conversations.rs +++ b/mailchimp/src/conversations.rs @@ -37,7 +37,7 @@ impl Conversations { has_unread_messages: crate::types::IsRead, list_id: &str, campaign_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !campaign_id.is_empty() { query_args.push(("campaign_id".to_string(), campaign_id.to_string())); @@ -93,7 +93,7 @@ impl Conversations { fields: &[String], exclude_fields: &[String], conversation_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -144,7 +144,7 @@ impl Conversations { is_read: crate::types::IsRead, before_timestamp: Option>, since_timestamp: Option>, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if let Some(date) = before_timestamp { query_args.push(("before_timestamp".to_string(), date.to_rfc3339())); @@ -200,7 +200,7 @@ impl Conversations { exclude_fields: &[String], conversation_id: &str, message_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); diff --git a/mailchimp/src/customer_journeys.rs b/mailchimp/src/customer_journeys.rs index c41f2342..49b9a156 100644 --- a/mailchimp/src/customer_journeys.rs +++ b/mailchimp/src/customer_journeys.rs @@ -28,7 +28,7 @@ impl CustomerJourneys { journey_id: i64, step_id: i64, body: &crate::types::SubscriberInAutomationQueue, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/customer-journeys/journeys/{}/steps/{}/actions/trigger", diff --git a/mailchimp/src/ecommerce.rs b/mailchimp/src/ecommerce.rs index 8173179d..0574bc4d 100644 --- a/mailchimp/src/ecommerce.rs +++ b/mailchimp/src/ecommerce.rs @@ -39,7 +39,7 @@ impl Ecommerce { outreach_id: &str, customer_id: &str, has_outreach: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !campaign_id.is_empty() { query_args.push(("campaign_id".to_string(), campaign_id.to_string())); @@ -99,7 +99,7 @@ impl Ecommerce { exclude_fields: &[String], count: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -137,7 +137,7 @@ impl Ecommerce { pub async fn post_store( &self, body: &crate::types::ECommerceStore, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/ecommerce/stores", None); self.client .post( @@ -167,7 +167,7 @@ impl Ecommerce { fields: &[String], exclude_fields: &[String], store_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -205,7 +205,7 @@ impl Ecommerce { * * * `store_id: &str` -- The name of the folder. */ - pub async fn delete_stores(&self, store_id: &str) -> ClientResult<()> { + pub async fn delete_stores(&self, store_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}", @@ -238,7 +238,7 @@ impl Ecommerce { &self, store_id: &str, body: &crate::types::ECommerceStoreData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}", @@ -278,7 +278,7 @@ impl Ecommerce { count: i64, offset: i64, store_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -326,7 +326,7 @@ impl Ecommerce { &self, store_id: &str, body: &crate::types::ECommerceCart, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/carts", @@ -364,7 +364,7 @@ impl Ecommerce { exclude_fields: &[String], store_id: &str, cart_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -404,7 +404,11 @@ impl Ecommerce { * * `store_id: &str` -- The name of the folder. * * `cart_id: &str` -- The name of the folder. */ - pub async fn delete_stores_carts(&self, store_id: &str, cart_id: &str) -> ClientResult<()> { + pub async fn delete_stores_carts( + &self, + store_id: &str, + cart_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/carts/{}", @@ -440,7 +444,7 @@ impl Ecommerce { store_id: &str, cart_id: &str, body: &crate::types::ECommerceCartData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/carts/{}", @@ -483,7 +487,7 @@ impl Ecommerce { offset: i64, store_id: &str, cart_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -534,7 +538,7 @@ impl Ecommerce { store_id: &str, cart_id: &str, body: &crate::types::ECommerceCartLineItemData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/carts/{}/lines", @@ -575,7 +579,7 @@ impl Ecommerce { store_id: &str, cart_id: &str, line_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -622,7 +626,7 @@ impl Ecommerce { store_id: &str, cart_id: &str, line_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/carts/{}/lines/{}", @@ -661,7 +665,7 @@ impl Ecommerce { cart_id: &str, line_id: &str, body: &crate::types::ECommerceCartLineItemDataType, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/carts/{}/lines/{}", @@ -705,7 +709,7 @@ impl Ecommerce { offset: i64, store_id: &str, email_address: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -756,7 +760,7 @@ impl Ecommerce { &self, store_id: &str, body: &crate::types::ECommerceCustomerData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/customers", @@ -794,7 +798,7 @@ impl Ecommerce { exclude_fields: &[String], store_id: &str, customer_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -839,7 +843,7 @@ impl Ecommerce { store_id: &str, customer_id: &str, body: &crate::types::ECommerceCustomerDataType, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/customers/{}", @@ -874,7 +878,7 @@ impl Ecommerce { &self, store_id: &str, customer_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/customers/{}", @@ -910,7 +914,7 @@ impl Ecommerce { store_id: &str, customer_id: &str, body: &crate::types::ECommerceCartCustomer, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/customers/{}", @@ -951,7 +955,7 @@ impl Ecommerce { count: i64, offset: i64, store_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -999,7 +1003,7 @@ impl Ecommerce { &self, store_id: &str, body: &crate::types::ECommercePromoRule, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/promo-rules", @@ -1037,7 +1041,7 @@ impl Ecommerce { exclude_fields: &[String], store_id: &str, promo_rule_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -1081,7 +1085,7 @@ impl Ecommerce { &self, store_id: &str, promo_rule_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/promo-rules/{}", @@ -1117,7 +1121,7 @@ impl Ecommerce { store_id: &str, promo_rule_id: &str, body: &crate::types::ECommercePromoRuleData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/promo-rules/{}", @@ -1160,7 +1164,7 @@ impl Ecommerce { offset: i64, promo_rule_id: &str, store_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -1211,7 +1215,7 @@ impl Ecommerce { store_id: &str, promo_rule_id: &str, body: &crate::types::ECommercePromoCode, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/promo-rules/{}/promo-codes", @@ -1252,7 +1256,7 @@ impl Ecommerce { store_id: &str, promo_rule_id: &str, promo_code_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -1299,7 +1303,7 @@ impl Ecommerce { store_id: &str, promo_rule_id: &str, promo_code_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/promo-rules/{}/promo-codes/{}", @@ -1338,7 +1342,7 @@ impl Ecommerce { promo_rule_id: &str, promo_code_id: &str, body: &crate::types::ECommercePromoCodeData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/promo-rules/{}/promo-codes/{}", @@ -1388,7 +1392,7 @@ impl Ecommerce { has_outreach: bool, campaign_id: &str, outreach_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !campaign_id.is_empty() { query_args.push(("campaign_id".to_string(), campaign_id.to_string())); @@ -1448,7 +1452,7 @@ impl Ecommerce { &self, store_id: &str, body: &crate::types::ECommerceOrder, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/orders", @@ -1486,7 +1490,7 @@ impl Ecommerce { exclude_fields: &[String], store_id: &str, order_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -1526,7 +1530,11 @@ impl Ecommerce { * * `store_id: &str` -- The name of the folder. * * `order_id: &str` -- The id for the order in a store. */ - pub async fn delete_stores_orders(&self, store_id: &str, order_id: &str) -> ClientResult<()> { + pub async fn delete_stores_orders( + &self, + store_id: &str, + order_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/orders/{}", @@ -1562,7 +1570,7 @@ impl Ecommerce { store_id: &str, order_id: &str, body: &crate::types::ECommerceOrderData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/orders/{}", @@ -1605,7 +1613,7 @@ impl Ecommerce { offset: i64, store_id: &str, order_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -1656,7 +1664,7 @@ impl Ecommerce { store_id: &str, order_id: &str, body: &crate::types::ECommerceOrderLineItem, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/orders/{}/lines", @@ -1697,7 +1705,7 @@ impl Ecommerce { store_id: &str, order_id: &str, line_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -1744,7 +1752,7 @@ impl Ecommerce { store_id: &str, order_id: &str, line_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/orders/{}/lines/{}", @@ -1783,7 +1791,7 @@ impl Ecommerce { order_id: &str, line_id: &str, body: &crate::types::ECommerceOrderLineItemData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/orders/{}/lines/{}", @@ -1825,7 +1833,7 @@ impl Ecommerce { count: i64, offset: i64, store_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -1873,7 +1881,7 @@ impl Ecommerce { &self, store_id: &str, body: &crate::types::ECommerceProductData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/products", @@ -1911,7 +1919,7 @@ impl Ecommerce { exclude_fields: &[String], store_id: &str, product_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -1955,7 +1963,7 @@ impl Ecommerce { &self, store_id: &str, product_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/products/{}", @@ -1991,7 +1999,7 @@ impl Ecommerce { store_id: &str, product_id: &str, body: &crate::types::ECommerceProductDataType, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/products/{}", @@ -2034,7 +2042,7 @@ impl Ecommerce { offset: i64, store_id: &str, product_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -2085,7 +2093,7 @@ impl Ecommerce { store_id: &str, product_id: &str, body: &crate::types::ECommerceProductVariant, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/products/{}/variants", @@ -2126,7 +2134,7 @@ impl Ecommerce { store_id: &str, product_id: &str, variant_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -2174,7 +2182,7 @@ impl Ecommerce { product_id: &str, variant_id: &str, body: &crate::types::ECommerceProductVariant, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/products/{}/variants/{}", @@ -2212,7 +2220,7 @@ impl Ecommerce { store_id: &str, product_id: &str, variant_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/products/{}/variants/{}", @@ -2251,7 +2259,7 @@ impl Ecommerce { product_id: &str, variant_id: &str, body: &crate::types::ECommerceProductVariantData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/products/{}/variants/{}", @@ -2295,7 +2303,7 @@ impl Ecommerce { offset: i64, store_id: &str, product_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -2346,7 +2354,7 @@ impl Ecommerce { store_id: &str, product_id: &str, body: &crate::types::ECommerceProductImage, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/products/{}/images", @@ -2387,7 +2395,7 @@ impl Ecommerce { store_id: &str, product_id: &str, image_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -2434,7 +2442,7 @@ impl Ecommerce { store_id: &str, product_id: &str, image_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/products/{}/images/{}", @@ -2473,7 +2481,7 @@ impl Ecommerce { product_id: &str, image_id: &str, body: &crate::types::ECommerceProductImageData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ecommerce/stores/{}/products/{}/images/{}", diff --git a/mailchimp/src/facebook_ads.rs b/mailchimp/src/facebook_ads.rs index ba04a13d..8cf58a36 100644 --- a/mailchimp/src/facebook_ads.rs +++ b/mailchimp/src/facebook_ads.rs @@ -35,7 +35,7 @@ impl FacebookAds { offset: i64, sort_field: crate::types::GetAllFacebookAdsSortField, sort_dir: crate::types::SortDir, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -85,7 +85,7 @@ impl FacebookAds { fields: &[String], outreach_id: &str, exclude_fields: &[String], - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); diff --git a/mailchimp/src/file_manager.rs b/mailchimp/src/file_manager.rs index 4ff4bcd5..15339e90 100644 --- a/mailchimp/src/file_manager.rs +++ b/mailchimp/src/file_manager.rs @@ -43,7 +43,7 @@ impl FileManager { since_created_at: &str, sort_field: crate::types::GetFileManagerFilesSortField, sort_dir: crate::types::SortDir, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !before_created_at.is_empty() { query_args.push(( @@ -102,7 +102,7 @@ impl FileManager { pub async fn post( &self, body: &crate::types::GalleryFile, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/file-manager/files", None); self.client .post( @@ -132,7 +132,7 @@ impl FileManager { fields: &[String], exclude_fields: &[String], file_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -170,7 +170,7 @@ impl FileManager { * * * `file_id: &str` -- The unique id for the File Manager file. */ - pub async fn delete_files(&self, file_id: &str) -> ClientResult<()> { + pub async fn delete_files(&self, file_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/file-manager/files/{}", @@ -203,7 +203,7 @@ impl FileManager { &self, file_id: &str, body: &crate::types::GalleryFileData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/file-manager/files/{}", @@ -247,7 +247,7 @@ impl FileManager { created_by: &str, before_created_at: &str, since_created_at: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !before_created_at.is_empty() { query_args.push(( @@ -297,7 +297,7 @@ impl FileManager { pub async fn post_folder( &self, body: &crate::types::GalleryFolder, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/file-manager/folders", None); self.client .post( @@ -327,7 +327,7 @@ impl FileManager { fields: &[String], exclude_fields: &[String], folder_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -365,7 +365,7 @@ impl FileManager { * * * `folder_id: &str` -- The unique id for the File Manager folder. */ - pub async fn delete_folders(&self, folder_id: &str) -> ClientResult<()> { + pub async fn delete_folders(&self, folder_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/file-manager/folders/{}", @@ -398,7 +398,7 @@ impl FileManager { &self, folder_id: &str, body: &crate::types::GalleryFolder, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/file-manager/folders/{}", diff --git a/mailchimp/src/landing_pages.rs b/mailchimp/src/landing_pages.rs index fa1a4b4b..49a8fb91 100644 --- a/mailchimp/src/landing_pages.rs +++ b/mailchimp/src/landing_pages.rs @@ -33,7 +33,7 @@ impl LandingPages { fields: &[String], exclude_fields: &[String], count: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -77,7 +77,7 @@ impl LandingPages { &self, use_default_list: bool, body: &crate::types::LandingPageData, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if use_default_list { query_args.push(("use_default_list".to_string(), use_default_list.to_string())); @@ -112,7 +112,7 @@ impl LandingPages { fields: &[String], exclude_fields: &[String], page_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -150,7 +150,7 @@ impl LandingPages { * * * `page_id: &str` -- The unique id for the page. */ - pub async fn delete(&self, page_id: &str) -> ClientResult<()> { + pub async fn delete(&self, page_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/landing-pages/{}", @@ -183,7 +183,7 @@ impl LandingPages { &self, page_id: &str, body: &crate::types::LandingPageDataType, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/landing-pages/{}", @@ -215,7 +215,7 @@ impl LandingPages { pub async fn post_actions_publish( &self, page_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/landing-pages/{}/actions/publish", @@ -244,7 +244,7 @@ impl LandingPages { * * * `page_id: &str` -- The unique id for the page. */ - pub async fn post_actions_unpublish(&self, page_id: &str) -> ClientResult<()> { + pub async fn post_actions_unpublish(&self, page_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/landing-pages/{}/actions/unpublish", @@ -280,7 +280,7 @@ impl LandingPages { fields: &[String], exclude_fields: &[String], page_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); diff --git a/mailchimp/src/lib.rs b/mailchimp/src/lib.rs index c7e35d57..a1dfc912 100644 --- a/mailchimp/src/lib.rs +++ b/mailchimp/src/lib.rs @@ -131,9 +131,27 @@ pub mod types; pub mod utils; pub mod verified_domains; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -638,13 +656,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -657,7 +676,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -680,13 +699,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -707,7 +727,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -726,7 +746,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -751,6 +775,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -767,7 +792,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -792,7 +817,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -815,6 +840,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -831,7 +857,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -857,7 +883,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -900,6 +926,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -912,7 +939,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -935,7 +962,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -944,7 +971,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -952,7 +979,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -962,32 +989,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -999,7 +1030,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1008,7 +1039,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1016,7 +1047,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1024,7 +1055,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1032,7 +1063,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/mailchimp/src/lists.rs b/mailchimp/src/lists.rs index 7c6588f7..4f1c4e08 100644 --- a/mailchimp/src/lists.rs +++ b/mailchimp/src/lists.rs @@ -49,7 +49,7 @@ impl Lists { sort_dir: crate::types::SortDir, has_ecommerce_store: bool, include_total_contacts: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !before_campaign_last_sent.is_empty() { query_args.push(( @@ -130,7 +130,7 @@ impl Lists { pub async fn post( &self, body: &crate::types::SubscriberList, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/lists", None); self.client .post( @@ -162,7 +162,7 @@ impl Lists { exclude_fields: &[String], list_id: &str, include_total_contacts: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -214,7 +214,7 @@ impl Lists { skip_merge_validation: bool, skip_duplicate_check: bool, body: &crate::types::MembersSubscribeUnsubscribeFromAListInBatch, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if skip_duplicate_check { query_args.push(( @@ -258,7 +258,7 @@ impl Lists { * * * `list_id: &str` -- The unique ID for the list. */ - pub async fn delete(&self, list_id: &str) -> ClientResult<()> { + pub async fn delete(&self, list_id: &str) -> ClientResult> { let url = self.client.url( &format!("/lists/{}", crate::progenitor_support::encode_path(list_id),), None, @@ -288,7 +288,7 @@ impl Lists { &self, list_id: &str, body: &crate::types::SubscriberListData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!("/lists/{}", crate::progenitor_support::encode_path(list_id),), None, @@ -325,7 +325,7 @@ impl Lists { count: i64, offset: i64, list_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -382,7 +382,7 @@ impl Lists { offset: i64, list_id: &str, report_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -434,7 +434,7 @@ impl Lists { fields: &[String], exclude_fields: &[String], list_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -479,7 +479,7 @@ impl Lists { fields: &[String], exclude_fields: &[String], list_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -532,7 +532,7 @@ impl Lists { list_id: &str, sort_field: crate::types::GetListsGrowthHistorySortField, sort_dir: crate::types::SortDir, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -591,7 +591,7 @@ impl Lists { exclude_fields: &[String], list_id: &str, month: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -643,7 +643,7 @@ impl Lists { count: i64, offset: i64, type_: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -694,7 +694,7 @@ impl Lists { &self, list_id: &str, body: &crate::types::InterestCategory, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/interest-categories", @@ -732,7 +732,7 @@ impl Lists { interest_category_id: &str, fields: &[String], exclude_fields: &[String], - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -776,7 +776,7 @@ impl Lists { &self, list_id: &str, interest_category_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/interest-categories/{}", @@ -812,7 +812,7 @@ impl Lists { list_id: &str, interest_category_id: &str, body: &crate::types::InterestCategory, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/interest-categories/{}", @@ -855,7 +855,7 @@ impl Lists { exclude_fields: &[String], count: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -906,7 +906,7 @@ impl Lists { list_id: &str, interest_category_id: &str, body: &crate::types::Interest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/interest-categories/{}/interests", @@ -947,7 +947,7 @@ impl Lists { interest_id: &str, fields: &[String], exclude_fields: &[String], - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -994,7 +994,7 @@ impl Lists { list_id: &str, interest_category_id: &str, interest_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/interest-categories/{}/interests/{}", @@ -1033,7 +1033,7 @@ impl Lists { interest_category_id: &str, interest_id: &str, body: &crate::types::Interest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/interest-categories/{}/interests/{}", @@ -1091,7 +1091,7 @@ impl Lists { include_unsubscribed: bool, since_updated_at: &str, before_updated_at: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !before_created_at.is_empty() { query_args.push(( @@ -1175,7 +1175,7 @@ impl Lists { &self, list_id: &str, body: &crate::types::ListData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/segments", @@ -1219,7 +1219,7 @@ impl Lists { include_cleaned: bool, include_transactional: bool, include_unsubscribed: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -1279,7 +1279,8 @@ impl Lists { list_id: &str, segment_id: &str, body: &crate::types::MembersAddRemoveFromAStaticSegment, - ) -> ClientResult { + ) -> ClientResult> + { let url = self.client.url( &format!( "/lists/{}/segments/{}", @@ -1310,7 +1311,11 @@ impl Lists { * * `list_id: &str` -- The unique ID for the list. * * `segment_id: &str` -- The unique id for the segment. */ - pub async fn delete_segments(&self, list_id: &str, segment_id: &str) -> ClientResult<()> { + pub async fn delete_segments( + &self, + list_id: &str, + segment_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/segments/{}", @@ -1346,7 +1351,7 @@ impl Lists { list_id: &str, segment_id: &str, body: &crate::types::ListDataType, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/segments/{}", @@ -1395,7 +1400,7 @@ impl Lists { include_cleaned: bool, include_transactional: bool, include_unsubscribed: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -1461,7 +1466,7 @@ impl Lists { list_id: &str, segment_id: &str, body: &crate::types::SubscriberInAutomationQueue, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/segments/{}/members", @@ -1498,7 +1503,7 @@ impl Lists { list_id: &str, segment_id: &str, subscriber_hash: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/segments/{}/members/{}", @@ -1534,7 +1539,7 @@ impl Lists { &self, list_id: &str, name: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !name.is_empty() { query_args.push(("name".to_string(), name.to_string())); @@ -1610,7 +1615,7 @@ impl Lists { sort_dir: crate::types::SortDir, since_last_campaign: bool, unsubscribed_since: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !before_last_changed.is_empty() { query_args.push(( @@ -1726,7 +1731,7 @@ impl Lists { list_id: &str, skip_merge_validation: bool, body: &crate::types::AddListMembers, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if skip_merge_validation { query_args.push(( @@ -1773,7 +1778,7 @@ impl Lists { exclude_fields: &[String], list_id: &str, subscriber_hash: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -1820,7 +1825,7 @@ impl Lists { subscriber_hash: &str, skip_merge_validation: bool, body: &crate::types::AddListMembersData, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if skip_merge_validation { query_args.push(( @@ -1860,7 +1865,11 @@ impl Lists { * * `list_id: &str` -- The unique ID for the list. * * `subscriber_hash: &str` -- The MD5 hash of the lowercase version of the list member's email address. */ - pub async fn delete_members(&self, list_id: &str, subscriber_hash: &str) -> ClientResult<()> { + pub async fn delete_members( + &self, + list_id: &str, + subscriber_hash: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/members/{}", @@ -1898,7 +1907,7 @@ impl Lists { subscriber_hash: &str, skip_merge_validation: bool, body: &crate::types::AddListMembersDataType, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if skip_merge_validation { query_args.push(( @@ -1948,7 +1957,7 @@ impl Lists { fields: &[String], exclude_fields: &[String], action: &[String], - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !action.is_empty() { query_args.push(("action".to_string(), action.join(" "))); @@ -2005,7 +2014,7 @@ impl Lists { count: i64, offset: i64, activity_filters: &[String], - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !activity_filters.is_empty() { query_args.push(("activity_filters".to_string(), activity_filters.join(" "))); @@ -2066,7 +2075,7 @@ impl Lists { exclude_fields: &[String], count: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -2117,7 +2126,7 @@ impl Lists { list_id: &str, subscriber_hash: &str, body: &crate::types::MemberTags, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/members/{}/tags", @@ -2160,7 +2169,7 @@ impl Lists { offset: i64, fields: &[String], exclude_fields: &[String], - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -2211,7 +2220,7 @@ impl Lists { list_id: &str, subscriber_hash: &str, body: &crate::types::EventsData, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/members/{}/events", @@ -2250,7 +2259,7 @@ impl Lists { subscriber_hash: &str, fields: &[String], exclude_fields: &[String], - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -2306,7 +2315,7 @@ impl Lists { exclude_fields: &[String], count: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -2363,7 +2372,7 @@ impl Lists { list_id: &str, subscriber_hash: &str, body: &crate::types::MemberNotes, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/members/{}/notes", @@ -2404,7 +2413,7 @@ impl Lists { note_id: &str, fields: &[String], exclude_fields: &[String], - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -2451,7 +2460,7 @@ impl Lists { list_id: &str, subscriber_hash: &str, note_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/members/{}/notes/{}", @@ -2490,7 +2499,7 @@ impl Lists { subscriber_hash: &str, note_id: &str, body: &crate::types::MemberNotes, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/members/{}/notes/{}", @@ -2526,7 +2535,7 @@ impl Lists { &self, list_id: &str, subscriber_hash: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/members/{}/actions/delete-permanent", @@ -2571,7 +2580,7 @@ impl Lists { offset: i64, type_: &str, required: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -2625,7 +2634,7 @@ impl Lists { &self, list_id: &str, body: &crate::types::MergeFieldData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/merge-fields", @@ -2663,7 +2672,7 @@ impl Lists { merge_id: &str, exclude_fields: &[String], fields: &[String], - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -2703,7 +2712,11 @@ impl Lists { * * `list_id: &str` -- The unique ID for the list. * * `merge_id: &str` -- The id for the merge field. */ - pub async fn delete_merge_fields(&self, list_id: &str, merge_id: &str) -> ClientResult<()> { + pub async fn delete_merge_fields( + &self, + list_id: &str, + merge_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/merge-fields/{}", @@ -2739,7 +2752,7 @@ impl Lists { list_id: &str, merge_id: &str, body: &crate::types::MergeFieldDataType, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/merge-fields/{}", @@ -2769,7 +2782,10 @@ impl Lists { * * * `list_id: &str` -- The unique ID for the list. */ - pub async fn get_webhook(&self, list_id: &str) -> ClientResult { + pub async fn get_webhook( + &self, + list_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/webhooks", @@ -2802,7 +2818,7 @@ impl Lists { &self, list_id: &str, body: &crate::types::AddWebhook, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/webhooks", @@ -2836,7 +2852,7 @@ impl Lists { &self, list_id: &str, webhook_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/webhooks/{}", @@ -2867,7 +2883,11 @@ impl Lists { * * `list_id: &str` -- The unique ID for the list. * * `webhook_id: &str` -- The name of the folder. */ - pub async fn delete_webhooks(&self, list_id: &str, webhook_id: &str) -> ClientResult<()> { + pub async fn delete_webhooks( + &self, + list_id: &str, + webhook_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/webhooks/{}", @@ -2903,7 +2923,7 @@ impl Lists { list_id: &str, webhook_id: &str, body: &crate::types::AddWebhook, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/webhooks/{}", @@ -2936,7 +2956,7 @@ impl Lists { pub async fn get_signup_form( &self, list_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/signup-forms", @@ -2969,7 +2989,7 @@ impl Lists { &self, list_id: &str, body: &crate::types::SignupFormData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/lists/{}/signup-forms", @@ -3005,7 +3025,7 @@ impl Lists { fields: &[String], exclude_fields: &[String], list_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); diff --git a/mailchimp/src/ping.rs b/mailchimp/src/ping.rs index 00adffbe..400a5d61 100644 --- a/mailchimp/src/ping.rs +++ b/mailchimp/src/ping.rs @@ -18,7 +18,7 @@ impl Ping { * * A health check for the API that won't return any account-specific information. */ - pub async fn get(&self) -> ClientResult { + pub async fn get(&self) -> ClientResult> { let url = self.client.url("/ping", None); self.client .get( diff --git a/mailchimp/src/reporting.rs b/mailchimp/src/reporting.rs index 5a80789c..dae493ba 100644 --- a/mailchimp/src/reporting.rs +++ b/mailchimp/src/reporting.rs @@ -35,7 +35,7 @@ impl Reporting { offset: i64, sort_field: crate::types::GetAllFacebookAdsSortField, sort_dir: crate::types::SortDir, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -87,7 +87,7 @@ impl Reporting { fields: &[String], outreach_id: &str, exclude_fields: &[String], - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -138,7 +138,8 @@ impl Reporting { offset: i64, outreach_id: &str, sort_field: crate::types::GetReportsEcommerceProductActivitySortField, - ) -> ClientResult { + ) -> ClientResult> + { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -192,7 +193,7 @@ impl Reporting { fields: &[String], outreach_id: &str, exclude_fields: &[String], - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -239,7 +240,7 @@ impl Reporting { exclude_fields: &[String], count: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); diff --git a/mailchimp/src/reports.rs b/mailchimp/src/reports.rs index 2b277d9f..865f7029 100644 --- a/mailchimp/src/reports.rs +++ b/mailchimp/src/reports.rs @@ -37,7 +37,7 @@ impl Reports { type_: crate::types::CampaignType, before_send_time: Option>, since_send_time: Option>, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if let Some(date) = before_send_time { query_args.push(("before_send_time".to_string(), date.to_rfc3339())); @@ -90,7 +90,7 @@ impl Reports { fields: &[String], exclude_fields: &[String], campaign_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -135,7 +135,7 @@ impl Reports { fields: &[String], exclude_fields: &[String], campaign_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -182,7 +182,7 @@ impl Reports { exclude_fields: &[String], campaign_id: &str, report_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -228,7 +228,7 @@ impl Reports { fields: &[String], exclude_fields: &[String], campaign_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -277,7 +277,7 @@ impl Reports { count: i64, offset: i64, campaign_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -330,7 +330,7 @@ impl Reports { exclude_fields: &[String], campaign_id: &str, link_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -382,7 +382,7 @@ impl Reports { offset: i64, campaign_id: &str, link_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -438,7 +438,7 @@ impl Reports { campaign_id: &str, link_id: &str, subscriber_hash: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -491,7 +491,7 @@ impl Reports { offset: i64, campaign_id: &str, since: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -547,7 +547,7 @@ impl Reports { exclude_fields: &[String], campaign_id: &str, subscriber_hash: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -593,7 +593,7 @@ impl Reports { fields: &[String], exclude_fields: &[String], campaign_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -638,7 +638,7 @@ impl Reports { fields: &[String], exclude_fields: &[String], campaign_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -689,7 +689,7 @@ impl Reports { offset: i64, campaign_id: &str, since: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -747,7 +747,7 @@ impl Reports { campaign_id: &str, subscriber_hash: &str, since: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -800,7 +800,7 @@ impl Reports { campaign_id: &str, count: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -855,7 +855,7 @@ impl Reports { count: i64, offset: i64, campaign_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -908,7 +908,7 @@ impl Reports { exclude_fields: &[String], campaign_id: &str, subscriber_hash: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -954,7 +954,7 @@ impl Reports { fields: &[String], exclude_fields: &[String], campaign_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -1003,7 +1003,7 @@ impl Reports { count: i64, offset: i64, campaign_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -1056,7 +1056,7 @@ impl Reports { exclude_fields: &[String], campaign_id: &str, subscriber_hash: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -1108,7 +1108,8 @@ impl Reports { offset: i64, campaign_id: &str, sort_field: crate::types::GetReportsEcommerceProductActivitySortField, - ) -> ClientResult { + ) -> ClientResult> + { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); diff --git a/mailchimp/src/root.rs b/mailchimp/src/root.rs index 74a3b1a6..58ce8372 100644 --- a/mailchimp/src/root.rs +++ b/mailchimp/src/root.rs @@ -27,7 +27,7 @@ impl Root { &self, fields: &[String], exclude_fields: &[String], - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); diff --git a/mailchimp/src/search_campaigns.rs b/mailchimp/src/search_campaigns.rs index c7352908..231762ef 100644 --- a/mailchimp/src/search_campaigns.rs +++ b/mailchimp/src/search_campaigns.rs @@ -29,7 +29,7 @@ impl SearchCampaigns { fields: &[String], exclude_fields: &[String], query: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); diff --git a/mailchimp/src/search_members.rs b/mailchimp/src/search_members.rs index 9311fe07..f113b677 100644 --- a/mailchimp/src/search_members.rs +++ b/mailchimp/src/search_members.rs @@ -31,7 +31,7 @@ impl SearchMembers { exclude_fields: &[String], query: &str, list_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); diff --git a/mailchimp/src/template_folders.rs b/mailchimp/src/template_folders.rs index ce59435f..a050229d 100644 --- a/mailchimp/src/template_folders.rs +++ b/mailchimp/src/template_folders.rs @@ -31,7 +31,7 @@ impl TemplateFolders { exclude_fields: &[String], count: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -69,7 +69,7 @@ impl TemplateFolders { pub async fn post( &self, body: &crate::types::GalleryFolder, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/template-folders", None); self.client .post( @@ -99,7 +99,7 @@ impl TemplateFolders { fields: &[String], exclude_fields: &[String], folder_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -137,7 +137,7 @@ impl TemplateFolders { * * * `folder_id: &str` -- The unique id for the template folder. */ - pub async fn delete(&self, folder_id: &str) -> ClientResult<()> { + pub async fn delete(&self, folder_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/template-folders/{}", @@ -170,7 +170,7 @@ impl TemplateFolders { &self, folder_id: &str, body: &crate::types::GalleryFolder, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/template-folders/{}", diff --git a/mailchimp/src/templates.rs b/mailchimp/src/templates.rs index 71fad0c8..e8507feb 100644 --- a/mailchimp/src/templates.rs +++ b/mailchimp/src/templates.rs @@ -47,7 +47,7 @@ impl Templates { folder_id: &str, sort_field: crate::types::GetTemplatesSortField, sort_dir: crate::types::SortDir, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !before_date_created.is_empty() { query_args.push(( @@ -113,7 +113,7 @@ impl Templates { pub async fn post( &self, body: &crate::types::TemplateInstance, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/templates", None); self.client .post( @@ -143,7 +143,7 @@ impl Templates { fields: &[String], exclude_fields: &[String], template_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); @@ -181,7 +181,7 @@ impl Templates { * * * `template_id: &str` -- The unique id for the template. */ - pub async fn delete(&self, template_id: &str) -> ClientResult<()> { + pub async fn delete(&self, template_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/templates/{}", @@ -214,7 +214,7 @@ impl Templates { &self, template_id: &str, body: &crate::types::TemplateInstance, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/templates/{}", @@ -250,7 +250,7 @@ impl Templates { fields: &[String], exclude_fields: &[String], template_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !exclude_fields.is_empty() { query_args.push(("exclude_fields".to_string(), exclude_fields.join(" "))); diff --git a/mailchimp/src/verified_domains.rs b/mailchimp/src/verified_domains.rs index 63f14da9..a0231058 100644 --- a/mailchimp/src/verified_domains.rs +++ b/mailchimp/src/verified_domains.rs @@ -22,7 +22,10 @@ impl VerifiedDomains { * * * `domain_name: &str` -- The name of the folder. */ - pub async fn get(&self, domain_name: &str) -> ClientResult { + pub async fn get( + &self, + domain_name: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/verified-domains/{}", @@ -51,7 +54,7 @@ impl VerifiedDomains { * * * `domain_name: &str` -- The name of the folder. */ - pub async fn delete(&self, domain_name: &str) -> ClientResult<()> { + pub async fn delete(&self, domain_name: &str) -> ClientResult> { let url = self.client.url( &format!( "/verified-domains/{}", @@ -84,7 +87,7 @@ impl VerifiedDomains { &self, domain_name: &str, body: &crate::types::VerifyADomainSending, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/verified-domains/{}/actions/verify", @@ -109,7 +112,9 @@ impl VerifiedDomains { * * Get all of the sending domains on the account. */ - pub async fn get_verified_domains(&self) -> ClientResult { + pub async fn get_verified_domains( + &self, + ) -> ClientResult> { let url = self.client.url("/verified-domains", None); self.client .get( @@ -131,7 +136,7 @@ impl VerifiedDomains { pub async fn create( &self, body: &crate::types::VerifiedDomainsDataType, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/verified-domains", None); self.client .post( diff --git a/okta/src/applications.rs b/okta/src/applications.rs index 6b20e81e..c15307d1 100644 --- a/okta/src/applications.rs +++ b/okta/src/applications.rs @@ -35,7 +35,7 @@ impl Applications { filter: &str, expand: &str, include_non_deleted: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -85,7 +85,7 @@ impl Applications { filter: &str, expand: &str, include_non_deleted: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -130,7 +130,7 @@ impl Applications { &self, activate: bool, body: &crate::types::Application, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if activate { query_args.push(("activate".to_string(), activate.to_string())); @@ -159,7 +159,11 @@ impl Applications { * * `app_id: &str` * * `expand: &str` */ - pub async fn get(&self, app_id: &str, expand: &str) -> ClientResult { + pub async fn get( + &self, + app_id: &str, + expand: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -198,7 +202,7 @@ impl Applications { &self, app_id: &str, body: &crate::types::Application, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/apps/{}", @@ -227,7 +231,7 @@ impl Applications { * * * `app_id: &str` */ - pub async fn delete(&self, app_id: &str) -> ClientResult<()> { + pub async fn delete(&self, app_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/apps/{}", @@ -256,7 +260,10 @@ impl Applications { * * * `app_id: &str` */ - pub async fn list_csrs_fors(&self, app_id: &str) -> ClientResult> { + pub async fn list_csrs_fors( + &self, + app_id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/apps/{}/credentials/csrs", @@ -283,7 +290,10 @@ impl Applications { * * Enumerates Certificate Signing Requests for an application */ - pub async fn list_all_csrs_fors(&self, app_id: &str) -> ClientResult> { + pub async fn list_all_csrs_fors( + &self, + app_id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/apps/{}/credentials/csrs", @@ -316,7 +326,7 @@ impl Applications { &self, app_id: &str, body: &crate::types::CsrMetadata, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/apps/{}/credentials/csrs", @@ -342,7 +352,11 @@ impl Applications { * * `app_id: &str` * * `csr_id: &str` */ - pub async fn get_csr_for(&self, app_id: &str, csr_id: &str) -> ClientResult { + pub async fn get_csr_for( + &self, + app_id: &str, + csr_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/apps/{}/credentials/csrs/{}", @@ -369,7 +383,11 @@ impl Applications { * * `app_id: &str` * * `csr_id: &str` */ - pub async fn revoke_csr_from(&self, app_id: &str, csr_id: &str) -> ClientResult<()> { + pub async fn revoke_csr_from( + &self, + app_id: &str, + csr_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/apps/{}/credentials/csrs/{}", @@ -400,7 +418,7 @@ impl Applications { &self, app_id: &str, csr_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/apps/{}/credentials/csrs/{}/lifecycle/publish", @@ -430,7 +448,10 @@ impl Applications { * * * `app_id: &str` */ - pub async fn list_keys(&self, app_id: &str) -> ClientResult> { + pub async fn list_keys( + &self, + app_id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/apps/{}/credentials/keys", @@ -457,7 +478,10 @@ impl Applications { * * Enumerates key credentials for an application */ - pub async fn list_all_keys(&self, app_id: &str) -> ClientResult> { + pub async fn list_all_keys( + &self, + app_id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/apps/{}/credentials/keys", @@ -489,7 +513,7 @@ impl Applications { &self, app_id: &str, validity_years: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if validity_years > 0 { query_args.push(("validityYears".to_string(), validity_years.to_string())); @@ -529,7 +553,7 @@ impl Applications { &self, app_id: &str, key_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/apps/{}/credentials/keys/{}", @@ -566,7 +590,7 @@ impl Applications { app_id: &str, key_id: &str, target_aid: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !target_aid.is_empty() { query_args.push(("targetAid".to_string(), target_aid.to_string())); @@ -605,7 +629,7 @@ impl Applications { &self, app_id: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -640,7 +664,7 @@ impl Applications { &self, app_id: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -677,7 +701,7 @@ impl Applications { &self, app_id: &str, body: &crate::types::OAuth2ScopeConsentGrant, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/apps/{}/grants", @@ -711,7 +735,7 @@ impl Applications { app_id: &str, grant_id: &str, expand: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -750,7 +774,7 @@ impl Applications { &self, app_id: &str, grant_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/apps/{}/grants/{}", @@ -791,7 +815,7 @@ impl Applications { after: &str, limit: i64, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -838,7 +862,7 @@ impl Applications { app_id: &str, q: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -883,7 +907,7 @@ impl Applications { app_id: &str, group_id: &str, expand: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -925,7 +949,7 @@ impl Applications { app_id: &str, group_id: &str, body: &crate::types::ApplicationGroupAssignment, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/apps/{}/groups/{}", @@ -956,7 +980,11 @@ impl Applications { * * `app_id: &str` * * `group_id: &str` */ - pub async fn delete_group_assignment(&self, app_id: &str, group_id: &str) -> ClientResult<()> { + pub async fn delete_group_assignment( + &self, + app_id: &str, + group_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/apps/{}/groups/{}", @@ -986,7 +1014,7 @@ impl Applications { * * * `app_id: &str` */ - pub async fn activate(&self, app_id: &str) -> ClientResult<()> { + pub async fn activate(&self, app_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/apps/{}/lifecycle/activate", @@ -1015,7 +1043,7 @@ impl Applications { * * * `app_id: &str` */ - pub async fn deactivate(&self, app_id: &str) -> ClientResult<()> { + pub async fn deactivate(&self, app_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/apps/{}/lifecycle/deactivate", @@ -1051,7 +1079,7 @@ impl Applications { expand: &str, after: &str, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -1092,7 +1120,7 @@ impl Applications { &self, app_id: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -1125,7 +1153,10 @@ impl Applications { * * * `app_id: &str` */ - pub async fn revoke_o_auth_2_tokens_for(&self, app_id: &str) -> ClientResult<()> { + pub async fn revoke_o_auth_2_tokens_for( + &self, + app_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/apps/{}/tokens", @@ -1159,7 +1190,7 @@ impl Applications { app_id: &str, token_id: &str, expand: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -1198,7 +1229,7 @@ impl Applications { &self, app_id: &str, token_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/apps/{}/tokens/{}", @@ -1243,7 +1274,7 @@ impl Applications { limit: i64, filter: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -1298,7 +1329,7 @@ impl Applications { query_scope: &str, filter: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -1346,7 +1377,7 @@ impl Applications { &self, app_id: &str, body: &crate::types::AppUser, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/apps/{}/users", @@ -1382,7 +1413,7 @@ impl Applications { app_id: &str, user_id: &str, expand: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -1424,7 +1455,7 @@ impl Applications { app_id: &str, user_id: &str, body: &crate::types::AppUser, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/apps/{}/users/{}", @@ -1461,7 +1492,7 @@ impl Applications { app_id: &str, user_id: &str, send_email: bool, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if send_email { query_args.push(("sendEmail".to_string(), send_email.to_string())); diff --git a/okta/src/authorization_servers.rs b/okta/src/authorization_servers.rs index 37522347..59907ed0 100644 --- a/okta/src/authorization_servers.rs +++ b/okta/src/authorization_servers.rs @@ -27,7 +27,7 @@ impl AuthorizationServers { q: &str, limit: &str, after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -59,7 +59,10 @@ impl AuthorizationServers { * * Success */ - pub async fn list_all(&self, q: &str) -> ClientResult> { + pub async fn list_all( + &self, + q: &str, + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !q.is_empty() { query_args.push(("q".to_string(), q.to_string())); @@ -86,7 +89,7 @@ impl AuthorizationServers { pub async fn create( &self, body: &crate::types::AuthorizationServer, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/api/v1/authorizationServers", None); self.client .post( @@ -110,7 +113,7 @@ impl AuthorizationServers { pub async fn get( &self, auth_server_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}", @@ -141,7 +144,7 @@ impl AuthorizationServers { &self, auth_server_id: &str, body: &crate::types::AuthorizationServer, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}", @@ -168,7 +171,7 @@ impl AuthorizationServers { * * * `auth_server_id: &str` */ - pub async fn delete(&self, auth_server_id: &str) -> ClientResult<()> { + pub async fn delete(&self, auth_server_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}", @@ -198,7 +201,7 @@ impl AuthorizationServers { pub async fn list_o_auth_2_claims( &self, auth_server_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/claims", @@ -226,7 +229,7 @@ impl AuthorizationServers { pub async fn list_all_o_auth_2_claims( &self, auth_server_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/claims", @@ -257,7 +260,7 @@ impl AuthorizationServers { &self, auth_server_id: &str, body: &crate::types::OAuth2Claim, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/claims", @@ -289,7 +292,7 @@ impl AuthorizationServers { &self, auth_server_id: &str, claim_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/claims/{}", @@ -323,7 +326,7 @@ impl AuthorizationServers { auth_server_id: &str, claim_id: &str, body: &crate::types::OAuth2Claim, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/claims/{}", @@ -356,7 +359,7 @@ impl AuthorizationServers { &self, auth_server_id: &str, claim_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/claims/{}", @@ -387,7 +390,7 @@ impl AuthorizationServers { pub async fn list_o_auth_2_clients_fors( &self, auth_server_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/clients", @@ -415,7 +418,7 @@ impl AuthorizationServers { pub async fn list_all_o_auth_2_clients_fors( &self, auth_server_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/clients", @@ -453,7 +456,7 @@ impl AuthorizationServers { expand: &str, after: &str, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -496,7 +499,7 @@ impl AuthorizationServers { auth_server_id: &str, client_id: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -535,7 +538,7 @@ impl AuthorizationServers { &self, auth_server_id: &str, client_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/clients/{}/tokens", @@ -572,7 +575,7 @@ impl AuthorizationServers { client_id: &str, token_id: &str, expand: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -614,7 +617,7 @@ impl AuthorizationServers { auth_server_id: &str, client_id: &str, token_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/clients/{}/tokens/{}", @@ -646,7 +649,7 @@ impl AuthorizationServers { pub async fn list_keys( &self, auth_server_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/credentials/keys", @@ -674,7 +677,7 @@ impl AuthorizationServers { pub async fn list_all_keys( &self, auth_server_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/credentials/keys", @@ -705,7 +708,7 @@ impl AuthorizationServers { &self, auth_server_id: &str, body: &crate::types::JwkUse, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/credentials/lifecycle/keyRotate", @@ -732,7 +735,7 @@ impl AuthorizationServers { * * * `auth_server_id: &str` */ - pub async fn activate(&self, auth_server_id: &str) -> ClientResult<()> { + pub async fn activate(&self, auth_server_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/lifecycle/activate", @@ -759,7 +762,7 @@ impl AuthorizationServers { * * * `auth_server_id: &str` */ - pub async fn deactivate(&self, auth_server_id: &str) -> ClientResult<()> { + pub async fn deactivate(&self, auth_server_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/lifecycle/deactivate", @@ -789,7 +792,7 @@ impl AuthorizationServers { pub async fn list_policies( &self, auth_server_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/policies", @@ -817,7 +820,7 @@ impl AuthorizationServers { pub async fn list_all_policies( &self, auth_server_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/policies", @@ -848,7 +851,7 @@ impl AuthorizationServers { &self, auth_server_id: &str, body: &crate::types::AuthorizationServerPolicy, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/policies", @@ -880,7 +883,7 @@ impl AuthorizationServers { &self, auth_server_id: &str, policy_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/policies/{}", @@ -914,7 +917,7 @@ impl AuthorizationServers { auth_server_id: &str, policy_id: &str, body: &crate::types::AuthorizationServerPolicy, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/policies/{}", @@ -943,7 +946,11 @@ impl AuthorizationServers { * * `auth_server_id: &str` * * `policy_id: &str` */ - pub async fn delete_policy(&self, auth_server_id: &str, policy_id: &str) -> ClientResult<()> { + pub async fn delete_policy( + &self, + auth_server_id: &str, + policy_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/policies/{}", @@ -972,7 +979,11 @@ impl AuthorizationServers { * * `auth_server_id: &str` * * `policy_id: &str` */ - pub async fn activate_policy(&self, auth_server_id: &str, policy_id: &str) -> ClientResult<()> { + pub async fn activate_policy( + &self, + auth_server_id: &str, + policy_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/policies/{}/lifecycle/activate", @@ -1005,7 +1016,7 @@ impl AuthorizationServers { &self, auth_server_id: &str, policy_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/policies/{}/lifecycle/deactivate", @@ -1038,7 +1049,7 @@ impl AuthorizationServers { &self, policy_id: &str, auth_server_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/policies/{}/rules", @@ -1068,7 +1079,7 @@ impl AuthorizationServers { &self, policy_id: &str, auth_server_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/policies/{}/rules", @@ -1102,7 +1113,7 @@ impl AuthorizationServers { policy_id: &str, auth_server_id: &str, body: &crate::types::AuthorizationServerPolicyRule, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/policies/{}/rules", @@ -1137,7 +1148,7 @@ impl AuthorizationServers { policy_id: &str, auth_server_id: &str, rule_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/policies/{}/rules/{}", @@ -1174,7 +1185,7 @@ impl AuthorizationServers { auth_server_id: &str, rule_id: &str, body: &crate::types::AuthorizationServerPolicyRule, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/policies/{}/rules/{}", @@ -1210,7 +1221,7 @@ impl AuthorizationServers { policy_id: &str, auth_server_id: &str, rule_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/policies/{}/rules/{}", @@ -1246,7 +1257,7 @@ impl AuthorizationServers { auth_server_id: &str, policy_id: &str, rule_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/policies/{}/rules/{}/lifecycle/activate", @@ -1282,7 +1293,7 @@ impl AuthorizationServers { auth_server_id: &str, policy_id: &str, rule_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/policies/{}/rules/{}/lifecycle/deactivate", @@ -1322,7 +1333,7 @@ impl AuthorizationServers { filter: &str, cursor: &str, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); @@ -1368,7 +1379,7 @@ impl AuthorizationServers { q: &str, filter: &str, cursor: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); @@ -1411,7 +1422,7 @@ impl AuthorizationServers { &self, auth_server_id: &str, body: &crate::types::OAuth2Scope, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/scopes", @@ -1443,7 +1454,7 @@ impl AuthorizationServers { &self, auth_server_id: &str, scope_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/scopes/{}", @@ -1477,7 +1488,7 @@ impl AuthorizationServers { auth_server_id: &str, scope_id: &str, body: &crate::types::OAuth2Scope, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/scopes/{}", @@ -1510,7 +1521,7 @@ impl AuthorizationServers { &self, auth_server_id: &str, scope_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/authorizationServers/{}/scopes/{}", diff --git a/okta/src/domains.rs b/okta/src/domains.rs index fc84e915..add3e37a 100644 --- a/okta/src/domains.rs +++ b/okta/src/domains.rs @@ -18,7 +18,7 @@ impl Domains { * * List all verified custom Domains for the org. */ - pub async fn list(&self) -> ClientResult { + pub async fn list(&self) -> ClientResult> { let url = self.client.url("/api/v1/domains", None); self.client .get( @@ -37,7 +37,10 @@ impl Domains { * * Creates your domain. */ - pub async fn create(&self, body: &crate::types::Domain) -> ClientResult { + pub async fn create( + &self, + body: &crate::types::Domain, + ) -> ClientResult> { let url = self.client.url("/api/v1/domains", None); self.client .post( @@ -60,7 +63,10 @@ impl Domains { * * * `domain_id: &str` */ - pub async fn get(&self, domain_id: &str) -> ClientResult { + pub async fn get( + &self, + domain_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/domains/{}", @@ -89,7 +95,7 @@ impl Domains { * * * `domain_id: &str` */ - pub async fn delete(&self, domain_id: &str) -> ClientResult<()> { + pub async fn delete(&self, domain_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/domains/{}", @@ -122,7 +128,7 @@ impl Domains { &self, domain_id: &str, body: &crate::types::DomainCertificate, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/domains/{}/certificate", @@ -151,7 +157,10 @@ impl Domains { * * * `domain_id: &str` */ - pub async fn verify(&self, domain_id: &str) -> ClientResult { + pub async fn verify( + &self, + domain_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/domains/{}/verify", diff --git a/okta/src/event_hooks.rs b/okta/src/event_hooks.rs index 765a7f97..700cc148 100644 --- a/okta/src/event_hooks.rs +++ b/okta/src/event_hooks.rs @@ -16,7 +16,7 @@ impl EventHooks { * * Success */ - pub async fn list(&self) -> ClientResult> { + pub async fn list(&self) -> ClientResult>> { let url = self.client.url("/api/v1/eventHooks", None); self.client .get( @@ -35,7 +35,7 @@ impl EventHooks { * * Success */ - pub async fn list_all(&self) -> ClientResult> { + pub async fn list_all(&self) -> ClientResult>> { let url = self.client.url("/api/v1/eventHooks", None); self.client .get_all_pages( @@ -55,7 +55,7 @@ impl EventHooks { pub async fn create( &self, body: &crate::types::EventHook, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/api/v1/eventHooks", None); self.client .post( @@ -76,7 +76,10 @@ impl EventHooks { * * * `event_hook_id: &str` */ - pub async fn get(&self, event_hook_id: &str) -> ClientResult { + pub async fn get( + &self, + event_hook_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/eventHooks/{}", @@ -107,7 +110,7 @@ impl EventHooks { &self, event_hook_id: &str, body: &crate::types::EventHook, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/eventHooks/{}", @@ -134,7 +137,7 @@ impl EventHooks { * * * `event_hook_id: &str` */ - pub async fn delete(&self, event_hook_id: &str) -> ClientResult<()> { + pub async fn delete(&self, event_hook_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/eventHooks/{}", @@ -161,7 +164,10 @@ impl EventHooks { * * * `event_hook_id: &str` */ - pub async fn activate(&self, event_hook_id: &str) -> ClientResult { + pub async fn activate( + &self, + event_hook_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/eventHooks/{}/lifecycle/activate", @@ -188,7 +194,10 @@ impl EventHooks { * * * `event_hook_id: &str` */ - pub async fn deactivate(&self, event_hook_id: &str) -> ClientResult { + pub async fn deactivate( + &self, + event_hook_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/eventHooks/{}/lifecycle/deactivate", @@ -215,7 +224,10 @@ impl EventHooks { * * * `event_hook_id: &str` */ - pub async fn verify(&self, event_hook_id: &str) -> ClientResult { + pub async fn verify( + &self, + event_hook_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/eventHooks/{}/lifecycle/verify", diff --git a/okta/src/features.rs b/okta/src/features.rs index 20bfa6cb..b18bcf95 100644 --- a/okta/src/features.rs +++ b/okta/src/features.rs @@ -16,7 +16,7 @@ impl Features { * * Success */ - pub async fn list(&self) -> ClientResult> { + pub async fn list(&self) -> ClientResult>> { let url = self.client.url("/api/v1/features", None); self.client .get( @@ -35,7 +35,7 @@ impl Features { * * Success */ - pub async fn list_all(&self) -> ClientResult> { + pub async fn list_all(&self) -> ClientResult>> { let url = self.client.url("/api/v1/features", None); self.client .get_all_pages( @@ -56,7 +56,10 @@ impl Features { * * * `feature_id: &str` */ - pub async fn get(&self, feature_id: &str) -> ClientResult { + pub async fn get( + &self, + feature_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/features/{}", @@ -86,7 +89,7 @@ impl Features { pub async fn list_dependencies( &self, feature_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/features/{}/dependencies", @@ -114,7 +117,7 @@ impl Features { pub async fn list_all_dependencies( &self, feature_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/features/{}/dependencies", @@ -144,7 +147,7 @@ impl Features { pub async fn list_dependents( &self, feature_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/features/{}/dependents", @@ -172,7 +175,7 @@ impl Features { pub async fn list_all_dependents( &self, feature_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/features/{}/dependents", @@ -206,7 +209,7 @@ impl Features { feature_id: &str, lifecycle: &str, mode: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !mode.is_empty() { query_args.push(("mode".to_string(), mode.to_string())); diff --git a/okta/src/groups.rs b/okta/src/groups.rs index f510c653..1dd1a154 100644 --- a/okta/src/groups.rs +++ b/okta/src/groups.rs @@ -33,7 +33,7 @@ impl Groups { after: &str, limit: i64, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -76,7 +76,7 @@ impl Groups { q: &str, search: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -106,7 +106,10 @@ impl Groups { * * Adds a new group with `OKTA_GROUP` type to your organization. */ - pub async fn create(&self, body: &crate::types::Group) -> ClientResult { + pub async fn create( + &self, + body: &crate::types::Group, + ) -> ClientResult> { let url = self.client.url("/api/v1/groups", None); self.client .post( @@ -138,7 +141,7 @@ impl Groups { after: &str, search: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -179,7 +182,7 @@ impl Groups { &self, search: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -211,7 +214,7 @@ impl Groups { pub async fn create_rule( &self, body: &crate::types::GroupRule, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/api/v1/groups/rules", None); self.client .post( @@ -239,7 +242,7 @@ impl Groups { &self, rule_id: &str, expand: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -276,7 +279,7 @@ impl Groups { &self, rule_id: &str, body: &crate::types::GroupRule, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/groups/rules/{}", @@ -306,7 +309,11 @@ impl Groups { * * `rule_id: &str` * * `remove_users: bool` -- Indicates whether to keep or remove users from groups assigned by this rule. */ - pub async fn delete_rule(&self, rule_id: &str, remove_users: bool) -> ClientResult<()> { + pub async fn delete_rule( + &self, + rule_id: &str, + remove_users: bool, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if remove_users { query_args.push(("removeUsers".to_string(), remove_users.to_string())); @@ -341,7 +348,7 @@ impl Groups { * * * `rule_id: &str` */ - pub async fn activate_rule(&self, rule_id: &str) -> ClientResult<()> { + pub async fn activate_rule(&self, rule_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/groups/rules/{}/lifecycle/activate", @@ -370,7 +377,7 @@ impl Groups { * * * `rule_id: &str` */ - pub async fn deactivate_rule(&self, rule_id: &str) -> ClientResult<()> { + pub async fn deactivate_rule(&self, rule_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/groups/rules/{}/lifecycle/deactivate", @@ -399,7 +406,7 @@ impl Groups { * * * `group_id: &str` */ - pub async fn get(&self, group_id: &str) -> ClientResult { + pub async fn get(&self, group_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/groups/{}", @@ -432,7 +439,7 @@ impl Groups { &self, group_id: &str, body: &crate::types::Group, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/groups/{}", @@ -461,7 +468,7 @@ impl Groups { * * * `group_id: &str` */ - pub async fn delete(&self, group_id: &str) -> ClientResult<()> { + pub async fn delete(&self, group_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/groups/{}", @@ -497,7 +504,7 @@ impl Groups { group_id: &str, after: &str, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -536,7 +543,7 @@ impl Groups { pub async fn list_all_assigned_applications_fors( &self, group_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/groups/{}/apps", @@ -568,7 +575,7 @@ impl Groups { &self, group_id: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -603,7 +610,7 @@ impl Groups { &self, group_id: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -642,7 +649,7 @@ impl Groups { group_id: &str, disable_notifications: &str, body: &crate::types::AssignRoleRequest, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !disable_notifications.is_empty() { query_args.push(( @@ -683,7 +690,7 @@ impl Groups { &self, group_id: &str, role_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/groups/{}/roles/{}", @@ -712,7 +719,11 @@ impl Groups { * * `group_id: &str` * * `role_id: &str` */ - pub async fn remove_role_from(&self, group_id: &str, role_id: &str) -> ClientResult<()> { + pub async fn remove_role_from( + &self, + group_id: &str, + role_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/groups/{}/roles/{}", @@ -749,7 +760,7 @@ impl Groups { role_id: &str, after: &str, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -788,7 +799,7 @@ impl Groups { &self, group_id: &str, role_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/groups/{}/roles/{}/targets/catalog/apps", @@ -823,7 +834,7 @@ impl Groups { group_id: &str, role_id: &str, app_name: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/groups/{}/roles/{}/targets/catalog/apps/{}", @@ -859,7 +870,7 @@ impl Groups { group_id: &str, role_id: &str, app_name: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/groups/{}/roles/{}/targets/catalog/apps/{}", @@ -899,7 +910,7 @@ impl Groups { role_id: &str, app_name: &str, application_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/groups/{}/roles/{}/targets/catalog/apps/{}/{}", @@ -940,7 +951,7 @@ impl Groups { role_id: &str, app_name: &str, application_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/groups/{}/roles/{}/targets/catalog/apps/{}/{}", @@ -979,7 +990,7 @@ impl Groups { role_id: &str, after: &str, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -1018,7 +1029,7 @@ impl Groups { &self, group_id: &str, role_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/groups/{}/roles/{}/targets/groups", @@ -1053,7 +1064,7 @@ impl Groups { group_id: &str, role_id: &str, target_group_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/groups/{}/roles/{}/targets/groups/{}", @@ -1089,7 +1100,7 @@ impl Groups { group_id: &str, role_id: &str, target_group_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/groups/{}/roles/{}/targets/groups/{}", @@ -1127,7 +1138,7 @@ impl Groups { group_id: &str, after: &str, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -1163,7 +1174,10 @@ impl Groups { * * Enumerates all users that are a member of a group. */ - pub async fn list_all_users(&self, group_id: &str) -> ClientResult> { + pub async fn list_all_users( + &self, + group_id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/groups/{}/users", @@ -1193,7 +1207,11 @@ impl Groups { * * `group_id: &str` * * `user_id: &str` */ - pub async fn add_user(&self, group_id: &str, user_id: &str) -> ClientResult<()> { + pub async fn add_user( + &self, + group_id: &str, + user_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/groups/{}/users/{}", @@ -1224,7 +1242,11 @@ impl Groups { * * `group_id: &str` * * `user_id: &str` */ - pub async fn remove_user_from(&self, group_id: &str, user_id: &str) -> ClientResult<()> { + pub async fn remove_user_from( + &self, + group_id: &str, + user_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/groups/{}/users/{}", diff --git a/okta/src/identity_providers.rs b/okta/src/identity_providers.rs index 73306dfa..f3ca8ba7 100644 --- a/okta/src/identity_providers.rs +++ b/okta/src/identity_providers.rs @@ -31,7 +31,7 @@ impl IdentityProviders { after: &str, limit: i64, type_: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -70,7 +70,7 @@ impl IdentityProviders { &self, q: &str, type_: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !q.is_empty() { query_args.push(("q".to_string(), q.to_string())); @@ -100,7 +100,7 @@ impl IdentityProviders { pub async fn create( &self, body: &crate::types::IdentityProvider, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/api/v1/idps", None); self.client .post( @@ -128,7 +128,7 @@ impl IdentityProviders { &self, after: &str, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -159,7 +159,9 @@ impl IdentityProviders { * * Enumerates IdP key credentials. */ - pub async fn list_all_keys(&self) -> ClientResult> { + pub async fn list_all_keys( + &self, + ) -> ClientResult>> { let url = self.client.url("/api/v1/idps/credentials/keys", None); self.client .get_all_pages( @@ -181,7 +183,7 @@ impl IdentityProviders { pub async fn create_key( &self, body: &crate::types::JsonWebKey, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/api/v1/idps/credentials/keys", None); self.client .post( @@ -204,7 +206,10 @@ impl IdentityProviders { * * * `key_id: &str` */ - pub async fn get_key(&self, key_id: &str) -> ClientResult { + pub async fn get_key( + &self, + key_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/idps/credentials/keys/{}", @@ -233,7 +238,7 @@ impl IdentityProviders { * * * `key_id: &str` */ - pub async fn delete_key(&self, key_id: &str) -> ClientResult<()> { + pub async fn delete_key(&self, key_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/idps/credentials/keys/{}", @@ -262,7 +267,10 @@ impl IdentityProviders { * * * `idp_id: &str` */ - pub async fn get(&self, idp_id: &str) -> ClientResult { + pub async fn get( + &self, + idp_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/idps/{}", @@ -295,7 +303,7 @@ impl IdentityProviders { &self, idp_id: &str, body: &crate::types::IdentityProvider, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/idps/{}", @@ -324,7 +332,7 @@ impl IdentityProviders { * * * `idp_id: &str` */ - pub async fn delete(&self, idp_id: &str) -> ClientResult<()> { + pub async fn delete(&self, idp_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/idps/{}", @@ -353,7 +361,10 @@ impl IdentityProviders { * * * `idp_id: &str` */ - pub async fn list_csrs_fors(&self, idp_id: &str) -> ClientResult> { + pub async fn list_csrs_fors( + &self, + idp_id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/idps/{}/credentials/csrs", @@ -380,7 +391,10 @@ impl IdentityProviders { * * Enumerates Certificate Signing Requests for an IdP */ - pub async fn list_all_csrs_fors(&self, idp_id: &str) -> ClientResult> { + pub async fn list_all_csrs_fors( + &self, + idp_id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/idps/{}/credentials/csrs", @@ -413,7 +427,7 @@ impl IdentityProviders { &self, idp_id: &str, body: &crate::types::CsrMetadata, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/idps/{}/credentials/csrs", @@ -441,7 +455,11 @@ impl IdentityProviders { * * `idp_id: &str` * * `csr_id: &str` */ - pub async fn get_csr_for(&self, idp_id: &str, csr_id: &str) -> ClientResult { + pub async fn get_csr_for( + &self, + idp_id: &str, + csr_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/idps/{}/credentials/csrs/{}", @@ -470,7 +488,11 @@ impl IdentityProviders { * * `idp_id: &str` * * `csr_id: &str` */ - pub async fn revoke_csr_for(&self, idp_id: &str, csr_id: &str) -> ClientResult<()> { + pub async fn revoke_csr_for( + &self, + idp_id: &str, + csr_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/idps/{}/credentials/csrs/{}", @@ -503,7 +525,7 @@ impl IdentityProviders { &self, idp_id: &str, csr_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/idps/{}/credentials/csrs/{}/lifecycle/publish", @@ -536,7 +558,7 @@ impl IdentityProviders { pub async fn list_signing_keys( &self, idp_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/idps/{}/credentials/keys", @@ -566,7 +588,7 @@ impl IdentityProviders { pub async fn list_all_signing_keys( &self, idp_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/idps/{}/credentials/keys", @@ -600,7 +622,7 @@ impl IdentityProviders { &self, idp_id: &str, validity_years: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if validity_years > 0 { query_args.push(("validityYears".to_string(), validity_years.to_string())); @@ -640,7 +662,7 @@ impl IdentityProviders { &self, idp_id: &str, key_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/idps/{}/credentials/keys/{}", @@ -677,7 +699,7 @@ impl IdentityProviders { idp_id: &str, key_id: &str, target_idp_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !target_idp_id.is_empty() { query_args.push(("targetIdpId".to_string(), target_idp_id.to_string())); @@ -713,7 +735,10 @@ impl IdentityProviders { * * * `idp_id: &str` */ - pub async fn activate(&self, idp_id: &str) -> ClientResult { + pub async fn activate( + &self, + idp_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/idps/{}/lifecycle/activate", @@ -742,7 +767,10 @@ impl IdentityProviders { * * * `idp_id: &str` */ - pub async fn deactivate(&self, idp_id: &str) -> ClientResult { + pub async fn deactivate( + &self, + idp_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/idps/{}/lifecycle/deactivate", @@ -774,7 +802,7 @@ impl IdentityProviders { pub async fn list_application_users( &self, idp_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/idps/{}/users", @@ -804,7 +832,7 @@ impl IdentityProviders { pub async fn list_all_application_users( &self, idp_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/idps/{}/users", @@ -836,7 +864,7 @@ impl IdentityProviders { &self, idp_id: &str, user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/idps/{}/users/{}", @@ -872,7 +900,7 @@ impl IdentityProviders { idp_id: &str, user_id: &str, body: &crate::types::UserIdentityProviderLinkRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/idps/{}/users/{}", @@ -903,7 +931,11 @@ impl IdentityProviders { * * `idp_id: &str` * * `user_id: &str` */ - pub async fn unlink_user_from(&self, idp_id: &str, user_id: &str) -> ClientResult<()> { + pub async fn unlink_user_from( + &self, + idp_id: &str, + user_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/idps/{}/users/{}", @@ -938,7 +970,7 @@ impl IdentityProviders { &self, idp_id: &str, user_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/idps/{}/users/{}/credentials/tokens", @@ -970,7 +1002,7 @@ impl IdentityProviders { &self, idp_id: &str, user_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/idps/{}/users/{}/credentials/tokens", diff --git a/okta/src/inline_hooks.rs b/okta/src/inline_hooks.rs index 2e44142c..12059aa3 100644 --- a/okta/src/inline_hooks.rs +++ b/okta/src/inline_hooks.rs @@ -20,7 +20,10 @@ impl InlineHooks { * * * `type_: &str` */ - pub async fn list(&self, type_: &str) -> ClientResult> { + pub async fn list( + &self, + type_: &str, + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !type_.is_empty() { query_args.push(("type".to_string(), type_.to_string())); @@ -46,7 +49,10 @@ impl InlineHooks { * * Success */ - pub async fn list_all(&self, type_: &str) -> ClientResult> { + pub async fn list_all( + &self, + type_: &str, + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !type_.is_empty() { query_args.push(("type".to_string(), type_.to_string())); @@ -73,7 +79,7 @@ impl InlineHooks { pub async fn create( &self, body: &crate::types::InlineHook, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/api/v1/inlineHooks", None); self.client .post( @@ -94,7 +100,10 @@ impl InlineHooks { * * * `inline_hook_id: &str` */ - pub async fn get(&self, inline_hook_id: &str) -> ClientResult { + pub async fn get( + &self, + inline_hook_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/inlineHooks/{}", @@ -125,7 +134,7 @@ impl InlineHooks { &self, inline_hook_id: &str, body: &crate::types::InlineHook, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/inlineHooks/{}", @@ -152,7 +161,7 @@ impl InlineHooks { * * * `inline_hook_id: &str` */ - pub async fn delete(&self, inline_hook_id: &str) -> ClientResult<()> { + pub async fn delete(&self, inline_hook_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/inlineHooks/{}", @@ -183,7 +192,7 @@ impl InlineHooks { &self, inline_hook_id: &str, body: &crate::types::Links, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/inlineHooks/{}/execute", @@ -210,7 +219,10 @@ impl InlineHooks { * * * `inline_hook_id: &str` */ - pub async fn activate(&self, inline_hook_id: &str) -> ClientResult { + pub async fn activate( + &self, + inline_hook_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/inlineHooks/{}/lifecycle/activate", @@ -237,7 +249,10 @@ impl InlineHooks { * * * `inline_hook_id: &str` */ - pub async fn deactivate(&self, inline_hook_id: &str) -> ClientResult { + pub async fn deactivate( + &self, + inline_hook_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/inlineHooks/{}/lifecycle/deactivate", diff --git a/okta/src/lib.rs b/okta/src/lib.rs index 70c45570..269fec0a 100644 --- a/okta/src/lib.rs +++ b/okta/src/lib.rs @@ -97,9 +97,27 @@ pub mod users; #[doc(hidden)] pub mod utils; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -303,13 +321,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -322,7 +341,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -345,13 +364,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -372,7 +392,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -391,7 +411,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -416,6 +440,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -432,7 +457,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -457,7 +482,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -480,6 +505,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -496,7 +522,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -522,7 +548,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -565,6 +591,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -577,7 +604,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -600,7 +627,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -609,7 +636,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -617,7 +644,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -627,32 +654,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -664,7 +695,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -673,7 +704,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -681,7 +712,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -689,7 +720,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -697,7 +728,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/okta/src/linked_objects.rs b/okta/src/linked_objects.rs index 40f61b46..220a1190 100644 --- a/okta/src/linked_objects.rs +++ b/okta/src/linked_objects.rs @@ -16,7 +16,9 @@ impl LinkedObjects { * * Success */ - pub async fn list_definitions(&self) -> ClientResult> { + pub async fn list_definitions( + &self, + ) -> ClientResult>> { let url = self .client .url("/api/v1/meta/schemas/user/linkedObjects", None); @@ -37,7 +39,9 @@ impl LinkedObjects { * * Success */ - pub async fn list_all_definitions(&self) -> ClientResult> { + pub async fn list_all_definitions( + &self, + ) -> ClientResult>> { let url = self .client .url("/api/v1/meta/schemas/user/linkedObjects", None); @@ -59,7 +63,7 @@ impl LinkedObjects { pub async fn add_definition( &self, body: &crate::types::LinkedObject, - ) -> ClientResult { + ) -> ClientResult> { let url = self .client .url("/api/v1/meta/schemas/user/linkedObjects", None); @@ -85,7 +89,7 @@ impl LinkedObjects { pub async fn get_definition( &self, linked_object_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/meta/schemas/user/linkedObjects/{}", @@ -112,7 +116,10 @@ impl LinkedObjects { * * * `linked_object_name: &str` */ - pub async fn delete_definition(&self, linked_object_name: &str) -> ClientResult<()> { + pub async fn delete_definition( + &self, + linked_object_name: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/meta/schemas/user/linkedObjects/{}", diff --git a/okta/src/logs.rs b/okta/src/logs.rs index 0794a948..59b1b7f8 100644 --- a/okta/src/logs.rs +++ b/okta/src/logs.rs @@ -37,7 +37,7 @@ impl Logs { limit: i64, sort_order: &str, after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -88,7 +88,7 @@ impl Logs { filter: &str, q: &str, sort_order: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !filter.is_empty() { query_args.push(("filter".to_string(), filter.to_string())); diff --git a/okta/src/network_zones.rs b/okta/src/network_zones.rs index 5b80743c..2df1f450 100644 --- a/okta/src/network_zones.rs +++ b/okta/src/network_zones.rs @@ -29,7 +29,7 @@ impl NetworkZones { after: &str, limit: i64, filter: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -61,7 +61,10 @@ impl NetworkZones { * * Enumerates network zones added to your organization with pagination. A subset of zones can be returned that match a supported filter expression or query. */ - pub async fn list_all(&self, filter: &str) -> ClientResult> { + pub async fn list_all( + &self, + filter: &str, + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !filter.is_empty() { query_args.push(("filter".to_string(), filter.to_string())); @@ -88,7 +91,7 @@ impl NetworkZones { pub async fn create( &self, body: &crate::types::NetworkZone, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/api/v1/zones", None); self.client .post( @@ -111,7 +114,10 @@ impl NetworkZones { * * * `zone_id: &str` */ - pub async fn get(&self, zone_id: &str) -> ClientResult { + pub async fn get( + &self, + zone_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/zones/{}", @@ -144,7 +150,7 @@ impl NetworkZones { &self, zone_id: &str, body: &crate::types::NetworkZone, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/zones/{}", @@ -173,7 +179,7 @@ impl NetworkZones { * * * `zone_id: &str` */ - pub async fn delete(&self, zone_id: &str) -> ClientResult<()> { + pub async fn delete(&self, zone_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/zones/{}", @@ -202,7 +208,10 @@ impl NetworkZones { * * * `zone_id: &str` */ - pub async fn activate(&self, zone_id: &str) -> ClientResult { + pub async fn activate( + &self, + zone_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/zones/{}/lifecycle/activate", @@ -231,7 +240,10 @@ impl NetworkZones { * * * `zone_id: &str` */ - pub async fn deactivate(&self, zone_id: &str) -> ClientResult { + pub async fn deactivate( + &self, + zone_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/zones/{}/lifecycle/deactivate", diff --git a/okta/src/policies.rs b/okta/src/policies.rs index 6275784e..01d54e89 100644 --- a/okta/src/policies.rs +++ b/okta/src/policies.rs @@ -27,7 +27,7 @@ impl Policies { type_: &str, status: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -64,7 +64,7 @@ impl Policies { type_: &str, status: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -102,7 +102,7 @@ impl Policies { &self, activate: bool, body: &crate::types::Policy, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if activate { query_args.push(("activate".to_string(), activate.to_string())); @@ -135,7 +135,7 @@ impl Policies { &self, policy_id: &str, expand: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -172,7 +172,7 @@ impl Policies { &self, policy_id: &str, body: &crate::types::Policy, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/policies/{}", @@ -199,7 +199,7 @@ impl Policies { * * * `policy_id: &str` */ - pub async fn delete_policy(&self, policy_id: &str) -> ClientResult<()> { + pub async fn delete_policy(&self, policy_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/policies/{}", @@ -226,7 +226,7 @@ impl Policies { * * * `policy_id: &str` */ - pub async fn activate_policy(&self, policy_id: &str) -> ClientResult<()> { + pub async fn activate_policy(&self, policy_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/policies/{}/lifecycle/activate", @@ -253,7 +253,7 @@ impl Policies { * * * `policy_id: &str` */ - pub async fn deactivate_policy(&self, policy_id: &str) -> ClientResult<()> { + pub async fn deactivate_policy(&self, policy_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/policies/{}/lifecycle/deactivate", @@ -283,7 +283,7 @@ impl Policies { pub async fn list_policy_rules( &self, policy_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/policies/{}/rules", @@ -311,7 +311,7 @@ impl Policies { pub async fn list_all_policy_rules( &self, policy_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/policies/{}/rules", @@ -342,7 +342,7 @@ impl Policies { &self, policy_id: &str, body: &crate::types::PolicyRule, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/policies/{}/rules", @@ -374,7 +374,7 @@ impl Policies { &self, policy_id: &str, rule_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/policies/{}/rules/{}", @@ -408,7 +408,7 @@ impl Policies { policy_id: &str, rule_id: &str, body: &crate::types::PolicyRule, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/policies/{}/rules/{}", @@ -437,7 +437,11 @@ impl Policies { * * `policy_id: &str` * * `rule_id: &str` */ - pub async fn delete_policy_rule(&self, policy_id: &str, rule_id: &str) -> ClientResult<()> { + pub async fn delete_policy_rule( + &self, + policy_id: &str, + rule_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/policies/{}/rules/{}", @@ -466,7 +470,11 @@ impl Policies { * * `policy_id: &str` * * `rule_id: &str` */ - pub async fn activate_policy_rule(&self, policy_id: &str, rule_id: &str) -> ClientResult<()> { + pub async fn activate_policy_rule( + &self, + policy_id: &str, + rule_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/policies/{}/rules/{}/lifecycle/activate", @@ -495,7 +503,11 @@ impl Policies { * * `policy_id: &str` * * `rule_id: &str` */ - pub async fn deactivate_policy_rule(&self, policy_id: &str, rule_id: &str) -> ClientResult<()> { + pub async fn deactivate_policy_rule( + &self, + policy_id: &str, + rule_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/policies/{}/rules/{}/lifecycle/deactivate", diff --git a/okta/src/profile_mappings.rs b/okta/src/profile_mappings.rs index 2b6e2e7b..fa7e2302 100644 --- a/okta/src/profile_mappings.rs +++ b/okta/src/profile_mappings.rs @@ -29,7 +29,7 @@ impl ProfileMappings { limit: i64, source_id: &str, target_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -68,7 +68,7 @@ impl ProfileMappings { &self, source_id: &str, target_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !source_id.is_empty() { query_args.push(("sourceId".to_string(), source_id.to_string())); @@ -101,7 +101,10 @@ impl ProfileMappings { * * * `mapping_id: &str` */ - pub async fn get(&self, mapping_id: &str) -> ClientResult { + pub async fn get( + &self, + mapping_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/mappings/{}", @@ -134,7 +137,7 @@ impl ProfileMappings { &self, mapping_id: &str, body: &crate::types::ProfileMapping, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/mappings/{}", diff --git a/okta/src/sessions.rs b/okta/src/sessions.rs index a5506008..d1b88a77 100644 --- a/okta/src/sessions.rs +++ b/okta/src/sessions.rs @@ -21,7 +21,7 @@ impl Sessions { pub async fn create( &self, body: &crate::types::CreateSessionRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/api/v1/sessions", None); self.client .post( @@ -42,7 +42,10 @@ impl Sessions { * * * `session_id: &str` */ - pub async fn get(&self, session_id: &str) -> ClientResult { + pub async fn get( + &self, + session_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/sessions/{}", @@ -71,7 +74,7 @@ impl Sessions { * * * `session_id: &str` */ - pub async fn end(&self, session_id: &str) -> ClientResult<()> { + pub async fn end(&self, session_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/sessions/{}", @@ -100,7 +103,10 @@ impl Sessions { * * * `session_id: &str` */ - pub async fn refresh(&self, session_id: &str) -> ClientResult { + pub async fn refresh( + &self, + session_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/sessions/{}/lifecycle/refresh", diff --git a/okta/src/templates.rs b/okta/src/templates.rs index 141c7f98..620e5311 100644 --- a/okta/src/templates.rs +++ b/okta/src/templates.rs @@ -25,7 +25,7 @@ impl Templates { pub async fn list_sms( &self, template_type: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !template_type.is_empty() { query_args.push(("templateType".to_string(), template_type.to_string())); @@ -56,7 +56,7 @@ impl Templates { pub async fn list_all_sms( &self, template_type: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !template_type.is_empty() { query_args.push(("templateType".to_string(), template_type.to_string())); @@ -85,7 +85,7 @@ impl Templates { pub async fn create_sms( &self, body: &crate::types::SmsTemplate, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/api/v1/templates/sms", None); self.client .post( @@ -108,7 +108,10 @@ impl Templates { * * * `template_id: &str` */ - pub async fn get_sm(&self, template_id: &str) -> ClientResult { + pub async fn get_sm( + &self, + template_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/templates/sms/{}", @@ -141,7 +144,7 @@ impl Templates { &self, template_id: &str, body: &crate::types::SmsTemplate, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/templates/sms/{}", @@ -174,7 +177,7 @@ impl Templates { &self, template_id: &str, body: &crate::types::SmsTemplate, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/templates/sms/{}", @@ -203,7 +206,7 @@ impl Templates { * * * `template_id: &str` */ - pub async fn delete_sms(&self, template_id: &str) -> ClientResult<()> { + pub async fn delete_sms(&self, template_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/templates/sms/{}", diff --git a/okta/src/threat_insights.rs b/okta/src/threat_insights.rs index d9913f15..a68a7990 100644 --- a/okta/src/threat_insights.rs +++ b/okta/src/threat_insights.rs @@ -18,7 +18,7 @@ impl ThreatInsights { */ pub async fn get_current_configuration( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/api/v1/threats/configuration", None); self.client .get( @@ -38,7 +38,7 @@ impl ThreatInsights { pub async fn update_configuration( &self, body: &crate::types::ThreatInsightConfiguration, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/api/v1/threats/configuration", None); self.client .post( diff --git a/okta/src/trusted_origins.rs b/okta/src/trusted_origins.rs index 8ccdc528..0dc7537d 100644 --- a/okta/src/trusted_origins.rs +++ b/okta/src/trusted_origins.rs @@ -29,7 +29,7 @@ impl TrustedOrigins { filter: &str, after: &str, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -68,7 +68,7 @@ impl TrustedOrigins { &self, q: &str, filter: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !filter.is_empty() { query_args.push(("filter".to_string(), filter.to_string())); @@ -98,7 +98,7 @@ impl TrustedOrigins { pub async fn create_origin( &self, body: &crate::types::TrustedOrigin, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/api/v1/trustedOrigins", None); self.client .post( @@ -122,7 +122,7 @@ impl TrustedOrigins { pub async fn get_origin( &self, trusted_origin_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/trustedOrigins/{}", @@ -153,7 +153,7 @@ impl TrustedOrigins { &self, trusted_origin_id: &str, body: &crate::types::TrustedOrigin, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/trustedOrigins/{}", @@ -180,7 +180,10 @@ impl TrustedOrigins { * * * `trusted_origin_id: &str` */ - pub async fn delete_origin(&self, trusted_origin_id: &str) -> ClientResult<()> { + pub async fn delete_origin( + &self, + trusted_origin_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/trustedOrigins/{}", @@ -210,7 +213,7 @@ impl TrustedOrigins { pub async fn activate_origin( &self, trusted_origin_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/trustedOrigins/{}/lifecycle/activate", @@ -240,7 +243,7 @@ impl TrustedOrigins { pub async fn deactivate_origin( &self, trusted_origin_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/trustedOrigins/{}/lifecycle/deactivate", diff --git a/okta/src/user_factors.rs b/okta/src/user_factors.rs index 2a0ecb55..f9faa534 100644 --- a/okta/src/user_factors.rs +++ b/okta/src/user_factors.rs @@ -20,7 +20,10 @@ impl UserFactors { * * * `user_id: &str` */ - pub async fn list_factors(&self, user_id: &str) -> ClientResult> { + pub async fn list_factors( + &self, + user_id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/users/{}/factors", @@ -48,7 +51,7 @@ impl UserFactors { pub async fn list_all_factors( &self, user_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/users/{}/factors", @@ -89,7 +92,7 @@ impl UserFactors { token_lifetime_seconds: i64, activate: bool, body: &crate::types::UserFactor, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if activate { query_args.push(("activate".to_string(), activate.to_string())); @@ -137,7 +140,7 @@ impl UserFactors { pub async fn list_supported_factors( &self, user_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/users/{}/factors/catalog", @@ -165,7 +168,7 @@ impl UserFactors { pub async fn list_all_supported_factors( &self, user_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/users/{}/factors/catalog", @@ -195,7 +198,7 @@ impl UserFactors { pub async fn list_supported_security_questions( &self, user_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/users/{}/factors/questions", @@ -223,7 +226,7 @@ impl UserFactors { pub async fn list_all_supported_security_questions( &self, user_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/users/{}/factors/questions", @@ -255,7 +258,7 @@ impl UserFactors { &self, user_id: &str, factor_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/factors/{}", @@ -284,7 +287,11 @@ impl UserFactors { * * `user_id: &str` * * `factor_id: &str` */ - pub async fn delete_factor(&self, user_id: &str, factor_id: &str) -> ClientResult<()> { + pub async fn delete_factor( + &self, + user_id: &str, + factor_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/factors/{}", @@ -320,7 +327,7 @@ impl UserFactors { user_id: &str, factor_id: &str, body: &crate::types::ActivateFactorRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/factors/{}/lifecycle/activate", @@ -355,7 +362,7 @@ impl UserFactors { user_id: &str, factor_id: &str, transaction_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/factors/{}/transactions/{}", @@ -399,7 +406,7 @@ impl UserFactors { template_id: &str, token_lifetime_seconds: i64, body: &crate::types::VerifyFactorRequest, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !template_id.is_empty() { query_args.push(("templateId".to_string(), template_id.to_string())); diff --git a/okta/src/user_schemas.rs b/okta/src/user_schemas.rs index df7b79ad..9621afc3 100644 --- a/okta/src/user_schemas.rs +++ b/okta/src/user_schemas.rs @@ -25,7 +25,7 @@ impl UserSchemas { pub async fn get_application( &self, app_instance_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/meta/schemas/apps/{}/default", @@ -58,7 +58,7 @@ impl UserSchemas { &self, app_instance_id: &str, body: &crate::types::UserSchema, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/meta/schemas/apps/{}/default", @@ -87,7 +87,10 @@ impl UserSchemas { * * * `schema_id: &str` */ - pub async fn get(&self, schema_id: &str) -> ClientResult { + pub async fn get( + &self, + schema_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/meta/schemas/user/{}", @@ -118,7 +121,7 @@ impl UserSchemas { &self, schema_id: &str, body: &crate::types::UserSchema, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/meta/schemas/user/{}", diff --git a/okta/src/user_types.rs b/okta/src/user_types.rs index af335034..8a5ffc79 100644 --- a/okta/src/user_types.rs +++ b/okta/src/user_types.rs @@ -16,7 +16,7 @@ impl UserTypes { * * Fetches all User Types in your org */ - pub async fn list(&self) -> ClientResult> { + pub async fn list(&self) -> ClientResult>> { let url = self.client.url("/api/v1/meta/types/user", None); self.client .get( @@ -35,7 +35,7 @@ impl UserTypes { * * Fetches all User Types in your org */ - pub async fn list_all(&self) -> ClientResult> { + pub async fn list_all(&self) -> ClientResult>> { let url = self.client.url("/api/v1/meta/types/user", None); self.client .get_all_pages( @@ -55,7 +55,7 @@ impl UserTypes { pub async fn create( &self, body: &crate::types::UserType, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/api/v1/meta/types/user", None); self.client .post( @@ -76,7 +76,10 @@ impl UserTypes { * * * `type_id: &str` */ - pub async fn get(&self, type_id: &str) -> ClientResult { + pub async fn get( + &self, + type_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/meta/types/user/{}", @@ -107,7 +110,7 @@ impl UserTypes { &self, type_id: &str, body: &crate::types::UserType, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/meta/types/user/{}", @@ -138,7 +141,7 @@ impl UserTypes { &self, type_id: &str, body: &crate::types::UserType, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/meta/types/user/{}", @@ -165,7 +168,7 @@ impl UserTypes { * * * `type_id: &str` */ - pub async fn delete(&self, type_id: &str) -> ClientResult<()> { + pub async fn delete(&self, type_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/meta/types/user/{}", diff --git a/okta/src/users.rs b/okta/src/users.rs index 1ad8f1db..aff2dee5 100644 --- a/okta/src/users.rs +++ b/okta/src/users.rs @@ -37,7 +37,7 @@ impl Users { search: &str, sort_by: &str, sort_order: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -88,7 +88,7 @@ impl Users { search: &str, sort_by: &str, sort_order: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !filter.is_empty() { query_args.push(("filter".to_string(), filter.to_string())); @@ -136,7 +136,7 @@ impl Users { provider: bool, next_login: &str, body: &crate::types::CreateUserRequest, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if activate { query_args.push(("activate".to_string(), activate.to_string())); @@ -173,7 +173,7 @@ impl Users { associated_user_id: &str, primary_relationship_name: &str, primary_user_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/linkedObjects/{}/{}", @@ -204,7 +204,7 @@ impl Users { * * * `user_id: &str` */ - pub async fn get(&self, user_id: &str) -> ClientResult { + pub async fn get(&self, user_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}", @@ -239,7 +239,7 @@ impl Users { user_id: &str, strict: bool, body: &crate::types::User, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if strict { query_args.push(("strict".to_string(), strict.to_string())); @@ -278,7 +278,7 @@ impl Users { user_id: &str, strict: bool, body: &crate::types::User, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if strict { query_args.push(("strict".to_string(), strict.to_string())); @@ -314,7 +314,11 @@ impl Users { * * `user_id: &str` * * `send_email: bool` */ - pub async fn deactivate_or_delete(&self, user_id: &str, send_email: bool) -> ClientResult<()> { + pub async fn deactivate_or_delete( + &self, + user_id: &str, + send_email: bool, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if send_email { query_args.push(("sendEmail".to_string(), send_email.to_string())); @@ -349,7 +353,10 @@ impl Users { * * * `user_id: &str` */ - pub async fn list_app_links(&self, user_id: &str) -> ClientResult> { + pub async fn list_app_links( + &self, + user_id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/users/{}/appLinks", @@ -379,7 +386,7 @@ impl Users { pub async fn list_all_app_links( &self, user_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/users/{}/appLinks", @@ -409,7 +416,7 @@ impl Users { pub async fn list_clients( &self, user_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/users/{}/clients", @@ -437,7 +444,7 @@ impl Users { pub async fn list_all_clients( &self, user_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/users/{}/clients", @@ -475,7 +482,7 @@ impl Users { expand: &str, after: &str, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -518,7 +525,7 @@ impl Users { user_id: &str, client_id: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -557,7 +564,7 @@ impl Users { &self, user_id: &str, client_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/clients/{}/grants", @@ -596,7 +603,7 @@ impl Users { expand: &str, after: &str, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -639,7 +646,7 @@ impl Users { user_id: &str, client_id: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -678,7 +685,7 @@ impl Users { &self, user_id: &str, client_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/clients/{}/tokens", @@ -719,7 +726,7 @@ impl Users { expand: &str, limit: i64, after: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -767,7 +774,7 @@ impl Users { user_id: &str, client_id: &str, token_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/clients/{}/tokens/{}", @@ -804,7 +811,7 @@ impl Users { user_id: &str, strict: bool, body: &crate::types::ChangePasswordRequest, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if strict { query_args.push(("strict".to_string(), strict.to_string())); @@ -843,7 +850,7 @@ impl Users { &self, user_id: &str, body: &crate::types::UserCredentials, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/credentials/change_recovery_question", @@ -873,7 +880,7 @@ impl Users { pub async fn post_credentials_forgot_password( &self, user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/credentials/forgot_password", @@ -911,7 +918,7 @@ impl Users { expand: &str, after: &str, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -956,7 +963,7 @@ impl Users { user_id: &str, scope_id: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -992,7 +999,7 @@ impl Users { * * * `user_id: &str` */ - pub async fn revoke_grants(&self, user_id: &str) -> ClientResult<()> { + pub async fn revoke_grants(&self, user_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/grants", @@ -1026,7 +1033,7 @@ impl Users { user_id: &str, grant_id: &str, expand: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -1061,7 +1068,11 @@ impl Users { * * `user_id: &str` * * `grant_id: &str` */ - pub async fn revoke_grant(&self, user_id: &str, grant_id: &str) -> ClientResult<()> { + pub async fn revoke_grant( + &self, + user_id: &str, + grant_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/grants/{}", @@ -1091,7 +1102,10 @@ impl Users { * * * `user_id: &str` */ - pub async fn list_groups(&self, user_id: &str) -> ClientResult> { + pub async fn list_groups( + &self, + user_id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/users/{}/groups", @@ -1118,7 +1132,10 @@ impl Users { * * Fetches the groups of which the user is a member. */ - pub async fn list_all_groups(&self, user_id: &str) -> ClientResult> { + pub async fn list_all_groups( + &self, + user_id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/users/{}/groups", @@ -1150,7 +1167,7 @@ impl Users { pub async fn list_identity_providers( &self, user_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/users/{}/idps", @@ -1180,7 +1197,7 @@ impl Users { pub async fn list_all_identity_providers( &self, user_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/users/{}/idps", @@ -1214,7 +1231,7 @@ impl Users { &self, user_id: &str, send_email: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if send_email { query_args.push(("sendEmail".to_string(), send_email.to_string())); @@ -1250,7 +1267,11 @@ impl Users { * * `user_id: &str` * * `send_email: bool` */ - pub async fn deactivate(&self, user_id: &str, send_email: bool) -> ClientResult<()> { + pub async fn deactivate( + &self, + user_id: &str, + send_email: bool, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if send_email { query_args.push(("sendEmail".to_string(), send_email.to_string())); @@ -1285,7 +1306,10 @@ impl Users { * * * `user_id: &str` */ - pub async fn expire_password(&self, user_id: &str) -> ClientResult { + pub async fn expire_password( + &self, + user_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/lifecycle/expire_password?tempPassword=false", @@ -1317,7 +1341,7 @@ impl Users { pub async fn expire_password_and_get_temporary( &self, user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/lifecycle/expire_password?tempPassword=true", @@ -1351,7 +1375,7 @@ impl Users { &self, user_id: &str, send_email: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if send_email { query_args.push(("sendEmail".to_string(), send_email.to_string())); @@ -1386,7 +1410,7 @@ impl Users { * * * `user_id: &str` */ - pub async fn reset_factors(&self, user_id: &str) -> ClientResult<()> { + pub async fn reset_factors(&self, user_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/lifecycle/reset_factors", @@ -1420,7 +1444,7 @@ impl Users { &self, user_id: &str, send_email: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if send_email { query_args.push(("sendEmail".to_string(), send_email.to_string())); @@ -1455,7 +1479,7 @@ impl Users { * * * `user_id: &str` */ - pub async fn suspend(&self, user_id: &str) -> ClientResult<()> { + pub async fn suspend(&self, user_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/lifecycle/suspend", @@ -1484,7 +1508,7 @@ impl Users { * * * `user_id: &str` */ - pub async fn unlock(&self, user_id: &str) -> ClientResult<()> { + pub async fn unlock(&self, user_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/lifecycle/unlock", @@ -1513,7 +1537,7 @@ impl Users { * * * `user_id: &str` */ - pub async fn unsuspend(&self, user_id: &str) -> ClientResult<()> { + pub async fn unsuspend(&self, user_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/lifecycle/unsuspend", @@ -1549,7 +1573,7 @@ impl Users { relationship_name: &str, after: &str, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -1588,7 +1612,7 @@ impl Users { &self, user_id: &str, relationship_name: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/users/{}/linkedObjects/{}", @@ -1621,7 +1645,7 @@ impl Users { &self, user_id: &str, relationship_name: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/linkedObjects/{}", @@ -1654,7 +1678,7 @@ impl Users { &self, user_id: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -1689,7 +1713,7 @@ impl Users { &self, user_id: &str, expand: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !expand.is_empty() { query_args.push(("expand".to_string(), expand.to_string())); @@ -1728,7 +1752,7 @@ impl Users { user_id: &str, disable_notifications: &str, body: &crate::types::AssignRoleRequest, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !disable_notifications.is_empty() { query_args.push(( @@ -1765,7 +1789,11 @@ impl Users { * * `user_id: &str` * * `role_id: &str` */ - pub async fn remove_role_from(&self, user_id: &str, role_id: &str) -> ClientResult<()> { + pub async fn remove_role_from( + &self, + user_id: &str, + role_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/roles/{}", @@ -1802,7 +1830,7 @@ impl Users { role_id: &str, after: &str, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -1841,7 +1869,7 @@ impl Users { &self, user_id: &str, role_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/users/{}/roles/{}/targets/catalog/apps", @@ -1874,7 +1902,7 @@ impl Users { &self, user_id: &str, role_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/roles/{}/targets/catalog/apps", @@ -1909,7 +1937,7 @@ impl Users { user_id: &str, role_id: &str, app_name: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/roles/{}/targets/catalog/apps/{}", @@ -1945,7 +1973,7 @@ impl Users { user_id: &str, role_id: &str, app_name: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/roles/{}/targets/catalog/apps/{}", @@ -1985,7 +2013,7 @@ impl Users { role_id: &str, app_name: &str, application_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/roles/{}/targets/catalog/apps/{}/{}", @@ -2026,7 +2054,7 @@ impl Users { role_id: &str, app_name: &str, application_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/roles/{}/targets/catalog/apps/{}/{}", @@ -2065,7 +2093,7 @@ impl Users { role_id: &str, after: &str, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !after.is_empty() { query_args.push(("after".to_string(), after.to_string())); @@ -2104,7 +2132,7 @@ impl Users { &self, user_id: &str, role_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/api/v1/users/{}/roles/{}/targets/groups", @@ -2139,7 +2167,7 @@ impl Users { user_id: &str, role_id: &str, group_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/roles/{}/targets/groups/{}", @@ -2175,7 +2203,7 @@ impl Users { user_id: &str, role_id: &str, group_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/api/v1/users/{}/roles/{}/targets/groups/{}", @@ -2205,7 +2233,11 @@ impl Users { * * `user_id: &str` * * `oauth_tokens: bool` -- Revoke issued OpenID Connect and OAuth refresh and access tokens. */ - pub async fn clear_sessions(&self, user_id: &str, oauth_tokens: bool) -> ClientResult<()> { + pub async fn clear_sessions( + &self, + user_id: &str, + oauth_tokens: bool, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if oauth_tokens { query_args.push(("oauthTokens".to_string(), oauth_tokens.to_string())); diff --git a/ramp/src/auths.rs b/ramp/src/auths.rs index 808f0d37..1531c3bd 100644 --- a/ramp/src/auths.rs +++ b/ramp/src/auths.rs @@ -51,7 +51,7 @@ impl Auths { * * * `authorization: &str` -- Basic \. */ - pub async fn post_token(&self) -> ClientResult { + pub async fn post_token(&self) -> ClientResult> { let url = self.client.url("/token", None); self.client .post( diff --git a/ramp/src/businesses.rs b/ramp/src/businesses.rs index 91024589..749546fd 100644 --- a/ramp/src/businesses.rs +++ b/ramp/src/businesses.rs @@ -22,7 +22,9 @@ impl Businesses { * * * `authorization: &str` -- The OAuth2 token header. */ - pub async fn get_resources_busine(&self) -> ClientResult { + pub async fn get_resources_busine( + &self, + ) -> ClientResult> { let url = self.client.url("/business", None); self.client .get( @@ -47,7 +49,7 @@ impl Businesses { */ pub async fn get_resources_business_current( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/business/balance", None); self.client .get( diff --git a/ramp/src/card_programs.rs b/ramp/src/card_programs.rs index 8a9e3c5e..15e4a77c 100644 --- a/ramp/src/card_programs.rs +++ b/ramp/src/card_programs.rs @@ -28,7 +28,7 @@ impl CardPrograms { &self, start: &str, page_size: f64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !page_size.to_string().is_empty() { query_args.push(("page_size".to_string(), page_size.to_string())); @@ -38,7 +38,7 @@ impl CardPrograms { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/card-programs?{}", query_), None); - let resp: crate::types::GetCardProgramsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -50,7 +50,11 @@ impl CardPrograms { .await?; // Return our response data. - Ok(resp.card_programs.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.card_programs.to_vec(), + )) } /** * List card programs. @@ -61,9 +65,13 @@ impl CardPrograms { * * Retrieve all card programs. */ - pub async fn get_all(&self) -> ClientResult> { + pub async fn get_all(&self) -> ClientResult>> { let url = self.client.url("/card-programs", None); - let resp: crate::types::GetCardProgramsResponse = self + let crate::Response:: { + mut status, + mut headers, + body, + } = self .client .get( &url, @@ -74,8 +82,8 @@ impl CardPrograms { ) .await?; - let mut card_programs = resp.card_programs; - let mut page = resp.page.next.to_string(); + let mut card_programs = body.card_programs; + let mut page = body.page.next.to_string(); // Paginate if we should. while !page.is_empty() { @@ -91,10 +99,12 @@ impl CardPrograms { .await { Ok(mut resp) => { - card_programs.append(&mut resp.card_programs); + card_programs.append(&mut resp.body.card_programs); + status = resp.status; + headers = resp.headers; - page = if resp.page.next != page { - resp.page.next.to_string() + page = if body.page.next != page { + body.page.next.to_string() } else { "".to_string() }; @@ -110,7 +120,7 @@ impl CardPrograms { } // Return our response data. - Ok(card_programs) + Ok(crate::Response::new(status, headers, card_programs)) } /** * Create a card program. @@ -126,7 +136,7 @@ impl CardPrograms { pub async fn post_resources( &self, body: &crate::types::PostResourcesCardProgramRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/card-programs", None); self.client .post( @@ -149,7 +159,10 @@ impl CardPrograms { * * * `authorization: &str` -- The OAuth2 token header. */ - pub async fn get_program(&self, id: &str) -> ClientResult { + pub async fn get_program( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/card-programs/{}", diff --git a/ramp/src/cards.rs b/ramp/src/cards.rs index 767c612a..3c5b21ac 100644 --- a/ramp/src/cards.rs +++ b/ramp/src/cards.rs @@ -32,7 +32,7 @@ impl Cards { page_size: f64, user_id: &str, card_program_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !card_program_id.is_empty() { query_args.push(("card_program_id".to_string(), card_program_id.to_string())); @@ -48,7 +48,7 @@ impl Cards { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/cards?{}", query_), None); - let resp: crate::types::GetCardsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -60,7 +60,11 @@ impl Cards { .await?; // Return our response data. - Ok(resp.cards.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.cards.to_vec(), + )) } /** * List cards. @@ -75,7 +79,7 @@ impl Cards { &self, user_id: &str, card_program_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !card_program_id.is_empty() { query_args.push(("card_program_id".to_string(), card_program_id.to_string())); @@ -85,7 +89,11 @@ impl Cards { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/cards?{}", query_), None); - let resp: crate::types::GetCardsResponse = self + let crate::Response:: { + mut status, + mut headers, + body, + } = self .client .get( &url, @@ -96,8 +104,8 @@ impl Cards { ) .await?; - let mut cards = resp.cards; - let mut page = resp.page.next.to_string(); + let mut cards = body.cards; + let mut page = body.page.next.to_string(); // Paginate if we should. while !page.is_empty() { @@ -113,10 +121,12 @@ impl Cards { .await { Ok(mut resp) => { - cards.append(&mut resp.cards); + cards.append(&mut resp.body.cards); + status = resp.status; + headers = resp.headers; - page = if resp.page.next != page { - resp.page.next.to_string() + page = if body.page.next != page { + body.page.next.to_string() } else { "".to_string() }; @@ -132,7 +142,7 @@ impl Cards { } // Return our response data. - Ok(cards) + Ok(crate::Response::new(status, headers, cards)) } /** * GET a card. @@ -145,7 +155,7 @@ impl Cards { * * * `authorization: &str` -- The OAuth2 token header. */ - pub async fn get(&self, id: &str) -> ClientResult { + pub async fn get(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!("/cards/{}", crate::progenitor_support::encode_path(id),), None, @@ -175,7 +185,7 @@ impl Cards { &self, id: &str, body: &crate::types::PatchResourcesCardsCardRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!("/cards/{}", crate::progenitor_support::encode_path(id),), None, @@ -204,7 +214,7 @@ impl Cards { pub async fn post_resources_physical( &self, body: &crate::types::PostResourcesCardPhysicalRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/cards/deferred/physical", None); self.client .post( @@ -230,7 +240,7 @@ impl Cards { pub async fn post_resources_virtual( &self, body: &crate::types::PostResourcesCardVirtualRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/cards/deferred/virtual", None); self.client .post( @@ -253,7 +263,7 @@ impl Cards { &self, id: &str, body: &crate::types::PostResourcesCardsCardSuspensionRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/cards/{}/deferred/termination", @@ -282,7 +292,7 @@ impl Cards { &self, id: &str, body: &crate::types::PostResourcesCardsCardSuspensionRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/cards/{}/deferred/suspension", @@ -311,7 +321,7 @@ impl Cards { &self, id: &str, body: &crate::types::PostResourcesCardsCardSuspensionRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/cards/{}/deferred/unsuspension", @@ -343,7 +353,7 @@ impl Cards { pub async fn get_resources_deferred( &self, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/cards/deferred/status/{}", diff --git a/ramp/src/custom_ids.rs b/ramp/src/custom_ids.rs index bbddbe0a..61e1e9d4 100644 --- a/ramp/src/custom_ids.rs +++ b/ramp/src/custom_ids.rs @@ -22,7 +22,7 @@ impl CustomIds { */ pub async fn get_custom_provider( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/custom-id-provider", None); self.client .get( @@ -47,7 +47,7 @@ impl CustomIds { */ pub async fn postcustom_provider( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/custom-id-provider", None); self.client .post( @@ -69,7 +69,7 @@ impl CustomIds { pub async fn post_custom_provider_application_link( &self, body: &crate::types::GetCustomProviderResponse, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/custom-id-provider/application-link", None); @@ -98,7 +98,7 @@ impl CustomIds { &self, entity_type: &str, custom_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/custom-id-provider/{}/{}/ramp-id", @@ -130,7 +130,7 @@ impl CustomIds { &self, entity_type: &str, ramp_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/custom-id-provider/{}/{}/custom-id", @@ -160,7 +160,7 @@ impl CustomIds { &self, entity_type: &str, body: &crate::types::PostCustomProviderEntityTypeLinkRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/custom-id-provider/{}/custom-id-link", diff --git a/ramp/src/departments.rs b/ramp/src/departments.rs index 2e60ceb3..e9903ab8 100644 --- a/ramp/src/departments.rs +++ b/ramp/src/departments.rs @@ -28,7 +28,7 @@ impl Departments { &self, start: &str, page_size: f64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !page_size.to_string().is_empty() { query_args.push(("page_size".to_string(), page_size.to_string())); @@ -38,7 +38,7 @@ impl Departments { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/departments?{}", query_), None); - let resp: crate::types::GetDepartmentsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -50,7 +50,11 @@ impl Departments { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * List departments. @@ -61,9 +65,13 @@ impl Departments { * * Retrieve all departments. */ - pub async fn get_all(&self) -> ClientResult> { + pub async fn get_all(&self) -> ClientResult>> { let url = self.client.url("/departments", None); - let resp: crate::types::GetDepartmentsResponse = self + let crate::Response:: { + mut status, + mut headers, + body, + } = self .client .get( &url, @@ -74,8 +82,8 @@ impl Departments { ) .await?; - let mut data = resp.data; - let mut page = resp.page.next.to_string(); + let mut data = body.data; + let mut page = body.page.next.to_string(); // Paginate if we should. while !page.is_empty() { @@ -91,10 +99,12 @@ impl Departments { .await { Ok(mut resp) => { - data.append(&mut resp.data); + data.append(&mut resp.body.data); + status = resp.status; + headers = resp.headers; - page = if resp.page.next != page { - resp.page.next.to_string() + page = if body.page.next != page { + body.page.next.to_string() } else { "".to_string() }; @@ -110,7 +120,7 @@ impl Departments { } // Return our response data. - Ok(data) + Ok(crate::Response::new(status, headers, data)) } /** * Create department. @@ -122,7 +132,7 @@ impl Departments { pub async fn post( &self, body: &crate::types::PostLocationRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/departments", None); self.client .post( @@ -145,7 +155,7 @@ impl Departments { * * * `authorization: &str` -- The OAuth2 token header. */ - pub async fn get(&self, id: &str) -> ClientResult { + pub async fn get(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!( "/departments/{}", @@ -174,7 +184,7 @@ impl Departments { &self, id: &str, body: &crate::types::PostLocationRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/departments/{}", diff --git a/ramp/src/lib.rs b/ramp/src/lib.rs index 392d9cf7..5cab8006 100644 --- a/ramp/src/lib.rs +++ b/ramp/src/lib.rs @@ -114,9 +114,27 @@ pub mod users; #[doc(hidden)] pub mod utils; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -619,13 +637,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -638,7 +657,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -661,13 +680,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -688,7 +708,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -707,7 +727,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -732,6 +756,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -748,7 +773,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -773,7 +798,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -796,6 +821,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -812,7 +838,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -838,7 +864,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -881,6 +907,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -893,7 +920,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -916,7 +943,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -925,7 +952,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -933,7 +960,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -943,32 +970,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -980,7 +1011,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -989,7 +1020,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -997,7 +1028,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1005,7 +1036,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1013,7 +1044,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/ramp/src/locations.rs b/ramp/src/locations.rs index 83ebbdf6..990cbb8c 100644 --- a/ramp/src/locations.rs +++ b/ramp/src/locations.rs @@ -28,7 +28,7 @@ impl Locations { &self, start: &str, page_size: f64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !page_size.to_string().is_empty() { query_args.push(("page_size".to_string(), page_size.to_string())); @@ -38,7 +38,7 @@ impl Locations { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/locations?{}", query_), None); - let resp: crate::types::GetLocationResponse = self + let resp: crate::Response = self .client .get( &url, @@ -50,7 +50,11 @@ impl Locations { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * List locations. @@ -61,9 +65,13 @@ impl Locations { * * Retrieves all locations for your business. */ - pub async fn get_all(&self) -> ClientResult> { + pub async fn get_all(&self) -> ClientResult>> { let url = self.client.url("/locations", None); - let resp: crate::types::GetLocationResponse = self + let crate::Response:: { + mut status, + mut headers, + body, + } = self .client .get( &url, @@ -74,8 +82,8 @@ impl Locations { ) .await?; - let mut data = resp.data; - let mut page = resp.page.next.to_string(); + let mut data = body.data; + let mut page = body.page.next.to_string(); // Paginate if we should. while !page.is_empty() { @@ -91,10 +99,12 @@ impl Locations { .await { Ok(mut resp) => { - data.append(&mut resp.data); + data.append(&mut resp.body.data); + status = resp.status; + headers = resp.headers; - page = if resp.page.next != page { - resp.page.next.to_string() + page = if body.page.next != page { + body.page.next.to_string() } else { "".to_string() }; @@ -110,7 +120,7 @@ impl Locations { } // Return our response data. - Ok(data) + Ok(crate::Response::new(status, headers, data)) } /** * Create new location. @@ -126,7 +136,7 @@ impl Locations { pub async fn post( &self, body: &crate::types::PostLocationRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/locations", None); self.client .post( @@ -149,7 +159,7 @@ impl Locations { * * * `authorization: &str` -- The OAuth2 token header. */ - pub async fn get(&self, id: &str) -> ClientResult { + pub async fn get(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!("/locations/{}", crate::progenitor_support::encode_path(id),), None, @@ -175,7 +185,7 @@ impl Locations { &self, id: &str, body: &crate::types::PostLocationRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!("/locations/{}", crate::progenitor_support::encode_path(id),), None, diff --git a/ramp/src/receipts.rs b/ramp/src/receipts.rs index 3000aa81..f91e18d2 100644 --- a/ramp/src/receipts.rs +++ b/ramp/src/receipts.rs @@ -35,7 +35,7 @@ impl Receipts { created_before: Option>, start: &str, page_size: f64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if let Some(date) = created_after { query_args.push(("created_after".to_string(), date.to_rfc3339())); @@ -57,7 +57,7 @@ impl Receipts { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/receipts?{}", query_), None); - let resp: crate::types::GetReceiptsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -69,7 +69,11 @@ impl Receipts { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * List receipts. @@ -86,7 +90,7 @@ impl Receipts { to_date: Option>, created_after: Option>, created_before: Option>, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if let Some(date) = created_after { query_args.push(("created_after".to_string(), date.to_rfc3339())); @@ -102,7 +106,11 @@ impl Receipts { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/receipts?{}", query_), None); - let resp: crate::types::GetReceiptsResponse = self + let crate::Response:: { + mut status, + mut headers, + body, + } = self .client .get( &url, @@ -113,8 +121,8 @@ impl Receipts { ) .await?; - let mut data = resp.data; - let mut page = resp.page.next.to_string(); + let mut data = body.data; + let mut page = body.page.next.to_string(); // Paginate if we should. while !page.is_empty() { @@ -130,10 +138,12 @@ impl Receipts { .await { Ok(mut resp) => { - data.append(&mut resp.data); + data.append(&mut resp.body.data); + status = resp.status; + headers = resp.headers; - page = if resp.page.next != page { - resp.page.next.to_string() + page = if body.page.next != page { + body.page.next.to_string() } else { "".to_string() }; @@ -149,7 +159,7 @@ impl Receipts { } // Return our response data. - Ok(data) + Ok(crate::Response::new(status, headers, data)) } /** * Get details for one receipt. @@ -158,7 +168,7 @@ impl Receipts { * * */ - pub async fn get(&self, id: &str) -> ClientResult { + pub async fn get(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!("/receipts/{}", crate::progenitor_support::encode_path(id),), None, diff --git a/ramp/src/reimbursements.rs b/ramp/src/reimbursements.rs index 6dd0592e..cba6fe3c 100644 --- a/ramp/src/reimbursements.rs +++ b/ramp/src/reimbursements.rs @@ -25,7 +25,7 @@ impl Reimbursements { &self, start: &str, page_size: f64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !page_size.to_string().is_empty() { query_args.push(("page_size".to_string(), page_size.to_string())); @@ -37,7 +37,7 @@ impl Reimbursements { let url = self .client .url(&format!("/reimbursements?{}", query_), None); - let resp: crate::types::GetReimbursementsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -49,7 +49,11 @@ impl Reimbursements { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * List Reimbursements. @@ -58,9 +62,13 @@ impl Reimbursements { * * As opposed to `get`, this function returns all the pages of the request at once. */ - pub async fn get_all(&self) -> ClientResult> { + pub async fn get_all(&self) -> ClientResult>> { let url = self.client.url("/reimbursements", None); - let resp: crate::types::GetReimbursementsResponse = self + let crate::Response:: { + mut status, + mut headers, + body, + } = self .client .get( &url, @@ -71,8 +79,8 @@ impl Reimbursements { ) .await?; - let mut data = resp.data; - let mut page = resp.page.next.to_string(); + let mut data = body.data; + let mut page = body.page.next.to_string(); // Paginate if we should. while !page.is_empty() { @@ -88,10 +96,12 @@ impl Reimbursements { .await { Ok(mut resp) => { - data.append(&mut resp.data); + data.append(&mut resp.body.data); + status = resp.status; + headers = resp.headers; - page = if resp.page.next != page { - resp.page.next.to_string() + page = if body.page.next != page { + body.page.next.to_string() } else { "".to_string() }; @@ -107,14 +117,17 @@ impl Reimbursements { } // Return our response data. - Ok(data) + Ok(crate::Response::new(status, headers, data)) } /** * Get details for one reimbursement. * * This function performs a `GET` to the `/reimbursements/{id}` endpoint. */ - pub async fn get(&self, id: &str) -> ClientResult { + pub async fn get( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/reimbursements/{}", diff --git a/ramp/src/transactions.rs b/ramp/src/transactions.rs index 77bf166d..e45a7948 100644 --- a/ramp/src/transactions.rs +++ b/ramp/src/transactions.rs @@ -56,7 +56,7 @@ impl Transactions { start: &str, page_size: f64, requires_memo: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !department_id.is_empty() { query_args.push(("department_id".to_string(), department_id.to_string())); @@ -120,7 +120,7 @@ impl Transactions { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/transactions?{}", query_), None); - let resp: crate::types::GetTransactionResponse = self + let resp: crate::Response = self .client .get( &url, @@ -132,7 +132,11 @@ impl Transactions { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * List transactions. @@ -159,7 +163,7 @@ impl Transactions { min_amount: f64, max_amount: f64, requires_memo: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !department_id.is_empty() { query_args.push(("department_id".to_string(), department_id.to_string())); @@ -217,7 +221,11 @@ impl Transactions { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/transactions?{}", query_), None); - let resp: crate::types::GetTransactionResponse = self + let crate::Response:: { + mut status, + mut headers, + body, + } = self .client .get( &url, @@ -228,8 +236,8 @@ impl Transactions { ) .await?; - let mut data = resp.data; - let mut page = resp.page.next.to_string(); + let mut data = body.data; + let mut page = body.page.next.to_string(); // Paginate if we should. while !page.is_empty() { @@ -245,10 +253,12 @@ impl Transactions { .await { Ok(mut resp) => { - data.append(&mut resp.data); + data.append(&mut resp.body.data); + status = resp.status; + headers = resp.headers; - page = if resp.page.next != page { - resp.page.next.to_string() + page = if body.page.next != page { + body.page.next.to_string() } else { "".to_string() }; @@ -264,7 +274,7 @@ impl Transactions { } // Return our response data. - Ok(data) + Ok(crate::Response::new(status, headers, data)) } /** * GET a transaction. @@ -277,7 +287,10 @@ impl Transactions { * * * `authorization: &str` -- The OAuth2 token header. */ - pub async fn get_resource(&self, id: &str) -> ClientResult { + pub async fn get_resource( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/transactions/{}", diff --git a/ramp/src/users.rs b/ramp/src/users.rs index 31aa5422..384ddf51 100644 --- a/ramp/src/users.rs +++ b/ramp/src/users.rs @@ -22,7 +22,7 @@ impl Users { * * * `authorization: &str` -- The OAuth2 token header. */ - pub async fn get(&self, id: &str) -> ClientResult { + pub async fn get(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!("/users/{}", crate::progenitor_support::encode_path(id),), None, @@ -44,7 +44,7 @@ impl Users { * * Suspends a user. Does not delete the user's cards. Currently this action is not reversible. */ - pub async fn delete(&self, id: &str) -> ClientResult<()> { + pub async fn delete(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!("/users/{}", crate::progenitor_support::encode_path(id),), None, @@ -70,7 +70,7 @@ impl Users { &self, id: &str, body: &crate::types::PatchUsersRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!("/users/{}", crate::progenitor_support::encode_path(id),), None, @@ -106,7 +106,7 @@ impl Users { page_size: f64, department_id: &str, location_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !department_id.is_empty() { query_args.push(("department_id".to_string(), department_id.to_string())); @@ -122,7 +122,7 @@ impl Users { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/users?{}", query_), None); - let resp: crate::types::GetUsersResponse = self + let resp: crate::Response = self .client .get( &url, @@ -134,7 +134,11 @@ impl Users { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * List users. @@ -149,7 +153,7 @@ impl Users { &self, department_id: &str, location_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !department_id.is_empty() { query_args.push(("department_id".to_string(), department_id.to_string())); @@ -159,7 +163,11 @@ impl Users { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/users?{}", query_), None); - let resp: crate::types::GetUsersResponse = self + let crate::Response:: { + mut status, + mut headers, + body, + } = self .client .get( &url, @@ -170,8 +178,8 @@ impl Users { ) .await?; - let mut data = resp.data; - let mut page = resp.page.next.to_string(); + let mut data = body.data; + let mut page = body.page.next.to_string(); // Paginate if we should. while !page.is_empty() { @@ -187,10 +195,12 @@ impl Users { .await { Ok(mut resp) => { - data.append(&mut resp.data); + data.append(&mut resp.body.data); + status = resp.status; + headers = resp.headers; - page = if resp.page.next != page { - resp.page.next.to_string() + page = if body.page.next != page { + body.page.next.to_string() } else { "".to_string() }; @@ -206,7 +216,7 @@ impl Users { } // Return our response data. - Ok(data) + Ok(crate::Response::new(status, headers, data)) } /** * Invite a new user. @@ -218,7 +228,7 @@ impl Users { pub async fn post_deferred( &self, body: &crate::types::PostUsersDeferredRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/users/deferred", None); self.client .post( @@ -240,7 +250,7 @@ impl Users { pub async fn get_deferred_status( &self, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/deferred/status/{}", diff --git a/rev.ai/src/account.rs b/rev.ai/src/account.rs index df72ec06..2197d130 100644 --- a/rev.ai/src/account.rs +++ b/rev.ai/src/account.rs @@ -18,7 +18,7 @@ impl Account { * * Get the developer's account information */ - pub async fn get(&self) -> ClientResult { + pub async fn get(&self) -> ClientResult> { let url = self.client.url("/account", None); self.client .get( diff --git a/rev.ai/src/captions.rs b/rev.ai/src/captions.rs index 9f825dac..f3d208a9 100644 --- a/rev.ai/src/captions.rs +++ b/rev.ai/src/captions.rs @@ -32,7 +32,7 @@ impl Captions { id: &str, accept: crate::types::Accept, speaker_channel: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if speaker_channel > 0 { query_args.push(("speaker_channel".to_string(), speaker_channel.to_string())); diff --git a/rev.ai/src/jobs.rs b/rev.ai/src/jobs.rs index 236f27b1..4aa0cb59 100644 --- a/rev.ai/src/jobs.rs +++ b/rev.ai/src/jobs.rs @@ -27,7 +27,7 @@ impl Jobs { &self, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); @@ -59,7 +59,7 @@ impl Jobs { pub async fn get_all_list_all_of( &self, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !starting_after.is_empty() { query_args.push(("starting_after".to_string(), starting_after.to_string())); @@ -86,7 +86,7 @@ impl Jobs { pub async fn submit_transcription( &self, body: &crate::types::SubmitJobMediaUrlOptionsAllOf, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/jobs", None); self.client .post( @@ -105,7 +105,7 @@ impl Jobs { * * Returns information about a transcription job */ - pub async fn get(&self, id: &str) -> ClientResult { + pub async fn get(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!("/jobs/{}", crate::progenitor_support::encode_path(id),), None, @@ -127,7 +127,7 @@ impl Jobs { * * Deletes a transcription job. All data related to the job, such as input media and transcript, will be permanently deleted. A job can only be deleted once it's completed (either with success or failure). */ - pub async fn delete(&self, id: &str) -> ClientResult<()> { + pub async fn delete(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!("/jobs/{}", crate::progenitor_support::encode_path(id),), None, diff --git a/rev.ai/src/lib.rs b/rev.ai/src/lib.rs index a7c4947d..37fc0393 100644 --- a/rev.ai/src/lib.rs +++ b/rev.ai/src/lib.rs @@ -269,9 +269,27 @@ pub mod types; #[doc(hidden)] pub mod utils; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -475,13 +493,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -494,7 +513,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -517,13 +536,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -544,7 +564,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -563,7 +583,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -588,6 +612,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -604,7 +629,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -629,7 +654,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -652,6 +677,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -668,7 +694,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -694,7 +720,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -737,6 +763,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -749,7 +776,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -772,7 +799,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -781,7 +808,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -789,7 +816,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -799,32 +826,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -836,7 +867,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -845,7 +876,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -853,7 +884,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -861,7 +892,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -869,7 +900,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/rev.ai/src/traits.rs b/rev.ai/src/traits.rs index e9db6d68..3a6ea312 100644 --- a/rev.ai/src/traits.rs +++ b/rev.ai/src/traits.rs @@ -1,17 +1,17 @@ -use crate::ClientResult; +use crate::{ClientResult, Response}; #[async_trait::async_trait] pub trait JobOps { /// Send a plain text email. /// /// This is a nicer experience than using `post`. - async fn post(&self, b: bytes::Bytes) -> ClientResult; + async fn post(&self, b: bytes::Bytes) -> ClientResult>; } #[async_trait::async_trait] impl JobOps for crate::jobs::Jobs { /// Create a job. - async fn post(&self, b: bytes::Bytes) -> ClientResult { + async fn post(&self, b: bytes::Bytes) -> ClientResult> { let form = reqwest::multipart::Form::new() .part( "media", diff --git a/rev.ai/src/transcript.rs b/rev.ai/src/transcript.rs index 15e65b76..1da16011 100644 --- a/rev.ai/src/transcript.rs +++ b/rev.ai/src/transcript.rs @@ -29,7 +29,7 @@ impl Transcript { &self, id: &str, accept: crate::types::AcceptTranscript, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/jobs/{}/transcript", diff --git a/sendgrid/src/alerts.rs b/sendgrid/src/alerts.rs index b5185bdd..3666c5ff 100644 --- a/sendgrid/src/alerts.rs +++ b/sendgrid/src/alerts.rs @@ -29,7 +29,9 @@ impl Alerts { * * `authorization: &str` -- The license key provided with your New Relic account. * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get_page(&self) -> ClientResult> { + pub async fn get_page( + &self, + ) -> ClientResult>> { let url = self.client.url("/alerts", None); self.client .get( @@ -56,7 +58,9 @@ impl Alerts { * * For more information about alerts, please see our [Alerts documentation](https://sendgrid.com/docs/ui/account-and-settings/alerts/). */ - pub async fn get_all(&self) -> ClientResult> { + pub async fn get_all( + &self, + ) -> ClientResult>> { let url = self.client.url("/alerts", None); self.client .get_all_pages( @@ -90,7 +94,7 @@ impl Alerts { pub async fn post( &self, body: &crate::types::PostAlertsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/alerts", None); self.client .post( @@ -120,7 +124,10 @@ impl Alerts { * * `authorization: &str` -- The license key provided with your New Relic account. * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get(&self, alert_id: i64) -> ClientResult { + pub async fn get( + &self, + alert_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/alerts/{}", @@ -155,7 +162,7 @@ impl Alerts { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn delete(&self, alert_id: i64) -> ClientResult { + pub async fn delete(&self, alert_id: i64) -> ClientResult> { let url = self.client.url( &format!( "/alerts/{}", @@ -194,7 +201,7 @@ impl Alerts { &self, alert_id: i64, body: &crate::types::PatchAlertsAlertRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/alerts/{}", diff --git a/sendgrid/src/api_key_permissions.rs b/sendgrid/src/api_key_permissions.rs index 4da04aea..b9e4e33b 100644 --- a/sendgrid/src/api_key_permissions.rs +++ b/sendgrid/src/api_key_permissions.rs @@ -30,7 +30,9 @@ impl ApiKeyPermissions { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get_scopes(&self) -> ClientResult { + pub async fn get_scopes( + &self, + ) -> ClientResult> { let url = self.client.url("/scopes", None); self.client .get( diff --git a/sendgrid/src/api_keys.rs b/sendgrid/src/api_keys.rs index 6c6ab071..a1b1e4dd 100644 --- a/sendgrid/src/api_keys.rs +++ b/sendgrid/src/api_keys.rs @@ -29,7 +29,10 @@ impl ApiKeys { * * `limit: i64` * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get(&self, limit: i64) -> ClientResult { + pub async fn get( + &self, + limit: i64, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); @@ -72,7 +75,7 @@ impl ApiKeys { pub async fn create( &self, body: &crate::types::CreateApiKeysRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/api_keys", None); self.client .post( @@ -102,7 +105,7 @@ impl ApiKeys { pub async fn get_key( &self, api_key_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api_keys/{}", @@ -141,7 +144,7 @@ impl ApiKeys { &self, api_key_id: &str, body: &crate::types::PutApiKeysKeyRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api_keys/{}", @@ -172,7 +175,7 @@ impl ApiKeys { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn delete_key(&self, api_key_id: &str) -> ClientResult<()> { + pub async fn delete_key(&self, api_key_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/api_keys/{}", @@ -207,7 +210,7 @@ impl ApiKeys { &self, api_key_id: &str, body: &crate::types::IpPool, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/api_keys/{}", diff --git a/sendgrid/src/blocks_api.rs b/sendgrid/src/blocks_api.rs index dcbd4929..9fff7335 100644 --- a/sendgrid/src/blocks_api.rs +++ b/sendgrid/src/blocks_api.rs @@ -32,7 +32,7 @@ impl BlocksApi { end_time: i64, limit: i64, offset: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if end_time > 0 { query_args.push(("end_time".to_string(), end_time.to_string())); @@ -74,7 +74,7 @@ impl BlocksApi { start_time: i64, end_time: i64, offset: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if end_time > 0 { query_args.push(("end_time".to_string(), end_time.to_string())); @@ -118,7 +118,7 @@ impl BlocksApi { pub async fn delete_suppression_blocks( &self, body: &crate::types::DeleteSuppressionBlocksRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/suppression/blocks", None); self.client .delete( @@ -144,7 +144,7 @@ impl BlocksApi { pub async fn get_suppression_blocks_email( &self, email: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/suppression/blocks/{}", @@ -174,7 +174,7 @@ impl BlocksApi { pub async fn get_all_suppression_blocks_email( &self, email: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/suppression/blocks/{}", @@ -206,7 +206,7 @@ impl BlocksApi { pub async fn delete_suppression_blocks_email( &self, email: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/suppression/blocks/{}", diff --git a/sendgrid/src/bounces_api.rs b/sendgrid/src/bounces_api.rs index 54d5b113..868faeba 100644 --- a/sendgrid/src/bounces_api.rs +++ b/sendgrid/src/bounces_api.rs @@ -29,7 +29,7 @@ impl BouncesApi { &self, start_time: i64, end_time: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if end_time > 0 { query_args.push(("end_time".to_string(), end_time.to_string())); @@ -64,7 +64,7 @@ impl BouncesApi { &self, start_time: i64, end_time: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if end_time > 0 { query_args.push(("end_time".to_string(), end_time.to_string())); @@ -105,7 +105,7 @@ impl BouncesApi { pub async fn delete_suppression_bounces( &self, body: &crate::types::DeleteSuppressionBouncesRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/suppression/bounces", None); self.client .delete( @@ -131,7 +131,7 @@ impl BouncesApi { pub async fn get_suppression_bounces_email( &self, email: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/suppression/bounces/{}", @@ -161,7 +161,7 @@ impl BouncesApi { pub async fn get_all_suppression_bounces_email( &self, email: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/suppression/bounces/{}", @@ -196,7 +196,7 @@ impl BouncesApi { email: &str, email_address: &str, body: &serde_json::Value, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !email_address.is_empty() { query_args.push(("email_address".to_string(), email_address.to_string())); diff --git a/sendgrid/src/campaigns_api.rs b/sendgrid/src/campaigns_api.rs index 3417eef4..7da52e95 100644 --- a/sendgrid/src/campaigns_api.rs +++ b/sendgrid/src/campaigns_api.rs @@ -32,7 +32,7 @@ impl CampaignsApi { &self, limit: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); @@ -68,7 +68,7 @@ impl CampaignsApi { pub async fn post_campaign( &self, body: &crate::types::CampaignsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/campaigns", None); self.client .post( @@ -94,7 +94,7 @@ impl CampaignsApi { pub async fn get_campaigns_campaign( &self, campaign_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}", @@ -123,7 +123,10 @@ impl CampaignsApi { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn delete_campaigns_campaign(&self, campaign_id: i64) -> ClientResult<()> { + pub async fn delete_campaigns_campaign( + &self, + campaign_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}", @@ -158,7 +161,7 @@ impl CampaignsApi { &self, campaign_id: i64, body: &crate::types::UpdateACampaignRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}", @@ -192,7 +195,7 @@ impl CampaignsApi { pub async fn post_campaigns_campaign_schedules_now( &self, campaign_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/schedules/now", @@ -224,7 +227,7 @@ impl CampaignsApi { pub async fn get_campaigns_campaign_schedule( &self, campaign_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/schedules", @@ -259,7 +262,7 @@ impl CampaignsApi { &self, campaign_id: i64, body: &crate::types::ScheduleACampaignRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/schedules", @@ -291,7 +294,10 @@ impl CampaignsApi { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn delete_campaigns_campaign_schedules(&self, campaign_id: i64) -> ClientResult<()> { + pub async fn delete_campaigns_campaign_schedules( + &self, + campaign_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/schedules", @@ -324,7 +330,7 @@ impl CampaignsApi { &self, campaign_id: i64, body: &crate::types::ScheduleACampaignRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/schedules", @@ -359,7 +365,7 @@ impl CampaignsApi { &self, campaign_id: i64, body: &crate::types::SendATestCampaignRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/campaigns/{}/schedules/test", diff --git a/sendgrid/src/cancel_scheduled_sends.rs b/sendgrid/src/cancel_scheduled_sends.rs index 492bd7ed..f1f641b7 100644 --- a/sendgrid/src/cancel_scheduled_sends.rs +++ b/sendgrid/src/cancel_scheduled_sends.rs @@ -26,7 +26,9 @@ impl CancelScheduledSends { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn post_mail_batch(&self) -> ClientResult { + pub async fn post_mail_batch( + &self, + ) -> ClientResult> { let url = self.client.url("/mail/batch", None); self.client .post( @@ -53,7 +55,7 @@ impl CancelScheduledSends { */ pub async fn get_user_scheduled_sends( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/scheduled_sends", None); self.client .get( @@ -78,7 +80,7 @@ impl CancelScheduledSends { */ pub async fn get_all_user_scheduled_sends( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/user/scheduled_sends", None); self.client .get_all_pages( @@ -110,7 +112,7 @@ impl CancelScheduledSends { pub async fn post_user_scheduled_send( &self, body: &crate::types::CancelPauseAScheduledSendRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user/scheduled_sends", None); self.client .post( @@ -139,7 +141,10 @@ impl CancelScheduledSends { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get_mail_batch(&self, batch_id: &str) -> ClientResult { + pub async fn get_mail_batch( + &self, + batch_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/mail/batch/{}", @@ -171,7 +176,7 @@ impl CancelScheduledSends { pub async fn get_user_scheduled_sends_batch( &self, batch_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/user/scheduled_sends/{}", @@ -201,7 +206,7 @@ impl CancelScheduledSends { pub async fn get_all_user_scheduled_sends_batch( &self, batch_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/user/scheduled_sends/{}", @@ -232,7 +237,10 @@ impl CancelScheduledSends { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn delete_user_scheduled_sends_batch(&self, batch_id: &str) -> ClientResult<()> { + pub async fn delete_user_scheduled_sends_batch( + &self, + batch_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/user/scheduled_sends/{}", @@ -267,7 +275,7 @@ impl CancelScheduledSends { &self, batch_id: &str, body: &crate::types::UserScheduledSendStatus, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/scheduled_sends/{}", diff --git a/sendgrid/src/categories.rs b/sendgrid/src/categories.rs index 1125633a..2e9f84de 100644 --- a/sendgrid/src/categories.rs +++ b/sendgrid/src/categories.rs @@ -30,7 +30,7 @@ impl Categories { limit: i64, category: &str, offset: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !category.is_empty() { query_args.push(("category".to_string(), category.to_string())); @@ -66,7 +66,7 @@ impl Categories { &self, category: &str, offset: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !category.is_empty() { query_args.push(("category".to_string(), category.to_string())); @@ -115,7 +115,7 @@ impl Categories { limit: i64, offset: i64, aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -182,7 +182,7 @@ impl Categories { limit: i64, offset: i64, aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -234,7 +234,7 @@ impl Categories { categories: &str, offset: i64, aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); diff --git a/sendgrid/src/certificates.rs b/sendgrid/src/certificates.rs index 1964afc6..2b1778a4 100644 --- a/sendgrid/src/certificates.rs +++ b/sendgrid/src/certificates.rs @@ -21,7 +21,7 @@ impl Certificates { pub async fn post_sso( &self, body: &crate::types::PostSsoCertificatesRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/sso/certificates", None); self.client .post( @@ -45,7 +45,7 @@ impl Certificates { pub async fn get_sso_integrations_integration( &self, integration_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/sso/integrations/{}/certificates", @@ -77,7 +77,7 @@ impl Certificates { pub async fn get_all_sso_integrations_integration( &self, integration_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/sso/integrations/{}/certificates", @@ -105,7 +105,7 @@ impl Certificates { pub async fn get_sso_cert( &self, cert_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/sso/certificates/{}", @@ -135,7 +135,7 @@ impl Certificates { pub async fn delete_sso_cert( &self, cert_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/sso/certificates/{}", @@ -166,7 +166,7 @@ impl Certificates { &self, cert_id: &str, body: &crate::types::PatchSsoCertificatesCertRequest, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/sso/certificates/{}", diff --git a/sendgrid/src/contacts.rs b/sendgrid/src/contacts.rs index 8104fbd2..191de3e7 100644 --- a/sendgrid/src/contacts.rs +++ b/sendgrid/src/contacts.rs @@ -24,7 +24,9 @@ impl Contacts { * * Please note that pagination of the contacts has been deprecated. */ - pub async fn get_mc_contats(&self) -> ClientResult { + pub async fn get_mc_contats( + &self, + ) -> ClientResult> { let url = self.client.url("/marketing/contacts", None); self.client .get( @@ -56,7 +58,7 @@ impl Contacts { pub async fn put_mc( &self, body: &crate::types::PutMcContactsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/marketing/contacts", None); self.client .put( @@ -92,7 +94,7 @@ impl Contacts { &self, delete_all_contacts: &str, ids: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !delete_all_contacts.is_empty() { query_args.push(( @@ -124,7 +126,9 @@ impl Contacts { * * **This endpoint returns the total number of contacts you have stored.** */ - pub async fn get_mc_count(&self) -> ClientResult { + pub async fn get_mc_count( + &self, + ) -> ClientResult> { let url = self.client.url("/marketing/contacts/count", None); self.client .get( @@ -151,7 +155,7 @@ impl Contacts { */ pub async fn get_marketing_exports( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/marketing/contacts/exports", None); self.client .get( @@ -183,7 +187,7 @@ impl Contacts { pub async fn post_mc_export( &self, body: &crate::types::PostMcContactsExportsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/marketing/contacts/exports", None); self.client .post( @@ -204,7 +208,10 @@ impl Contacts { * * The "Get Contacts by Emails" endpoint can be used to get the ID of a contact. */ - pub async fn get_mc(&self, id: &str) -> ClientResult { + pub async fn get_mc( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/marketing/contacts/{}", @@ -242,7 +249,7 @@ impl Contacts { pub async fn post_mc_search( &self, body: &crate::types::PostMcContactsSearchRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/marketing/contacts/search", None); self.client .post( @@ -280,7 +287,7 @@ impl Contacts { pub async fn put_mc_imports( &self, body: &crate::types::PutMcContactsImportsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/marketing/contacts/imports", None); self.client .put( @@ -312,7 +319,7 @@ impl Contacts { pub async fn get_marketing_import( &self, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/marketing/contacts/imports/{}", @@ -341,7 +348,10 @@ impl Contacts { * * If you would like to download a list, take the `id` that is returned from the "Export Contacts" endpoint and make an API request here to get the `urls`. Once you have the list of URLs, make a `GET` request on each URL to download your CSV file(s). */ - pub async fn get_mc_export(&self, id: &str) -> ClientResult { + pub async fn get_mc_export( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/marketing/contacts/exports/{}", @@ -373,7 +383,7 @@ impl Contacts { pub async fn post_marketing_batch( &self, body: &crate::types::PostMarketingContactsBatchRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/marketing/contacts/batch", None); self.client .post( @@ -409,7 +419,8 @@ impl Contacts { pub async fn post_marketing_search_email( &self, body: &crate::types::PostMarketingContactsSearchEmailsRequest, - ) -> ClientResult { + ) -> ClientResult> + { let url = self.client.url("/marketing/contacts/search/emails", None); self.client .post( diff --git a/sendgrid/src/contacts_api_custom_fields.rs b/sendgrid/src/contacts_api_custom_fields.rs index ab8fac7d..bb4b0920 100644 --- a/sendgrid/src/contacts_api_custom_fields.rs +++ b/sendgrid/src/contacts_api_custom_fields.rs @@ -24,7 +24,7 @@ impl ContactsApiCustomFields { */ pub async fn get_contactdb_custom_fields( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/contactdb/custom_fields", None); self.client .get( @@ -52,7 +52,7 @@ impl ContactsApiCustomFields { pub async fn post_contactdb_custom_field( &self, body: &crate::types::PostContactdbCustomFieldsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/contactdb/custom_fields", None); self.client .post( @@ -78,7 +78,7 @@ impl ContactsApiCustomFields { pub async fn get_contactdb_custom_fields_field( &self, custom_field_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/contactdb/custom_fields/{}", @@ -110,7 +110,7 @@ impl ContactsApiCustomFields { pub async fn delete_contactdb_custom_fields_field( &self, custom_field_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/contactdb/custom_fields/{}", @@ -141,7 +141,7 @@ impl ContactsApiCustomFields { */ pub async fn get_contactdb_reserved_fields( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/contactdb/reserved_fields", None); self.client .get( diff --git a/sendgrid/src/contacts_api_lists.rs b/sendgrid/src/contacts_api_lists.rs index 5b91b467..c64b86f0 100644 --- a/sendgrid/src/contacts_api_lists.rs +++ b/sendgrid/src/contacts_api_lists.rs @@ -22,7 +22,9 @@ impl ContactsApiLists { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get_contactdb_lists(&self) -> ClientResult { + pub async fn get_contactdb_lists( + &self, + ) -> ClientResult> { let url = self.client.url("/contactdb/lists", None); self.client .get( @@ -48,7 +50,7 @@ impl ContactsApiLists { pub async fn post_contactdb_list( &self, body: &crate::types::IpPool, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/contactdb/lists", None); self.client .post( @@ -71,7 +73,7 @@ impl ContactsApiLists { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn delete_contactdb_lists(&self, body: &[i64]) -> ClientResult<()> { + pub async fn delete_contactdb_lists(&self, body: &[i64]) -> ClientResult> { let url = self.client.url("/contactdb/lists", None); self.client .delete( @@ -98,7 +100,7 @@ impl ContactsApiLists { pub async fn get_contactdb_lists_list( &self, list_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/contactdb/lists/{}", @@ -133,7 +135,7 @@ impl ContactsApiLists { list_id: &str, delete_contacts: bool, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if delete_contacts { query_args.push(("delete_contacts".to_string(), delete_contacts.to_string())); @@ -173,7 +175,7 @@ impl ContactsApiLists { &self, list_id: &str, body: &crate::types::IpPool, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/contactdb/lists/{}", @@ -210,7 +212,7 @@ impl ContactsApiLists { list_id: i64, page: i64, page_size: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -254,7 +256,7 @@ impl ContactsApiLists { &self, list_id: i64, body: &[i64], - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/contactdb/lists/{}/recipients", @@ -287,7 +289,7 @@ impl ContactsApiLists { &self, list_id: i64, recipient_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/contactdb/lists/{}/recipients/{}", @@ -324,7 +326,7 @@ impl ContactsApiLists { list_id: i64, recipient_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/contactdb/lists/{}/recipients/{}", diff --git a/sendgrid/src/contacts_api_recipients.rs b/sendgrid/src/contacts_api_recipients.rs index aa3f7765..a8a13fad 100644 --- a/sendgrid/src/contacts_api_recipients.rs +++ b/sendgrid/src/contacts_api_recipients.rs @@ -31,7 +31,7 @@ impl ContactsApiRecipients { &self, page: i64, page_size: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); @@ -71,7 +71,7 @@ impl ContactsApiRecipients { pub async fn post_contactdb_recipient( &self, body: &[crate::types::PostContactdbRecipientsRequest], - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/contactdb/recipients", None); self.client .post( @@ -99,7 +99,7 @@ impl ContactsApiRecipients { pub async fn delete_contactdb_recipients( &self, body: &[String], - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/contactdb/recipients", None); self.client .delete( @@ -129,7 +129,7 @@ impl ContactsApiRecipients { pub async fn patch_contactdb_recipients( &self, body: &[crate::types::PatchContactdbRecipientsRequest], - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/contactdb/recipients", None); self.client .patch( @@ -154,7 +154,7 @@ impl ContactsApiRecipients { */ pub async fn get_contactdb_statu( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/contactdb/status", None); self.client .get( @@ -180,7 +180,7 @@ impl ContactsApiRecipients { pub async fn get_contactdb_recipients_recipient( &self, recipient_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/contactdb/recipients/{}", @@ -214,7 +214,7 @@ impl ContactsApiRecipients { pub async fn delete_contactdb_recipients_recipient( &self, recipient_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/contactdb/recipients/{}", @@ -248,7 +248,8 @@ impl ContactsApiRecipients { pub async fn get_contactdb_recipients_recipient_lists( &self, recipient_id: &str, - ) -> ClientResult { + ) -> ClientResult> + { let url = self.client.url( &format!( "/contactdb/recipients/{}/lists", @@ -281,7 +282,7 @@ impl ContactsApiRecipients { */ pub async fn get_contactdb_recipients_billable_count( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self .client .url("/contactdb/recipients/billable_count", None); @@ -308,7 +309,7 @@ impl ContactsApiRecipients { */ pub async fn get_contactdb_recipients_count( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/contactdb/recipients/count", None); self.client .get( @@ -344,7 +345,7 @@ impl ContactsApiRecipients { pub async fn get_contactdb_recipients_search( &self, field_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !field_name.is_empty() { query_args.push(("{field_name}".to_string(), field_name.to_string())); @@ -415,7 +416,8 @@ impl ContactsApiRecipients { pub async fn post_contactdb_recipients_search( &self, body: &crate::types::PostContactdbRecipientsSearchRequest, - ) -> ClientResult { + ) -> ClientResult> + { let url = self.client.url("/contactdb/recipients/search", None); self.client .post( diff --git a/sendgrid/src/contacts_api_segments.rs b/sendgrid/src/contacts_api_segments.rs index 50408f72..a482f851 100644 --- a/sendgrid/src/contacts_api_segments.rs +++ b/sendgrid/src/contacts_api_segments.rs @@ -24,7 +24,7 @@ impl ContactsApiSegments { */ pub async fn get_contactdb_segments( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/contactdb/segments", None); self.client .get( @@ -89,7 +89,7 @@ impl ContactsApiSegments { pub async fn post_contactdb_segment( &self, body: &crate::types::ContactdbSegments, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/contactdb/segments", None); self.client .post( @@ -116,7 +116,7 @@ impl ContactsApiSegments { pub async fn get_contactdb_segments_segment( &self, segment_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/contactdb/segments/{}", @@ -153,7 +153,7 @@ impl ContactsApiSegments { segment_id: &str, delete_contacts: bool, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if delete_contacts { query_args.push(("delete_contacts".to_string(), delete_contacts.to_string())); @@ -193,7 +193,7 @@ impl ContactsApiSegments { &self, segment_id: &str, body: &crate::types::PatchContactdbSegmentsSegmentRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/contactdb/segments/{}", @@ -229,7 +229,7 @@ impl ContactsApiSegments { segment_id: i64, page: i64, page_size: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page > 0 { query_args.push(("page".to_string(), page.to_string())); diff --git a/sendgrid/src/csv_ui_only.rs b/sendgrid/src/csv_ui_only.rs index f97fd42b..2d322f60 100644 --- a/sendgrid/src/csv_ui_only.rs +++ b/sendgrid/src/csv_ui_only.rs @@ -32,7 +32,7 @@ impl CsvUiOnly { pub async fn post_messages_download( &self, query: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !query.is_empty() { query_args.push(("query".to_string(), query.to_string())); @@ -65,7 +65,7 @@ impl CsvUiOnly { pub async fn get_messages_download( &self, download_uuid: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/messages/download/{}", diff --git a/sendgrid/src/custom_fields.rs b/sendgrid/src/custom_fields.rs index a4874d6f..d104d33e 100644 --- a/sendgrid/src/custom_fields.rs +++ b/sendgrid/src/custom_fields.rs @@ -20,7 +20,7 @@ impl CustomFields { */ pub async fn get_mc_field_definitions( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/marketing/field_definitions", None); self.client .get( @@ -48,7 +48,7 @@ impl CustomFields { pub async fn post_mc_field_definition( &self, body: &crate::types::PostMcFieldDefinitionsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/marketing/field_definitions", None); self.client .post( @@ -72,7 +72,7 @@ impl CustomFields { pub async fn delete_mc_field_definitions_custom( &self, custom_field_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/marketing/field_definitions/{}", @@ -103,7 +103,7 @@ impl CustomFields { &self, custom_field_id: &str, body: &crate::types::IpPool, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/marketing/field_definitions/{}", diff --git a/sendgrid/src/designs_api.rs b/sendgrid/src/designs_api.rs index 39feab0b..0c327355 100644 --- a/sendgrid/src/designs_api.rs +++ b/sendgrid/src/designs_api.rs @@ -22,7 +22,10 @@ impl DesignsApi { * * This endpoint is valuable when retrieving information stored in a field that you wish to update using a PATCH request. */ - pub async fn get_design(&self, id: &str) -> ClientResult { + pub async fn get_design( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!("/designs/{}", crate::progenitor_support::encode_path(id),), None, @@ -55,7 +58,7 @@ impl DesignsApi { &self, id: &str, body: &crate::types::DesignDuplicateInput, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!("/designs/{}", crate::progenitor_support::encode_path(id),), None, @@ -79,7 +82,10 @@ impl DesignsApi { * * Be sure to check the ID of the design you intend to delete before making this request; deleting a design is a permanent action. */ - pub async fn delete_design(&self, id: &str) -> ClientResult { + pub async fn delete_design( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!("/designs/{}", crate::progenitor_support::encode_path(id),), None, @@ -115,7 +121,7 @@ impl DesignsApi { &self, id: &str, body: &crate::types::PutDesignRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!("/designs/{}", crate::progenitor_support::encode_path(id),), None, @@ -152,7 +158,7 @@ impl DesignsApi { page_size: u64, page_token: &str, summary: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !page_size.to_string().is_empty() { query_args.push(("page_size".to_string(), page_size.to_string())); @@ -191,7 +197,7 @@ impl DesignsApi { pub async fn post_design( &self, body: &crate::types::DesignInputAllOf, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/designs", None); self.client .post( @@ -217,7 +223,7 @@ impl DesignsApi { pub async fn get_sendgrid_pre_built_design( &self, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/designs/pre-builts/{}", @@ -251,7 +257,7 @@ impl DesignsApi { &self, id: &str, body: &crate::types::DesignDuplicateInput, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/designs/pre-builts/{}", @@ -293,7 +299,7 @@ impl DesignsApi { page_size: u64, page_token: &str, summary: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !page_size.to_string().is_empty() { query_args.push(("page_size".to_string(), page_size.to_string())); diff --git a/sendgrid/src/domain_authentication.rs b/sendgrid/src/domain_authentication.rs index c4256eb4..f26a2c1d 100644 --- a/sendgrid/src/domain_authentication.rs +++ b/sendgrid/src/domain_authentication.rs @@ -34,7 +34,8 @@ impl DomainAuthentication { exclude_subusers: bool, username: &str, domain: &str, - ) -> ClientResult> { + ) -> ClientResult>> + { let mut query_args: Vec<(String, String)> = Default::default(); if !domain.is_empty() { query_args.push(("domain".to_string(), domain.to_string())); @@ -80,7 +81,8 @@ impl DomainAuthentication { exclude_subusers: bool, username: &str, domain: &str, - ) -> ClientResult> { + ) -> ClientResult>> + { let mut query_args: Vec<(String, String)> = Default::default(); if !domain.is_empty() { query_args.push(("domain".to_string(), domain.to_string())); @@ -126,7 +128,7 @@ impl DomainAuthentication { pub async fn post_whitelabel_domain( &self, body: &crate::types::PostWhitelabelDomainsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/whitelabel/domains", None); self.client .post( @@ -152,7 +154,7 @@ impl DomainAuthentication { pub async fn get_whitelabel_domains_domain( &self, domain_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/whitelabel/domains/{}", @@ -184,7 +186,7 @@ impl DomainAuthentication { pub async fn delete_whitelabel_domains_domain( &self, domain_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/whitelabel/domains/{}", @@ -217,7 +219,8 @@ impl DomainAuthentication { &self, domain_id: &str, body: &crate::types::PatchWhitelabelDomainsDomainRequest, - ) -> ClientResult> { + ) -> ClientResult>> + { let url = self.client.url( &format!( "/whitelabel/domains/{}", @@ -254,7 +257,8 @@ impl DomainAuthentication { pub async fn get_whitelabel_domains_default( &self, domain: &str, - ) -> ClientResult> { + ) -> ClientResult>> + { let mut query_args: Vec<(String, String)> = Default::default(); if !domain.is_empty() { query_args.push(("domain".to_string(), domain.to_string())); @@ -289,7 +293,8 @@ impl DomainAuthentication { pub async fn get_all_whitelabel_domains_default( &self, domain: &str, - ) -> ClientResult> { + ) -> ClientResult>> + { let mut query_args: Vec<(String, String)> = Default::default(); if !domain.is_empty() { query_args.push(("domain".to_string(), domain.to_string())); @@ -323,7 +328,7 @@ impl DomainAuthentication { &self, id: i64, body: &crate::types::Ips, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/whitelabel/domains/{}/ips", @@ -356,7 +361,7 @@ impl DomainAuthentication { &self, id: i64, ip: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/whitelabel/domains/{}/ips/{}", @@ -389,7 +394,7 @@ impl DomainAuthentication { pub async fn post_whitelabel_domains_validate( &self, id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/whitelabel/domains/{}/validate", @@ -423,7 +428,7 @@ impl DomainAuthentication { pub async fn get_whitelabel_domains_subuser( &self, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !username.is_empty() { query_args.push(("username".to_string(), username.to_string())); @@ -458,7 +463,7 @@ impl DomainAuthentication { pub async fn delete_whitelabel_domains_subuser( &self, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !username.is_empty() { query_args.push(("username".to_string(), username.to_string())); @@ -490,7 +495,7 @@ impl DomainAuthentication { &self, domain_id: i64, body: &crate::types::PutUserUsernameResponse, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/whitelabel/domains/{}/subuser", diff --git a/sendgrid/src/email_address_validation.rs b/sendgrid/src/email_address_validation.rs index 7091883f..9e3908c6 100644 --- a/sendgrid/src/email_address_validation.rs +++ b/sendgrid/src/email_address_validation.rs @@ -21,7 +21,7 @@ impl EmailAddressValidation { pub async fn post_validations_email( &self, body: &crate::types::PostValidationsEmailRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/validations/email", None); self.client .post( diff --git a/sendgrid/src/email_cname_records.rs b/sendgrid/src/email_cname_records.rs index a26e0d26..6e5ba1f0 100644 --- a/sendgrid/src/email_cname_records.rs +++ b/sendgrid/src/email_cname_records.rs @@ -29,7 +29,7 @@ impl EmailCnameRecords { pub async fn post_whitelabel_dns_email( &self, body: &crate::types::PostWhitelabelDnsEmailRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/whitelabel/dns/email", None); self.client .post( diff --git a/sendgrid/src/invalid_emails_api.rs b/sendgrid/src/invalid_emails_api.rs index 693aa8eb..8eeeccea 100644 --- a/sendgrid/src/invalid_emails_api.rs +++ b/sendgrid/src/invalid_emails_api.rs @@ -32,7 +32,7 @@ impl InvalidEmailsApi { end_time: i64, limit: i64, offset: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if end_time > 0 { query_args.push(("end_time".to_string(), end_time.to_string())); @@ -74,7 +74,7 @@ impl InvalidEmailsApi { start_time: i64, end_time: i64, offset: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if end_time > 0 { query_args.push(("end_time".to_string(), end_time.to_string())); @@ -118,7 +118,7 @@ impl InvalidEmailsApi { pub async fn delete_suppression_invalid_emails( &self, body: &crate::types::DeleteSuppressionBlocksRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/suppression/invalid_emails", None); self.client .delete( @@ -144,7 +144,7 @@ impl InvalidEmailsApi { pub async fn get_suppression_invalid_emails_email( &self, email: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/suppression/invalid_emails/{}", @@ -174,7 +174,7 @@ impl InvalidEmailsApi { pub async fn get_all_suppression_invalid_emails_email( &self, email: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/suppression/invalid_emails/{}", @@ -206,7 +206,7 @@ impl InvalidEmailsApi { pub async fn delete_suppression_invalid_emails_email( &self, email: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/suppression/invalid_emails/{}", diff --git a/sendgrid/src/ip_access_management.rs b/sendgrid/src/ip_access_management.rs index cdaf3598..86bfe64b 100644 --- a/sendgrid/src/ip_access_management.rs +++ b/sendgrid/src/ip_access_management.rs @@ -26,7 +26,7 @@ impl IpAccessManagement { */ pub async fn get_access_settings_whitelist( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/access_settings/whitelist", None); self.client .get( @@ -54,7 +54,7 @@ impl IpAccessManagement { pub async fn post_access_settings_whitelist( &self, body: &crate::types::PostAccessSettingsWhitelistRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/access_settings/whitelist", None); self.client .post( @@ -84,7 +84,7 @@ impl IpAccessManagement { pub async fn delete_access_settings_whitelist( &self, body: &crate::types::DeleteAccessSettingsWhitelistRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/access_settings/whitelist", None); self.client .delete( @@ -111,7 +111,7 @@ impl IpAccessManagement { pub async fn get_access_settings_activity( &self, limit: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); @@ -146,7 +146,7 @@ impl IpAccessManagement { pub async fn get_access_settings_whitelist_rule( &self, rule_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/access_settings/whitelist/{}", @@ -180,7 +180,7 @@ impl IpAccessManagement { pub async fn delete_access_settings_whitelist_rule( &self, rule_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/access_settings/whitelist/{}", diff --git a/sendgrid/src/ip_addresses.rs b/sendgrid/src/ip_addresses.rs index 1a33a879..8231cf5d 100644 --- a/sendgrid/src/ip_addresses.rs +++ b/sendgrid/src/ip_addresses.rs @@ -39,7 +39,7 @@ impl IpAddresses { offset: i64, subuser: &str, sort_by_direction: crate::types::SortByDirection, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if exclude_whitelabels { query_args.push(( @@ -97,7 +97,7 @@ impl IpAddresses { offset: i64, subuser: &str, sort_by_direction: crate::types::SortByDirection, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if exclude_whitelabels { query_args.push(( @@ -142,7 +142,7 @@ impl IpAddresses { pub async fn post_ip( &self, body: &crate::types::PostIpsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/ips", None); self.client .post( @@ -161,7 +161,9 @@ impl IpAddresses { * * **This endpoint gets amount of IP Addresses that can still be created during a given period and the price of those IPs.** */ - pub async fn get_ips_remaining(&self) -> ClientResult { + pub async fn get_ips_remaining( + &self, + ) -> ClientResult> { let url = self.client.url("/ips/remaining", None); self.client .get( @@ -184,7 +186,7 @@ impl IpAddresses { */ pub async fn get_ips_assigned( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/ips/assigned", None); self.client .get( @@ -209,7 +211,7 @@ impl IpAddresses { */ pub async fn get_all_ips_assigned( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/ips/assigned", None); self.client .get_all_pages( @@ -235,7 +237,7 @@ impl IpAddresses { pub async fn get_ips_ip_address( &self, ip_address: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ips/{}", diff --git a/sendgrid/src/ip_pools.rs b/sendgrid/src/ip_pools.rs index cff633b6..d279d1ea 100644 --- a/sendgrid/src/ip_pools.rs +++ b/sendgrid/src/ip_pools.rs @@ -18,7 +18,9 @@ impl IpPools { * * **This endpoint allows you to get all of your IP pools.** */ - pub async fn get_ips_pools(&self) -> ClientResult> { + pub async fn get_ips_pools( + &self, + ) -> ClientResult>> { let url = self.client.url("/ips/pools", None); self.client .get( @@ -39,7 +41,9 @@ impl IpPools { * * **This endpoint allows you to get all of your IP pools.** */ - pub async fn get_all_ips_pools(&self) -> ClientResult> { + pub async fn get_all_ips_pools( + &self, + ) -> ClientResult>> { let url = self.client.url("/ips/pools", None); self.client .get_all_pages( @@ -69,7 +73,7 @@ impl IpPools { pub async fn post_ips_pool( &self, body: &crate::types::IpPool, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/ips/pools", None); self.client .post( @@ -104,7 +108,7 @@ impl IpPools { &self, pool_name: &str, body: &crate::types::PostIpsWarmupRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ips/pools/{}/ips", @@ -132,7 +136,7 @@ impl IpPools { pub async fn get_ips_pools_pool_name( &self, pool_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ips/pools/{}", @@ -161,7 +165,7 @@ impl IpPools { &self, pool_name: &str, body: &crate::types::PutIpsPoolsPoolNameRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ips/pools/{}", @@ -189,7 +193,7 @@ impl IpPools { pub async fn delete_ips_pools_pool_name( &self, pool_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ips/pools/{}", @@ -218,7 +222,7 @@ impl IpPools { &self, pool_name: &str, ip: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ips/pools/{}/ips/{}", diff --git a/sendgrid/src/ip_warmup.rs b/sendgrid/src/ip_warmup.rs index 3b671031..51e5e095 100644 --- a/sendgrid/src/ip_warmup.rs +++ b/sendgrid/src/ip_warmup.rs @@ -18,7 +18,9 @@ impl IpWarmup { * * **This endpoint allows you to retrieve all of your IP addresses that are currently warming up.** */ - pub async fn get_ips_warmup(&self) -> ClientResult> { + pub async fn get_ips_warmup( + &self, + ) -> ClientResult>> { let url = self.client.url("/ips/warmup", None); self.client .get( @@ -39,7 +41,9 @@ impl IpWarmup { * * **This endpoint allows you to retrieve all of your IP addresses that are currently warming up.** */ - pub async fn get_all_ips_warmup(&self) -> ClientResult> { + pub async fn get_all_ips_warmup( + &self, + ) -> ClientResult>> { let url = self.client.url("/ips/warmup", None); self.client .get_all_pages( @@ -61,7 +65,7 @@ impl IpWarmup { pub async fn post_ips_warmup( &self, body: &crate::types::PostIpsWarmupRequest, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/ips/warmup", None); self.client .post( @@ -85,7 +89,7 @@ impl IpWarmup { pub async fn get_ips_warmup_ip_address( &self, ip_address: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/ips/warmup/{}", @@ -117,7 +121,7 @@ impl IpWarmup { pub async fn get_all_ips_warmup_ip_address( &self, ip_address: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/ips/warmup/{}", @@ -147,7 +151,7 @@ impl IpWarmup { pub async fn delete_ips_warmup_ip_address( &self, ip_address: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/ips/warmup/{}", diff --git a/sendgrid/src/lib.rs b/sendgrid/src/lib.rs index d7ba74ad..fefd49ba 100644 --- a/sendgrid/src/lib.rs +++ b/sendgrid/src/lib.rs @@ -127,9 +127,27 @@ pub mod users_api; pub mod utils; pub mod webhooks; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -333,13 +351,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -352,7 +371,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -375,13 +394,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -402,7 +422,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -421,7 +441,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -446,6 +470,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -462,7 +487,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -487,7 +512,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -510,6 +535,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -526,7 +552,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -552,7 +578,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -595,6 +621,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -607,7 +634,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -630,7 +657,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -639,7 +666,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -647,7 +674,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -657,32 +684,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -694,7 +725,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -703,7 +734,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -711,7 +742,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -719,7 +750,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -727,7 +758,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/sendgrid/src/link_branding.rs b/sendgrid/src/link_branding.rs index e2f6e1ff..94df6923 100644 --- a/sendgrid/src/link_branding.rs +++ b/sendgrid/src/link_branding.rs @@ -28,7 +28,7 @@ impl LinkBranding { pub async fn get_whitelabel_links( &self, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); @@ -60,7 +60,7 @@ impl LinkBranding { */ pub async fn get_all_whitelabel_links( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/whitelabel/links", None); self.client .get_all_pages( @@ -90,7 +90,7 @@ impl LinkBranding { pub async fn post_whitelabel_link( &self, body: &crate::types::PostWhitelabelLinksRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/whitelabel/links", None); self.client .post( @@ -118,7 +118,7 @@ impl LinkBranding { pub async fn post_whitelabel_links_validate( &self, id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/whitelabel/links/{}/validate", @@ -149,7 +149,7 @@ impl LinkBranding { &self, link_id: i64, body: &crate::types::PostWhitelabelLinksLinkSubuserRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/whitelabel/links/{}/subuser", @@ -183,7 +183,7 @@ impl LinkBranding { pub async fn get_whitelabel_links_link_branding( &self, id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/whitelabel/links/{}", @@ -216,7 +216,10 @@ impl LinkBranding { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn delete_whitelabel_links(&self, id: i64) -> ClientResult { + pub async fn delete_whitelabel_links( + &self, + id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/whitelabel/links/{}", @@ -251,7 +254,7 @@ impl LinkBranding { &self, id: i64, body: &crate::types::PatchWhitelabelLinksRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/whitelabel/links/{}", @@ -292,7 +295,7 @@ impl LinkBranding { pub async fn get_whitelabel_links_default( &self, domain: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !domain.is_empty() { query_args.push(("domain".to_string(), domain.to_string())); @@ -327,7 +330,7 @@ impl LinkBranding { pub async fn get_whitelabel_links_subuser( &self, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !username.is_empty() { query_args.push(("username".to_string(), username.to_string())); @@ -364,7 +367,7 @@ impl LinkBranding { pub async fn delete_whitelabel_links_subuser( &self, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !username.is_empty() { query_args.push(("username".to_string(), username.to_string())); diff --git a/sendgrid/src/lists.rs b/sendgrid/src/lists.rs index 9ede0c22..66da00b1 100644 --- a/sendgrid/src/lists.rs +++ b/sendgrid/src/lists.rs @@ -27,7 +27,7 @@ impl Lists { &self, page_size: f64, page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !page_size.to_string().is_empty() { query_args.push(("page_size".to_string(), page_size.to_string())); @@ -60,7 +60,10 @@ impl Lists { * * A link to the newly created object is in `_metadata`. */ - pub async fn post_mc(&self, body: &crate::types::IpPool) -> ClientResult { + pub async fn post_mc( + &self, + body: &crate::types::IpPool, + ) -> ClientResult> { let url = self.client.url("/marketing/lists", None); self.client .post( @@ -82,7 +85,7 @@ impl Lists { pub async fn get_mc_contacts_count( &self, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/marketing/lists/{}/contacts/count", @@ -119,7 +122,7 @@ impl Lists { &self, id: &str, contact_sample: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if contact_sample { query_args.push(("contact_sample".to_string(), contact_sample.to_string())); @@ -160,7 +163,7 @@ impl Lists { &self, id: &str, delete_contacts: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if delete_contacts { query_args.push(("delete_contacts".to_string(), delete_contacts.to_string())); @@ -195,7 +198,7 @@ impl Lists { &self, id: &str, body: &crate::types::PatchMcListsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/marketing/lists/{}", @@ -230,7 +233,7 @@ impl Lists { &self, id: &str, contact_ids: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !contact_ids.is_empty() { query_args.push(("contact_ids".to_string(), contact_ids.to_string())); diff --git a/sendgrid/src/mail_send.rs b/sendgrid/src/mail_send.rs index b6da2068..8dd33676 100644 --- a/sendgrid/src/mail_send.rs +++ b/sendgrid/src/mail_send.rs @@ -63,7 +63,10 @@ impl MailSend { * a. `--data-binary '@data.json.gz' * ` */ - pub async fn post(&self, body: &crate::types::PostMailSendRequest) -> ClientResult<()> { + pub async fn post( + &self, + body: &crate::types::PostMailSendRequest, + ) -> ClientResult> { let url = self.client.url("/mail/send", None); self.client .post( diff --git a/sendgrid/src/marketing_campaigns_stats.rs b/sendgrid/src/marketing_campaigns_stats.rs index 59ebea0c..45854b28 100644 --- a/sendgrid/src/marketing_campaigns_stats.rs +++ b/sendgrid/src/marketing_campaigns_stats.rs @@ -35,7 +35,7 @@ impl MarketingCampaignsStats { automation_ids: &[String], page_size: i64, page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !automation_ids.is_empty() { query_args.push(("automation_ids".to_string(), automation_ids.join(" "))); @@ -93,7 +93,7 @@ impl MarketingCampaignsStats { timezone: &str, page_size: i64, page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -162,7 +162,7 @@ impl MarketingCampaignsStats { singlesend_ids: &[String], page_size: i64, page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page_size > 0 { query_args.push(("page_size".to_string(), page_size.to_string())); @@ -218,7 +218,7 @@ impl MarketingCampaignsStats { page_size: i64, page_token: &str, group_by: &[String], - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -287,7 +287,7 @@ impl MarketingCampaignsStats { step_ids: &[String], page_size: i64, page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !group_by.is_empty() { query_args.push(("group_by".to_string(), group_by.join(" "))); @@ -349,7 +349,7 @@ impl MarketingCampaignsStats { group_by: &[String], ab_variation_id: &str, ab_phase_id: crate::types::AbPhaseId, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !ab_phase_id.to_string().is_empty() { query_args.push(("ab_phase_id".to_string(), ab_phase_id.to_string())); @@ -405,7 +405,7 @@ impl MarketingCampaignsStats { &self, ids: &[String], timezone: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !ids.is_empty() { query_args.push(("ids".to_string(), ids.join(" "))); @@ -448,7 +448,7 @@ impl MarketingCampaignsStats { &self, ids: &[String], timezone: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !ids.is_empty() { query_args.push(("ids".to_string(), ids.join(" "))); diff --git a/sendgrid/src/query.rs b/sendgrid/src/query.rs index 13ec3486..cf0f6537 100644 --- a/sendgrid/src/query.rs +++ b/sendgrid/src/query.rs @@ -69,7 +69,7 @@ impl Query { &self, query: &str, limit: f64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.to_string().is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -102,7 +102,10 @@ impl Query { * * * `authorization: &str` -- The license key provided with your New Relic account. */ - pub async fn get_messages_msg(&self, msg_id: &str) -> ClientResult { + pub async fn get_messages_msg( + &self, + msg_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/messages/{}", diff --git a/sendgrid/src/reverse_dns.rs b/sendgrid/src/reverse_dns.rs index bf7394a2..f01e8d53 100644 --- a/sendgrid/src/reverse_dns.rs +++ b/sendgrid/src/reverse_dns.rs @@ -36,7 +36,7 @@ impl ReverseDns { limit: i64, offset: i64, ip: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ip.is_empty() { query_args.push(("ip".to_string(), ip.to_string())); @@ -80,7 +80,7 @@ impl ReverseDns { &self, offset: i64, ip: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ip.is_empty() { query_args.push(("ip".to_string(), ip.to_string())); @@ -116,7 +116,7 @@ impl ReverseDns { pub async fn post_whitelabel_ip( &self, body: &crate::types::PostWhitelabelIpsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/whitelabel/ips", None); self.client .post( @@ -148,7 +148,7 @@ impl ReverseDns { pub async fn post_whitelabel_ips_validate( &self, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/whitelabel/ips/{}/validate", @@ -179,7 +179,10 @@ impl ReverseDns { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get_whitelabel_ip(&self, id: &str) -> ClientResult { + pub async fn get_whitelabel_ip( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/whitelabel/ips/{}", @@ -212,7 +215,10 @@ impl ReverseDns { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn delete_whitelabel_ips(&self, id: &str) -> ClientResult { + pub async fn delete_whitelabel_ips( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/whitelabel/ips/{}", diff --git a/sendgrid/src/segmenting_contacts.rs b/sendgrid/src/segmenting_contacts.rs index 247be0bf..718f8a99 100644 --- a/sendgrid/src/segmenting_contacts.rs +++ b/sendgrid/src/segmenting_contacts.rs @@ -36,7 +36,7 @@ impl SegmentingContacts { &self, parent_list_ids: &str, no_parent_list_id: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if no_parent_list_id { query_args.push(( @@ -71,7 +71,7 @@ impl SegmentingContacts { pub async fn post_marketing_segment( &self, body: &crate::types::PostMarketingSegmentsRequestAllOf, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/marketing/segments", None); self.client .post( @@ -98,7 +98,7 @@ impl SegmentingContacts { &self, segment_id: &str, query_json: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if query_json { query_args.push(("query_json".to_string(), query_json.to_string())); @@ -134,7 +134,7 @@ impl SegmentingContacts { pub async fn delete_marketing_segments_segment( &self, segment_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/marketing/segments/{}", @@ -165,7 +165,7 @@ impl SegmentingContacts { &self, segment_id: &str, body: &crate::types::SegmentWriteV2, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/marketing/segments/{}", @@ -195,7 +195,7 @@ impl SegmentingContacts { pub async fn post_marketing_segments_delete( &self, body: &crate::types::PostMarketingSegmentsDeleteRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/marketing/segments/delete", None); self.client .post( diff --git a/sendgrid/src/segmenting_contacts_beta.rs b/sendgrid/src/segmenting_contacts_beta.rs index a3fdad69..568f01b2 100644 --- a/sendgrid/src/segmenting_contacts_beta.rs +++ b/sendgrid/src/segmenting_contacts_beta.rs @@ -36,7 +36,7 @@ impl SegmentingContactsBeta { &self, parent_list_ids: &str, no_parent_list_id: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if no_parent_list_id { query_args.push(( @@ -73,7 +73,7 @@ impl SegmentingContactsBeta { pub async fn post_segment( &self, body: &crate::types::SegmentWriteV2, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/marketing/segments/2.0", None); self.client .post( @@ -100,7 +100,7 @@ impl SegmentingContactsBeta { &self, segment_id: &str, contacts_sample: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if contacts_sample { query_args.push(("contacts_sample".to_string(), contacts_sample.to_string())); @@ -131,7 +131,10 @@ impl SegmentingContactsBeta { * * **The Segmentation V2 API is currently in private beta. If you'd like to be added to the beta, please fill out this [form](https://docs.google.com/forms/d/e/1FAIpQLSd5zwC9dRk8lAp1oTWjdGc-aSY69flW_7wnutvKBhpUluSnfQ/viewform)** */ - pub async fn delete_segments_segment(&self, segment_id: &str) -> ClientResult<()> { + pub async fn delete_segments_segment( + &self, + segment_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/marketing/segments/2.0/{}", @@ -162,7 +165,7 @@ impl SegmentingContactsBeta { &self, segment_id: &str, body: &crate::types::SegmentUpdate, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/marketing/segments/2.0/{}", diff --git a/sendgrid/src/send_test_email.rs b/sendgrid/src/send_test_email.rs index bd7ac972..68bf6a28 100644 --- a/sendgrid/src/send_test_email.rs +++ b/sendgrid/src/send_test_email.rs @@ -29,7 +29,7 @@ impl SendTestEmail { pub async fn post_marketing_test_send_email( &self, body: &crate::types::PostMarketingTestSendEmailRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/marketing/test/send_email", None); self.client .post( diff --git a/sendgrid/src/sender_identities_api.rs b/sendgrid/src/sender_identities_api.rs index 37093e14..0dd4b433 100644 --- a/sendgrid/src/sender_identities_api.rs +++ b/sendgrid/src/sender_identities_api.rs @@ -22,7 +22,9 @@ impl SenderIdentitiesApi { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get_senders(&self) -> ClientResult { + pub async fn get_senders( + &self, + ) -> ClientResult> { let url = self.client.url("/senders", None); self.client .get( @@ -50,7 +52,7 @@ impl SenderIdentitiesApi { pub async fn post_sender( &self, body: &crate::types::PostSendersRequestAllOf, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/senders", None); self.client .post( @@ -76,7 +78,7 @@ impl SenderIdentitiesApi { pub async fn get_senders_sender( &self, sender_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/senders/{}", @@ -105,7 +107,10 @@ impl SenderIdentitiesApi { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn delete_senders_sender(&self, sender_id: i64) -> ClientResult { + pub async fn delete_senders_sender( + &self, + sender_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/senders/{}", @@ -142,7 +147,7 @@ impl SenderIdentitiesApi { &self, sender_id: i64, body: &crate::types::SenderRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/senders/{}", @@ -174,7 +179,7 @@ impl SenderIdentitiesApi { pub async fn post_senders_sender_resend_verification( &self, sender_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/senders/{}/resend_verification", diff --git a/sendgrid/src/sender_verification.rs b/sendgrid/src/sender_verification.rs index fccb9330..e7e15893 100644 --- a/sendgrid/src/sender_verification.rs +++ b/sendgrid/src/sender_verification.rs @@ -24,7 +24,7 @@ impl SenderVerification { */ pub async fn get_verified_senders_domains( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/verified_senders/domains", None); self.client .get( @@ -49,7 +49,7 @@ impl SenderVerification { */ pub async fn get_verified_senders_steps_completed( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/verified_senders/steps_completed", None); self.client .get( @@ -87,7 +87,7 @@ impl SenderVerification { limit: f64, last_seen_id: f64, id: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if id > 0 { query_args.push(("id".to_string(), id.to_string())); @@ -128,7 +128,7 @@ impl SenderVerification { pub async fn post_verified_sender( &self, body: &crate::types::VerifiedSenderRequestSchema, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/verified_senders", None); self.client .post( @@ -149,7 +149,10 @@ impl SenderVerification { * * The token is generated by SendGrid and included in a verification email delivered to the address that's pending verification. */ - pub async fn get_verified_senders_verify_token(&self, token: &str) -> ClientResult<()> { + pub async fn get_verified_senders_verify_token( + &self, + token: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/verified_senders/verify/{}", @@ -178,7 +181,10 @@ impl SenderVerification { * * You can retrieve the IDs associated with Sender Identities using the "Get All Verified Senders" endpoint. */ - pub async fn delete_verified_senders(&self, id: &str) -> ClientResult { + pub async fn delete_verified_senders( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/verified_senders/{}", @@ -213,7 +219,7 @@ impl SenderVerification { &self, id: &str, body: &crate::types::VerifiedSenderRequestSchema, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/verified_senders/{}", @@ -242,7 +248,10 @@ impl SenderVerification { * * You can retrieve the IDs associated with Sender Identities by passing a "Get All Verified Senders" endpoint. */ - pub async fn post_verified_senders_resend(&self, id: &str) -> ClientResult { + pub async fn post_verified_senders_resend( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/verified_senders/resend/{}", diff --git a/sendgrid/src/senders.rs b/sendgrid/src/senders.rs index e3432da3..3177a321 100644 --- a/sendgrid/src/senders.rs +++ b/sendgrid/src/senders.rs @@ -29,7 +29,7 @@ impl Senders { pub async fn post_marketing( &self, body: &crate::types::PostMarketingSendersRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/marketing/senders", None); self.client .post( diff --git a/sendgrid/src/settings_enforced_tls.rs b/sendgrid/src/settings_enforced_tls.rs index af6c158d..c1f51f9d 100644 --- a/sendgrid/src/settings_enforced_tls.rs +++ b/sendgrid/src/settings_enforced_tls.rs @@ -26,7 +26,9 @@ impl SettingsEnforcedTls { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get_user(&self) -> ClientResult { + pub async fn get_user( + &self, + ) -> ClientResult> { let url = self.client.url("/user/settings/enforced_tls", None); self.client .get( @@ -56,7 +58,7 @@ impl SettingsEnforcedTls { pub async fn patch_user( &self, body: &crate::types::EnforcedTlsRequestResponse, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user/settings/enforced_tls", None); self.client .patch( diff --git a/sendgrid/src/settings_inbound_parse.rs b/sendgrid/src/settings_inbound_parse.rs index 8e543799..29bbbebd 100644 --- a/sendgrid/src/settings_inbound_parse.rs +++ b/sendgrid/src/settings_inbound_parse.rs @@ -33,7 +33,7 @@ impl SettingsInboundParse { pub async fn post_user_webhooks_parse_setting( &self, body: &crate::types::ParseSetting, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user/webhooks/parse/settings", None); self.client .post( @@ -61,7 +61,7 @@ impl SettingsInboundParse { pub async fn get_user_webhooks_parse_settings_hostname( &self, hostname: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/webhooks/parse/settings/{}", @@ -95,7 +95,7 @@ impl SettingsInboundParse { pub async fn delete_user_webhooks_parse_settings_hostname( &self, hostname: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/webhooks/parse/settings/{}", @@ -130,7 +130,7 @@ impl SettingsInboundParse { &self, hostname: &str, body: &crate::types::ParseSetting, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/user/webhooks/parse/settings/{}", diff --git a/sendgrid/src/settings_mail.rs b/sendgrid/src/settings_mail.rs index 0292767e..7c720ac4 100644 --- a/sendgrid/src/settings_mail.rs +++ b/sendgrid/src/settings_mail.rs @@ -30,7 +30,7 @@ impl SettingsMail { &self, limit: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); @@ -67,7 +67,7 @@ impl SettingsMail { */ pub async fn get_mail_settings_address_whitelist( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/mail_settings/address_whitelist", None); self.client .get( @@ -103,7 +103,7 @@ impl SettingsMail { pub async fn patch_mail_settings_address_whitelist( &self, body: &crate::types::PatchMailSettingsAddressWhitelistRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/mail_settings/address_whitelist", None); self.client .patch( @@ -130,7 +130,9 @@ impl SettingsMail { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get_mail_settings_footer(&self) -> ClientResult { + pub async fn get_mail_settings_footer( + &self, + ) -> ClientResult> { let url = self.client.url("/mail_settings/footer", None); self.client .get( @@ -160,7 +162,7 @@ impl SettingsMail { pub async fn patch_mail_settings_footer( &self, body: &crate::types::MailSettingsFooter, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/mail_settings/footer", None); self.client .patch( @@ -187,7 +189,7 @@ impl SettingsMail { */ pub async fn get_mail_settings_forward_spam( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/mail_settings/forward_spam", None); self.client .get( @@ -228,7 +230,7 @@ impl SettingsMail { pub async fn patch_mail_settings_forward_spam( &self, body: &crate::types::MailSettingsForwardSpam, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/mail_settings/forward_spam", None); self.client .patch( @@ -257,7 +259,7 @@ impl SettingsMail { */ pub async fn get_mail_settings_template( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/mail_settings/template", None); self.client .get( @@ -287,7 +289,7 @@ impl SettingsMail { pub async fn patch_mail_settings_template( &self, body: &crate::types::PatchMailSettingsTemplateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/mail_settings/template", None); self.client .patch( @@ -320,7 +322,7 @@ impl SettingsMail { */ pub async fn get_mail_settings_bounce_purge( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/mail_settings/bounce_purge", None); self.client .get( @@ -354,7 +356,7 @@ impl SettingsMail { pub async fn patch_mail_settings_bounce_purge( &self, body: &crate::types::MailSettingsBouncePurge, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/mail_settings/bounce_purge", None); self.client .patch( @@ -381,7 +383,7 @@ impl SettingsMail { */ pub async fn get_mail_settings_forward_bounce( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/mail_settings/forward_bounce", None); self.client .get( @@ -411,7 +413,7 @@ impl SettingsMail { pub async fn patch_mail_settings_forward_bounce( &self, body: &crate::types::MailSettingsForwardBounce, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/mail_settings/forward_bounce", None); self.client .patch( diff --git a/sendgrid/src/settings_partner.rs b/sendgrid/src/settings_partner.rs index 960ba696..1fcc02a6 100644 --- a/sendgrid/src/settings_partner.rs +++ b/sendgrid/src/settings_partner.rs @@ -28,7 +28,7 @@ impl SettingsPartner { */ pub async fn get_partner_settings_new_relic( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/partner_settings/new_relic", None); self.client .get( @@ -58,7 +58,7 @@ impl SettingsPartner { pub async fn patch_partner_settings_new_relic( &self, body: &crate::types::PatchPartnerSettingsNewRelicRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/partner_settings/new_relic", None); self.client .patch( @@ -89,7 +89,7 @@ impl SettingsPartner { &self, limit: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); diff --git a/sendgrid/src/settings_tracking.rs b/sendgrid/src/settings_tracking.rs index 943d2e29..f10b4bc3 100644 --- a/sendgrid/src/settings_tracking.rs +++ b/sendgrid/src/settings_tracking.rs @@ -24,7 +24,7 @@ impl SettingsTracking { */ pub async fn get_tracking_settings( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/tracking_settings", None); self.client .get( @@ -51,7 +51,9 @@ impl SettingsTracking { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get_tracking_settings_click(&self) -> ClientResult { + pub async fn get_tracking_settings_click( + &self, + ) -> ClientResult> { let url = self.client.url("/tracking_settings/click", None); self.client .get( @@ -81,7 +83,7 @@ impl SettingsTracking { pub async fn patch_tracking_settings_click( &self, body: &crate::types::PatchTrackingSettingsOpenRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/tracking_settings/click", None); self.client .patch( @@ -111,7 +113,7 @@ impl SettingsTracking { */ pub async fn get_tracking_settings_google_analytic( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/tracking_settings/google_analytics", None); self.client .get( @@ -141,7 +143,7 @@ impl SettingsTracking { pub async fn patch_tracking_settings_google_analytics( &self, body: &crate::types::GoogleAnalyticsSettings, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/tracking_settings/google_analytics", None); self.client .patch( @@ -172,7 +174,7 @@ impl SettingsTracking { */ pub async fn get_tracking_settings_open( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/tracking_settings/open", None); self.client .get( @@ -204,7 +206,7 @@ impl SettingsTracking { pub async fn patch_tracking_settings_open( &self, body: &crate::types::PatchTrackingSettingsOpenRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/tracking_settings/open", None); self.client .patch( @@ -231,7 +233,7 @@ impl SettingsTracking { */ pub async fn get_tracking_settings_subscription( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/tracking_settings/subscription", None); self.client .get( @@ -259,7 +261,7 @@ impl SettingsTracking { pub async fn patch_tracking_settings_subscription( &self, body: &crate::types::SubscriptionTrackingSettings, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/tracking_settings/subscription", None); self.client .patch( diff --git a/sendgrid/src/single_sends.rs b/sendgrid/src/single_sends.rs index c6956fe1..7814583a 100644 --- a/sendgrid/src/single_sends.rs +++ b/sendgrid/src/single_sends.rs @@ -29,7 +29,7 @@ impl SingleSends { &self, page_size: i64, page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page_size > 0 { query_args.push(("page_size".to_string(), page_size.to_string())); @@ -63,7 +63,7 @@ impl SingleSends { pub async fn post_marketing_singlesend( &self, body: &crate::types::SinglesendRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/marketing/singlesends", None); self.client .post( @@ -90,7 +90,10 @@ impl SingleSends { * * * `ids: &[String]` -- The recipient IDs of the recipients that already existed from this request. */ - pub async fn delete_marketing_singlesends(&self, ids: &[String]) -> ClientResult<()> { + pub async fn delete_marketing_singlesends( + &self, + ids: &[String], + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !ids.is_empty() { query_args.push(("ids".to_string(), ids.join(" "))); @@ -121,7 +124,7 @@ impl SingleSends { pub async fn get_marketing_singlesend( &self, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/marketing/singlesends/{}", @@ -154,7 +157,7 @@ impl SingleSends { &self, id: &str, body: &crate::types::PostMarketingSinglesendsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/marketing/singlesends/{}", @@ -183,7 +186,10 @@ impl SingleSends { * * Please note that a `DELETE` request is permanent, and your Single Send will not be recoverable after deletion. */ - pub async fn delete_marketing_singlesends_single_sends(&self, id: &str) -> ClientResult<()> { + pub async fn delete_marketing_singlesends_single_sends( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/marketing/singlesends/{}", @@ -214,7 +220,7 @@ impl SingleSends { &self, id: &str, body: &crate::types::SinglesendRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/marketing/singlesends/{}", @@ -265,7 +271,7 @@ impl SingleSends { page_size: i64, page_token: &str, body: &crate::types::SinglesendSearch, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page_size > 0 { query_args.push(("page_size".to_string(), page_size.to_string())); @@ -300,7 +306,7 @@ impl SingleSends { &self, id: &str, body: &crate::types::PutMarketingSinglesendsScheduleRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/marketing/singlesends/{}/schedule", @@ -330,7 +336,7 @@ impl SingleSends { pub async fn delete_marketing_singlesends_schedule( &self, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/marketing/singlesends/{}/schedule", @@ -359,7 +365,8 @@ impl SingleSends { */ pub async fn get_marketing_singlesends_categories( &self, - ) -> ClientResult { + ) -> ClientResult> + { let url = self.client.url("/marketing/singlesends/categories", None); self.client .get( diff --git a/sendgrid/src/single_sign_on_settings.rs b/sendgrid/src/single_sign_on_settings.rs index 570134e1..8a117d12 100644 --- a/sendgrid/src/single_sign_on_settings.rs +++ b/sendgrid/src/single_sign_on_settings.rs @@ -27,7 +27,7 @@ impl SingleSignOnSettings { pub async fn get_sso_integrations( &self, si: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if si { query_args.push(("si".to_string(), si.to_string())); @@ -60,7 +60,7 @@ impl SingleSignOnSettings { pub async fn get_all_sso_integrations( &self, si: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if si { query_args.push(("si".to_string(), si.to_string())); @@ -89,7 +89,7 @@ impl SingleSignOnSettings { pub async fn post_sso_integration( &self, body: &crate::types::CreateIntegrationRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/sso/integrations", None); self.client .post( @@ -118,7 +118,7 @@ impl SingleSignOnSettings { &self, id: &str, si: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if si { query_args.push(("si".to_string(), si.to_string())); @@ -151,7 +151,7 @@ impl SingleSignOnSettings { * * You can retrieve the IDs for your configurations from the response provided by the "Get All SSO Integrations" endpoint. */ - pub async fn delete_sso_integrations(&self, id: &str) -> ClientResult<()> { + pub async fn delete_sso_integrations(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!( "/sso/integrations/{}", @@ -187,7 +187,7 @@ impl SingleSignOnSettings { id: &str, si: bool, body: &crate::types::CreateIntegrationRequest, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if si { query_args.push(("si".to_string(), si.to_string())); diff --git a/sendgrid/src/single_sign_on_teammates.rs b/sendgrid/src/single_sign_on_teammates.rs index dd3e14b2..3afc6235 100644 --- a/sendgrid/src/single_sign_on_teammates.rs +++ b/sendgrid/src/single_sign_on_teammates.rs @@ -23,7 +23,7 @@ impl SingleSignOnTeammates { pub async fn post_sso_teammate( &self, body: &crate::types::SsoTeammateRequestAllOf, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/sso/teammates", None); self.client .post( @@ -50,7 +50,7 @@ impl SingleSignOnTeammates { &self, username: &str, body: &crate::types::PatchSsoTeammatesUsernameRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/sso/teammates/{}", diff --git a/sendgrid/src/spam_reports_api.rs b/sendgrid/src/spam_reports_api.rs index ae4ae1be..bfbaf64f 100644 --- a/sendgrid/src/spam_reports_api.rs +++ b/sendgrid/src/spam_reports_api.rs @@ -32,7 +32,7 @@ impl SpamReportsApi { end_time: i64, limit: i64, offset: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if end_time > 0 { query_args.push(("end_time".to_string(), end_time.to_string())); @@ -74,7 +74,7 @@ impl SpamReportsApi { start_time: i64, end_time: i64, offset: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if end_time > 0 { query_args.push(("end_time".to_string(), end_time.to_string())); @@ -120,7 +120,7 @@ impl SpamReportsApi { pub async fn delete_suppression_spam_reports( &self, body: &crate::types::DeleteSuppressionBlocksRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/suppression/spam_reports", None); self.client .delete( @@ -146,7 +146,7 @@ impl SpamReportsApi { pub async fn get_suppression_spam_reports_email( &self, email: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/suppression/spam_reports/{}", @@ -176,7 +176,7 @@ impl SpamReportsApi { pub async fn get_all_suppression_spam_reports_email( &self, email: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/suppression/spam_reports/{}", @@ -210,7 +210,7 @@ impl SpamReportsApi { pub async fn delete_suppression_spam_reports_email( &self, email: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/suppression/spam_reports/{}", diff --git a/sendgrid/src/stats.rs b/sendgrid/src/stats.rs index 399e7338..d4c8fe97 100644 --- a/sendgrid/src/stats.rs +++ b/sendgrid/src/stats.rs @@ -35,7 +35,7 @@ impl Stats { aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -78,7 +78,7 @@ impl Stats { aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -132,7 +132,7 @@ impl Stats { aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -181,7 +181,7 @@ impl Stats { aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -245,7 +245,7 @@ impl Stats { aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -299,7 +299,7 @@ impl Stats { aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -348,7 +348,7 @@ impl Stats { start_date: &str, end_date: &str, aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -389,7 +389,7 @@ impl Stats { start_date: &str, end_date: &str, aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -442,7 +442,7 @@ impl Stats { start_date: &str, end_date: &str, aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -497,7 +497,7 @@ impl Stats { start_date: &str, end_date: &str, aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -555,7 +555,8 @@ impl Stats { aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> + { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -609,7 +610,8 @@ impl Stats { aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> + { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -671,7 +673,7 @@ impl Stats { aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -722,7 +724,7 @@ impl Stats { aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); diff --git a/sendgrid/src/subuser_monitor_settings.rs b/sendgrid/src/subuser_monitor_settings.rs index adaa6662..b1754591 100644 --- a/sendgrid/src/subuser_monitor_settings.rs +++ b/sendgrid/src/subuser_monitor_settings.rs @@ -19,7 +19,7 @@ impl SubuserMonitorSettings { pub async fn get_subusers_subuser_name_monitor( &self, subuser_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/subusers/{}/monitor", @@ -46,7 +46,7 @@ impl SubuserMonitorSettings { &self, subuser_name: &str, body: &crate::types::Monitor, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/subusers/{}/monitor", @@ -73,7 +73,7 @@ impl SubuserMonitorSettings { &self, subuser_name: &str, body: &crate::types::Monitor, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/subusers/{}/monitor", @@ -99,7 +99,7 @@ impl SubuserMonitorSettings { pub async fn delete_subusers_subuser_name_monitor( &self, subuser_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/subusers/{}/monitor", diff --git a/sendgrid/src/subuser_statistics.rs b/sendgrid/src/subuser_statistics.rs index 097395f1..bbc206c5 100644 --- a/sendgrid/src/subuser_statistics.rs +++ b/sendgrid/src/subuser_statistics.rs @@ -37,7 +37,7 @@ impl SubuserStatistics { sort_by_direction: crate::types::SortByDirection, limit: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !date.is_empty() { query_args.push(("date".to_string(), date.to_string())); @@ -103,7 +103,7 @@ impl SubuserStatistics { sort_by_direction: crate::types::SortByDirection, limit: i64, offset: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !date.is_empty() { query_args.push(("date".to_string(), date.to_string())); @@ -166,7 +166,7 @@ impl SubuserStatistics { offset: i64, aggregated_by: &str, sort_by_metric: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -232,7 +232,7 @@ impl SubuserStatistics { subusers: &str, start_date: &str, end_date: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); diff --git a/sendgrid/src/subusers_api.rs b/sendgrid/src/subusers_api.rs index 83062643..2233ec6a 100644 --- a/sendgrid/src/subusers_api.rs +++ b/sendgrid/src/subusers_api.rs @@ -31,7 +31,7 @@ impl SubusersApi { username: &str, limit: i64, offset: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); @@ -69,7 +69,7 @@ impl SubusersApi { &self, username: &str, offset: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if offset > 0 { query_args.push(("offset".to_string(), offset.to_string())); @@ -99,7 +99,7 @@ impl SubusersApi { pub async fn post_subuser( &self, body: &crate::types::PostSubusersRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/subusers", None); self.client .post( @@ -123,7 +123,7 @@ impl SubusersApi { pub async fn delete_subusers_subuser_name( &self, subuser_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/subusers/{}", @@ -152,7 +152,7 @@ impl SubusersApi { &self, subuser_name: &str, body: &crate::types::PatchSubusersSubuserNameRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/subusers/{}", @@ -186,7 +186,7 @@ impl SubusersApi { pub async fn get_subusers_reputations( &self, usernames: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !usernames.is_empty() { query_args.push(("usernames".to_string(), usernames.to_string())); @@ -219,7 +219,7 @@ impl SubusersApi { pub async fn get_all_subusers_reputations( &self, usernames: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !usernames.is_empty() { query_args.push(("usernames".to_string(), usernames.to_string())); @@ -256,7 +256,7 @@ impl SubusersApi { &self, subuser_name: &str, body: &[std::net::Ipv4Addr], - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/subusers/{}/ips", diff --git a/sendgrid/src/suppressions.rs b/sendgrid/src/suppressions.rs index 6f7a10d3..607e2fa6 100644 --- a/sendgrid/src/suppressions.rs +++ b/sendgrid/src/suppressions.rs @@ -22,7 +22,10 @@ impl Suppressions { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get_asm_groups_group(&self, group_id: &str) -> ClientResult> { + pub async fn get_asm_groups_group( + &self, + group_id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/asm/groups/{}/suppressions", @@ -49,7 +52,10 @@ impl Suppressions { * * **This endpoint allows you to retrieve all suppressed email addresses belonging to the given group.** */ - pub async fn get_all_asm_groups_group(&self, group_id: &str) -> ClientResult> { + pub async fn get_all_asm_groups_group( + &self, + group_id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/asm/groups/{}/suppressions", @@ -84,7 +90,7 @@ impl Suppressions { &self, group_id: &str, body: &crate::types::SuppressionsRequestBody, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/asm/groups/{}/suppressions", @@ -119,7 +125,7 @@ impl Suppressions { &self, group_id: &str, body: &crate::types::SuppressionsRequestBody, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/asm/groups/{}/suppressions/search", @@ -148,7 +154,9 @@ impl Suppressions { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get_asm(&self) -> ClientResult> { + pub async fn get_asm( + &self, + ) -> ClientResult>> { let url = self.client.url("/asm/suppressions", None); self.client .get( @@ -169,7 +177,9 @@ impl Suppressions { * * **This endpoint allows you to retrieve a list of all suppressions.** */ - pub async fn get_all_asm(&self) -> ClientResult> { + pub async fn get_all_asm( + &self, + ) -> ClientResult>> { let url = self.client.url("/asm/suppressions", None); self.client .get_all_pages( @@ -195,7 +205,7 @@ impl Suppressions { pub async fn get_asm_email( &self, email: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/asm/suppressions/{}", @@ -230,7 +240,7 @@ impl Suppressions { &self, group_id: &str, email: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/asm/groups/{}/suppressions/{}", diff --git a/sendgrid/src/suppressions_global.rs b/sendgrid/src/suppressions_global.rs index 267df4ba..34f62e2a 100644 --- a/sendgrid/src/suppressions_global.rs +++ b/sendgrid/src/suppressions_global.rs @@ -25,7 +25,7 @@ impl SuppressionsGlobal { pub async fn post_asm( &self, body: &crate::types::SuppressionsRequestBody, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/asm/suppressions/global", None); self.client .post( @@ -58,7 +58,7 @@ impl SuppressionsGlobal { end_time: i64, limit: i64, offset: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if end_time > 0 { query_args.push(("end_time".to_string(), end_time.to_string())); @@ -100,7 +100,7 @@ impl SuppressionsGlobal { start_time: i64, end_time: i64, offset: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if end_time > 0 { query_args.push(("end_time".to_string(), end_time.to_string())); @@ -141,7 +141,7 @@ impl SuppressionsGlobal { pub async fn get_asm_email( &self, email: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/asm/suppressions/global/{}", @@ -172,7 +172,10 @@ impl SuppressionsGlobal { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn delete_asm_email(&self, email: &str) -> ClientResult { + pub async fn delete_asm_email( + &self, + email: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/asm/suppressions/global/{}", diff --git a/sendgrid/src/suppressions_unsubscribe_groups.rs b/sendgrid/src/suppressions_unsubscribe_groups.rs index 672a5704..a8970b68 100644 --- a/sendgrid/src/suppressions_unsubscribe_groups.rs +++ b/sendgrid/src/suppressions_unsubscribe_groups.rs @@ -28,7 +28,7 @@ impl SuppressionsUnsubscribeGroups { pub async fn get_asm_groups( &self, id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if id > 0 { query_args.push(("id".to_string(), id.to_string())); @@ -59,7 +59,7 @@ impl SuppressionsUnsubscribeGroups { pub async fn get_all_asm_groups( &self, id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if id > 0 { query_args.push(("id".to_string(), id.to_string())); @@ -92,7 +92,7 @@ impl SuppressionsUnsubscribeGroups { pub async fn post_asm_group( &self, body: &crate::types::SuppressionGroupRequestBase, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/asm/groups", None); self.client .post( @@ -118,7 +118,7 @@ impl SuppressionsUnsubscribeGroups { pub async fn get_asm_groups_group( &self, group_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/asm/groups/{}", @@ -154,7 +154,7 @@ impl SuppressionsUnsubscribeGroups { pub async fn delete_asm_groups_group( &self, group_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/asm/groups/{}", @@ -187,7 +187,7 @@ impl SuppressionsUnsubscribeGroups { &self, group_id: &str, body: &crate::types::SuppressionGroupRequestBase, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/asm/groups/{}", diff --git a/sendgrid/src/teammates.rs b/sendgrid/src/teammates.rs index b9b9df31..8726b8d6 100644 --- a/sendgrid/src/teammates.rs +++ b/sendgrid/src/teammates.rs @@ -30,7 +30,7 @@ impl Teammates { &self, limit: u64, offset: u64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.to_string().is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -68,7 +68,7 @@ impl Teammates { pub async fn post( &self, body: &crate::types::PostTeammatesRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/teammates", None); self.client .post( @@ -96,7 +96,7 @@ impl Teammates { pub async fn post_pending_token_resend( &self, token: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teammates/pending/{}/resend", @@ -132,7 +132,7 @@ impl Teammates { &self, limit: i64, offset: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); @@ -168,7 +168,7 @@ impl Teammates { pub async fn get_all_scopes_requests( &self, offset: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if offset > 0 { query_args.push(("offset".to_string(), offset.to_string())); @@ -200,7 +200,9 @@ impl Teammates { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get_pending(&self) -> ClientResult { + pub async fn get_pending( + &self, + ) -> ClientResult> { let url = self.client.url("/teammates/pending", None); self.client .get( @@ -228,7 +230,7 @@ impl Teammates { pub async fn get_username( &self, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teammates/{}", @@ -262,7 +264,7 @@ impl Teammates { pub async fn delete_username( &self, username: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teammates/{}", @@ -301,7 +303,7 @@ impl Teammates { &self, username: &str, body: &crate::types::PatchTeammatesUsernameRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/teammates/{}", @@ -331,7 +333,7 @@ impl Teammates { pub async fn patch_scopes_requests_approve( &self, request_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/scopes/requests/{}/approve", @@ -358,7 +360,10 @@ impl Teammates { * * **Note:** Only teammate admins may delete a teammate's access request. */ - pub async fn delete_scopes_requests_request(&self, request_id: &str) -> ClientResult<()> { + pub async fn delete_scopes_requests_request( + &self, + request_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/scopes/requests/{}", @@ -387,7 +392,7 @@ impl Teammates { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn delete_pending_token(&self, token: &str) -> ClientResult<()> { + pub async fn delete_pending_token(&self, token: &str) -> ClientResult> { let url = self.client.url( &format!( "/teammates/pending/{}", diff --git a/sendgrid/src/transactional_templates.rs b/sendgrid/src/transactional_templates.rs index 3571ef98..43e77273 100644 --- a/sendgrid/src/transactional_templates.rs +++ b/sendgrid/src/transactional_templates.rs @@ -30,7 +30,7 @@ impl TransactionalTemplates { generations: crate::types::Generations, page_size: f64, page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !generations.to_string().is_empty() { query_args.push(("generations".to_string(), generations.to_string())); @@ -67,7 +67,7 @@ impl TransactionalTemplates { pub async fn post_template( &self, body: &crate::types::PostTemplatesRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/templates", None); self.client .post( @@ -93,7 +93,7 @@ impl TransactionalTemplates { pub async fn get_templates_template( &self, template_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/templates/{}", @@ -126,7 +126,7 @@ impl TransactionalTemplates { &self, template_id: &str, body: &crate::types::PostTemplatesTemplateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/templates/{}", @@ -158,7 +158,7 @@ impl TransactionalTemplates { pub async fn delete_templates_template( &self, template_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/templates/{}", @@ -193,7 +193,7 @@ impl TransactionalTemplates { &self, template_id: &str, body: &crate::types::PatchTemplatesTemplateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/templates/{}", diff --git a/sendgrid/src/transactional_templates_versions.rs b/sendgrid/src/transactional_templates_versions.rs index 2fec2735..25fc9f8a 100644 --- a/sendgrid/src/transactional_templates_versions.rs +++ b/sendgrid/src/transactional_templates_versions.rs @@ -26,7 +26,7 @@ impl TransactionalTemplatesVersions { &self, template_id: &str, body: &crate::types::TransactionalTemplateVersionCreate, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/templates/{}/versions", @@ -59,7 +59,7 @@ impl TransactionalTemplatesVersions { &self, template_id: &str, version_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/templates/{}/versions/{}/activate", @@ -93,7 +93,7 @@ impl TransactionalTemplatesVersions { &self, template_id: &str, version_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/templates/{}/versions/{}", @@ -127,7 +127,7 @@ impl TransactionalTemplatesVersions { &self, template_id: &str, version_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/templates/{}/versions/{}", @@ -162,7 +162,7 @@ impl TransactionalTemplatesVersions { template_id: &str, version_id: &str, body: &crate::types::TransactionalTemplateVersionCreate, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/templates/{}/versions/{}", diff --git a/sendgrid/src/users_api.rs b/sendgrid/src/users_api.rs index 68d1ca32..861a42c7 100644 --- a/sendgrid/src/users_api.rs +++ b/sendgrid/src/users_api.rs @@ -20,7 +20,9 @@ impl UsersApi { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get_user_profile(&self) -> ClientResult { + pub async fn get_user_profile( + &self, + ) -> ClientResult> { let url = self.client.url("/user/profile", None); self.client .get( @@ -48,7 +50,7 @@ impl UsersApi { pub async fn patch_user_profile( &self, body: &crate::types::UserProfile, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user/profile", None); self.client .patch( @@ -73,7 +75,9 @@ impl UsersApi { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get_user_account(&self) -> ClientResult { + pub async fn get_user_account( + &self, + ) -> ClientResult> { let url = self.client.url("/user/account", None); self.client .get( @@ -96,7 +100,9 @@ impl UsersApi { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get_user_email(&self) -> ClientResult { + pub async fn get_user_email( + &self, + ) -> ClientResult> { let url = self.client.url("/user/email", None); self.client .get( @@ -122,7 +128,7 @@ impl UsersApi { pub async fn put_user_email( &self, body: &crate::types::PutUserEmailRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user/email", None); self.client .put( @@ -145,7 +151,7 @@ impl UsersApi { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get_user_username(&self) -> ClientResult { + pub async fn get_user_username(&self) -> ClientResult> { let url = self.client.url("/user/username", None); self.client .get( @@ -171,7 +177,7 @@ impl UsersApi { pub async fn put_user_username( &self, body: &crate::types::PutUserUsernameRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user/username", None); self.client .put( @@ -196,7 +202,9 @@ impl UsersApi { * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ - pub async fn get_user_credits(&self) -> ClientResult { + pub async fn get_user_credits( + &self, + ) -> ClientResult> { let url = self.client.url("/user/credits", None); self.client .get( @@ -222,7 +230,7 @@ impl UsersApi { pub async fn put_user_password( &self, body: &crate::types::PutUserPasswordRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user/password", None); self.client .put( diff --git a/sendgrid/src/webhooks.rs b/sendgrid/src/webhooks.rs index 0e54f4bc..9ad6f57a 100644 --- a/sendgrid/src/webhooks.rs +++ b/sendgrid/src/webhooks.rs @@ -30,7 +30,7 @@ impl Webhooks { */ pub async fn get_user_event_settings( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user/webhooks/event/settings", None); self.client .get( @@ -62,7 +62,7 @@ impl Webhooks { pub async fn patch_user_event_settings( &self, body: &crate::types::WebhooksEventWebhookUpdateWithOAuthRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user/webhooks/event/settings", None); self.client .patch( @@ -87,7 +87,7 @@ impl Webhooks { */ pub async fn get_user_parse_settings( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/user/webhooks/parse/settings", None); self.client .get( @@ -126,7 +126,8 @@ impl Webhooks { aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> + { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -176,7 +177,8 @@ impl Webhooks { aggregated_by: crate::types::TraitStatsAdvancedBaseQueryStringsAggregatedBy, start_date: &str, end_date: &str, - ) -> ClientResult> { + ) -> ClientResult>> + { let mut query_args: Vec<(String, String)> = Default::default(); if !aggregated_by.to_string().is_empty() { query_args.push(("aggregated_by".to_string(), aggregated_by.to_string())); @@ -221,7 +223,8 @@ impl Webhooks { */ pub async fn get_user_event_settings_signed( &self, - ) -> ClientResult { + ) -> ClientResult> + { let url = self .client .url("/user/webhooks/event/settings/signed", None); @@ -253,7 +256,8 @@ impl Webhooks { pub async fn patch_user_event_settings_signed( &self, body: &crate::types::GetTrackingSettingsOpenResponse, - ) -> ClientResult { + ) -> ClientResult> + { let url = self .client .url("/user/webhooks/event/settings/signed", None); @@ -289,7 +293,7 @@ impl Webhooks { pub async fn post_user_event_test( &self, body: &crate::types::PostUserWebhooksEventTestRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/user/webhooks/event/test", None); self.client .post( diff --git a/shipbob/src/channels.rs b/shipbob/src/channels.rs index c69a4b9f..95baabd7 100644 --- a/shipbob/src/channels.rs +++ b/shipbob/src/channels.rs @@ -16,7 +16,7 @@ impl Channels { * * This function performs a `GET` to the `/channel` endpoint. */ - pub async fn get_page(&self) -> ClientResult> { + pub async fn get_page(&self) -> ClientResult>> { let url = self.client.url("/channel", None); self.client .get( @@ -35,7 +35,7 @@ impl Channels { * * As opposed to `get`, this function returns all the pages of the request at once. */ - pub async fn get_all(&self) -> ClientResult> { + pub async fn get_all(&self) -> ClientResult>> { let url = self.client.url("/channel", None); self.client .get_all_pages( diff --git a/shipbob/src/inventory.rs b/shipbob/src/inventory.rs index 9a432b9f..5617461c 100644 --- a/shipbob/src/inventory.rs +++ b/shipbob/src/inventory.rs @@ -20,7 +20,10 @@ impl Inventory { * * * `inventory_id: i64` -- Unique id of the channel. */ - pub async fn get(&self, inventory_id: i64) -> ClientResult { + pub async fn get( + &self, + inventory_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/inventory/{}", @@ -68,7 +71,7 @@ impl Inventory { ids: &[String], sort: &str, search: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ids.is_empty() { query_args.push(("IDs".to_string(), ids.join(" "))); @@ -117,7 +120,7 @@ impl Inventory { ids: &[String], sort: &str, search: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ids.is_empty() { query_args.push(("IDs".to_string(), ids.join(" "))); @@ -156,7 +159,10 @@ impl Inventory { * * `product_id: i64` -- The product id to get inventory for. * * `channel_id: i64` -- Unique id of the channel. */ - pub async fn get_product(&self, product_id: i64) -> ClientResult> { + pub async fn get_product( + &self, + product_id: i64, + ) -> ClientResult>> { let url = self.client.url( &format!( "/product/{}/inventory", @@ -184,7 +190,7 @@ impl Inventory { pub async fn get_all_product( &self, product_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/product/{}/inventory", diff --git a/shipbob/src/lib.rs b/shipbob/src/lib.rs index 401a4723..a8ae3040 100644 --- a/shipbob/src/lib.rs +++ b/shipbob/src/lib.rs @@ -154,9 +154,27 @@ pub mod utils; /// Use the Webhooks Resource to create, view or delete subscriptions for a user. pub mod webhooks; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -360,13 +378,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -379,7 +398,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -402,13 +421,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -429,7 +449,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -448,7 +468,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -473,6 +497,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -489,7 +514,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -514,7 +539,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -537,6 +562,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -553,7 +579,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -579,7 +605,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -622,6 +648,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -634,7 +661,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -657,7 +684,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -666,7 +693,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -674,7 +701,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -684,32 +711,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -721,7 +752,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -730,7 +761,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -738,7 +769,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -746,7 +777,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -754,7 +785,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/shipbob/src/locations.rs b/shipbob/src/locations.rs index b6354756..ea12d5f8 100644 --- a/shipbob/src/locations.rs +++ b/shipbob/src/locations.rs @@ -27,7 +27,7 @@ impl Locations { include_inactive: bool, receiving_enabled: bool, access_granted: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if access_granted { query_args.push(("AccessGranted".to_string(), access_granted.to_string())); @@ -65,7 +65,7 @@ impl Locations { include_inactive: bool, receiving_enabled: bool, access_granted: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if access_granted { query_args.push(("AccessGranted".to_string(), access_granted.to_string())); diff --git a/shipbob/src/orders.rs b/shipbob/src/orders.rs index e96e553d..9b90bc83 100644 --- a/shipbob/src/orders.rs +++ b/shipbob/src/orders.rs @@ -28,7 +28,7 @@ impl Orders { pub async fn post_estimate( &self, body: &crate::types::OrdersEstimateFulfillmentRequestModel, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/order/estimate", None); self.client .post( @@ -50,7 +50,7 @@ impl Orders { * * `order_id: i64` -- Unique id of the channel. * * `channel_id: i64` -- Unique id of the channel. */ - pub async fn get(&self, order_id: i64) -> ClientResult { + pub async fn get(&self, order_id: i64) -> ClientResult> { let url = self.client.url( &format!( "/order/{}", @@ -103,7 +103,7 @@ impl Orders { last_update_start_date: Option>, last_update_end_date: Option>, is_tracking_uploaded: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if let Some(date) = end_date { query_args.push(("EndDate".to_string(), date.to_rfc3339())); @@ -173,7 +173,7 @@ impl Orders { last_update_start_date: Option>, last_update_end_date: Option>, is_tracking_uploaded: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if let Some(date) = end_date { query_args.push(("EndDate".to_string(), date.to_rfc3339())); @@ -229,7 +229,7 @@ impl Orders { pub async fn post( &self, body: &crate::types::OrdersCreateOrderModel, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/order", None); self.client .post( @@ -254,7 +254,7 @@ impl Orders { pub async fn post_cancel( &self, order_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/order/{}/cancel", @@ -281,7 +281,7 @@ impl Orders { * * * `order_id: i64` -- The order ID to Get the JSON Stored. */ - pub async fn get_store_json(&self, order_id: i64) -> ClientResult { + pub async fn get_store_json(&self, order_id: i64) -> ClientResult> { let url = self.client.url( &format!( "/order/{}/storeOrderJson", @@ -312,7 +312,7 @@ impl Orders { &self, order_id: i64, body: &crate::types::OrdersAddStoreOrderJsonModel, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/order/{}/storeOrderJson", @@ -345,7 +345,7 @@ impl Orders { &self, order_id: i64, shipment_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/order/{}/shipment/{}", @@ -379,7 +379,7 @@ impl Orders { &self, shipment_id: i64, order_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/order/{}/shipment/{}/cancel", @@ -413,7 +413,7 @@ impl Orders { &self, order_id: i64, shipment_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/order/{}/shipment/{}/timeline", @@ -443,7 +443,7 @@ impl Orders { &self, order_id: i64, shipment_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/order/{}/shipment/{}/timeline", @@ -475,7 +475,7 @@ impl Orders { pub async fn get_shipments( &self, order_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/order/{}/shipment", @@ -503,7 +503,7 @@ impl Orders { pub async fn get_all_shipments( &self, order_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/order/{}/shipment", @@ -536,7 +536,7 @@ impl Orders { &self, order_id: i64, shipment_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/order/{}/shipment/{}/logs", @@ -566,7 +566,7 @@ impl Orders { &self, order_id: i64, shipment_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/order/{}/shipment/{}/logs", @@ -598,7 +598,7 @@ impl Orders { pub async fn get_shipment_orders( &self, shipment_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/shipment/{}", @@ -629,7 +629,7 @@ impl Orders { pub async fn post_shipment_cancel_orders( &self, shipment_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/shipment/{}/cancel", @@ -659,7 +659,7 @@ impl Orders { pub async fn post_shipment_cancel_bulk( &self, body: &crate::types::OrdersCancelShipmentsModel, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/shipment/cancelbulk", None); self.client .post( @@ -684,7 +684,7 @@ impl Orders { pub async fn get_shipment_timeline_orders( &self, shipment_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/shipment/{}/timeline", @@ -712,7 +712,7 @@ impl Orders { pub async fn get_all_shipment_timeline_all( &self, shipment_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/shipment/{}/timeline", @@ -743,7 +743,7 @@ impl Orders { pub async fn get_shipment_logs_orders( &self, shipment_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/shipment/{}/logs", @@ -771,7 +771,7 @@ impl Orders { pub async fn get_all_shipment_logs_all( &self, shipment_id: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/shipment/{}/logs", @@ -805,7 +805,7 @@ impl Orders { &self, page: i64, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("Limit".to_string(), limit.to_string())); @@ -838,7 +838,7 @@ impl Orders { */ pub async fn get_all_shipping_method( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/shippingmethod", None); self.client .get_all_pages( diff --git a/shipbob/src/products.rs b/shipbob/src/products.rs index c736d6b1..8573611f 100644 --- a/shipbob/src/products.rs +++ b/shipbob/src/products.rs @@ -45,7 +45,7 @@ impl Products { search: &str, active_status: crate::types::ProductActiveStatus, bundle_status: crate::types::ProductBundleStatus, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !active_status.to_string().is_empty() { query_args.push(("ActiveStatus".to_string(), active_status.to_string())); @@ -94,7 +94,7 @@ impl Products { search: &str, active_status: crate::types::ProductActiveStatus, bundle_status: crate::types::ProductBundleStatus, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !active_status.to_string().is_empty() { query_args.push(("ActiveStatus".to_string(), active_status.to_string())); @@ -135,7 +135,7 @@ impl Products { pub async fn post( &self, body: &crate::types::ProductsCreateProductModel, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/product", None); self.client .post( @@ -157,7 +157,10 @@ impl Products { * * `product_id: i64` -- Unique identifier of the product. * * `channel_id: i64` -- Unique id of the channel. */ - pub async fn get(&self, product_id: i64) -> ClientResult { + pub async fn get( + &self, + product_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/product/{}", @@ -189,7 +192,7 @@ impl Products { &self, product_id: i64, body: &crate::types::ProductsUpdateProductModel, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/product/{}", @@ -219,7 +222,7 @@ impl Products { pub async fn post_batch( &self, body: &[crate::types::ProductsCreateProductModel], - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/product/batch", None); self.client .post( diff --git a/shipbob/src/receiving.rs b/shipbob/src/receiving.rs index 35534b65..16e9bba4 100644 --- a/shipbob/src/receiving.rs +++ b/shipbob/src/receiving.rs @@ -18,7 +18,7 @@ impl Receiving { */ pub async fn get_fulfillment_center( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/fulfillmentCenter", None); self.client .get( @@ -39,7 +39,7 @@ impl Receiving { */ pub async fn get_all_fulfillment_center( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/fulfillmentCenter", None); self.client .get_all_pages( @@ -60,7 +60,10 @@ impl Receiving { * * * `id: i64` -- Unique id of the channel. */ - pub async fn get(&self, id: i64) -> ClientResult { + pub async fn get( + &self, + id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/receiving/{}", @@ -87,7 +90,7 @@ impl Receiving { * * * `id: i64` -- Unique id of the channel. */ - pub async fn get_label(&self, id: i64) -> ClientResult { + pub async fn get_label(&self, id: i64) -> ClientResult> { let url = self.client.url( &format!( "/receiving/{}/labels", @@ -113,7 +116,7 @@ impl Receiving { pub async fn post( &self, body: &crate::types::ReceivingCreateOrderModel, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/receiving", None); self.client .post( @@ -134,7 +137,7 @@ impl Receiving { * * * `id: i64` -- Id of the receiving order to cancel. */ - pub async fn post_cancel(&self, id: i64) -> ClientResult<()> { + pub async fn post_cancel(&self, id: i64) -> ClientResult> { let url = self.client.url( &format!( "/receiving/{}/cancel", diff --git a/shipbob/src/returns.rs b/shipbob/src/returns.rs index 30e176e4..72963912 100644 --- a/shipbob/src/returns.rs +++ b/shipbob/src/returns.rs @@ -21,7 +21,7 @@ impl Returns { * * `id: i64` -- Unique id of the channel. * * `channel_id: i64` -- Unique id of the channel. */ - pub async fn get(&self, id: i64) -> ClientResult { + pub async fn get(&self, id: i64) -> ClientResult> { let url = self.client.url( &format!( "/return/{}", @@ -53,7 +53,7 @@ impl Returns { &self, id: i64, body: &crate::types::ReturnsCreateReturn, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/return/{}", @@ -106,7 +106,7 @@ impl Returns { tracking_numbers: &[String], original_shipment_ids: &[String], inventory_ids: &[String], - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if let Some(date) = end_date { query_args.push(("EndDate".to_string(), date.to_rfc3339())); @@ -181,7 +181,7 @@ impl Returns { tracking_numbers: &[String], original_shipment_ids: &[String], inventory_ids: &[String], - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if let Some(date) = end_date { query_args.push(("EndDate".to_string(), date.to_rfc3339())); @@ -243,7 +243,7 @@ impl Returns { pub async fn post( &self, body: &crate::types::ReturnsCreateReturn, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/return", None); self.client .post( @@ -265,7 +265,10 @@ impl Returns { * * `id: i64` -- Unique id of the channel. * * `channel_id: i64` -- Unique id of the channel. */ - pub async fn post_cancel(&self, id: i64) -> ClientResult { + pub async fn post_cancel( + &self, + id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/return/{}/cancel", @@ -296,7 +299,7 @@ impl Returns { pub async fn get_status_history( &self, id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/return/{}/statushistory", diff --git a/shipbob/src/webhooks.rs b/shipbob/src/webhooks.rs index 57e3fab9..cb7f5ab2 100644 --- a/shipbob/src/webhooks.rs +++ b/shipbob/src/webhooks.rs @@ -29,7 +29,7 @@ impl Webhooks { topic: crate::types::WebhooksTopics, page: u64, limit: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("Limit".to_string(), limit.to_string())); @@ -64,7 +64,7 @@ impl Webhooks { pub async fn get_all( &self, topic: crate::types::WebhooksTopics, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !topic.to_string().is_empty() { query_args.push(("Topic".to_string(), topic.to_string())); @@ -93,7 +93,7 @@ impl Webhooks { pub async fn post( &self, body: &crate::types::WebhooksCreateWebhookSubscriptionModel, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/webhook", None); self.client .post( @@ -114,7 +114,7 @@ impl Webhooks { * * * `id: i64` -- Unique id of the channel. */ - pub async fn delete(&self, id: i64) -> ClientResult<()> { + pub async fn delete(&self, id: i64) -> ClientResult> { let url = self.client.url( &format!( "/webhook/{}", diff --git a/shopify/src/access.rs b/shopify/src/access.rs index 7a8896f4..5d88acc2 100644 --- a/shopify/src/access.rs +++ b/shopify/src/access.rs @@ -18,7 +18,7 @@ impl Access { * * https://shopify.dev/docs/admin-api/rest/reference/access/accessscope#index-2020-10 */ - pub async fn get_admin_oauth_scope(&self) -> ClientResult<()> { + pub async fn get_admin_oauth_scope(&self) -> ClientResult> { let url = self.client.url("/admin/oauth/access_scopes.json", None); self.client .get( @@ -37,7 +37,9 @@ impl Access { * * https://shopify.dev/docs/admin-api/rest/reference/access/storefrontaccesstoken#index-2020-01 */ - pub async fn deprecated_202001_get_storefront_token(&self) -> ClientResult<()> { + pub async fn deprecated_202001_get_storefront_token( + &self, + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/storefront_access_tokens.json", None); @@ -61,7 +63,7 @@ impl Access { pub async fn deprecated_202001_create_storefront_tokens( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/storefront_access_tokens.json", None); @@ -89,7 +91,7 @@ impl Access { pub async fn deprecated_202001_delete_storefront_tokens_param_token( &self, storefront_access_token_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/storefront_access_tokens/{}/json", @@ -114,7 +116,9 @@ impl Access { * * https://shopify.dev/docs/admin-api/rest/reference/access/storefrontaccesstoken#index-2020-04 */ - pub async fn deprecated_202004_get_storefront_token(&self) -> ClientResult<()> { + pub async fn deprecated_202004_get_storefront_token( + &self, + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/storefront_access_tokens.json", None); @@ -138,7 +142,7 @@ impl Access { pub async fn deprecated_202004_create_storefront_tokens( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/storefront_access_tokens.json", None); @@ -166,7 +170,7 @@ impl Access { pub async fn deprecated_202004_delete_storefront_tokens_param_token( &self, storefront_access_token_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/storefront_access_tokens/{}/json", @@ -191,7 +195,9 @@ impl Access { * * https://shopify.dev/docs/admin-api/rest/reference/access/storefrontaccesstoken#index-2020-07 */ - pub async fn deprecated_202007_get_storefront_token(&self) -> ClientResult<()> { + pub async fn deprecated_202007_get_storefront_token( + &self, + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/storefront_access_tokens.json", None); @@ -215,7 +221,7 @@ impl Access { pub async fn deprecated_202007_create_storefront_tokens( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/storefront_access_tokens.json", None); @@ -243,7 +249,7 @@ impl Access { pub async fn deprecated_202007_delete_storefront_tokens_param_token( &self, storefront_access_token_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/storefront_access_tokens/{}/json", @@ -268,7 +274,7 @@ impl Access { * * https://shopify.dev/docs/admin-api/rest/reference/access/storefrontaccesstoken#index-2020-10 */ - pub async fn get_storefront_token(&self) -> ClientResult<()> { + pub async fn get_storefront_token(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/storefront_access_tokens.json", None); @@ -289,7 +295,10 @@ impl Access { * * https://shopify.dev/docs/admin-api/rest/reference/access/storefrontaccesstoken#create-2020-10 */ - pub async fn create_storefront_tokens(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create_storefront_tokens( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/storefront_access_tokens.json", None); @@ -317,7 +326,7 @@ impl Access { pub async fn delete_storefront_tokens_param_token( &self, storefront_access_token_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/storefront_access_tokens/{}/json", @@ -342,7 +351,9 @@ impl Access { * * https://shopify.dev/docs/admin-api/rest/reference/access/storefrontaccesstoken#index-2021-01 */ - pub async fn deprecated_202101_get_storefront_token(&self) -> ClientResult<()> { + pub async fn deprecated_202101_get_storefront_token( + &self, + ) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/storefront_access_tokens.json", None); @@ -366,7 +377,7 @@ impl Access { pub async fn deprecated_202101_create_storefront_tokens( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/storefront_access_tokens.json", None); @@ -394,7 +405,7 @@ impl Access { pub async fn deprecated_202101_delete_storefront_tokens_param_token( &self, storefront_access_token_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/storefront_access_tokens/{}/json", @@ -419,7 +430,9 @@ impl Access { * * https://shopify.dev/docs/admin-api/rest/reference/access/storefrontaccesstoken#index-unstable */ - pub async fn deprecated_unstable_get_storefront_token(&self) -> ClientResult<()> { + pub async fn deprecated_unstable_get_storefront_token( + &self, + ) -> ClientResult> { let url = self .client .url("/admin/api/unstable/storefront_access_tokens.json", None); @@ -443,7 +456,7 @@ impl Access { pub async fn deprecated_unstable_create_storefront_tokens( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/unstable/storefront_access_tokens.json", None); @@ -471,7 +484,7 @@ impl Access { pub async fn deprecated_unstable_delete_storefront_tokens_param_token( &self, storefront_access_token_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/storefront_access_tokens/{}/json", diff --git a/shopify/src/analytics.rs b/shopify/src/analytics.rs index b50dfc84..fcbefd63 100644 --- a/shopify/src/analytics.rs +++ b/shopify/src/analytics.rs @@ -36,7 +36,7 @@ impl Analytics { updated_at_min: &str, updated_at_max: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -87,7 +87,7 @@ impl Analytics { name: &str, shopify_ql: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !name.is_empty() { query_args.push(("name".to_string(), name.to_string())); @@ -125,7 +125,7 @@ impl Analytics { &self, report_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -164,7 +164,7 @@ impl Analytics { &self, report_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/reports/{}/json", @@ -196,7 +196,7 @@ impl Analytics { pub async fn deprecated_202001_delete_reports_param_report( &self, report_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/reports/{}/json", @@ -239,7 +239,7 @@ impl Analytics { updated_at_min: &str, updated_at_max: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -290,7 +290,7 @@ impl Analytics { name: &str, shopify_ql: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !name.is_empty() { query_args.push(("name".to_string(), name.to_string())); @@ -328,7 +328,7 @@ impl Analytics { &self, report_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -367,7 +367,7 @@ impl Analytics { &self, report_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/reports/{}/json", @@ -399,7 +399,7 @@ impl Analytics { pub async fn deprecated_202004_delete_reports_param_report( &self, report_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/reports/{}/json", @@ -442,7 +442,7 @@ impl Analytics { updated_at_min: &str, updated_at_max: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -493,7 +493,7 @@ impl Analytics { name: &str, shopify_ql: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !name.is_empty() { query_args.push(("name".to_string(), name.to_string())); @@ -531,7 +531,7 @@ impl Analytics { &self, report_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -570,7 +570,7 @@ impl Analytics { &self, report_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/reports/{}/json", @@ -602,7 +602,7 @@ impl Analytics { pub async fn deprecated_202007_delete_reports_param_report( &self, report_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/reports/{}/json", @@ -645,7 +645,7 @@ impl Analytics { updated_at_min: &str, updated_at_max: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -696,7 +696,7 @@ impl Analytics { name: &str, shopify_ql: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !name.is_empty() { query_args.push(("name".to_string(), name.to_string())); @@ -734,7 +734,7 @@ impl Analytics { &self, report_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -773,7 +773,7 @@ impl Analytics { &self, report_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/reports/{}/json", @@ -802,7 +802,10 @@ impl Analytics { * * * `report_id: &str` -- storefront_access_token_id. */ - pub async fn delete_reports_param_report(&self, report_id: &str) -> ClientResult<()> { + pub async fn delete_reports_param_report( + &self, + report_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/reports/{}/json", @@ -845,7 +848,7 @@ impl Analytics { updated_at_min: &str, updated_at_max: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -896,7 +899,7 @@ impl Analytics { name: &str, shopify_ql: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !name.is_empty() { query_args.push(("name".to_string(), name.to_string())); @@ -934,7 +937,7 @@ impl Analytics { &self, report_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -973,7 +976,7 @@ impl Analytics { &self, report_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/reports/{}/json", @@ -1005,7 +1008,7 @@ impl Analytics { pub async fn deprecated_202101_delete_reports_param_report( &self, report_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/reports/{}/json", @@ -1048,7 +1051,7 @@ impl Analytics { updated_at_min: &str, updated_at_max: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1100,7 +1103,7 @@ impl Analytics { name: &str, shopify_ql: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !name.is_empty() { query_args.push(("name".to_string(), name.to_string())); @@ -1139,7 +1142,7 @@ impl Analytics { &self, report_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1178,7 +1181,7 @@ impl Analytics { &self, report_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/reports/{}/json", @@ -1210,7 +1213,7 @@ impl Analytics { pub async fn deprecated_unstable_delete_reports_param_report( &self, report_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/reports/{}/json", diff --git a/shopify/src/billing.rs b/shopify/src/billing.rs index 6d27a867..7d80656b 100644 --- a/shopify/src/billing.rs +++ b/shopify/src/billing.rs @@ -27,7 +27,7 @@ impl Billing { &self, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -60,7 +60,7 @@ impl Billing { pub async fn deprecated_202001_create_application_charges( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/application_charges.json", None); @@ -90,7 +90,7 @@ impl Billing { &self, application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -134,7 +134,7 @@ impl Billing { &self, application_charge_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/application_charges/{}/activate.json", @@ -168,7 +168,7 @@ impl Billing { &self, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -201,7 +201,7 @@ impl Billing { pub async fn deprecated_202004_create_application_charges( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/application_charges.json", None); @@ -231,7 +231,7 @@ impl Billing { &self, application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -275,7 +275,7 @@ impl Billing { &self, application_charge_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/application_charges/{}/activate.json", @@ -309,7 +309,7 @@ impl Billing { &self, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -342,7 +342,7 @@ impl Billing { pub async fn deprecated_202007_create_application_charges( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/application_charges.json", None); @@ -372,7 +372,7 @@ impl Billing { &self, application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -416,7 +416,7 @@ impl Billing { &self, application_charge_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/application_charges/{}/activate.json", @@ -446,7 +446,11 @@ impl Billing { * * `since_id: &str` -- Restrict results to after the specified ID. * * `fields: &str` -- A comma-separated list of fields to include in the response. */ - pub async fn get_application_charge(&self, since_id: &str, fields: &str) -> ClientResult<()> { + pub async fn get_application_charge( + &self, + since_id: &str, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -476,7 +480,10 @@ impl Billing { * * https://shopify.dev/docs/admin-api/rest/reference/billing/applicationcharge#create-2020-10 */ - pub async fn create_application_charges(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create_application_charges( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/application_charges.json", None); @@ -506,7 +513,7 @@ impl Billing { &self, application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -550,7 +557,7 @@ impl Billing { &self, application_charge_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/application_charges/{}/activate.json", @@ -584,7 +591,7 @@ impl Billing { &self, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -617,7 +624,7 @@ impl Billing { pub async fn deprecated_202101_create_application_charges( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/application_charges.json", None); @@ -647,7 +654,7 @@ impl Billing { &self, application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -687,7 +694,7 @@ impl Billing { &self, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -720,7 +727,7 @@ impl Billing { pub async fn deprecated_unstable_create_application_charges( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/unstable/application_charges.json", None); @@ -750,7 +757,7 @@ impl Billing { &self, application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -785,7 +792,10 @@ impl Billing { * * * `fields: &str` -- A comma-separated list of fields to include in the response. */ - pub async fn deprecated_202001_get_application_credit(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_202001_get_application_credit( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -815,7 +825,7 @@ impl Billing { pub async fn deprecated_202001_create_application_credits( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/application_credits.json", None); @@ -845,7 +855,7 @@ impl Billing { &self, application_credit_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -880,7 +890,10 @@ impl Billing { * * * `fields: &str` -- A comma-separated list of fields to include in the response. */ - pub async fn deprecated_202004_get_application_credit(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_202004_get_application_credit( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -910,7 +923,7 @@ impl Billing { pub async fn deprecated_202004_create_application_credits( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/application_credits.json", None); @@ -940,7 +953,7 @@ impl Billing { &self, application_credit_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -975,7 +988,10 @@ impl Billing { * * * `fields: &str` -- A comma-separated list of fields to include in the response. */ - pub async fn deprecated_202007_get_application_credit(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_202007_get_application_credit( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1005,7 +1021,7 @@ impl Billing { pub async fn deprecated_202007_create_application_credits( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/application_credits.json", None); @@ -1035,7 +1051,7 @@ impl Billing { &self, application_credit_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1070,7 +1086,7 @@ impl Billing { * * * `fields: &str` -- A comma-separated list of fields to include in the response. */ - pub async fn get_application_credit(&self, fields: &str) -> ClientResult<()> { + pub async fn get_application_credit(&self, fields: &str) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1097,7 +1113,10 @@ impl Billing { * * https://shopify.dev/docs/admin-api/rest/reference/billing/applicationcredit#create-2020-10 */ - pub async fn create_application_credits(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create_application_credits( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/application_credits.json", None); @@ -1127,7 +1146,7 @@ impl Billing { &self, application_credit_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1162,7 +1181,10 @@ impl Billing { * * * `fields: &str` -- A comma-separated list of fields to include in the response. */ - pub async fn deprecated_202101_get_application_credit(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_202101_get_application_credit( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1192,7 +1214,7 @@ impl Billing { pub async fn deprecated_202101_create_application_credits( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/application_credits.json", None); @@ -1222,7 +1244,7 @@ impl Billing { &self, application_credit_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1260,7 +1282,7 @@ impl Billing { pub async fn deprecated_unstable_get_application_credit( &self, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1290,7 +1312,7 @@ impl Billing { pub async fn deprecated_unstable_create_application_credits( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/unstable/application_credits.json", None); @@ -1320,7 +1342,7 @@ impl Billing { &self, application_credit_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1360,7 +1382,7 @@ impl Billing { &self, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1396,7 +1418,7 @@ impl Billing { pub async fn deprecated_202001_create_recurring_application_charges( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( "/admin/api/2020-01/recurring_application_charges.json", None, @@ -1427,7 +1449,7 @@ impl Billing { &self, recurring_application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1465,7 +1487,7 @@ impl Billing { pub async fn deprecated_202001_delete_recurring_application_charges_param_charge( &self, recurring_application_charge_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/recurring_application_charges/{}/json", @@ -1503,7 +1525,7 @@ impl Billing { &self, recurring_application_charge_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/recurring_application_charges/{}/activate.json", @@ -1537,7 +1559,7 @@ impl Billing { &self, recurring_application_charge_id: &str, recurring_application_charge_capped_amount: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if recurring_application_charge_capped_amount > 0 { query_args.push(( @@ -1580,7 +1602,7 @@ impl Billing { &self, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1616,7 +1638,7 @@ impl Billing { pub async fn deprecated_202004_create_recurring_application_charges( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( "/admin/api/2020-04/recurring_application_charges.json", None, @@ -1647,7 +1669,7 @@ impl Billing { &self, recurring_application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1685,7 +1707,7 @@ impl Billing { pub async fn deprecated_202004_delete_recurring_application_charges_param_charge( &self, recurring_application_charge_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/recurring_application_charges/{}/json", @@ -1723,7 +1745,7 @@ impl Billing { &self, recurring_application_charge_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/recurring_application_charges/{}/activate.json", @@ -1757,7 +1779,7 @@ impl Billing { &self, recurring_application_charge_id: &str, recurring_application_charge_capped_amount: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if recurring_application_charge_capped_amount > 0 { query_args.push(( @@ -1800,7 +1822,7 @@ impl Billing { &self, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1836,7 +1858,7 @@ impl Billing { pub async fn deprecated_202007_create_recurring_application_charges( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( "/admin/api/2020-07/recurring_application_charges.json", None, @@ -1867,7 +1889,7 @@ impl Billing { &self, recurring_application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1905,7 +1927,7 @@ impl Billing { pub async fn deprecated_202007_delete_recurring_application_charges_param_charge( &self, recurring_application_charge_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/recurring_application_charges/{}/json", @@ -1943,7 +1965,7 @@ impl Billing { &self, recurring_application_charge_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/recurring_application_charges/{}/activate.json", @@ -1977,7 +1999,7 @@ impl Billing { &self, recurring_application_charge_id: &str, recurring_application_charge_capped_amount: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if recurring_application_charge_capped_amount > 0 { query_args.push(( @@ -2020,7 +2042,7 @@ impl Billing { &self, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2056,7 +2078,7 @@ impl Billing { pub async fn create_recurring_application_charges( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( "/admin/api/2020-10/recurring_application_charges.json", None, @@ -2087,7 +2109,7 @@ impl Billing { &self, recurring_application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2125,7 +2147,7 @@ impl Billing { pub async fn delete_recurring_application_charges_param_charge( &self, recurring_application_charge_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/recurring_application_charges/{}/json", @@ -2163,7 +2185,7 @@ impl Billing { &self, recurring_application_charge_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/recurring_application_charges/{}/activate.json", @@ -2197,7 +2219,7 @@ impl Billing { &self, recurring_application_charge_id: &str, recurring_application_charge_capped_amount: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if recurring_application_charge_capped_amount > 0 { query_args.push(( @@ -2240,7 +2262,7 @@ impl Billing { &self, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2276,7 +2298,7 @@ impl Billing { pub async fn deprecated_202101_create_recurring_application_charges( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( "/admin/api/2021-01/recurring_application_charges.json", None, @@ -2307,7 +2329,7 @@ impl Billing { &self, recurring_application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2345,7 +2367,7 @@ impl Billing { pub async fn deprecated_202101_delete_recurring_application_charges_param_charge( &self, recurring_application_charge_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/recurring_application_charges/{}/json", @@ -2379,7 +2401,7 @@ impl Billing { &self, recurring_application_charge_id: &str, recurring_application_charge_capped_amount: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if recurring_application_charge_capped_amount > 0 { query_args.push(( @@ -2422,7 +2444,7 @@ impl Billing { &self, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2458,7 +2480,7 @@ impl Billing { pub async fn deprecated_unstable_create_recurring_application_charges( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( "/admin/api/unstable/recurring_application_charges.json", None, @@ -2489,7 +2511,7 @@ impl Billing { &self, recurring_application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2527,7 +2549,7 @@ impl Billing { pub async fn deprecated_unstable_delete_recurring_application_charges_param_charge( &self, recurring_application_charge_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/recurring_application_charges/{}/json", @@ -2561,7 +2583,7 @@ impl Billing { &self, recurring_application_charge_id: &str, recurring_application_charge_capped_amount: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if recurring_application_charge_capped_amount > 0 { query_args.push(( @@ -2604,7 +2626,7 @@ impl Billing { &self, recurring_application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2643,7 +2665,7 @@ impl Billing { &self, recurring_application_charge_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/recurring_application_charges/{}/usage_charges.json", @@ -2679,7 +2701,7 @@ impl Billing { recurring_application_charge_id: &str, usage_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2720,7 +2742,7 @@ impl Billing { &self, recurring_application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2759,7 +2781,7 @@ impl Billing { &self, recurring_application_charge_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/recurring_application_charges/{}/usage_charges.json", @@ -2795,7 +2817,7 @@ impl Billing { recurring_application_charge_id: &str, usage_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2836,7 +2858,7 @@ impl Billing { &self, recurring_application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2875,7 +2897,7 @@ impl Billing { &self, recurring_application_charge_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/recurring_application_charges/{}/usage_charges.json", @@ -2911,7 +2933,7 @@ impl Billing { recurring_application_charge_id: &str, usage_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2952,7 +2974,7 @@ impl Billing { &self, recurring_application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2991,7 +3013,7 @@ impl Billing { &self, recurring_application_charge_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/recurring_application_charges/{}/usage_charges.json", @@ -3027,7 +3049,7 @@ impl Billing { recurring_application_charge_id: &str, usage_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3068,7 +3090,7 @@ impl Billing { &self, recurring_application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3107,7 +3129,7 @@ impl Billing { &self, recurring_application_charge_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/recurring_application_charges/{}/usage_charges.json", @@ -3143,7 +3165,7 @@ impl Billing { recurring_application_charge_id: &str, usage_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3184,7 +3206,7 @@ impl Billing { &self, recurring_application_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3223,7 +3245,7 @@ impl Billing { &self, recurring_application_charge_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/recurring_application_charges/{}/usage_charges.json", @@ -3259,7 +3281,7 @@ impl Billing { recurring_application_charge_id: &str, usage_charge_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); diff --git a/shopify/src/customers.rs b/shopify/src/customers.rs index eaadd5a6..8da2331c 100644 --- a/shopify/src/customers.rs +++ b/shopify/src/customers.rs @@ -40,7 +40,7 @@ impl Customers { updated_at_max: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -88,7 +88,10 @@ impl Customers { * * https://shopify.dev/docs/admin-api/rest/reference/customers/customer#create-2020-01 */ - pub async fn deprecated_202001_create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn deprecated_202001_create( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-01/customers.json", None); self.client .post( @@ -122,7 +125,7 @@ impl Customers { query: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -167,7 +170,7 @@ impl Customers { &self, customer_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -206,7 +209,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/customers/{}/json", @@ -235,7 +238,10 @@ impl Customers { * * * `customer_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202001_delete_param(&self, customer_id: &str) -> ClientResult<()> { + pub async fn deprecated_202001_delete_param( + &self, + customer_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/customers/{}/json", @@ -269,7 +275,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/customers/{}/account_activation_url.json", @@ -302,7 +308,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/customers/{}/send_invite.json", @@ -327,7 +333,7 @@ impl Customers { * * https://shopify.dev/docs/admin-api/rest/reference/customers/customer#count-2020-01 */ - pub async fn deprecated_202001_get_count(&self) -> ClientResult<()> { + pub async fn deprecated_202001_get_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/customers/count.json", None); @@ -352,7 +358,10 @@ impl Customers { * * * `customer_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202001_get_param_order(&self, customer_id: &str) -> ClientResult<()> { + pub async fn deprecated_202001_get_param_order( + &self, + customer_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/customers/{}/orders.json", @@ -399,7 +408,7 @@ impl Customers { updated_at_max: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -447,7 +456,10 @@ impl Customers { * * https://shopify.dev/docs/admin-api/rest/reference/customers/customer#create-2020-04 */ - pub async fn deprecated_202004_create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn deprecated_202004_create( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-04/customers.json", None); self.client .post( @@ -481,7 +493,7 @@ impl Customers { query: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -526,7 +538,7 @@ impl Customers { &self, customer_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -565,7 +577,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/customers/{}/json", @@ -594,7 +606,10 @@ impl Customers { * * * `customer_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202004_delete_param(&self, customer_id: &str) -> ClientResult<()> { + pub async fn deprecated_202004_delete_param( + &self, + customer_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/customers/{}/json", @@ -628,7 +643,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/customers/{}/account_activation_url.json", @@ -661,7 +676,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/customers/{}/send_invite.json", @@ -686,7 +701,7 @@ impl Customers { * * https://shopify.dev/docs/admin-api/rest/reference/customers/customer#count-2020-04 */ - pub async fn deprecated_202004_get_count(&self) -> ClientResult<()> { + pub async fn deprecated_202004_get_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/customers/count.json", None); @@ -711,7 +726,10 @@ impl Customers { * * * `customer_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202004_get_param_order(&self, customer_id: &str) -> ClientResult<()> { + pub async fn deprecated_202004_get_param_order( + &self, + customer_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/customers/{}/orders.json", @@ -758,7 +776,7 @@ impl Customers { updated_at_max: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -806,7 +824,10 @@ impl Customers { * * https://shopify.dev/docs/admin-api/rest/reference/customers/customer#create-2020-07 */ - pub async fn deprecated_202007_create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn deprecated_202007_create( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-07/customers.json", None); self.client .post( @@ -840,7 +861,7 @@ impl Customers { query: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -885,7 +906,7 @@ impl Customers { &self, customer_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -924,7 +945,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/customers/{}/json", @@ -953,7 +974,10 @@ impl Customers { * * * `customer_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202007_delete_param(&self, customer_id: &str) -> ClientResult<()> { + pub async fn deprecated_202007_delete_param( + &self, + customer_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/customers/{}/json", @@ -987,7 +1011,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/customers/{}/account_activation_url.json", @@ -1020,7 +1044,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/customers/{}/send_invite.json", @@ -1045,7 +1069,7 @@ impl Customers { * * https://shopify.dev/docs/admin-api/rest/reference/customers/customer#count-2020-07 */ - pub async fn deprecated_202007_get_count(&self) -> ClientResult<()> { + pub async fn deprecated_202007_get_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/customers/count.json", None); @@ -1070,7 +1094,10 @@ impl Customers { * * * `customer_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202007_get_param_order(&self, customer_id: &str) -> ClientResult<()> { + pub async fn deprecated_202007_get_param_order( + &self, + customer_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/customers/{}/orders.json", @@ -1117,7 +1144,7 @@ impl Customers { updated_at_max: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -1165,7 +1192,7 @@ impl Customers { * * https://shopify.dev/docs/admin-api/rest/reference/customers/customer#create-2020-10 */ - pub async fn create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create(&self, body: &serde_json::Value) -> ClientResult> { let url = self.client.url("/admin/api/2020-10/customers.json", None); self.client .post( @@ -1199,7 +1226,7 @@ impl Customers { query: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1240,7 +1267,11 @@ impl Customers { * * `customer_id: &str` -- storefront_access_token_id. * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ - pub async fn get_param(&self, customer_id: &str, fields: &str) -> ClientResult<()> { + pub async fn get_param( + &self, + customer_id: &str, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1279,7 +1310,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/customers/{}/json", @@ -1308,7 +1339,7 @@ impl Customers { * * * `customer_id: &str` -- storefront_access_token_id. */ - pub async fn delete_param(&self, customer_id: &str) -> ClientResult<()> { + pub async fn delete_param(&self, customer_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/customers/{}/json", @@ -1342,7 +1373,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/customers/{}/account_activation_url.json", @@ -1375,7 +1406,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/customers/{}/send_invite.json", @@ -1400,7 +1431,7 @@ impl Customers { * * https://shopify.dev/docs/admin-api/rest/reference/customers/customer#count-2020-10 */ - pub async fn get_count(&self) -> ClientResult<()> { + pub async fn get_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/customers/count.json", None); @@ -1425,7 +1456,7 @@ impl Customers { * * * `customer_id: &str` -- storefront_access_token_id. */ - pub async fn get_param_order(&self, customer_id: &str) -> ClientResult<()> { + pub async fn get_param_order(&self, customer_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/customers/{}/orders.json", @@ -1472,7 +1503,7 @@ impl Customers { updated_at_max: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -1520,7 +1551,10 @@ impl Customers { * * https://shopify.dev/docs/admin-api/rest/reference/customers/customer#create-2021-01 */ - pub async fn deprecated_202101_create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn deprecated_202101_create( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2021-01/customers.json", None); self.client .post( @@ -1554,7 +1588,7 @@ impl Customers { query: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1599,7 +1633,7 @@ impl Customers { &self, customer_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1638,7 +1672,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/customers/{}/json", @@ -1667,7 +1701,10 @@ impl Customers { * * * `customer_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202101_delete_param(&self, customer_id: &str) -> ClientResult<()> { + pub async fn deprecated_202101_delete_param( + &self, + customer_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/customers/{}/json", @@ -1701,7 +1738,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/customers/{}/account_activation_url.json", @@ -1734,7 +1771,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/customers/{}/send_invite.json", @@ -1759,7 +1796,7 @@ impl Customers { * * https://shopify.dev/docs/admin-api/rest/reference/customers/customer#count-2021-01 */ - pub async fn deprecated_202101_get_count(&self) -> ClientResult<()> { + pub async fn deprecated_202101_get_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/customers/count.json", None); @@ -1784,7 +1821,10 @@ impl Customers { * * * `customer_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202101_get_param_order(&self, customer_id: &str) -> ClientResult<()> { + pub async fn deprecated_202101_get_param_order( + &self, + customer_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/customers/{}/orders.json", @@ -1831,7 +1871,7 @@ impl Customers { updated_at_max: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -1879,7 +1919,10 @@ impl Customers { * * https://shopify.dev/docs/admin-api/rest/reference/customers/customer#create-unstable */ - pub async fn deprecated_unstable_create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn deprecated_unstable_create( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/unstable/customers.json", None); self.client .post( @@ -1913,7 +1956,7 @@ impl Customers { query: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1958,7 +2001,7 @@ impl Customers { &self, customer_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1997,7 +2040,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/customers/{}/json", @@ -2026,7 +2069,10 @@ impl Customers { * * * `customer_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_unstable_delete_param(&self, customer_id: &str) -> ClientResult<()> { + pub async fn deprecated_unstable_delete_param( + &self, + customer_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/customers/{}/json", @@ -2060,7 +2106,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/customers/{}/account_activation_url.json", @@ -2093,7 +2139,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/customers/{}/send_invite.json", @@ -2118,7 +2164,7 @@ impl Customers { * * https://shopify.dev/docs/admin-api/rest/reference/customers/customer#count-unstable */ - pub async fn deprecated_unstable_get_count(&self) -> ClientResult<()> { + pub async fn deprecated_unstable_get_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/unstable/customers/count.json", None); @@ -2143,7 +2189,10 @@ impl Customers { * * * `customer_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_unstable_get_param_order(&self, customer_id: &str) -> ClientResult<()> { + pub async fn deprecated_unstable_get_param_order( + &self, + customer_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/customers/{}/orders.json", @@ -2175,7 +2224,7 @@ impl Customers { pub async fn deprecated_202001_get_param_addresse( &self, customer_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/customers/{}/addresses.json", @@ -2208,7 +2257,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/customers/{}/addresses.json", @@ -2242,7 +2291,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/customers/{}/addresses/{}/json", @@ -2278,7 +2327,7 @@ impl Customers { customer_id: &str, address_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/customers/{}/addresses/{}/json", @@ -2313,7 +2362,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/customers/{}/addresses/{}/json", @@ -2350,7 +2399,7 @@ impl Customers { customer_id: &str, address_ids: i64, operation: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if address_ids > 0 { query_args.push(("address_ids[]".to_string(), address_ids.to_string())); @@ -2393,7 +2442,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/customers/{}/addresses/{}/default.json", @@ -2426,7 +2475,7 @@ impl Customers { pub async fn deprecated_202004_get_param_addresse( &self, customer_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/customers/{}/addresses.json", @@ -2459,7 +2508,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/customers/{}/addresses.json", @@ -2493,7 +2542,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/customers/{}/addresses/{}/json", @@ -2529,7 +2578,7 @@ impl Customers { customer_id: &str, address_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/customers/{}/addresses/{}/json", @@ -2564,7 +2613,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/customers/{}/addresses/{}/json", @@ -2601,7 +2650,7 @@ impl Customers { customer_id: &str, address_ids: i64, operation: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if address_ids > 0 { query_args.push(("address_ids[]".to_string(), address_ids.to_string())); @@ -2644,7 +2693,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/customers/{}/addresses/{}/default.json", @@ -2677,7 +2726,7 @@ impl Customers { pub async fn deprecated_202007_get_param_addresse( &self, customer_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/customers/{}/addresses.json", @@ -2710,7 +2759,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/customers/{}/addresses.json", @@ -2744,7 +2793,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/customers/{}/addresses/{}/json", @@ -2780,7 +2829,7 @@ impl Customers { customer_id: &str, address_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/customers/{}/addresses/{}/json", @@ -2815,7 +2864,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/customers/{}/addresses/{}/json", @@ -2852,7 +2901,7 @@ impl Customers { customer_id: &str, address_ids: i64, operation: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if address_ids > 0 { query_args.push(("address_ids[]".to_string(), address_ids.to_string())); @@ -2895,7 +2944,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/customers/{}/addresses/{}/default.json", @@ -2925,7 +2974,7 @@ impl Customers { * * * `customer_id: &str` -- storefront_access_token_id. */ - pub async fn get_param_addresse(&self, customer_id: &str) -> ClientResult<()> { + pub async fn get_param_addresse(&self, customer_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/customers/{}/addresses.json", @@ -2958,7 +3007,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/customers/{}/addresses.json", @@ -2992,7 +3041,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/customers/{}/addresses/{}/json", @@ -3028,7 +3077,7 @@ impl Customers { customer_id: &str, address_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/customers/{}/addresses/{}/json", @@ -3063,7 +3112,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/customers/{}/addresses/{}/json", @@ -3100,7 +3149,7 @@ impl Customers { customer_id: &str, address_ids: i64, operation: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if address_ids > 0 { query_args.push(("address_ids[]".to_string(), address_ids.to_string())); @@ -3143,7 +3192,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/customers/{}/addresses/{}/default.json", @@ -3176,7 +3225,7 @@ impl Customers { pub async fn deprecated_202101_get_param_addresse( &self, customer_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/customers/{}/addresses.json", @@ -3209,7 +3258,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/customers/{}/addresses.json", @@ -3243,7 +3292,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/customers/{}/addresses/{}/json", @@ -3279,7 +3328,7 @@ impl Customers { customer_id: &str, address_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/customers/{}/addresses/{}/json", @@ -3314,7 +3363,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/customers/{}/addresses/{}/json", @@ -3351,7 +3400,7 @@ impl Customers { customer_id: &str, address_ids: i64, operation: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if address_ids > 0 { query_args.push(("address_ids[]".to_string(), address_ids.to_string())); @@ -3394,7 +3443,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/customers/{}/addresses/{}/default.json", @@ -3427,7 +3476,7 @@ impl Customers { pub async fn deprecated_unstable_get_param_addresse( &self, customer_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/customers/{}/addresses.json", @@ -3460,7 +3509,7 @@ impl Customers { &self, customer_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/customers/{}/addresses.json", @@ -3494,7 +3543,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/customers/{}/addresses/{}/json", @@ -3530,7 +3579,7 @@ impl Customers { customer_id: &str, address_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/customers/{}/addresses/{}/json", @@ -3565,7 +3614,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/customers/{}/addresses/{}/json", @@ -3602,7 +3651,7 @@ impl Customers { customer_id: &str, address_ids: i64, operation: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if address_ids > 0 { query_args.push(("address_ids[]".to_string(), address_ids.to_string())); @@ -3645,7 +3694,7 @@ impl Customers { &self, customer_id: &str, address_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/customers/{}/addresses/{}/default.json", @@ -3683,7 +3732,7 @@ impl Customers { limit: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3719,7 +3768,7 @@ impl Customers { pub async fn deprecated_202001_create_saved_searches( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/customer_saved_searches.json", None); @@ -3747,7 +3796,7 @@ impl Customers { pub async fn deprecated_202001_get_saved_searches_count( &self, since_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !since_id.is_empty() { query_args.push(("since_id".to_string(), since_id.to_string())); @@ -3786,7 +3835,7 @@ impl Customers { &self, customer_saved_search_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3825,7 +3874,7 @@ impl Customers { &self, customer_saved_search_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/customer_saved_searches/{}/json", @@ -3857,7 +3906,7 @@ impl Customers { pub async fn deprecated_202001_delete_saved_searches_param_search( &self, customer_saved_search_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/customer_saved_searches/{}/json", @@ -3897,7 +3946,7 @@ impl Customers { order: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3946,7 +3995,7 @@ impl Customers { limit: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3982,7 +4031,7 @@ impl Customers { pub async fn deprecated_202004_create_saved_searches( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/customer_saved_searches.json", None); @@ -4010,7 +4059,7 @@ impl Customers { pub async fn deprecated_202004_get_saved_searches_count( &self, since_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !since_id.is_empty() { query_args.push(("since_id".to_string(), since_id.to_string())); @@ -4049,7 +4098,7 @@ impl Customers { &self, customer_saved_search_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4088,7 +4137,7 @@ impl Customers { &self, customer_saved_search_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/customer_saved_searches/{}/json", @@ -4120,7 +4169,7 @@ impl Customers { pub async fn deprecated_202004_delete_saved_searches_param_search( &self, customer_saved_search_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/customer_saved_searches/{}/json", @@ -4160,7 +4209,7 @@ impl Customers { order: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4209,7 +4258,7 @@ impl Customers { limit: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4245,7 +4294,7 @@ impl Customers { pub async fn deprecated_202007_create_saved_searches( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/customer_saved_searches.json", None); @@ -4273,7 +4322,7 @@ impl Customers { pub async fn deprecated_202007_get_saved_searches_count( &self, since_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !since_id.is_empty() { query_args.push(("since_id".to_string(), since_id.to_string())); @@ -4312,7 +4361,7 @@ impl Customers { &self, customer_saved_search_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4351,7 +4400,7 @@ impl Customers { &self, customer_saved_search_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/customer_saved_searches/{}/json", @@ -4383,7 +4432,7 @@ impl Customers { pub async fn deprecated_202007_delete_saved_searches_param_search( &self, customer_saved_search_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/customer_saved_searches/{}/json", @@ -4423,7 +4472,7 @@ impl Customers { order: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4472,7 +4521,7 @@ impl Customers { limit: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4505,7 +4554,10 @@ impl Customers { * * https://shopify.dev/docs/admin-api/rest/reference/customers/customersavedsearch#create-2020-10 */ - pub async fn create_saved_searches(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create_saved_searches( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/customer_saved_searches.json", None); @@ -4530,7 +4582,10 @@ impl Customers { * * * `since_id: &str` -- Restrict results to after the specified ID. */ - pub async fn get_saved_searches_count(&self, since_id: &str) -> ClientResult<()> { + pub async fn get_saved_searches_count( + &self, + since_id: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !since_id.is_empty() { query_args.push(("since_id".to_string(), since_id.to_string())); @@ -4569,7 +4624,7 @@ impl Customers { &self, customer_saved_search_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4608,7 +4663,7 @@ impl Customers { &self, customer_saved_search_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/customer_saved_searches/{}/json", @@ -4640,7 +4695,7 @@ impl Customers { pub async fn delete_saved_searches_param_search( &self, customer_saved_search_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/customer_saved_searches/{}/json", @@ -4680,7 +4735,7 @@ impl Customers { order: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4729,7 +4784,7 @@ impl Customers { limit: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4765,7 +4820,7 @@ impl Customers { pub async fn deprecated_202101_create_saved_searches( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/customer_saved_searches.json", None); @@ -4793,7 +4848,7 @@ impl Customers { pub async fn deprecated_202101_get_saved_searches_count( &self, since_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !since_id.is_empty() { query_args.push(("since_id".to_string(), since_id.to_string())); @@ -4832,7 +4887,7 @@ impl Customers { &self, customer_saved_search_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4871,7 +4926,7 @@ impl Customers { &self, customer_saved_search_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/customer_saved_searches/{}/json", @@ -4903,7 +4958,7 @@ impl Customers { pub async fn deprecated_202101_delete_saved_searches_param_search( &self, customer_saved_search_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/customer_saved_searches/{}/json", @@ -4943,7 +4998,7 @@ impl Customers { order: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4992,7 +5047,7 @@ impl Customers { limit: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -5031,7 +5086,7 @@ impl Customers { pub async fn deprecated_unstable_create_saved_searches( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/unstable/customer_saved_searches.json", None); @@ -5059,7 +5114,7 @@ impl Customers { pub async fn deprecated_unstable_get_saved_searches_count( &self, since_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !since_id.is_empty() { query_args.push(("since_id".to_string(), since_id.to_string())); @@ -5098,7 +5153,7 @@ impl Customers { &self, customer_saved_search_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -5137,7 +5192,7 @@ impl Customers { &self, customer_saved_search_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/customer_saved_searches/{}/json", @@ -5169,7 +5224,7 @@ impl Customers { pub async fn deprecated_unstable_delete_saved_searches_param_search( &self, customer_saved_search_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/customer_saved_searches/{}/json", @@ -5209,7 +5264,7 @@ impl Customers { order: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); diff --git a/shopify/src/deprecated_api_calls.rs b/shopify/src/deprecated_api_calls.rs index 18c6d237..fb86bf0d 100644 --- a/shopify/src/deprecated_api_calls.rs +++ b/shopify/src/deprecated_api_calls.rs @@ -18,7 +18,7 @@ impl DeprecatedApiCalls { * * https://shopify.dev/docs/admin-api/rest/reference/deprecated_api_calls#index-2021-01 */ - pub async fn deprecated_202101_get_call(&self) -> ClientResult<()> { + pub async fn deprecated_202101_get_call(&self) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/deprecated_api_calls.json", None); @@ -39,7 +39,7 @@ impl DeprecatedApiCalls { * * https://shopify.dev/docs/admin-api/rest/reference/deprecated_api_calls#index-unstable */ - pub async fn deprecated_unstable_get_call(&self) -> ClientResult<()> { + pub async fn deprecated_unstable_get_call(&self) -> ClientResult> { let url = self .client .url("/admin/api/unstable/deprecated_api_calls.json", None); diff --git a/shopify/src/discounts.rs b/shopify/src/discounts.rs index 313319ca..85d47dc8 100644 --- a/shopify/src/discounts.rs +++ b/shopify/src/discounts.rs @@ -25,7 +25,7 @@ impl Discounts { pub async fn deprecated_202001_get_price_rules_param_rule_code( &self, price_rule_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/price_rules/{}/discount_codes.json", @@ -58,7 +58,7 @@ impl Discounts { &self, price_rule_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/price_rules/{}/discount_codes.json", @@ -92,7 +92,7 @@ impl Discounts { &self, price_rule_id: &str, discount_code_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/price_rules/{}/discount_codes/{}/json", @@ -128,7 +128,7 @@ impl Discounts { price_rule_id: &str, discount_code_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/price_rules/{}/discount_codes/{}/json", @@ -163,7 +163,7 @@ impl Discounts { &self, price_rule_id: &str, discount_code_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/price_rules/{}/discount_codes/{}/json", @@ -195,7 +195,10 @@ impl Discounts { * * * `code: i64` -- recurring_application_charge[capped_amount]. */ - pub async fn deprecated_202001_get_codes_lookup(&self, code: i64) -> ClientResult<()> { + pub async fn deprecated_202001_get_codes_lookup( + &self, + code: i64, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if code > 0 { query_args.push(("code".to_string(), code.to_string())); @@ -247,7 +250,7 @@ impl Discounts { &self, price_rule_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/price_rules/{}/batch.json", @@ -281,7 +284,7 @@ impl Discounts { &self, price_rule_id: &str, batch_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/price_rules/{}/batch/{}/json", @@ -318,7 +321,7 @@ impl Discounts { &self, price_rule_id: &str, batch_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/price_rules/{}/batch/{}/discount_codes.json", @@ -351,7 +354,7 @@ impl Discounts { pub async fn deprecated_202004_get_price_rules_param_rule_code( &self, price_rule_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/price_rules/{}/discount_codes.json", @@ -384,7 +387,7 @@ impl Discounts { &self, price_rule_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/price_rules/{}/discount_codes.json", @@ -418,7 +421,7 @@ impl Discounts { &self, price_rule_id: &str, discount_code_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/price_rules/{}/discount_codes/{}/json", @@ -454,7 +457,7 @@ impl Discounts { price_rule_id: &str, discount_code_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/price_rules/{}/discount_codes/{}/json", @@ -489,7 +492,7 @@ impl Discounts { &self, price_rule_id: &str, discount_code_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/price_rules/{}/discount_codes/{}/json", @@ -521,7 +524,10 @@ impl Discounts { * * * `code: i64` -- recurring_application_charge[capped_amount]. */ - pub async fn deprecated_202004_get_codes_lookup(&self, code: i64) -> ClientResult<()> { + pub async fn deprecated_202004_get_codes_lookup( + &self, + code: i64, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if code > 0 { query_args.push(("code".to_string(), code.to_string())); @@ -573,7 +579,7 @@ impl Discounts { &self, price_rule_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/price_rules/{}/batch.json", @@ -607,7 +613,7 @@ impl Discounts { &self, price_rule_id: &str, batch_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/price_rules/{}/batch/{}/json", @@ -644,7 +650,7 @@ impl Discounts { &self, price_rule_id: &str, batch_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/price_rules/{}/batch/{}/discount_codes.json", @@ -677,7 +683,7 @@ impl Discounts { pub async fn deprecated_202007_get_price_rules_param_rule_code( &self, price_rule_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/price_rules/{}/discount_codes.json", @@ -710,7 +716,7 @@ impl Discounts { &self, price_rule_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/price_rules/{}/discount_codes.json", @@ -744,7 +750,7 @@ impl Discounts { &self, price_rule_id: &str, discount_code_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/price_rules/{}/discount_codes/{}/json", @@ -780,7 +786,7 @@ impl Discounts { price_rule_id: &str, discount_code_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/price_rules/{}/discount_codes/{}/json", @@ -815,7 +821,7 @@ impl Discounts { &self, price_rule_id: &str, discount_code_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/price_rules/{}/discount_codes/{}/json", @@ -847,7 +853,10 @@ impl Discounts { * * * `code: i64` -- recurring_application_charge[capped_amount]. */ - pub async fn deprecated_202007_get_codes_lookup(&self, code: i64) -> ClientResult<()> { + pub async fn deprecated_202007_get_codes_lookup( + &self, + code: i64, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if code > 0 { query_args.push(("code".to_string(), code.to_string())); @@ -899,7 +908,7 @@ impl Discounts { &self, price_rule_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/price_rules/{}/batch.json", @@ -933,7 +942,7 @@ impl Discounts { &self, price_rule_id: &str, batch_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/price_rules/{}/batch/{}/json", @@ -970,7 +979,7 @@ impl Discounts { &self, price_rule_id: &str, batch_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/price_rules/{}/batch/{}/discount_codes.json", @@ -1000,7 +1009,10 @@ impl Discounts { * * * `price_rule_id: &str` -- storefront_access_token_id. */ - pub async fn get_price_rules_param_rule_code(&self, price_rule_id: &str) -> ClientResult<()> { + pub async fn get_price_rules_param_rule_code( + &self, + price_rule_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/price_rules/{}/discount_codes.json", @@ -1033,7 +1045,7 @@ impl Discounts { &self, price_rule_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/price_rules/{}/discount_codes.json", @@ -1067,7 +1079,7 @@ impl Discounts { &self, price_rule_id: &str, discount_code_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/price_rules/{}/discount_codes/{}/json", @@ -1103,7 +1115,7 @@ impl Discounts { price_rule_id: &str, discount_code_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/price_rules/{}/discount_codes/{}/json", @@ -1138,7 +1150,7 @@ impl Discounts { &self, price_rule_id: &str, discount_code_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/price_rules/{}/discount_codes/{}/json", @@ -1170,7 +1182,7 @@ impl Discounts { * * * `code: i64` -- recurring_application_charge[capped_amount]. */ - pub async fn get_codes_lookup(&self, code: i64) -> ClientResult<()> { + pub async fn get_codes_lookup(&self, code: i64) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if code > 0 { query_args.push(("code".to_string(), code.to_string())); @@ -1222,7 +1234,7 @@ impl Discounts { &self, price_rule_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/price_rules/{}/batch.json", @@ -1256,7 +1268,7 @@ impl Discounts { &self, price_rule_id: &str, batch_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/price_rules/{}/batch/{}/json", @@ -1293,7 +1305,7 @@ impl Discounts { &self, price_rule_id: &str, batch_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/price_rules/{}/batch/{}/discount_codes.json", @@ -1326,7 +1338,7 @@ impl Discounts { pub async fn deprecated_202101_get_price_rules_param_rule_code( &self, price_rule_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/price_rules/{}/discount_codes.json", @@ -1359,7 +1371,7 @@ impl Discounts { &self, price_rule_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/price_rules/{}/discount_codes.json", @@ -1393,7 +1405,7 @@ impl Discounts { &self, price_rule_id: &str, discount_code_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/price_rules/{}/discount_codes/{}/json", @@ -1429,7 +1441,7 @@ impl Discounts { price_rule_id: &str, discount_code_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/price_rules/{}/discount_codes/{}/json", @@ -1464,7 +1476,7 @@ impl Discounts { &self, price_rule_id: &str, discount_code_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/price_rules/{}/discount_codes/{}/json", @@ -1496,7 +1508,10 @@ impl Discounts { * * * `code: i64` -- recurring_application_charge[capped_amount]. */ - pub async fn deprecated_202101_get_codes_lookup(&self, code: i64) -> ClientResult<()> { + pub async fn deprecated_202101_get_codes_lookup( + &self, + code: i64, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if code > 0 { query_args.push(("code".to_string(), code.to_string())); @@ -1548,7 +1563,7 @@ impl Discounts { &self, price_rule_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/price_rules/{}/batch.json", @@ -1582,7 +1597,7 @@ impl Discounts { &self, price_rule_id: &str, batch_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/price_rules/{}/batch/{}/json", @@ -1619,7 +1634,7 @@ impl Discounts { &self, price_rule_id: &str, batch_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/price_rules/{}/batch/{}/discount_codes.json", @@ -1652,7 +1667,7 @@ impl Discounts { pub async fn deprecated_unstable_get_price_rules_param_rule_code( &self, price_rule_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/price_rules/{}/discount_codes.json", @@ -1685,7 +1700,7 @@ impl Discounts { &self, price_rule_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/price_rules/{}/discount_codes.json", @@ -1719,7 +1734,7 @@ impl Discounts { &self, price_rule_id: &str, discount_code_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/price_rules/{}/discount_codes/{}/json", @@ -1755,7 +1770,7 @@ impl Discounts { price_rule_id: &str, discount_code_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/price_rules/{}/discount_codes/{}/json", @@ -1790,7 +1805,7 @@ impl Discounts { &self, price_rule_id: &str, discount_code_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/price_rules/{}/discount_codes/{}/json", @@ -1822,7 +1837,10 @@ impl Discounts { * * * `code: i64` -- recurring_application_charge[capped_amount]. */ - pub async fn deprecated_unstable_get_codes_lookup(&self, code: i64) -> ClientResult<()> { + pub async fn deprecated_unstable_get_codes_lookup( + &self, + code: i64, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if code > 0 { query_args.push(("code".to_string(), code.to_string())); @@ -1874,7 +1892,7 @@ impl Discounts { &self, price_rule_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/price_rules/{}/batch.json", @@ -1908,7 +1926,7 @@ impl Discounts { &self, price_rule_id: &str, batch_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/price_rules/{}/batch/{}/json", @@ -1945,7 +1963,7 @@ impl Discounts { &self, price_rule_id: &str, batch_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/price_rules/{}/batch/{}/discount_codes.json", diff --git a/shopify/src/events.rs b/shopify/src/events.rs index a461a07d..2e79aaf6 100644 --- a/shopify/src/events.rs +++ b/shopify/src/events.rs @@ -38,7 +38,7 @@ impl Events { filter: &str, verb: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -91,7 +91,7 @@ impl Events { &self, event_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -131,7 +131,7 @@ impl Events { &self, created_at_min: &str, created_at_max: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -181,7 +181,7 @@ impl Events { filter: &str, verb: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -234,7 +234,7 @@ impl Events { &self, event_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -274,7 +274,7 @@ impl Events { &self, created_at_min: &str, created_at_max: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -324,7 +324,7 @@ impl Events { filter: &str, verb: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -377,7 +377,7 @@ impl Events { &self, event_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -417,7 +417,7 @@ impl Events { &self, created_at_min: &str, created_at_max: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -467,7 +467,7 @@ impl Events { filter: &str, verb: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -516,7 +516,11 @@ impl Events { * * `event_id: &str` -- storefront_access_token_id. * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ - pub async fn get_param(&self, event_id: &str, fields: &str) -> ClientResult<()> { + pub async fn get_param( + &self, + event_id: &str, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -552,7 +556,11 @@ impl Events { * * `created_at_min: &str` -- Count only events created at or after this date and time. (format: 2014-04-25T16:15:47-04:00). * * `created_at_max: &str` -- Count only events created at or before this date and time. (format: 2014-04-25T16:15:47-04:00). */ - pub async fn get_count(&self, created_at_min: &str, created_at_max: &str) -> ClientResult<()> { + pub async fn get_count( + &self, + created_at_min: &str, + created_at_max: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -602,7 +610,7 @@ impl Events { filter: &str, verb: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -655,7 +663,7 @@ impl Events { &self, event_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -695,7 +703,7 @@ impl Events { &self, created_at_min: &str, created_at_max: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -745,7 +753,7 @@ impl Events { filter: &str, verb: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -798,7 +806,7 @@ impl Events { &self, event_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -838,7 +846,7 @@ impl Events { &self, created_at_min: &str, created_at_max: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -893,7 +901,7 @@ impl Events { topic: &str, updated_at_min: &str, updated_at_max: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !address.is_empty() { query_args.push(("address".to_string(), address.to_string())); @@ -953,7 +961,7 @@ impl Events { &self, format: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !format.is_empty() { query_args.push(("format".to_string(), format.to_string())); @@ -990,7 +998,7 @@ impl Events { &self, address: &str, topic: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !address.is_empty() { query_args.push(("address".to_string(), address.to_string())); @@ -1029,7 +1037,7 @@ impl Events { &self, webhook_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1068,7 +1076,7 @@ impl Events { &self, webhook_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/webhooks/{}/json", @@ -1100,7 +1108,7 @@ impl Events { pub async fn deprecated_202001_delete_webhooks_param_webhook( &self, webhook_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/webhooks/{}/json", @@ -1150,7 +1158,7 @@ impl Events { topic: &str, updated_at_min: &str, updated_at_max: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !address.is_empty() { query_args.push(("address".to_string(), address.to_string())); @@ -1210,7 +1218,7 @@ impl Events { &self, format: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !format.is_empty() { query_args.push(("format".to_string(), format.to_string())); @@ -1247,7 +1255,7 @@ impl Events { &self, address: &str, topic: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !address.is_empty() { query_args.push(("address".to_string(), address.to_string())); @@ -1286,7 +1294,7 @@ impl Events { &self, webhook_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1325,7 +1333,7 @@ impl Events { &self, webhook_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/webhooks/{}/json", @@ -1357,7 +1365,7 @@ impl Events { pub async fn deprecated_202004_delete_webhooks_param_webhook( &self, webhook_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/webhooks/{}/json", @@ -1407,7 +1415,7 @@ impl Events { topic: &str, updated_at_min: &str, updated_at_max: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !address.is_empty() { query_args.push(("address".to_string(), address.to_string())); @@ -1467,7 +1475,7 @@ impl Events { &self, format: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !format.is_empty() { query_args.push(("format".to_string(), format.to_string())); @@ -1504,7 +1512,7 @@ impl Events { &self, address: &str, topic: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !address.is_empty() { query_args.push(("address".to_string(), address.to_string())); @@ -1543,7 +1551,7 @@ impl Events { &self, webhook_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1582,7 +1590,7 @@ impl Events { &self, webhook_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/webhooks/{}/json", @@ -1614,7 +1622,7 @@ impl Events { pub async fn deprecated_202007_delete_webhooks_param_webhook( &self, webhook_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/webhooks/{}/json", @@ -1664,7 +1672,7 @@ impl Events { topic: &str, updated_at_min: &str, updated_at_max: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !address.is_empty() { query_args.push(("address".to_string(), address.to_string())); @@ -1724,7 +1732,7 @@ impl Events { &self, format: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !format.is_empty() { query_args.push(("format".to_string(), format.to_string())); @@ -1757,7 +1765,11 @@ impl Events { * * `topic: &str` -- Show webhook subscriptions with a given topic. * For a list of valid values, refer to the topic property.>. */ - pub async fn get_webhooks_count(&self, address: &str, topic: &str) -> ClientResult<()> { + pub async fn get_webhooks_count( + &self, + address: &str, + topic: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !address.is_empty() { query_args.push(("address".to_string(), address.to_string())); @@ -1796,7 +1808,7 @@ impl Events { &self, webhook_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1835,7 +1847,7 @@ impl Events { &self, webhook_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/webhooks/{}/json", @@ -1864,7 +1876,10 @@ impl Events { * * * `webhook_id: &str` -- storefront_access_token_id. */ - pub async fn delete_webhooks_param_webhook(&self, webhook_id: &str) -> ClientResult<()> { + pub async fn delete_webhooks_param_webhook( + &self, + webhook_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/webhooks/{}/json", @@ -1914,7 +1929,7 @@ impl Events { topic: &str, updated_at_min: &str, updated_at_max: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !address.is_empty() { query_args.push(("address".to_string(), address.to_string())); @@ -1974,7 +1989,7 @@ impl Events { &self, format: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !format.is_empty() { query_args.push(("format".to_string(), format.to_string())); @@ -2011,7 +2026,7 @@ impl Events { &self, address: &str, topic: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !address.is_empty() { query_args.push(("address".to_string(), address.to_string())); @@ -2050,7 +2065,7 @@ impl Events { &self, webhook_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2089,7 +2104,7 @@ impl Events { &self, webhook_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/webhooks/{}/json", @@ -2121,7 +2136,7 @@ impl Events { pub async fn deprecated_202101_delete_webhooks_param_webhook( &self, webhook_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/webhooks/{}/json", @@ -2171,7 +2186,7 @@ impl Events { topic: &str, updated_at_min: &str, updated_at_max: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !address.is_empty() { query_args.push(("address".to_string(), address.to_string())); @@ -2231,7 +2246,7 @@ impl Events { &self, format: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !format.is_empty() { query_args.push(("format".to_string(), format.to_string())); @@ -2268,7 +2283,7 @@ impl Events { &self, address: &str, topic: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !address.is_empty() { query_args.push(("address".to_string(), address.to_string())); @@ -2307,7 +2322,7 @@ impl Events { &self, webhook_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2346,7 +2361,7 @@ impl Events { &self, webhook_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/webhooks/{}/json", @@ -2378,7 +2393,7 @@ impl Events { pub async fn deprecated_unstable_delete_webhooks_param_webhook( &self, webhook_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/webhooks/{}/json", diff --git a/shopify/src/inventory.rs b/shopify/src/inventory.rs index 5f2486be..7a3bb57b 100644 --- a/shopify/src/inventory.rs +++ b/shopify/src/inventory.rs @@ -31,7 +31,7 @@ impl Inventory { ids_required: &str, limit: &str, ids: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if ids > 0 { query_args.push(("ids".to_string(), ids.to_string())); @@ -76,7 +76,7 @@ impl Inventory { pub async fn deprecated_202001_get_items_param_item( &self, inventory_item_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/inventory_items/{}/json", @@ -109,7 +109,7 @@ impl Inventory { &self, inventory_item_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/inventory_items/{}/json", @@ -147,7 +147,7 @@ impl Inventory { ids_required: &str, limit: &str, ids: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if ids > 0 { query_args.push(("ids".to_string(), ids.to_string())); @@ -192,7 +192,7 @@ impl Inventory { pub async fn deprecated_202004_get_items_param_item( &self, inventory_item_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/inventory_items/{}/json", @@ -225,7 +225,7 @@ impl Inventory { &self, inventory_item_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/inventory_items/{}/json", @@ -263,7 +263,7 @@ impl Inventory { ids_required: &str, limit: &str, ids: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if ids > 0 { query_args.push(("ids".to_string(), ids.to_string())); @@ -308,7 +308,7 @@ impl Inventory { pub async fn deprecated_202007_get_items_param_item( &self, inventory_item_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/inventory_items/{}/json", @@ -341,7 +341,7 @@ impl Inventory { &self, inventory_item_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/inventory_items/{}/json", @@ -374,7 +374,12 @@ impl Inventory { * (default: 50, maximum: 250). * * `ids: i64` -- recurring_application_charge[capped_amount]. */ - pub async fn get_item(&self, ids_required: &str, limit: &str, ids: i64) -> ClientResult<()> { + pub async fn get_item( + &self, + ids_required: &str, + limit: &str, + ids: i64, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if ids > 0 { query_args.push(("ids".to_string(), ids.to_string())); @@ -416,7 +421,10 @@ impl Inventory { * * * `inventory_item_id: &str` -- storefront_access_token_id. */ - pub async fn get_items_param_item(&self, inventory_item_id: &str) -> ClientResult<()> { + pub async fn get_items_param_item( + &self, + inventory_item_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/inventory_items/{}/json", @@ -449,7 +457,7 @@ impl Inventory { &self, inventory_item_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/inventory_items/{}/json", @@ -487,7 +495,7 @@ impl Inventory { ids_required: &str, limit: &str, ids: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if ids > 0 { query_args.push(("ids".to_string(), ids.to_string())); @@ -532,7 +540,7 @@ impl Inventory { pub async fn deprecated_202101_get_items_param_item( &self, inventory_item_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/inventory_items/{}/json", @@ -565,7 +573,7 @@ impl Inventory { &self, inventory_item_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/inventory_items/{}/json", @@ -603,7 +611,7 @@ impl Inventory { ids_required: &str, limit: &str, ids: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if ids > 0 { query_args.push(("ids".to_string(), ids.to_string())); @@ -648,7 +656,7 @@ impl Inventory { pub async fn deprecated_unstable_get_items_param_item( &self, inventory_item_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/inventory_items/{}/json", @@ -681,7 +689,7 @@ impl Inventory { &self, inventory_item_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/inventory_items/{}/json", @@ -724,7 +732,7 @@ impl Inventory { location_ids: &str, limit: &str, updated_at_min: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !inventory_item_ids.is_empty() { query_args.push(( @@ -779,7 +787,7 @@ impl Inventory { location_id_required: &str, inventory_item_id: i64, location_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if inventory_item_id > 0 { query_args.push(( @@ -840,7 +848,7 @@ impl Inventory { location_id_required: &str, available_adjustment_required: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !available_adjustment_required.is_empty() { query_args.push(( @@ -903,7 +911,7 @@ impl Inventory { location_id_required: &str, relocate_if_necessary: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !inventory_item_id_required.is_empty() { query_args.push(( @@ -970,7 +978,7 @@ impl Inventory { available_required: &str, disconnect_if_necessary: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !available_required.is_empty() { query_args.push(( @@ -1042,7 +1050,7 @@ impl Inventory { location_ids: &str, limit: &str, updated_at_min: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !inventory_item_ids.is_empty() { query_args.push(( @@ -1097,7 +1105,7 @@ impl Inventory { location_id_required: &str, inventory_item_id: i64, location_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if inventory_item_id > 0 { query_args.push(( @@ -1158,7 +1166,7 @@ impl Inventory { location_id_required: &str, available_adjustment_required: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !available_adjustment_required.is_empty() { query_args.push(( @@ -1221,7 +1229,7 @@ impl Inventory { location_id_required: &str, relocate_if_necessary: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !inventory_item_id_required.is_empty() { query_args.push(( @@ -1288,7 +1296,7 @@ impl Inventory { available_required: &str, disconnect_if_necessary: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !available_required.is_empty() { query_args.push(( @@ -1360,7 +1368,7 @@ impl Inventory { location_ids: &str, limit: &str, updated_at_min: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !inventory_item_ids.is_empty() { query_args.push(( @@ -1415,7 +1423,7 @@ impl Inventory { location_id_required: &str, inventory_item_id: i64, location_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if inventory_item_id > 0 { query_args.push(( @@ -1476,7 +1484,7 @@ impl Inventory { location_id_required: &str, available_adjustment_required: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !available_adjustment_required.is_empty() { query_args.push(( @@ -1539,7 +1547,7 @@ impl Inventory { location_id_required: &str, relocate_if_necessary: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !inventory_item_id_required.is_empty() { query_args.push(( @@ -1606,7 +1614,7 @@ impl Inventory { available_required: &str, disconnect_if_necessary: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !available_required.is_empty() { query_args.push(( @@ -1678,7 +1686,7 @@ impl Inventory { location_ids: &str, limit: &str, updated_at_min: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !inventory_item_ids.is_empty() { query_args.push(( @@ -1733,7 +1741,7 @@ impl Inventory { location_id_required: &str, inventory_item_id: i64, location_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if inventory_item_id > 0 { query_args.push(( @@ -1794,7 +1802,7 @@ impl Inventory { location_id_required: &str, available_adjustment_required: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !available_adjustment_required.is_empty() { query_args.push(( @@ -1857,7 +1865,7 @@ impl Inventory { location_id_required: &str, relocate_if_necessary: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !inventory_item_id_required.is_empty() { query_args.push(( @@ -1924,7 +1932,7 @@ impl Inventory { available_required: &str, disconnect_if_necessary: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !available_required.is_empty() { query_args.push(( @@ -1996,7 +2004,7 @@ impl Inventory { location_ids: &str, limit: &str, updated_at_min: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !inventory_item_ids.is_empty() { query_args.push(( @@ -2051,7 +2059,7 @@ impl Inventory { location_id_required: &str, inventory_item_id: i64, location_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if inventory_item_id > 0 { query_args.push(( @@ -2112,7 +2120,7 @@ impl Inventory { location_id_required: &str, available_adjustment_required: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !available_adjustment_required.is_empty() { query_args.push(( @@ -2175,7 +2183,7 @@ impl Inventory { location_id_required: &str, relocate_if_necessary: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !inventory_item_id_required.is_empty() { query_args.push(( @@ -2242,7 +2250,7 @@ impl Inventory { available_required: &str, disconnect_if_necessary: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !available_required.is_empty() { query_args.push(( @@ -2314,7 +2322,7 @@ impl Inventory { location_ids: &str, limit: &str, updated_at_min: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !inventory_item_ids.is_empty() { query_args.push(( @@ -2369,7 +2377,7 @@ impl Inventory { location_id_required: &str, inventory_item_id: i64, location_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if inventory_item_id > 0 { query_args.push(( @@ -2430,7 +2438,7 @@ impl Inventory { location_id_required: &str, available_adjustment_required: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !available_adjustment_required.is_empty() { query_args.push(( @@ -2496,7 +2504,7 @@ impl Inventory { location_id_required: &str, relocate_if_necessary: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !inventory_item_id_required.is_empty() { query_args.push(( @@ -2563,7 +2571,7 @@ impl Inventory { available_required: &str, disconnect_if_necessary: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !available_required.is_empty() { query_args.push(( @@ -2617,7 +2625,7 @@ impl Inventory { * * https://shopify.dev/docs/admin-api/rest/reference/inventory/location#index-2020-01 */ - pub async fn deprecated_202001_get_location(&self) -> ClientResult<()> { + pub async fn deprecated_202001_get_location(&self) -> ClientResult> { let url = self.client.url("/admin/api/2020-01/locations.json", None); self.client .get( @@ -2643,7 +2651,7 @@ impl Inventory { pub async fn deprecated_202001_get_locations_param_location( &self, location_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/locations/{}/json", @@ -2668,7 +2676,7 @@ impl Inventory { * * https://shopify.dev/docs/admin-api/rest/reference/inventory/location#count-2020-01 */ - pub async fn deprecated_202001_get_locations_count(&self) -> ClientResult<()> { + pub async fn deprecated_202001_get_locations_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/locations/count.json", None); @@ -2696,7 +2704,7 @@ impl Inventory { pub async fn deprecated_202001_get_locations_param_location_level( &self, location_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/locations/{}/inventory_levels.json", @@ -2721,7 +2729,7 @@ impl Inventory { * * https://shopify.dev/docs/admin-api/rest/reference/inventory/location#index-2020-04 */ - pub async fn deprecated_202004_get_location(&self) -> ClientResult<()> { + pub async fn deprecated_202004_get_location(&self) -> ClientResult> { let url = self.client.url("/admin/api/2020-04/locations.json", None); self.client .get( @@ -2747,7 +2755,7 @@ impl Inventory { pub async fn deprecated_202004_get_locations_param_location( &self, location_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/locations/{}/json", @@ -2772,7 +2780,7 @@ impl Inventory { * * https://shopify.dev/docs/admin-api/rest/reference/inventory/location#count-2020-04 */ - pub async fn deprecated_202004_get_locations_count(&self) -> ClientResult<()> { + pub async fn deprecated_202004_get_locations_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/locations/count.json", None); @@ -2800,7 +2808,7 @@ impl Inventory { pub async fn deprecated_202004_get_locations_param_location_level( &self, location_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/locations/{}/inventory_levels.json", @@ -2825,7 +2833,7 @@ impl Inventory { * * https://shopify.dev/docs/admin-api/rest/reference/inventory/location#index-2020-07 */ - pub async fn deprecated_202007_get_location(&self) -> ClientResult<()> { + pub async fn deprecated_202007_get_location(&self) -> ClientResult> { let url = self.client.url("/admin/api/2020-07/locations.json", None); self.client .get( @@ -2851,7 +2859,7 @@ impl Inventory { pub async fn deprecated_202007_get_locations_param_location( &self, location_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/locations/{}/json", @@ -2876,7 +2884,7 @@ impl Inventory { * * https://shopify.dev/docs/admin-api/rest/reference/inventory/location#count-2020-07 */ - pub async fn deprecated_202007_get_locations_count(&self) -> ClientResult<()> { + pub async fn deprecated_202007_get_locations_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/locations/count.json", None); @@ -2904,7 +2912,7 @@ impl Inventory { pub async fn deprecated_202007_get_locations_param_location_level( &self, location_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/locations/{}/inventory_levels.json", @@ -2929,7 +2937,7 @@ impl Inventory { * * https://shopify.dev/docs/admin-api/rest/reference/inventory/location#index-2020-10 */ - pub async fn get_location(&self) -> ClientResult<()> { + pub async fn get_location(&self) -> ClientResult> { let url = self.client.url("/admin/api/2020-10/locations.json", None); self.client .get( @@ -2952,7 +2960,10 @@ impl Inventory { * * * `location_id: &str` -- storefront_access_token_id. */ - pub async fn get_locations_param_location(&self, location_id: &str) -> ClientResult<()> { + pub async fn get_locations_param_location( + &self, + location_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/locations/{}/json", @@ -2977,7 +2988,7 @@ impl Inventory { * * https://shopify.dev/docs/admin-api/rest/reference/inventory/location#count-2020-10 */ - pub async fn get_locations_count(&self) -> ClientResult<()> { + pub async fn get_locations_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/locations/count.json", None); @@ -3002,7 +3013,10 @@ impl Inventory { * * * `location_id: &str` -- storefront_access_token_id. */ - pub async fn get_locations_param_location_level(&self, location_id: &str) -> ClientResult<()> { + pub async fn get_locations_param_location_level( + &self, + location_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/locations/{}/inventory_levels.json", @@ -3027,7 +3041,7 @@ impl Inventory { * * https://shopify.dev/docs/admin-api/rest/reference/inventory/location#index-2021-01 */ - pub async fn deprecated_202101_get_location(&self) -> ClientResult<()> { + pub async fn deprecated_202101_get_location(&self) -> ClientResult> { let url = self.client.url("/admin/api/2021-01/locations.json", None); self.client .get( @@ -3053,7 +3067,7 @@ impl Inventory { pub async fn deprecated_202101_get_locations_param_location( &self, location_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/locations/{}/json", @@ -3078,7 +3092,7 @@ impl Inventory { * * https://shopify.dev/docs/admin-api/rest/reference/inventory/location#count-2021-01 */ - pub async fn deprecated_202101_get_locations_count(&self) -> ClientResult<()> { + pub async fn deprecated_202101_get_locations_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/locations/count.json", None); @@ -3106,7 +3120,7 @@ impl Inventory { pub async fn deprecated_202101_get_locations_param_location_level( &self, location_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/locations/{}/inventory_levels.json", @@ -3131,7 +3145,7 @@ impl Inventory { * * https://shopify.dev/docs/admin-api/rest/reference/inventory/location#index-unstable */ - pub async fn deprecated_unstable_get_location(&self) -> ClientResult<()> { + pub async fn deprecated_unstable_get_location(&self) -> ClientResult> { let url = self.client.url("/admin/api/unstable/locations.json", None); self.client .get( @@ -3157,7 +3171,7 @@ impl Inventory { pub async fn deprecated_unstable_get_locations_param_location( &self, location_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/locations/{}/json", @@ -3182,7 +3196,9 @@ impl Inventory { * * https://shopify.dev/docs/admin-api/rest/reference/inventory/location#count-unstable */ - pub async fn deprecated_unstable_get_locations_count(&self) -> ClientResult<()> { + pub async fn deprecated_unstable_get_locations_count( + &self, + ) -> ClientResult> { let url = self .client .url("/admin/api/unstable/locations/count.json", None); @@ -3210,7 +3226,7 @@ impl Inventory { pub async fn deprecated_unstable_get_locations_param_location_level( &self, location_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/locations/{}/inventory_levels.json", diff --git a/shopify/src/lib.rs b/shopify/src/lib.rs index 610edbdf..08148558 100644 --- a/shopify/src/lib.rs +++ b/shopify/src/lib.rs @@ -119,9 +119,27 @@ pub mod types; #[doc(hidden)] pub mod utils; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -616,13 +634,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -635,7 +654,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -658,13 +677,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -685,7 +705,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -704,7 +724,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -729,6 +753,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -745,7 +770,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -770,7 +795,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -793,6 +818,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -809,7 +835,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -835,7 +861,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -878,6 +904,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -890,7 +917,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -913,7 +940,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -922,7 +949,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -930,7 +957,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -940,32 +967,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -977,7 +1008,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -986,7 +1017,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -994,7 +1025,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1002,7 +1033,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1010,7 +1041,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/shopify/src/metafield.rs b/shopify/src/metafield.rs index 74f7ee22..6f448f44 100644 --- a/shopify/src/metafield.rs +++ b/shopify/src/metafield.rs @@ -27,7 +27,7 @@ impl Metafield { &self, metafield_owner_id: i64, metafield_owner_resource: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if metafield_owner_id > 0 { query_args.push(( @@ -63,7 +63,10 @@ impl Metafield { * * https://shopify.dev/docs/admin-api/rest/reference/metafield#create-2020-01 */ - pub async fn deprecated_202001_create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn deprecated_202001_create( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-01/metafields.json", None); self.client .post( @@ -82,7 +85,7 @@ impl Metafield { * * https://shopify.dev/docs/admin-api/rest/reference/metafield#count-2020-01 */ - pub async fn deprecated_202001_get_count(&self) -> ClientResult<()> { + pub async fn deprecated_202001_get_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/metafields/count.json", None); @@ -112,7 +115,7 @@ impl Metafield { &self, metafield_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -151,7 +154,7 @@ impl Metafield { &self, metafield_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/metafields/{}/json", @@ -180,7 +183,10 @@ impl Metafield { * * * `metafield_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202001_delete_param(&self, metafield_id: &str) -> ClientResult<()> { + pub async fn deprecated_202001_delete_param( + &self, + metafield_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/metafields/{}/json", @@ -214,7 +220,7 @@ impl Metafield { &self, metafield_owner_id: i64, metafield_owner_resource: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if metafield_owner_id > 0 { query_args.push(( @@ -250,7 +256,10 @@ impl Metafield { * * https://shopify.dev/docs/admin-api/rest/reference/metafield#create-2020-04 */ - pub async fn deprecated_202004_create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn deprecated_202004_create( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-04/metafields.json", None); self.client .post( @@ -269,7 +278,7 @@ impl Metafield { * * https://shopify.dev/docs/admin-api/rest/reference/metafield#count-2020-04 */ - pub async fn deprecated_202004_get_count(&self) -> ClientResult<()> { + pub async fn deprecated_202004_get_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/metafields/count.json", None); @@ -299,7 +308,7 @@ impl Metafield { &self, metafield_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -338,7 +347,7 @@ impl Metafield { &self, metafield_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/metafields/{}/json", @@ -367,7 +376,10 @@ impl Metafield { * * * `metafield_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202004_delete_param(&self, metafield_id: &str) -> ClientResult<()> { + pub async fn deprecated_202004_delete_param( + &self, + metafield_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/metafields/{}/json", @@ -401,7 +413,7 @@ impl Metafield { &self, metafield_owner_id: i64, metafield_owner_resource: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if metafield_owner_id > 0 { query_args.push(( @@ -437,7 +449,10 @@ impl Metafield { * * https://shopify.dev/docs/admin-api/rest/reference/metafield#create-2020-07 */ - pub async fn deprecated_202007_create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn deprecated_202007_create( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-07/metafields.json", None); self.client .post( @@ -456,7 +471,7 @@ impl Metafield { * * https://shopify.dev/docs/admin-api/rest/reference/metafield#count-2020-07 */ - pub async fn deprecated_202007_get_count(&self) -> ClientResult<()> { + pub async fn deprecated_202007_get_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/metafields/count.json", None); @@ -486,7 +501,7 @@ impl Metafield { &self, metafield_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -525,7 +540,7 @@ impl Metafield { &self, metafield_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/metafields/{}/json", @@ -554,7 +569,10 @@ impl Metafield { * * * `metafield_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202007_delete_param(&self, metafield_id: &str) -> ClientResult<()> { + pub async fn deprecated_202007_delete_param( + &self, + metafield_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/metafields/{}/json", @@ -588,7 +606,7 @@ impl Metafield { &self, metafield_owner_id: i64, metafield_owner_resource: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if metafield_owner_id > 0 { query_args.push(( @@ -624,7 +642,7 @@ impl Metafield { * * https://shopify.dev/docs/admin-api/rest/reference/metafield#create-2020-10 */ - pub async fn create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create(&self, body: &serde_json::Value) -> ClientResult> { let url = self.client.url("/admin/api/2020-10/metafields.json", None); self.client .post( @@ -643,7 +661,7 @@ impl Metafield { * * https://shopify.dev/docs/admin-api/rest/reference/metafield#count-2020-10 */ - pub async fn get_count(&self) -> ClientResult<()> { + pub async fn get_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/metafields/count.json", None); @@ -669,7 +687,11 @@ impl Metafield { * * `metafield_id: &str` -- storefront_access_token_id. * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ - pub async fn get_param(&self, metafield_id: &str, fields: &str) -> ClientResult<()> { + pub async fn get_param( + &self, + metafield_id: &str, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -708,7 +730,7 @@ impl Metafield { &self, metafield_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/metafields/{}/json", @@ -737,7 +759,7 @@ impl Metafield { * * * `metafield_id: &str` -- storefront_access_token_id. */ - pub async fn delete_param(&self, metafield_id: &str) -> ClientResult<()> { + pub async fn delete_param(&self, metafield_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/metafields/{}/json", @@ -771,7 +793,7 @@ impl Metafield { &self, metafield_owner_id: i64, metafield_owner_resource: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if metafield_owner_id > 0 { query_args.push(( @@ -807,7 +829,10 @@ impl Metafield { * * https://shopify.dev/docs/admin-api/rest/reference/metafield#create-2021-01 */ - pub async fn deprecated_202101_create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn deprecated_202101_create( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2021-01/metafields.json", None); self.client .post( @@ -826,7 +851,7 @@ impl Metafield { * * https://shopify.dev/docs/admin-api/rest/reference/metafield#count-2021-01 */ - pub async fn deprecated_202101_get_count(&self) -> ClientResult<()> { + pub async fn deprecated_202101_get_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/metafields/count.json", None); @@ -856,7 +881,7 @@ impl Metafield { &self, metafield_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -895,7 +920,7 @@ impl Metafield { &self, metafield_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/metafields/{}/json", @@ -924,7 +949,10 @@ impl Metafield { * * * `metafield_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202101_delete_param(&self, metafield_id: &str) -> ClientResult<()> { + pub async fn deprecated_202101_delete_param( + &self, + metafield_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/metafields/{}/json", @@ -958,7 +986,7 @@ impl Metafield { &self, metafield_owner_id: i64, metafield_owner_resource: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if metafield_owner_id > 0 { query_args.push(( @@ -994,7 +1022,10 @@ impl Metafield { * * https://shopify.dev/docs/admin-api/rest/reference/metafield#create-unstable */ - pub async fn deprecated_unstable_create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn deprecated_unstable_create( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/unstable/metafields.json", None); self.client .post( @@ -1013,7 +1044,7 @@ impl Metafield { * * https://shopify.dev/docs/admin-api/rest/reference/metafield#count-unstable */ - pub async fn deprecated_unstable_get_count(&self) -> ClientResult<()> { + pub async fn deprecated_unstable_get_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/unstable/metafields/count.json", None); @@ -1043,7 +1074,7 @@ impl Metafield { &self, metafield_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1082,7 +1113,7 @@ impl Metafield { &self, metafield_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/metafields/{}/json", @@ -1111,7 +1142,10 @@ impl Metafield { * * * `metafield_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_unstable_delete_param(&self, metafield_id: &str) -> ClientResult<()> { + pub async fn deprecated_unstable_delete_param( + &self, + metafield_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/metafields/{}/json", diff --git a/shopify/src/online_store.rs b/shopify/src/online_store.rs index c7e951fb..605dd0fd 100644 --- a/shopify/src/online_store.rs +++ b/shopify/src/online_store.rs @@ -57,7 +57,7 @@ impl OnlineStore { tag: &str, author: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !author.is_empty() { query_args.push(("author".to_string(), author.to_string())); @@ -132,7 +132,7 @@ impl OnlineStore { &self, blog_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/blogs/{}/articles.json", @@ -183,7 +183,7 @@ impl OnlineStore { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -243,7 +243,7 @@ impl OnlineStore { blog_id: &str, article_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -285,7 +285,7 @@ impl OnlineStore { blog_id: &str, article_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/blogs/{}/articles/{}/json", @@ -320,7 +320,7 @@ impl OnlineStore { &self, blog_id: &str, article_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/blogs/{}/articles/{}/json", @@ -346,7 +346,7 @@ impl OnlineStore { * * https://shopify.dev/docs/admin-api/rest/reference/online-store/article#authors-2020-01 */ - pub async fn deprecated_202001_get_articles_author(&self) -> ClientResult<()> { + pub async fn deprecated_202001_get_articles_author(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/articles/authors.json", None); @@ -376,7 +376,7 @@ impl OnlineStore { &self, limit: &str, popular: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -445,7 +445,7 @@ impl OnlineStore { tag: &str, author: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !author.is_empty() { query_args.push(("author".to_string(), author.to_string())); @@ -520,7 +520,7 @@ impl OnlineStore { &self, blog_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/blogs/{}/articles.json", @@ -571,7 +571,7 @@ impl OnlineStore { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -631,7 +631,7 @@ impl OnlineStore { blog_id: &str, article_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -673,7 +673,7 @@ impl OnlineStore { blog_id: &str, article_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/blogs/{}/articles/{}/json", @@ -708,7 +708,7 @@ impl OnlineStore { &self, blog_id: &str, article_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/blogs/{}/articles/{}/json", @@ -734,7 +734,7 @@ impl OnlineStore { * * https://shopify.dev/docs/admin-api/rest/reference/online-store/article#authors-2020-04 */ - pub async fn deprecated_202004_get_articles_author(&self) -> ClientResult<()> { + pub async fn deprecated_202004_get_articles_author(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/articles/authors.json", None); @@ -764,7 +764,7 @@ impl OnlineStore { &self, limit: &str, popular: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -833,7 +833,7 @@ impl OnlineStore { tag: &str, author: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !author.is_empty() { query_args.push(("author".to_string(), author.to_string())); @@ -908,7 +908,7 @@ impl OnlineStore { &self, blog_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/blogs/{}/articles.json", @@ -959,7 +959,7 @@ impl OnlineStore { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -1019,7 +1019,7 @@ impl OnlineStore { blog_id: &str, article_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1061,7 +1061,7 @@ impl OnlineStore { blog_id: &str, article_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/blogs/{}/articles/{}/json", @@ -1096,7 +1096,7 @@ impl OnlineStore { &self, blog_id: &str, article_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/blogs/{}/articles/{}/json", @@ -1122,7 +1122,7 @@ impl OnlineStore { * * https://shopify.dev/docs/admin-api/rest/reference/online-store/article#authors-2020-07 */ - pub async fn deprecated_202007_get_articles_author(&self) -> ClientResult<()> { + pub async fn deprecated_202007_get_articles_author(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/articles/authors.json", None); @@ -1152,7 +1152,7 @@ impl OnlineStore { &self, limit: &str, popular: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1221,7 +1221,7 @@ impl OnlineStore { tag: &str, author: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !author.is_empty() { query_args.push(("author".to_string(), author.to_string())); @@ -1296,7 +1296,7 @@ impl OnlineStore { &self, blog_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/blogs/{}/articles.json", @@ -1347,7 +1347,7 @@ impl OnlineStore { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -1407,7 +1407,7 @@ impl OnlineStore { blog_id: &str, article_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1449,7 +1449,7 @@ impl OnlineStore { blog_id: &str, article_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/blogs/{}/articles/{}/json", @@ -1484,7 +1484,7 @@ impl OnlineStore { &self, blog_id: &str, article_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/blogs/{}/articles/{}/json", @@ -1510,7 +1510,7 @@ impl OnlineStore { * * https://shopify.dev/docs/admin-api/rest/reference/online-store/article#authors-2020-10 */ - pub async fn get_articles_author(&self) -> ClientResult<()> { + pub async fn get_articles_author(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/articles/authors.json", None); @@ -1536,7 +1536,11 @@ impl OnlineStore { * * `limit: &str` -- The maximum number of tags to retrieve. * * `popular: &str` -- A flag for ordering retrieved tags. If present in the request, then the results will be ordered by popularity, starting with the most popular tag. */ - pub async fn get_articles_tag(&self, limit: &str, popular: &str) -> ClientResult<()> { + pub async fn get_articles_tag( + &self, + limit: &str, + popular: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1605,7 +1609,7 @@ impl OnlineStore { tag: &str, author: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !author.is_empty() { query_args.push(("author".to_string(), author.to_string())); @@ -1680,7 +1684,7 @@ impl OnlineStore { &self, blog_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/blogs/{}/articles.json", @@ -1731,7 +1735,7 @@ impl OnlineStore { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -1791,7 +1795,7 @@ impl OnlineStore { blog_id: &str, article_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1833,7 +1837,7 @@ impl OnlineStore { blog_id: &str, article_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/blogs/{}/articles/{}/json", @@ -1868,7 +1872,7 @@ impl OnlineStore { &self, blog_id: &str, article_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/blogs/{}/articles/{}/json", @@ -1894,7 +1898,7 @@ impl OnlineStore { * * https://shopify.dev/docs/admin-api/rest/reference/online-store/article#authors-2021-01 */ - pub async fn deprecated_202101_get_articles_author(&self) -> ClientResult<()> { + pub async fn deprecated_202101_get_articles_author(&self) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/articles/authors.json", None); @@ -1924,7 +1928,7 @@ impl OnlineStore { &self, limit: &str, popular: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1993,7 +1997,7 @@ impl OnlineStore { tag: &str, author: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !author.is_empty() { query_args.push(("author".to_string(), author.to_string())); @@ -2068,7 +2072,7 @@ impl OnlineStore { &self, blog_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/blogs/{}/articles.json", @@ -2119,7 +2123,7 @@ impl OnlineStore { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -2179,7 +2183,7 @@ impl OnlineStore { blog_id: &str, article_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2221,7 +2225,7 @@ impl OnlineStore { blog_id: &str, article_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/blogs/{}/articles/{}/json", @@ -2256,7 +2260,7 @@ impl OnlineStore { &self, blog_id: &str, article_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/blogs/{}/articles/{}/json", @@ -2282,7 +2286,9 @@ impl OnlineStore { * * https://shopify.dev/docs/admin-api/rest/reference/online-store/article#authors-unstable */ - pub async fn deprecated_unstable_get_articles_author(&self) -> ClientResult<()> { + pub async fn deprecated_unstable_get_articles_author( + &self, + ) -> ClientResult> { let url = self .client .url("/admin/api/unstable/articles/authors.json", None); @@ -2312,7 +2318,7 @@ impl OnlineStore { &self, limit: &str, popular: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -2355,7 +2361,7 @@ impl OnlineStore { theme_id: &str, fields: &str, asset_key: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !asset_key.is_empty() { query_args.push(("asset[key]".to_string(), asset_key.to_string())); @@ -2402,7 +2408,7 @@ impl OnlineStore { src: &str, source_key: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !source_key.is_empty() { query_args.push(("source_key".to_string(), source_key.to_string())); @@ -2445,7 +2451,7 @@ impl OnlineStore { &self, theme_id: &str, asset_key: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !asset_key.is_empty() { query_args.push(("asset[key]".to_string(), asset_key.to_string())); @@ -2489,7 +2495,7 @@ impl OnlineStore { theme_id: &str, fields: &str, asset_key: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !asset_key.is_empty() { query_args.push(("asset[key]".to_string(), asset_key.to_string())); @@ -2536,7 +2542,7 @@ impl OnlineStore { src: &str, source_key: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !source_key.is_empty() { query_args.push(("source_key".to_string(), source_key.to_string())); @@ -2579,7 +2585,7 @@ impl OnlineStore { &self, theme_id: &str, asset_key: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !asset_key.is_empty() { query_args.push(("asset[key]".to_string(), asset_key.to_string())); @@ -2623,7 +2629,7 @@ impl OnlineStore { theme_id: &str, fields: &str, asset_key: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !asset_key.is_empty() { query_args.push(("asset[key]".to_string(), asset_key.to_string())); @@ -2670,7 +2676,7 @@ impl OnlineStore { src: &str, source_key: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !source_key.is_empty() { query_args.push(("source_key".to_string(), source_key.to_string())); @@ -2713,7 +2719,7 @@ impl OnlineStore { &self, theme_id: &str, asset_key: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !asset_key.is_empty() { query_args.push(("asset[key]".to_string(), asset_key.to_string())); @@ -2757,7 +2763,7 @@ impl OnlineStore { theme_id: &str, fields: &str, asset_key: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !asset_key.is_empty() { query_args.push(("asset[key]".to_string(), asset_key.to_string())); @@ -2804,7 +2810,7 @@ impl OnlineStore { src: &str, source_key: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !source_key.is_empty() { query_args.push(("source_key".to_string(), source_key.to_string())); @@ -2847,7 +2853,7 @@ impl OnlineStore { &self, theme_id: &str, asset_key: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !asset_key.is_empty() { query_args.push(("asset[key]".to_string(), asset_key.to_string())); @@ -2891,7 +2897,7 @@ impl OnlineStore { theme_id: &str, fields: &str, asset_key: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !asset_key.is_empty() { query_args.push(("asset[key]".to_string(), asset_key.to_string())); @@ -2938,7 +2944,7 @@ impl OnlineStore { src: &str, source_key: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !source_key.is_empty() { query_args.push(("source_key".to_string(), source_key.to_string())); @@ -2981,7 +2987,7 @@ impl OnlineStore { &self, theme_id: &str, asset_key: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !asset_key.is_empty() { query_args.push(("asset[key]".to_string(), asset_key.to_string())); @@ -3025,7 +3031,7 @@ impl OnlineStore { theme_id: &str, fields: &str, asset_key: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !asset_key.is_empty() { query_args.push(("asset[key]".to_string(), asset_key.to_string())); @@ -3072,7 +3078,7 @@ impl OnlineStore { src: &str, source_key: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !source_key.is_empty() { query_args.push(("source_key".to_string(), source_key.to_string())); @@ -3115,7 +3121,7 @@ impl OnlineStore { &self, theme_id: &str, asset_key: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !asset_key.is_empty() { query_args.push(("asset[key]".to_string(), asset_key.to_string())); @@ -3160,7 +3166,7 @@ impl OnlineStore { since_id: &str, handle: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3198,7 +3204,7 @@ impl OnlineStore { pub async fn deprecated_202001_create_blogs( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-01/blogs.json", None); self.client .post( @@ -3217,7 +3223,7 @@ impl OnlineStore { * * https://shopify.dev/docs/admin-api/rest/reference/online-store/blog#count-2020-01 */ - pub async fn deprecated_202001_get_blogs_count(&self) -> ClientResult<()> { + pub async fn deprecated_202001_get_blogs_count(&self) -> ClientResult> { let url = self.client.url("/admin/api/2020-01/blogs/count.json", None); self.client .get( @@ -3245,7 +3251,7 @@ impl OnlineStore { &self, blog_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3284,7 +3290,7 @@ impl OnlineStore { &self, blog_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/blogs/{}/json", @@ -3316,7 +3322,7 @@ impl OnlineStore { pub async fn deprecated_202001_delete_blogs_param_blog( &self, blog_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/blogs/{}/json", @@ -3382,7 +3388,7 @@ impl OnlineStore { status: &str, article_id: i64, blog_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if article_id > 0 { query_args.push(("article_id".to_string(), article_id.to_string())); @@ -3448,7 +3454,7 @@ impl OnlineStore { pub async fn deprecated_202001_create_comments( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-01/comments.json", None); self.client .post( @@ -3501,7 +3507,7 @@ impl OnlineStore { status: &str, article_id: i64, blog_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if article_id > 0 { query_args.push(("article_id".to_string(), article_id.to_string())); @@ -3564,7 +3570,7 @@ impl OnlineStore { &self, comment_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3603,7 +3609,7 @@ impl OnlineStore { &self, comment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/comments/{}/json", @@ -3636,7 +3642,7 @@ impl OnlineStore { &self, comment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/comments/{}/spam.json", @@ -3669,7 +3675,7 @@ impl OnlineStore { &self, comment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/comments/{}/not_spam.json", @@ -3702,7 +3708,7 @@ impl OnlineStore { &self, comment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/comments/{}/approve.json", @@ -3735,7 +3741,7 @@ impl OnlineStore { &self, comment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/comments/{}/remove.json", @@ -3768,7 +3774,7 @@ impl OnlineStore { &self, comment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/comments/{}/restore.json", @@ -3809,7 +3815,7 @@ impl OnlineStore { path: &str, target: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3852,7 +3858,7 @@ impl OnlineStore { pub async fn deprecated_202001_create_redirects( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-01/redirects.json", None); self.client .post( @@ -3880,7 +3886,7 @@ impl OnlineStore { &self, path: &str, target: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !path.is_empty() { query_args.push(("path".to_string(), path.to_string())); @@ -3919,7 +3925,7 @@ impl OnlineStore { &self, redirect_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3958,7 +3964,7 @@ impl OnlineStore { &self, redirect_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/redirects/{}/json", @@ -3990,7 +3996,7 @@ impl OnlineStore { pub async fn deprecated_202001_delete_redirects_param_redirect( &self, redirect_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/redirects/{}/json", @@ -4031,7 +4037,7 @@ impl OnlineStore { path: &str, target: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4074,7 +4080,7 @@ impl OnlineStore { pub async fn deprecated_202004_create_redirects( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-04/redirects.json", None); self.client .post( @@ -4102,7 +4108,7 @@ impl OnlineStore { &self, path: &str, target: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !path.is_empty() { query_args.push(("path".to_string(), path.to_string())); @@ -4141,7 +4147,7 @@ impl OnlineStore { &self, redirect_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4180,7 +4186,7 @@ impl OnlineStore { &self, redirect_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/redirects/{}/json", @@ -4212,7 +4218,7 @@ impl OnlineStore { pub async fn deprecated_202004_delete_redirects_param_redirect( &self, redirect_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/redirects/{}/json", @@ -4253,7 +4259,7 @@ impl OnlineStore { path: &str, target: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4296,7 +4302,7 @@ impl OnlineStore { pub async fn deprecated_202007_create_redirects( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-07/redirects.json", None); self.client .post( @@ -4324,7 +4330,7 @@ impl OnlineStore { &self, path: &str, target: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !path.is_empty() { query_args.push(("path".to_string(), path.to_string())); @@ -4363,7 +4369,7 @@ impl OnlineStore { &self, redirect_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4402,7 +4408,7 @@ impl OnlineStore { &self, redirect_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/redirects/{}/json", @@ -4434,7 +4440,7 @@ impl OnlineStore { pub async fn deprecated_202007_delete_redirects_param_redirect( &self, redirect_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/redirects/{}/json", @@ -4475,7 +4481,7 @@ impl OnlineStore { path: &str, target: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4515,7 +4521,10 @@ impl OnlineStore { * * https://shopify.dev/docs/admin-api/rest/reference/online-store/redirect#create-2020-10 */ - pub async fn create_redirects(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create_redirects( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-10/redirects.json", None); self.client .post( @@ -4539,7 +4548,11 @@ impl OnlineStore { * * `path: &str` -- Count redirects with given path. * * `target: &str` -- Count redirects with given target. */ - pub async fn get_redirects_count(&self, path: &str, target: &str) -> ClientResult<()> { + pub async fn get_redirects_count( + &self, + path: &str, + target: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !path.is_empty() { query_args.push(("path".to_string(), path.to_string())); @@ -4578,7 +4591,7 @@ impl OnlineStore { &self, redirect_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4617,7 +4630,7 @@ impl OnlineStore { &self, redirect_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/redirects/{}/json", @@ -4646,7 +4659,10 @@ impl OnlineStore { * * * `redirect_id: &str` -- storefront_access_token_id. */ - pub async fn delete_redirects_param_redirect(&self, redirect_id: &str) -> ClientResult<()> { + pub async fn delete_redirects_param_redirect( + &self, + redirect_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/redirects/{}/json", @@ -4687,7 +4703,7 @@ impl OnlineStore { path: &str, target: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4730,7 +4746,7 @@ impl OnlineStore { pub async fn deprecated_202101_create_redirects( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2021-01/redirects.json", None); self.client .post( @@ -4758,7 +4774,7 @@ impl OnlineStore { &self, path: &str, target: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !path.is_empty() { query_args.push(("path".to_string(), path.to_string())); @@ -4797,7 +4813,7 @@ impl OnlineStore { &self, redirect_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4836,7 +4852,7 @@ impl OnlineStore { &self, redirect_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/redirects/{}/json", @@ -4868,7 +4884,7 @@ impl OnlineStore { pub async fn deprecated_202101_delete_redirects_param_redirect( &self, redirect_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/redirects/{}/json", @@ -4909,7 +4925,7 @@ impl OnlineStore { path: &str, target: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4952,7 +4968,7 @@ impl OnlineStore { pub async fn deprecated_unstable_create_redirects( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/unstable/redirects.json", None); self.client .post( @@ -4980,7 +4996,7 @@ impl OnlineStore { &self, path: &str, target: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !path.is_empty() { query_args.push(("path".to_string(), path.to_string())); @@ -5019,7 +5035,7 @@ impl OnlineStore { &self, redirect_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -5058,7 +5074,7 @@ impl OnlineStore { &self, redirect_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/redirects/{}/json", @@ -5090,7 +5106,7 @@ impl OnlineStore { pub async fn deprecated_unstable_delete_redirects_param_redirect( &self, redirect_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/redirects/{}/json", @@ -5137,7 +5153,7 @@ impl OnlineStore { updated_at_max: &str, src: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -5188,7 +5204,7 @@ impl OnlineStore { pub async fn deprecated_202001_create_script_tags( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-01/script_tags.json", None); self.client .post( @@ -5211,7 +5227,10 @@ impl OnlineStore { * * * `src: &str` -- Count only script tags with a given URL. */ - pub async fn deprecated_202001_get_script_tags_count(&self, src: &str) -> ClientResult<()> { + pub async fn deprecated_202001_get_script_tags_count( + &self, + src: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !src.is_empty() { query_args.push(("src".to_string(), src.to_string())); @@ -5247,7 +5266,7 @@ impl OnlineStore { &self, script_tag_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -5286,7 +5305,7 @@ impl OnlineStore { &self, script_tag_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/script_tags/{}/json", @@ -5318,7 +5337,7 @@ impl OnlineStore { pub async fn deprecated_202001_delete_script_tags_param_tag( &self, script_tag_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/script_tags/{}/json", @@ -5365,7 +5384,7 @@ impl OnlineStore { updated_at_max: &str, src: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -5416,7 +5435,7 @@ impl OnlineStore { pub async fn deprecated_202004_create_script_tags( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-04/script_tags.json", None); self.client .post( @@ -5439,7 +5458,10 @@ impl OnlineStore { * * * `src: &str` -- Count only script tags with a given URL. */ - pub async fn deprecated_202004_get_script_tags_count(&self, src: &str) -> ClientResult<()> { + pub async fn deprecated_202004_get_script_tags_count( + &self, + src: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !src.is_empty() { query_args.push(("src".to_string(), src.to_string())); @@ -5475,7 +5497,7 @@ impl OnlineStore { &self, script_tag_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -5514,7 +5536,7 @@ impl OnlineStore { &self, script_tag_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/script_tags/{}/json", @@ -5546,7 +5568,7 @@ impl OnlineStore { pub async fn deprecated_202004_delete_script_tags_param_tag( &self, script_tag_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/script_tags/{}/json", @@ -5593,7 +5615,7 @@ impl OnlineStore { updated_at_max: &str, src: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -5644,7 +5666,7 @@ impl OnlineStore { pub async fn deprecated_202007_create_script_tags( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-07/script_tags.json", None); self.client .post( @@ -5667,7 +5689,10 @@ impl OnlineStore { * * * `src: &str` -- Count only script tags with a given URL. */ - pub async fn deprecated_202007_get_script_tags_count(&self, src: &str) -> ClientResult<()> { + pub async fn deprecated_202007_get_script_tags_count( + &self, + src: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !src.is_empty() { query_args.push(("src".to_string(), src.to_string())); @@ -5703,7 +5728,7 @@ impl OnlineStore { &self, script_tag_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -5742,7 +5767,7 @@ impl OnlineStore { &self, script_tag_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/script_tags/{}/json", @@ -5774,7 +5799,7 @@ impl OnlineStore { pub async fn deprecated_202007_delete_script_tags_param_tag( &self, script_tag_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/script_tags/{}/json", @@ -5821,7 +5846,7 @@ impl OnlineStore { updated_at_max: &str, src: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -5869,7 +5894,10 @@ impl OnlineStore { * * https://shopify.dev/docs/admin-api/rest/reference/online-store/scripttag#create-2020-10 */ - pub async fn create_script_tags(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create_script_tags( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-10/script_tags.json", None); self.client .post( @@ -5892,7 +5920,7 @@ impl OnlineStore { * * * `src: &str` -- Count only script tags with a given URL. */ - pub async fn get_script_tags_count(&self, src: &str) -> ClientResult<()> { + pub async fn get_script_tags_count(&self, src: &str) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !src.is_empty() { query_args.push(("src".to_string(), src.to_string())); @@ -5928,7 +5956,7 @@ impl OnlineStore { &self, script_tag_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -5967,7 +5995,7 @@ impl OnlineStore { &self, script_tag_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/script_tags/{}/json", @@ -5996,7 +6024,10 @@ impl OnlineStore { * * * `script_tag_id: &str` -- storefront_access_token_id. */ - pub async fn delete_script_tags_param_tag(&self, script_tag_id: &str) -> ClientResult<()> { + pub async fn delete_script_tags_param_tag( + &self, + script_tag_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/script_tags/{}/json", @@ -6043,7 +6074,7 @@ impl OnlineStore { updated_at_max: &str, src: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -6094,7 +6125,7 @@ impl OnlineStore { pub async fn deprecated_202101_create_script_tags( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2021-01/script_tags.json", None); self.client .post( @@ -6117,7 +6148,10 @@ impl OnlineStore { * * * `src: &str` -- Count only script tags with a given URL. */ - pub async fn deprecated_202101_get_script_tags_count(&self, src: &str) -> ClientResult<()> { + pub async fn deprecated_202101_get_script_tags_count( + &self, + src: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !src.is_empty() { query_args.push(("src".to_string(), src.to_string())); @@ -6153,7 +6187,7 @@ impl OnlineStore { &self, script_tag_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -6192,7 +6226,7 @@ impl OnlineStore { &self, script_tag_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/script_tags/{}/json", @@ -6224,7 +6258,7 @@ impl OnlineStore { pub async fn deprecated_202101_delete_script_tags_param_tag( &self, script_tag_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/script_tags/{}/json", @@ -6271,7 +6305,7 @@ impl OnlineStore { updated_at_max: &str, src: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -6322,7 +6356,7 @@ impl OnlineStore { pub async fn deprecated_unstable_create_script_tags( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/unstable/script_tags.json", None); @@ -6347,7 +6381,10 @@ impl OnlineStore { * * * `src: &str` -- Count only script tags with a given URL. */ - pub async fn deprecated_unstable_get_script_tags_count(&self, src: &str) -> ClientResult<()> { + pub async fn deprecated_unstable_get_script_tags_count( + &self, + src: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !src.is_empty() { query_args.push(("src".to_string(), src.to_string())); @@ -6383,7 +6420,7 @@ impl OnlineStore { &self, script_tag_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -6422,7 +6459,7 @@ impl OnlineStore { &self, script_tag_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/script_tags/{}/json", @@ -6454,7 +6491,7 @@ impl OnlineStore { pub async fn deprecated_unstable_delete_script_tags_param_tag( &self, script_tag_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/script_tags/{}/json", @@ -6483,7 +6520,10 @@ impl OnlineStore { * * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ - pub async fn deprecated_202001_get_theme(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_202001_get_theme( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -6515,7 +6555,7 @@ impl OnlineStore { pub async fn deprecated_202001_create_themes( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-01/themes.json", None); self.client .post( @@ -6543,7 +6583,7 @@ impl OnlineStore { &self, theme_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -6582,7 +6622,7 @@ impl OnlineStore { &self, theme_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/themes/{}/json", @@ -6614,7 +6654,7 @@ impl OnlineStore { pub async fn deprecated_202001_delete_themes_param_theme( &self, theme_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/themes/{}/json", @@ -6643,7 +6683,10 @@ impl OnlineStore { * * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ - pub async fn deprecated_202004_get_theme(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_202004_get_theme( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -6675,7 +6718,7 @@ impl OnlineStore { pub async fn deprecated_202004_create_themes( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-04/themes.json", None); self.client .post( @@ -6703,7 +6746,7 @@ impl OnlineStore { &self, theme_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -6742,7 +6785,7 @@ impl OnlineStore { &self, theme_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/themes/{}/json", @@ -6774,7 +6817,7 @@ impl OnlineStore { pub async fn deprecated_202004_delete_themes_param_theme( &self, theme_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/themes/{}/json", @@ -6803,7 +6846,10 @@ impl OnlineStore { * * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ - pub async fn deprecated_202007_get_theme(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_202007_get_theme( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -6835,7 +6881,7 @@ impl OnlineStore { pub async fn deprecated_202007_create_themes( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-07/themes.json", None); self.client .post( @@ -6863,7 +6909,7 @@ impl OnlineStore { &self, theme_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -6902,7 +6948,7 @@ impl OnlineStore { &self, theme_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/themes/{}/json", @@ -6934,7 +6980,7 @@ impl OnlineStore { pub async fn deprecated_202007_delete_themes_param_theme( &self, theme_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/themes/{}/json", @@ -6963,7 +7009,7 @@ impl OnlineStore { * * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ - pub async fn get_theme(&self, fields: &str) -> ClientResult<()> { + pub async fn get_theme(&self, fields: &str) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -6992,7 +7038,10 @@ impl OnlineStore { * * https://shopify.dev/docs/admin-api/rest/reference/online-store/theme#create-2020-10 */ - pub async fn create_themes(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create_themes( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-10/themes.json", None); self.client .post( @@ -7016,7 +7065,11 @@ impl OnlineStore { * * `theme_id: &str` -- storefront_access_token_id. * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ - pub async fn get_themes_param_theme(&self, theme_id: &str, fields: &str) -> ClientResult<()> { + pub async fn get_themes_param_theme( + &self, + theme_id: &str, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -7055,7 +7108,7 @@ impl OnlineStore { &self, theme_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/themes/{}/json", @@ -7084,7 +7137,10 @@ impl OnlineStore { * * * `theme_id: &str` -- storefront_access_token_id. */ - pub async fn delete_themes_param_theme(&self, theme_id: &str) -> ClientResult<()> { + pub async fn delete_themes_param_theme( + &self, + theme_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/themes/{}/json", @@ -7113,7 +7169,10 @@ impl OnlineStore { * * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ - pub async fn deprecated_202101_get_theme(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_202101_get_theme( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -7145,7 +7204,7 @@ impl OnlineStore { pub async fn deprecated_202101_create_themes( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2021-01/themes.json", None); self.client .post( @@ -7173,7 +7232,7 @@ impl OnlineStore { &self, theme_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -7212,7 +7271,7 @@ impl OnlineStore { &self, theme_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/themes/{}/json", @@ -7244,7 +7303,7 @@ impl OnlineStore { pub async fn deprecated_202101_delete_themes_param_theme( &self, theme_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/themes/{}/json", @@ -7273,7 +7332,10 @@ impl OnlineStore { * * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ - pub async fn deprecated_unstable_get_theme(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_unstable_get_theme( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -7305,7 +7367,7 @@ impl OnlineStore { pub async fn deprecated_unstable_create_themes( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/unstable/themes.json", None); self.client .post( @@ -7333,7 +7395,7 @@ impl OnlineStore { &self, theme_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -7372,7 +7434,7 @@ impl OnlineStore { &self, theme_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/themes/{}/json", @@ -7404,7 +7466,7 @@ impl OnlineStore { pub async fn deprecated_unstable_delete_themes_param_theme( &self, theme_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/themes/{}/json", diff --git a/shopify/src/orders.rs b/shopify/src/orders.rs index 4196ec8c..8a96b485 100644 --- a/shopify/src/orders.rs +++ b/shopify/src/orders.rs @@ -39,7 +39,7 @@ impl Orders { updated_at_min: &str, updated_at_max: &str, status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -102,7 +102,7 @@ impl Orders { updated_at_min: &str, updated_at_max: &str, status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -165,7 +165,7 @@ impl Orders { updated_at_min: &str, updated_at_max: &str, status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -228,7 +228,7 @@ impl Orders { updated_at_min: &str, updated_at_max: &str, status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -291,7 +291,7 @@ impl Orders { updated_at_min: &str, updated_at_max: &str, status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -354,7 +354,7 @@ impl Orders { updated_at_min: &str, updated_at_max: &str, status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -454,7 +454,7 @@ impl Orders { financial_status: &str, fulfillment_status: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !attribution_app_id.is_empty() { query_args.push(( @@ -548,7 +548,10 @@ impl Orders { * * https://shopify.dev/docs/admin-api/rest/reference/orders/order#create-2020-01 */ - pub async fn deprecated_202001_create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn deprecated_202001_create( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-01/orders.json", None); self.client .post( @@ -576,7 +579,7 @@ impl Orders { &self, order_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -615,7 +618,7 @@ impl Orders { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/json", @@ -644,7 +647,10 @@ impl Orders { * * * `order_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202001_delete_param(&self, order_id: &str) -> ClientResult<()> { + pub async fn deprecated_202001_delete_param( + &self, + order_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/json", @@ -708,7 +714,7 @@ impl Orders { status: &str, financial_status: &str, fulfillment_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -764,7 +770,7 @@ impl Orders { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/close.json", @@ -797,7 +803,7 @@ impl Orders { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/open.json", @@ -848,7 +854,7 @@ impl Orders { email: &str, refund: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !amount.is_empty() { query_args.push(("amount".to_string(), amount.to_string())); @@ -957,7 +963,7 @@ impl Orders { financial_status: &str, fulfillment_status: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !attribution_app_id.is_empty() { query_args.push(( @@ -1051,7 +1057,10 @@ impl Orders { * * https://shopify.dev/docs/admin-api/rest/reference/orders/order#create-2020-04 */ - pub async fn deprecated_202004_create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn deprecated_202004_create( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-04/orders.json", None); self.client .post( @@ -1079,7 +1088,7 @@ impl Orders { &self, order_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1118,7 +1127,7 @@ impl Orders { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/json", @@ -1147,7 +1156,10 @@ impl Orders { * * * `order_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202004_delete_param(&self, order_id: &str) -> ClientResult<()> { + pub async fn deprecated_202004_delete_param( + &self, + order_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/json", @@ -1211,7 +1223,7 @@ impl Orders { status: &str, financial_status: &str, fulfillment_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -1267,7 +1279,7 @@ impl Orders { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/close.json", @@ -1300,7 +1312,7 @@ impl Orders { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/open.json", @@ -1351,7 +1363,7 @@ impl Orders { email: &str, refund: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !amount.is_empty() { query_args.push(("amount".to_string(), amount.to_string())); @@ -1460,7 +1472,7 @@ impl Orders { financial_status: &str, fulfillment_status: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !attribution_app_id.is_empty() { query_args.push(( @@ -1535,7 +1547,10 @@ impl Orders { * * * `order_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202001_get_param_risk(&self, order_id: &str) -> ClientResult<()> { + pub async fn deprecated_202001_get_param_risk( + &self, + order_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/risks.json", @@ -1568,7 +1583,7 @@ impl Orders { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/risks.json", @@ -1602,7 +1617,7 @@ impl Orders { &self, order_id: &str, risk_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/risks/{}/json", @@ -1642,7 +1657,7 @@ impl Orders { order_id: &str, risk_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/risks/{}/json", @@ -1681,7 +1696,7 @@ impl Orders { &self, order_id: &str, risk_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/risks/{}/json", @@ -1711,7 +1726,10 @@ impl Orders { * * * `order_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202004_get_param_risk(&self, order_id: &str) -> ClientResult<()> { + pub async fn deprecated_202004_get_param_risk( + &self, + order_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/risks.json", @@ -1744,7 +1762,7 @@ impl Orders { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/risks.json", @@ -1778,7 +1796,7 @@ impl Orders { &self, order_id: &str, risk_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/risks/{}/json", @@ -1818,7 +1836,7 @@ impl Orders { order_id: &str, risk_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/risks/{}/json", @@ -1857,7 +1875,7 @@ impl Orders { &self, order_id: &str, risk_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/risks/{}/json", @@ -1887,7 +1905,10 @@ impl Orders { * * * `order_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202007_get_param_risk(&self, order_id: &str) -> ClientResult<()> { + pub async fn deprecated_202007_get_param_risk( + &self, + order_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/orders/{}/risks.json", @@ -1920,7 +1941,7 @@ impl Orders { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/orders/{}/risks.json", @@ -1954,7 +1975,7 @@ impl Orders { &self, order_id: &str, risk_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/orders/{}/risks/{}/json", @@ -1994,7 +2015,7 @@ impl Orders { order_id: &str, risk_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/orders/{}/risks/{}/json", @@ -2033,7 +2054,7 @@ impl Orders { &self, order_id: &str, risk_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/orders/{}/risks/{}/json", @@ -2063,7 +2084,7 @@ impl Orders { * * * `order_id: &str` -- storefront_access_token_id. */ - pub async fn get_param_risk(&self, order_id: &str) -> ClientResult<()> { + pub async fn get_param_risk(&self, order_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/orders/{}/risks.json", @@ -2096,7 +2117,7 @@ impl Orders { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/orders/{}/risks.json", @@ -2126,7 +2147,11 @@ impl Orders { * * `order_id: &str` -- storefront_access_token_id. * * `risk_id: &str` -- storefront_access_token_id. */ - pub async fn get_param_risks_risk(&self, order_id: &str, risk_id: &str) -> ClientResult<()> { + pub async fn get_param_risks_risk( + &self, + order_id: &str, + risk_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/orders/{}/risks/{}/json", @@ -2166,7 +2191,7 @@ impl Orders { order_id: &str, risk_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/orders/{}/risks/{}/json", @@ -2201,7 +2226,11 @@ impl Orders { * * `order_id: &str` -- storefront_access_token_id. * * `risk_id: &str` -- storefront_access_token_id. */ - pub async fn delete_param_risks_risk(&self, order_id: &str, risk_id: &str) -> ClientResult<()> { + pub async fn delete_param_risks_risk( + &self, + order_id: &str, + risk_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/orders/{}/risks/{}/json", @@ -2231,7 +2260,10 @@ impl Orders { * * * `order_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202101_get_param_risk(&self, order_id: &str) -> ClientResult<()> { + pub async fn deprecated_202101_get_param_risk( + &self, + order_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/orders/{}/risks.json", @@ -2264,7 +2296,7 @@ impl Orders { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/orders/{}/risks.json", @@ -2298,7 +2330,7 @@ impl Orders { &self, order_id: &str, risk_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/orders/{}/risks/{}/json", @@ -2338,7 +2370,7 @@ impl Orders { order_id: &str, risk_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/orders/{}/risks/{}/json", @@ -2377,7 +2409,7 @@ impl Orders { &self, order_id: &str, risk_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/orders/{}/risks/{}/json", @@ -2407,7 +2439,10 @@ impl Orders { * * * `order_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_unstable_get_param_risk(&self, order_id: &str) -> ClientResult<()> { + pub async fn deprecated_unstable_get_param_risk( + &self, + order_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/orders/{}/risks.json", @@ -2440,7 +2475,7 @@ impl Orders { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/orders/{}/risks.json", @@ -2474,7 +2509,7 @@ impl Orders { &self, order_id: &str, risk_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/orders/{}/risks/{}/json", @@ -2514,7 +2549,7 @@ impl Orders { order_id: &str, risk_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/orders/{}/risks/{}/json", @@ -2553,7 +2588,7 @@ impl Orders { &self, order_id: &str, risk_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/orders/{}/risks/{}/json", @@ -2594,7 +2629,7 @@ impl Orders { limit: &str, fields: &str, in_shop_currency: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2686,7 +2721,7 @@ impl Orders { transactions: &str, currency: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !currency.is_empty() { query_args.push(("currency".to_string(), currency.to_string())); @@ -2763,7 +2798,7 @@ impl Orders { refund_id: &str, fields: &str, in_shop_currency: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2846,7 +2881,7 @@ impl Orders { refund_line_items: &str, currency: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !currency.is_empty() { query_args.push(("currency".to_string(), currency.to_string())); @@ -2901,7 +2936,7 @@ impl Orders { limit: &str, fields: &str, in_shop_currency: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2993,7 +3028,7 @@ impl Orders { transactions: &str, currency: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !currency.is_empty() { query_args.push(("currency".to_string(), currency.to_string())); @@ -3070,7 +3105,7 @@ impl Orders { refund_id: &str, fields: &str, in_shop_currency: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3153,7 +3188,7 @@ impl Orders { refund_line_items: &str, currency: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !currency.is_empty() { query_args.push(("currency".to_string(), currency.to_string())); @@ -3208,7 +3243,7 @@ impl Orders { limit: &str, fields: &str, in_shop_currency: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3300,7 +3335,7 @@ impl Orders { transactions: &str, currency: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !currency.is_empty() { query_args.push(("currency".to_string(), currency.to_string())); @@ -3377,7 +3412,7 @@ impl Orders { refund_id: &str, fields: &str, in_shop_currency: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3460,7 +3495,7 @@ impl Orders { refund_line_items: &str, currency: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !currency.is_empty() { query_args.push(("currency".to_string(), currency.to_string())); @@ -3515,7 +3550,7 @@ impl Orders { limit: &str, fields: &str, in_shop_currency: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3607,7 +3642,7 @@ impl Orders { transactions: &str, currency: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !currency.is_empty() { query_args.push(("currency".to_string(), currency.to_string())); @@ -3684,7 +3719,7 @@ impl Orders { refund_id: &str, fields: &str, in_shop_currency: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3767,7 +3802,7 @@ impl Orders { refund_line_items: &str, currency: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !currency.is_empty() { query_args.push(("currency".to_string(), currency.to_string())); @@ -3822,7 +3857,7 @@ impl Orders { limit: &str, fields: &str, in_shop_currency: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3914,7 +3949,7 @@ impl Orders { transactions: &str, currency: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !currency.is_empty() { query_args.push(("currency".to_string(), currency.to_string())); @@ -3991,7 +4026,7 @@ impl Orders { refund_id: &str, fields: &str, in_shop_currency: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4074,7 +4109,7 @@ impl Orders { refund_line_items: &str, currency: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !currency.is_empty() { query_args.push(("currency".to_string(), currency.to_string())); @@ -4129,7 +4164,7 @@ impl Orders { limit: &str, fields: &str, in_shop_currency: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4221,7 +4256,7 @@ impl Orders { transactions: &str, currency: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !currency.is_empty() { query_args.push(("currency".to_string(), currency.to_string())); @@ -4298,7 +4333,7 @@ impl Orders { refund_id: &str, fields: &str, in_shop_currency: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4381,7 +4416,7 @@ impl Orders { refund_line_items: &str, currency: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !currency.is_empty() { query_args.push(("currency".to_string(), currency.to_string())); diff --git a/shopify/src/plus.rs b/shopify/src/plus.rs index dabc7bb4..7ff6201a 100644 --- a/shopify/src/plus.rs +++ b/shopify/src/plus.rs @@ -35,7 +35,7 @@ impl Plus { limit: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -74,7 +74,7 @@ impl Plus { pub async fn deprecated_202001_create_gift_cards( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-01/gift_cards.json", None); self.client .post( @@ -100,7 +100,7 @@ impl Plus { pub async fn deprecated_202001_get_gift_cards_param_card( &self, gift_card_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/gift_cards/{}/json", @@ -134,7 +134,7 @@ impl Plus { &self, gift_card_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/gift_cards/{}/json", @@ -166,7 +166,10 @@ impl Plus { * enabled: Count only enabled gift cards * disabled: Count only disabled gift cards. */ - pub async fn deprecated_202001_get_gift_cards_count(&self, status: &str) -> ClientResult<()> { + pub async fn deprecated_202001_get_gift_cards_count( + &self, + status: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !status.is_empty() { query_args.push(("status".to_string(), status.to_string())); @@ -201,7 +204,7 @@ impl Plus { &self, gift_card_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/gift_cards/{}/disable.json", @@ -252,7 +255,7 @@ impl Plus { query: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -305,7 +308,7 @@ impl Plus { limit: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -344,7 +347,7 @@ impl Plus { pub async fn deprecated_202004_create_gift_cards( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-04/gift_cards.json", None); self.client .post( @@ -370,7 +373,7 @@ impl Plus { pub async fn deprecated_202004_get_gift_cards_param_card( &self, gift_card_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/gift_cards/{}/json", @@ -404,7 +407,7 @@ impl Plus { &self, gift_card_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/gift_cards/{}/json", @@ -436,7 +439,10 @@ impl Plus { * enabled: Count only enabled gift cards * disabled: Count only disabled gift cards. */ - pub async fn deprecated_202004_get_gift_cards_count(&self, status: &str) -> ClientResult<()> { + pub async fn deprecated_202004_get_gift_cards_count( + &self, + status: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !status.is_empty() { query_args.push(("status".to_string(), status.to_string())); @@ -471,7 +477,7 @@ impl Plus { &self, gift_card_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/gift_cards/{}/disable.json", @@ -522,7 +528,7 @@ impl Plus { query: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -575,7 +581,7 @@ impl Plus { limit: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -614,7 +620,7 @@ impl Plus { pub async fn deprecated_202007_create_gift_cards( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-07/gift_cards.json", None); self.client .post( @@ -640,7 +646,7 @@ impl Plus { pub async fn deprecated_202007_get_gift_cards_param_card( &self, gift_card_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/gift_cards/{}/json", @@ -674,7 +680,7 @@ impl Plus { &self, gift_card_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/gift_cards/{}/json", @@ -706,7 +712,10 @@ impl Plus { * enabled: Count only enabled gift cards * disabled: Count only disabled gift cards. */ - pub async fn deprecated_202007_get_gift_cards_count(&self, status: &str) -> ClientResult<()> { + pub async fn deprecated_202007_get_gift_cards_count( + &self, + status: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !status.is_empty() { query_args.push(("status".to_string(), status.to_string())); @@ -741,7 +750,7 @@ impl Plus { &self, gift_card_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/gift_cards/{}/disable.json", @@ -792,7 +801,7 @@ impl Plus { query: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -845,7 +854,7 @@ impl Plus { limit: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -881,7 +890,10 @@ impl Plus { * * https://shopify.dev/docs/admin-api/rest/reference/plus/giftcard#create-2020-10 */ - pub async fn create_gift_cards(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create_gift_cards( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-10/gift_cards.json", None); self.client .post( @@ -904,7 +916,10 @@ impl Plus { * * * `gift_card_id: &str` -- storefront_access_token_id. */ - pub async fn get_gift_cards_param_card(&self, gift_card_id: &str) -> ClientResult<()> { + pub async fn get_gift_cards_param_card( + &self, + gift_card_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/gift_cards/{}/json", @@ -938,7 +953,7 @@ impl Plus { &self, gift_card_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/gift_cards/{}/json", @@ -970,7 +985,7 @@ impl Plus { * enabled: Count only enabled gift cards * disabled: Count only disabled gift cards. */ - pub async fn get_gift_cards_count(&self, status: &str) -> ClientResult<()> { + pub async fn get_gift_cards_count(&self, status: &str) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !status.is_empty() { query_args.push(("status".to_string(), status.to_string())); @@ -1005,7 +1020,7 @@ impl Plus { &self, gift_card_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/gift_cards/{}/disable.json", @@ -1056,7 +1071,7 @@ impl Plus { query: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1109,7 +1124,7 @@ impl Plus { limit: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1148,7 +1163,7 @@ impl Plus { pub async fn deprecated_202101_create_gift_cards( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2021-01/gift_cards.json", None); self.client .post( @@ -1174,7 +1189,7 @@ impl Plus { pub async fn deprecated_202101_get_gift_cards_param_card( &self, gift_card_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/gift_cards/{}/json", @@ -1208,7 +1223,7 @@ impl Plus { &self, gift_card_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/gift_cards/{}/json", @@ -1240,7 +1255,10 @@ impl Plus { * enabled: Count only enabled gift cards * disabled: Count only disabled gift cards. */ - pub async fn deprecated_202101_get_gift_cards_count(&self, status: &str) -> ClientResult<()> { + pub async fn deprecated_202101_get_gift_cards_count( + &self, + status: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !status.is_empty() { query_args.push(("status".to_string(), status.to_string())); @@ -1275,7 +1293,7 @@ impl Plus { &self, gift_card_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/gift_cards/{}/disable.json", @@ -1326,7 +1344,7 @@ impl Plus { query: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1379,7 +1397,7 @@ impl Plus { limit: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1418,7 +1436,7 @@ impl Plus { pub async fn deprecated_unstable_create_gift_cards( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/unstable/gift_cards.json", None); self.client .post( @@ -1444,7 +1462,7 @@ impl Plus { pub async fn deprecated_unstable_get_gift_cards_param_card( &self, gift_card_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/gift_cards/{}/json", @@ -1478,7 +1496,7 @@ impl Plus { &self, gift_card_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/gift_cards/{}/json", @@ -1510,7 +1528,10 @@ impl Plus { * enabled: Count only enabled gift cards * disabled: Count only disabled gift cards. */ - pub async fn deprecated_unstable_get_gift_cards_count(&self, status: &str) -> ClientResult<()> { + pub async fn deprecated_unstable_get_gift_cards_count( + &self, + status: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !status.is_empty() { query_args.push(("status".to_string(), status.to_string())); @@ -1545,7 +1566,7 @@ impl Plus { &self, gift_card_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/gift_cards/{}/disable.json", @@ -1596,7 +1617,7 @@ impl Plus { query: &str, limit: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1642,7 +1663,7 @@ impl Plus { &self, limit: &str, page_info: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1675,7 +1696,10 @@ impl Plus { * * * `user_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202001_get_users_param_user(&self, user_id: &str) -> ClientResult<()> { + pub async fn deprecated_202001_get_users_param_user( + &self, + user_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/users/{}/json", @@ -1700,7 +1724,7 @@ impl Plus { * * https://shopify.dev/docs/admin-api/rest/reference/plus/user#current-2020-01 */ - pub async fn deprecated_202001_get_users_current(&self) -> ClientResult<()> { + pub async fn deprecated_202001_get_users_current(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/users/current.json", None); @@ -1731,7 +1755,7 @@ impl Plus { &self, limit: &str, page_info: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1764,7 +1788,10 @@ impl Plus { * * * `user_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202004_get_users_param_user(&self, user_id: &str) -> ClientResult<()> { + pub async fn deprecated_202004_get_users_param_user( + &self, + user_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/users/{}/json", @@ -1789,7 +1816,7 @@ impl Plus { * * https://shopify.dev/docs/admin-api/rest/reference/plus/user#current-2020-04 */ - pub async fn deprecated_202004_get_users_current(&self) -> ClientResult<()> { + pub async fn deprecated_202004_get_users_current(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/users/current.json", None); @@ -1820,7 +1847,7 @@ impl Plus { &self, limit: &str, page_info: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1853,7 +1880,10 @@ impl Plus { * * * `user_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202007_get_users_param_user(&self, user_id: &str) -> ClientResult<()> { + pub async fn deprecated_202007_get_users_param_user( + &self, + user_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/users/{}/json", @@ -1878,7 +1908,7 @@ impl Plus { * * https://shopify.dev/docs/admin-api/rest/reference/plus/user#current-2020-07 */ - pub async fn deprecated_202007_get_users_current(&self) -> ClientResult<()> { + pub async fn deprecated_202007_get_users_current(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/users/current.json", None); @@ -1905,7 +1935,11 @@ impl Plus { * (default: 50, maximum: 250). * * `page_info: &str` -- A unique ID used to access a certain page of results. */ - pub async fn get_user(&self, limit: &str, page_info: &str) -> ClientResult<()> { + pub async fn get_user( + &self, + limit: &str, + page_info: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1938,7 +1972,7 @@ impl Plus { * * * `user_id: &str` -- storefront_access_token_id. */ - pub async fn get_users_param_user(&self, user_id: &str) -> ClientResult<()> { + pub async fn get_users_param_user(&self, user_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/users/{}/json", @@ -1963,7 +1997,7 @@ impl Plus { * * https://shopify.dev/docs/admin-api/rest/reference/plus/user#current-2020-10 */ - pub async fn get_users_current(&self) -> ClientResult<()> { + pub async fn get_users_current(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/users/current.json", None); @@ -1994,7 +2028,7 @@ impl Plus { &self, limit: &str, page_info: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -2027,7 +2061,10 @@ impl Plus { * * * `user_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202101_get_users_param_user(&self, user_id: &str) -> ClientResult<()> { + pub async fn deprecated_202101_get_users_param_user( + &self, + user_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/users/{}/json", @@ -2052,7 +2089,7 @@ impl Plus { * * https://shopify.dev/docs/admin-api/rest/reference/plus/user#current-2021-01 */ - pub async fn deprecated_202101_get_users_current(&self) -> ClientResult<()> { + pub async fn deprecated_202101_get_users_current(&self) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/users/current.json", None); @@ -2083,7 +2120,7 @@ impl Plus { &self, limit: &str, page_info: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -2119,7 +2156,7 @@ impl Plus { pub async fn deprecated_unstable_get_users_param_user( &self, user_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/users/{}/json", @@ -2144,7 +2181,7 @@ impl Plus { * * https://shopify.dev/docs/admin-api/rest/reference/plus/user#current-unstable */ - pub async fn deprecated_unstable_get_users_current(&self) -> ClientResult<()> { + pub async fn deprecated_unstable_get_users_current(&self) -> ClientResult> { let url = self .client .url("/admin/api/unstable/users/current.json", None); diff --git a/shopify/src/products.rs b/shopify/src/products.rs index 7192c749..5b111cd0 100644 --- a/shopify/src/products.rs +++ b/shopify/src/products.rs @@ -30,7 +30,7 @@ impl Products { limit: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -66,7 +66,7 @@ impl Products { pub async fn deprecated_202001_create_collects( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-01/collects.json", None); self.client .post( @@ -94,7 +94,7 @@ impl Products { &self, collect_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -132,7 +132,7 @@ impl Products { pub async fn deprecated_202001_delete_collects_param_collect( &self, collect_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/collects/{}/json", @@ -164,7 +164,7 @@ impl Products { pub async fn deprecated_202001_get_collects_count( &self, collection_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if collection_id > 0 { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -203,7 +203,7 @@ impl Products { limit: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -239,7 +239,7 @@ impl Products { pub async fn deprecated_202004_create_collects( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-04/collects.json", None); self.client .post( @@ -267,7 +267,7 @@ impl Products { &self, collect_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -305,7 +305,7 @@ impl Products { pub async fn deprecated_202004_delete_collects_param_collect( &self, collect_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/collects/{}/json", @@ -337,7 +337,7 @@ impl Products { pub async fn deprecated_202004_get_collects_count( &self, collection_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if collection_id > 0 { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -376,7 +376,7 @@ impl Products { limit: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -412,7 +412,7 @@ impl Products { pub async fn deprecated_202007_create_collects( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-07/collects.json", None); self.client .post( @@ -440,7 +440,7 @@ impl Products { &self, collect_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -478,7 +478,7 @@ impl Products { pub async fn deprecated_202007_delete_collects_param_collect( &self, collect_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/collects/{}/json", @@ -510,7 +510,7 @@ impl Products { pub async fn deprecated_202007_get_collects_count( &self, collection_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if collection_id > 0 { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -544,7 +544,12 @@ impl Products { * * `since_id: &str` -- Restrict results to after the specified ID. * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ - pub async fn get_collect(&self, limit: &str, since_id: &str, fields: &str) -> ClientResult<()> { + pub async fn get_collect( + &self, + limit: &str, + since_id: &str, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -577,7 +582,10 @@ impl Products { * * https://shopify.dev/docs/admin-api/rest/reference/products/collect#create-2020-10 */ - pub async fn create_collects(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create_collects( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-10/collects.json", None); self.client .post( @@ -605,7 +613,7 @@ impl Products { &self, collect_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -640,7 +648,10 @@ impl Products { * * * `collect_id: &str` -- storefront_access_token_id. */ - pub async fn delete_collects_param_collect(&self, collect_id: &str) -> ClientResult<()> { + pub async fn delete_collects_param_collect( + &self, + collect_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/collects/{}/json", @@ -669,7 +680,10 @@ impl Products { * * * `collection_id: i64` -- recurring_application_charge[capped_amount]. */ - pub async fn get_collects_count(&self, collection_id: i64) -> ClientResult<()> { + pub async fn get_collects_count( + &self, + collection_id: i64, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if collection_id > 0 { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -708,7 +722,7 @@ impl Products { limit: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -744,7 +758,7 @@ impl Products { pub async fn deprecated_202101_create_collects( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2021-01/collects.json", None); self.client .post( @@ -772,7 +786,7 @@ impl Products { &self, collect_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -810,7 +824,7 @@ impl Products { pub async fn deprecated_202101_delete_collects_param_collect( &self, collect_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/collects/{}/json", @@ -842,7 +856,7 @@ impl Products { pub async fn deprecated_202101_get_collects_count( &self, collection_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if collection_id > 0 { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -881,7 +895,7 @@ impl Products { limit: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -917,7 +931,7 @@ impl Products { pub async fn deprecated_unstable_create_collects( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/unstable/collects.json", None); self.client .post( @@ -945,7 +959,7 @@ impl Products { &self, collect_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -983,7 +997,7 @@ impl Products { pub async fn deprecated_unstable_delete_collects_param_collect( &self, collect_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/collects/{}/json", @@ -1015,7 +1029,7 @@ impl Products { pub async fn deprecated_unstable_get_collects_count( &self, collection_id: i64, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if collection_id > 0 { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -1051,7 +1065,7 @@ impl Products { &self, collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1092,7 +1106,7 @@ impl Products { &self, collection_id: &str, limit: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1132,7 +1146,7 @@ impl Products { &self, collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1173,7 +1187,7 @@ impl Products { &self, collection_id: &str, limit: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1213,7 +1227,7 @@ impl Products { &self, collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1254,7 +1268,7 @@ impl Products { &self, collection_id: &str, limit: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1294,7 +1308,7 @@ impl Products { &self, collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1335,7 +1349,7 @@ impl Products { &self, collection_id: &str, limit: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1375,7 +1389,7 @@ impl Products { &self, collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1416,7 +1430,7 @@ impl Products { &self, collection_id: &str, limit: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1456,7 +1470,7 @@ impl Products { &self, collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1497,7 +1511,7 @@ impl Products { &self, collection_id: &str, limit: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1563,7 +1577,7 @@ impl Products { published_at_max: &str, published_status: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1626,7 +1640,7 @@ impl Products { pub async fn deprecated_202001_create_custom_collections( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/custom_collections.json", None); @@ -1671,7 +1685,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !product_id.is_empty() { query_args.push(("product_id".to_string(), product_id.to_string())); @@ -1728,7 +1742,7 @@ impl Products { &self, custom_collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1767,7 +1781,7 @@ impl Products { &self, custom_collection_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/custom_collections/{}/json", @@ -1799,7 +1813,7 @@ impl Products { pub async fn deprecated_202001_delete_custom_collections_param_collection( &self, custom_collection_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/custom_collections/{}/json", @@ -1859,7 +1873,7 @@ impl Products { published_at_max: &str, published_status: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1922,7 +1936,7 @@ impl Products { pub async fn deprecated_202004_create_custom_collections( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/custom_collections.json", None); @@ -1967,7 +1981,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !product_id.is_empty() { query_args.push(("product_id".to_string(), product_id.to_string())); @@ -2024,7 +2038,7 @@ impl Products { &self, custom_collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2063,7 +2077,7 @@ impl Products { &self, custom_collection_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/custom_collections/{}/json", @@ -2095,7 +2109,7 @@ impl Products { pub async fn deprecated_202004_delete_custom_collections_param_collection( &self, custom_collection_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/custom_collections/{}/json", @@ -2155,7 +2169,7 @@ impl Products { published_at_max: &str, published_status: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2218,7 +2232,7 @@ impl Products { pub async fn deprecated_202007_create_custom_collections( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/custom_collections.json", None); @@ -2263,7 +2277,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !product_id.is_empty() { query_args.push(("product_id".to_string(), product_id.to_string())); @@ -2320,7 +2334,7 @@ impl Products { &self, custom_collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2359,7 +2373,7 @@ impl Products { &self, custom_collection_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/custom_collections/{}/json", @@ -2391,7 +2405,7 @@ impl Products { pub async fn deprecated_202007_delete_custom_collections_param_collection( &self, custom_collection_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/custom_collections/{}/json", @@ -2451,7 +2465,7 @@ impl Products { published_at_max: &str, published_status: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2511,7 +2525,10 @@ impl Products { * * https://shopify.dev/docs/admin-api/rest/reference/products/customcollection#create-2020-10 */ - pub async fn create_custom_collections(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create_custom_collections( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/custom_collections.json", None); @@ -2556,7 +2573,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !product_id.is_empty() { query_args.push(("product_id".to_string(), product_id.to_string())); @@ -2613,7 +2630,7 @@ impl Products { &self, custom_collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2652,7 +2669,7 @@ impl Products { &self, custom_collection_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/custom_collections/{}/json", @@ -2684,7 +2701,7 @@ impl Products { pub async fn delete_custom_collections_param_collection( &self, custom_collection_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/custom_collections/{}/json", @@ -2744,7 +2761,7 @@ impl Products { published_at_max: &str, published_status: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2807,7 +2824,7 @@ impl Products { pub async fn deprecated_202101_create_custom_collections( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/custom_collections.json", None); @@ -2852,7 +2869,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !product_id.is_empty() { query_args.push(("product_id".to_string(), product_id.to_string())); @@ -2909,7 +2926,7 @@ impl Products { &self, custom_collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2948,7 +2965,7 @@ impl Products { &self, custom_collection_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/custom_collections/{}/json", @@ -2980,7 +2997,7 @@ impl Products { pub async fn deprecated_202101_delete_custom_collections_param_collection( &self, custom_collection_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/custom_collections/{}/json", @@ -3040,7 +3057,7 @@ impl Products { published_at_max: &str, published_status: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3103,7 +3120,7 @@ impl Products { pub async fn deprecated_unstable_create_custom_collections( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/unstable/custom_collections.json", None); @@ -3148,7 +3165,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !product_id.is_empty() { query_args.push(("product_id".to_string(), product_id.to_string())); @@ -3205,7 +3222,7 @@ impl Products { &self, custom_collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3244,7 +3261,7 @@ impl Products { &self, custom_collection_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/custom_collections/{}/json", @@ -3276,7 +3293,7 @@ impl Products { pub async fn deprecated_unstable_delete_custom_collections_param_collection( &self, custom_collection_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/custom_collections/{}/json", @@ -3353,7 +3370,7 @@ impl Products { published_status: &str, fields: &str, presentment_currencies: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_id.is_empty() { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -3438,7 +3455,10 @@ impl Products { * * https://shopify.dev/docs/admin-api/rest/reference/products/product#create-2020-01 */ - pub async fn deprecated_202001_create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn deprecated_202001_create( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-01/products.json", None); self.client .post( @@ -3487,7 +3507,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_id.is_empty() { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -3550,7 +3570,7 @@ impl Products { &self, product_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3593,7 +3613,7 @@ impl Products { &self, product_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/products/{}/json", @@ -3622,7 +3642,10 @@ impl Products { * * * `product_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202001_delete_param(&self, product_id: &str) -> ClientResult<()> { + pub async fn deprecated_202001_delete_param( + &self, + product_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/products/{}/json", @@ -3699,7 +3722,7 @@ impl Products { published_status: &str, fields: &str, presentment_currencies: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_id.is_empty() { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -3784,7 +3807,10 @@ impl Products { * * https://shopify.dev/docs/admin-api/rest/reference/products/product#create-2020-04 */ - pub async fn deprecated_202004_create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn deprecated_202004_create( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-04/products.json", None); self.client .post( @@ -3833,7 +3859,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_id.is_empty() { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -3896,7 +3922,7 @@ impl Products { &self, product_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3939,7 +3965,7 @@ impl Products { &self, product_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/products/{}/json", @@ -3968,7 +3994,10 @@ impl Products { * * * `product_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202004_delete_param(&self, product_id: &str) -> ClientResult<()> { + pub async fn deprecated_202004_delete_param( + &self, + product_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/products/{}/json", @@ -4045,7 +4074,7 @@ impl Products { published_status: &str, fields: &str, presentment_currencies: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_id.is_empty() { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -4130,7 +4159,10 @@ impl Products { * * https://shopify.dev/docs/admin-api/rest/reference/products/product#create-2020-07 */ - pub async fn deprecated_202007_create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn deprecated_202007_create( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-07/products.json", None); self.client .post( @@ -4179,7 +4211,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_id.is_empty() { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -4242,7 +4274,7 @@ impl Products { &self, product_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4285,7 +4317,7 @@ impl Products { &self, product_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/products/{}/json", @@ -4314,7 +4346,10 @@ impl Products { * * * `product_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202007_delete_param(&self, product_id: &str) -> ClientResult<()> { + pub async fn deprecated_202007_delete_param( + &self, + product_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/products/{}/json", @@ -4391,7 +4426,7 @@ impl Products { published_status: &str, fields: &str, presentment_currencies: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_id.is_empty() { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -4476,7 +4511,7 @@ impl Products { * * https://shopify.dev/docs/admin-api/rest/reference/products/product#create-2020-10 */ - pub async fn create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create(&self, body: &serde_json::Value) -> ClientResult> { let url = self.client.url("/admin/api/2020-10/products.json", None); self.client .post( @@ -4525,7 +4560,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_id.is_empty() { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -4584,7 +4619,11 @@ impl Products { * * `product_id: &str` -- storefront_access_token_id. * * `fields: &str` -- A comma-separated list of fields to include in the response. */ - pub async fn get_param(&self, product_id: &str, fields: &str) -> ClientResult<()> { + pub async fn get_param( + &self, + product_id: &str, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4627,7 +4666,7 @@ impl Products { &self, product_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/products/{}/json", @@ -4656,7 +4695,7 @@ impl Products { * * * `product_id: &str` -- storefront_access_token_id. */ - pub async fn delete_param(&self, product_id: &str) -> ClientResult<()> { + pub async fn delete_param(&self, product_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/products/{}/json", @@ -4733,7 +4772,7 @@ impl Products { published_status: &str, fields: &str, presentment_currencies: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_id.is_empty() { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -4818,7 +4857,10 @@ impl Products { * * https://shopify.dev/docs/admin-api/rest/reference/products/product#create-2021-01 */ - pub async fn deprecated_202101_create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn deprecated_202101_create( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2021-01/products.json", None); self.client .post( @@ -4867,7 +4909,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_id.is_empty() { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -4930,7 +4972,7 @@ impl Products { &self, product_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4973,7 +5015,7 @@ impl Products { &self, product_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/products/{}/json", @@ -5002,7 +5044,10 @@ impl Products { * * * `product_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_202101_delete_param(&self, product_id: &str) -> ClientResult<()> { + pub async fn deprecated_202101_delete_param( + &self, + product_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/products/{}/json", @@ -5079,7 +5124,7 @@ impl Products { published_status: &str, fields: &str, presentment_currencies: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_id.is_empty() { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -5164,7 +5209,10 @@ impl Products { * * https://shopify.dev/docs/admin-api/rest/reference/products/product#create-unstable */ - pub async fn deprecated_unstable_create(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn deprecated_unstable_create( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/unstable/products.json", None); self.client .post( @@ -5213,7 +5261,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_id.is_empty() { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -5276,7 +5324,7 @@ impl Products { &self, product_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -5319,7 +5367,7 @@ impl Products { &self, product_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/products/{}/json", @@ -5348,7 +5396,10 @@ impl Products { * * * `product_id: &str` -- storefront_access_token_id. */ - pub async fn deprecated_unstable_delete_param(&self, product_id: &str) -> ClientResult<()> { + pub async fn deprecated_unstable_delete_param( + &self, + product_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/products/{}/json", @@ -5384,7 +5435,7 @@ impl Products { product_id: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -5426,7 +5477,7 @@ impl Products { &self, product_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/products/{}/images.json", @@ -5460,7 +5511,7 @@ impl Products { &self, product_id: &str, since_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !since_id.is_empty() { query_args.push(("since_id".to_string(), since_id.to_string())); @@ -5502,7 +5553,7 @@ impl Products { product_id: &str, image_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -5544,7 +5595,7 @@ impl Products { product_id: &str, image_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/products/{}/images/{}/json", @@ -5579,7 +5630,7 @@ impl Products { &self, product_id: &str, image_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/products/{}/images/{}/json", @@ -5616,7 +5667,7 @@ impl Products { product_id: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -5658,7 +5709,7 @@ impl Products { &self, product_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/products/{}/images.json", @@ -5692,7 +5743,7 @@ impl Products { &self, product_id: &str, since_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !since_id.is_empty() { query_args.push(("since_id".to_string(), since_id.to_string())); @@ -5734,7 +5785,7 @@ impl Products { product_id: &str, image_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -5776,7 +5827,7 @@ impl Products { product_id: &str, image_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/products/{}/images/{}/json", @@ -5811,7 +5862,7 @@ impl Products { &self, product_id: &str, image_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/products/{}/images/{}/json", @@ -5848,7 +5899,7 @@ impl Products { product_id: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -5890,7 +5941,7 @@ impl Products { &self, product_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/products/{}/images.json", @@ -5924,7 +5975,7 @@ impl Products { &self, product_id: &str, since_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !since_id.is_empty() { query_args.push(("since_id".to_string(), since_id.to_string())); @@ -5966,7 +6017,7 @@ impl Products { product_id: &str, image_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -6008,7 +6059,7 @@ impl Products { product_id: &str, image_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/products/{}/images/{}/json", @@ -6043,7 +6094,7 @@ impl Products { &self, product_id: &str, image_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/products/{}/images/{}/json", @@ -6080,7 +6131,7 @@ impl Products { product_id: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -6122,7 +6173,7 @@ impl Products { &self, product_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/products/{}/images.json", @@ -6156,7 +6207,7 @@ impl Products { &self, product_id: &str, since_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !since_id.is_empty() { query_args.push(("since_id".to_string(), since_id.to_string())); @@ -6198,7 +6249,7 @@ impl Products { product_id: &str, image_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -6240,7 +6291,7 @@ impl Products { product_id: &str, image_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/products/{}/images/{}/json", @@ -6275,7 +6326,7 @@ impl Products { &self, product_id: &str, image_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/products/{}/images/{}/json", @@ -6312,7 +6363,7 @@ impl Products { product_id: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -6354,7 +6405,7 @@ impl Products { &self, product_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/products/{}/images.json", @@ -6388,7 +6439,7 @@ impl Products { &self, product_id: &str, since_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !since_id.is_empty() { query_args.push(("since_id".to_string(), since_id.to_string())); @@ -6430,7 +6481,7 @@ impl Products { product_id: &str, image_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -6472,7 +6523,7 @@ impl Products { product_id: &str, image_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/products/{}/images/{}/json", @@ -6507,7 +6558,7 @@ impl Products { &self, product_id: &str, image_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/products/{}/images/{}/json", @@ -6544,7 +6595,7 @@ impl Products { product_id: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -6586,7 +6637,7 @@ impl Products { &self, product_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/products/{}/images.json", @@ -6620,7 +6671,7 @@ impl Products { &self, product_id: &str, since_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !since_id.is_empty() { query_args.push(("since_id".to_string(), since_id.to_string())); @@ -6662,7 +6713,7 @@ impl Products { product_id: &str, image_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -6704,7 +6755,7 @@ impl Products { product_id: &str, image_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/products/{}/images/{}/json", @@ -6739,7 +6790,7 @@ impl Products { &self, product_id: &str, image_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/products/{}/images/{}/json", @@ -6800,7 +6851,7 @@ impl Products { published_at_max: &str, published_status: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -6863,7 +6914,7 @@ impl Products { pub async fn deprecated_202001_create_smart_collections( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/smart_collections.json", None); @@ -6908,7 +6959,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !product_id.is_empty() { query_args.push(("product_id".to_string(), product_id.to_string())); @@ -6962,7 +7013,7 @@ impl Products { &self, smart_collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -7001,7 +7052,7 @@ impl Products { &self, smart_collection_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/smart_collections/{}/json", @@ -7033,7 +7084,7 @@ impl Products { pub async fn deprecated_202001_delete_smart_collections_param_collection( &self, smart_collection_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/smart_collections/{}/json", @@ -7072,7 +7123,7 @@ impl Products { products: &str, sort_order: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !products.is_empty() { query_args.push(("products".to_string(), products.to_string())); @@ -7141,7 +7192,7 @@ impl Products { published_at_max: &str, published_status: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -7204,7 +7255,7 @@ impl Products { pub async fn deprecated_202004_create_smart_collections( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/smart_collections.json", None); @@ -7249,7 +7300,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !product_id.is_empty() { query_args.push(("product_id".to_string(), product_id.to_string())); @@ -7303,7 +7354,7 @@ impl Products { &self, smart_collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -7342,7 +7393,7 @@ impl Products { &self, smart_collection_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/smart_collections/{}/json", @@ -7374,7 +7425,7 @@ impl Products { pub async fn deprecated_202004_delete_smart_collections_param_collection( &self, smart_collection_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/smart_collections/{}/json", @@ -7413,7 +7464,7 @@ impl Products { products: &str, sort_order: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !products.is_empty() { query_args.push(("products".to_string(), products.to_string())); @@ -7482,7 +7533,7 @@ impl Products { published_at_max: &str, published_status: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -7545,7 +7596,7 @@ impl Products { pub async fn deprecated_202007_create_smart_collections( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/smart_collections.json", None); @@ -7590,7 +7641,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !product_id.is_empty() { query_args.push(("product_id".to_string(), product_id.to_string())); @@ -7644,7 +7695,7 @@ impl Products { &self, smart_collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -7683,7 +7734,7 @@ impl Products { &self, smart_collection_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/smart_collections/{}/json", @@ -7715,7 +7766,7 @@ impl Products { pub async fn deprecated_202007_delete_smart_collections_param_collection( &self, smart_collection_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/smart_collections/{}/json", @@ -7754,7 +7805,7 @@ impl Products { products: &str, sort_order: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !products.is_empty() { query_args.push(("products".to_string(), products.to_string())); @@ -7823,7 +7874,7 @@ impl Products { published_at_max: &str, published_status: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -7883,7 +7934,10 @@ impl Products { * * https://shopify.dev/docs/admin-api/rest/reference/products/smartcollection#create-2020-10 */ - pub async fn create_smart_collections(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create_smart_collections( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/smart_collections.json", None); @@ -7928,7 +7982,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !product_id.is_empty() { query_args.push(("product_id".to_string(), product_id.to_string())); @@ -7982,7 +8036,7 @@ impl Products { &self, smart_collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -8021,7 +8075,7 @@ impl Products { &self, smart_collection_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/smart_collections/{}/json", @@ -8053,7 +8107,7 @@ impl Products { pub async fn delete_smart_collections_param_collection( &self, smart_collection_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/smart_collections/{}/json", @@ -8092,7 +8146,7 @@ impl Products { products: &str, sort_order: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !products.is_empty() { query_args.push(("products".to_string(), products.to_string())); @@ -8161,7 +8215,7 @@ impl Products { published_at_max: &str, published_status: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -8224,7 +8278,7 @@ impl Products { pub async fn deprecated_202101_create_smart_collections( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/smart_collections.json", None); @@ -8269,7 +8323,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !product_id.is_empty() { query_args.push(("product_id".to_string(), product_id.to_string())); @@ -8323,7 +8377,7 @@ impl Products { &self, smart_collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -8362,7 +8416,7 @@ impl Products { &self, smart_collection_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/smart_collections/{}/json", @@ -8394,7 +8448,7 @@ impl Products { pub async fn deprecated_202101_delete_smart_collections_param_collection( &self, smart_collection_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/smart_collections/{}/json", @@ -8433,7 +8487,7 @@ impl Products { products: &str, sort_order: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !products.is_empty() { query_args.push(("products".to_string(), products.to_string())); @@ -8502,7 +8556,7 @@ impl Products { published_at_max: &str, published_status: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -8565,7 +8619,7 @@ impl Products { pub async fn deprecated_unstable_create_smart_collections( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/unstable/smart_collections.json", None); @@ -8610,7 +8664,7 @@ impl Products { published_at_min: &str, published_at_max: &str, published_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !product_id.is_empty() { query_args.push(("product_id".to_string(), product_id.to_string())); @@ -8667,7 +8721,7 @@ impl Products { &self, smart_collection_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -8706,7 +8760,7 @@ impl Products { &self, smart_collection_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/smart_collections/{}/json", @@ -8738,7 +8792,7 @@ impl Products { pub async fn deprecated_unstable_delete_smart_collections_param_collection( &self, smart_collection_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/smart_collections/{}/json", @@ -8777,7 +8831,7 @@ impl Products { products: &str, sort_order: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !products.is_empty() { query_args.push(("products".to_string(), products.to_string())); diff --git a/shopify/src/sales_channels.rs b/shopify/src/sales_channels.rs index fa191ac0..350274aa 100644 --- a/shopify/src/sales_channels.rs +++ b/shopify/src/sales_channels.rs @@ -21,7 +21,7 @@ impl SalesChannels { pub async fn deprecated_202001_create_checkouts( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-01/checkouts.json", None); self.client .post( @@ -43,7 +43,7 @@ impl SalesChannels { pub async fn deprecated_202004_create_checkouts( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-04/checkouts.json", None); self.client .post( @@ -65,7 +65,7 @@ impl SalesChannels { pub async fn deprecated_202007_create_checkouts( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-07/checkouts.json", None); self.client .post( @@ -84,7 +84,10 @@ impl SalesChannels { * * https://shopify.dev/docs/admin-api/rest/reference/sales-channels/checkout#create-2020-10 */ - pub async fn create_checkouts(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create_checkouts( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-10/checkouts.json", None); self.client .post( @@ -106,7 +109,7 @@ impl SalesChannels { pub async fn deprecated_202101_create_checkouts( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2021-01/checkouts.json", None); self.client .post( @@ -128,7 +131,7 @@ impl SalesChannels { pub async fn deprecated_unstable_create_checkouts( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/unstable/checkouts.json", None); self.client .post( @@ -155,7 +158,7 @@ impl SalesChannels { &self, token: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/checkouts/{}/complete.json", @@ -187,7 +190,7 @@ impl SalesChannels { pub async fn deprecated_202001_get_checkouts_param_token( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/checkouts/{}/json", @@ -220,7 +223,7 @@ impl SalesChannels { &self, token: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/checkouts/{}/json", @@ -254,7 +257,7 @@ impl SalesChannels { pub async fn deprecated_202001_get_checkouts_param_token_shipping_rate( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/checkouts/{}/shipping_rates.json", @@ -287,7 +290,7 @@ impl SalesChannels { &self, token: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/checkouts/{}/complete.json", @@ -319,7 +322,7 @@ impl SalesChannels { pub async fn deprecated_202004_get_checkouts_param_token( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/checkouts/{}/json", @@ -352,7 +355,7 @@ impl SalesChannels { &self, token: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/checkouts/{}/json", @@ -386,7 +389,7 @@ impl SalesChannels { pub async fn deprecated_202004_get_checkouts_param_token_shipping_rate( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/checkouts/{}/shipping_rates.json", @@ -419,7 +422,7 @@ impl SalesChannels { &self, token: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/checkouts/{}/complete.json", @@ -451,7 +454,7 @@ impl SalesChannels { pub async fn deprecated_202007_get_checkouts_param_token( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/checkouts/{}/json", @@ -484,7 +487,7 @@ impl SalesChannels { &self, token: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/checkouts/{}/json", @@ -518,7 +521,7 @@ impl SalesChannels { pub async fn deprecated_202007_get_checkouts_param_token_shipping_rate( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/checkouts/{}/shipping_rates.json", @@ -551,7 +554,7 @@ impl SalesChannels { &self, token: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/checkouts/{}/complete.json", @@ -580,7 +583,10 @@ impl SalesChannels { * * * `token: &str` -- storefront_access_token_id. */ - pub async fn get_checkouts_param_token(&self, token: &str) -> ClientResult<()> { + pub async fn get_checkouts_param_token( + &self, + token: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/checkouts/{}/json", @@ -613,7 +619,7 @@ impl SalesChannels { &self, token: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/checkouts/{}/json", @@ -644,7 +650,10 @@ impl SalesChannels { * * * `token: &str` -- storefront_access_token_id. */ - pub async fn get_checkouts_param_token_shipping_rate(&self, token: &str) -> ClientResult<()> { + pub async fn get_checkouts_param_token_shipping_rate( + &self, + token: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/checkouts/{}/shipping_rates.json", @@ -677,7 +686,7 @@ impl SalesChannels { &self, token: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/checkouts/{}/complete.json", @@ -709,7 +718,7 @@ impl SalesChannels { pub async fn deprecated_202101_get_checkouts_param_token( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/checkouts/{}/json", @@ -742,7 +751,7 @@ impl SalesChannels { &self, token: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/checkouts/{}/json", @@ -776,7 +785,7 @@ impl SalesChannels { pub async fn deprecated_202101_get_checkouts_param_token_shipping_rate( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/checkouts/{}/shipping_rates.json", @@ -809,7 +818,7 @@ impl SalesChannels { &self, token: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/checkouts/{}/complete.json", @@ -841,7 +850,7 @@ impl SalesChannels { pub async fn deprecated_unstable_get_checkouts_param_token( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/checkouts/{}/json", @@ -874,7 +883,7 @@ impl SalesChannels { &self, token: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/checkouts/{}/json", @@ -908,7 +917,7 @@ impl SalesChannels { pub async fn deprecated_unstable_get_checkouts_param_token_shipping_rate( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/checkouts/{}/shipping_rates.json", @@ -938,7 +947,10 @@ impl SalesChannels { * * `limit: &str` -- Amount of results * (default: 50, maximum: 1000). */ - pub async fn deprecated_202001_get_collection_listing(&self, limit: &str) -> ClientResult<()> { + pub async fn deprecated_202001_get_collection_listing( + &self, + limit: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -975,7 +987,7 @@ impl SalesChannels { &self, collection_listing_id: &str, limit: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1013,7 +1025,7 @@ impl SalesChannels { pub async fn deprecated_202001_get_collection_listings_param_listing( &self, collection_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/collection_listings/{}/json", @@ -1046,7 +1058,7 @@ impl SalesChannels { &self, collection_listing_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/collection_listings/{}/json", @@ -1078,7 +1090,7 @@ impl SalesChannels { pub async fn deprecated_202001_delete_collection_listings_param_listing( &self, collection_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/collection_listings/{}/json", @@ -1108,7 +1120,10 @@ impl SalesChannels { * * `limit: &str` -- Amount of results * (default: 50, maximum: 1000). */ - pub async fn deprecated_202004_get_collection_listing(&self, limit: &str) -> ClientResult<()> { + pub async fn deprecated_202004_get_collection_listing( + &self, + limit: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1145,7 +1160,7 @@ impl SalesChannels { &self, collection_listing_id: &str, limit: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1183,7 +1198,7 @@ impl SalesChannels { pub async fn deprecated_202004_get_collection_listings_param_listing( &self, collection_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/collection_listings/{}/json", @@ -1216,7 +1231,7 @@ impl SalesChannels { &self, collection_listing_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/collection_listings/{}/json", @@ -1248,7 +1263,7 @@ impl SalesChannels { pub async fn deprecated_202004_delete_collection_listings_param_listing( &self, collection_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/collection_listings/{}/json", @@ -1278,7 +1293,10 @@ impl SalesChannels { * * `limit: &str` -- Amount of results * (default: 50, maximum: 1000). */ - pub async fn deprecated_202007_get_collection_listing(&self, limit: &str) -> ClientResult<()> { + pub async fn deprecated_202007_get_collection_listing( + &self, + limit: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1315,7 +1333,7 @@ impl SalesChannels { &self, collection_listing_id: &str, limit: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1353,7 +1371,7 @@ impl SalesChannels { pub async fn deprecated_202007_get_collection_listings_param_listing( &self, collection_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/collection_listings/{}/json", @@ -1386,7 +1404,7 @@ impl SalesChannels { &self, collection_listing_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/collection_listings/{}/json", @@ -1418,7 +1436,7 @@ impl SalesChannels { pub async fn deprecated_202007_delete_collection_listings_param_listing( &self, collection_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/collection_listings/{}/json", @@ -1448,7 +1466,7 @@ impl SalesChannels { * * `limit: &str` -- Amount of results * (default: 50, maximum: 1000). */ - pub async fn get_collection_listing(&self, limit: &str) -> ClientResult<()> { + pub async fn get_collection_listing(&self, limit: &str) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1485,7 +1503,7 @@ impl SalesChannels { &self, collection_listing_id: &str, limit: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1523,7 +1541,7 @@ impl SalesChannels { pub async fn get_collection_listings_param_listing( &self, collection_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/collection_listings/{}/json", @@ -1556,7 +1574,7 @@ impl SalesChannels { &self, collection_listing_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/collection_listings/{}/json", @@ -1588,7 +1606,7 @@ impl SalesChannels { pub async fn delete_collection_listings_param_listing( &self, collection_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/collection_listings/{}/json", @@ -1618,7 +1636,10 @@ impl SalesChannels { * * `limit: &str` -- Amount of results * (default: 50, maximum: 1000). */ - pub async fn deprecated_202101_get_collection_listing(&self, limit: &str) -> ClientResult<()> { + pub async fn deprecated_202101_get_collection_listing( + &self, + limit: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1655,7 +1676,7 @@ impl SalesChannels { &self, collection_listing_id: &str, limit: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1693,7 +1714,7 @@ impl SalesChannels { pub async fn deprecated_202101_get_collection_listings_param_listing( &self, collection_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/collection_listings/{}/json", @@ -1726,7 +1747,7 @@ impl SalesChannels { &self, collection_listing_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/collection_listings/{}/json", @@ -1758,7 +1779,7 @@ impl SalesChannels { pub async fn deprecated_202101_delete_collection_listings_param_listing( &self, collection_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/collection_listings/{}/json", @@ -1791,7 +1812,7 @@ impl SalesChannels { pub async fn deprecated_unstable_get_collection_listing( &self, limit: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1828,7 +1849,7 @@ impl SalesChannels { &self, collection_listing_id: &str, limit: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -1866,7 +1887,7 @@ impl SalesChannels { pub async fn deprecated_unstable_get_collection_listings_param_listing( &self, collection_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/collection_listings/{}/json", @@ -1899,7 +1920,7 @@ impl SalesChannels { &self, collection_listing_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/collection_listings/{}/json", @@ -1931,7 +1952,7 @@ impl SalesChannels { pub async fn deprecated_unstable_delete_collection_listings_param_listing( &self, collection_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/collection_listings/{}/json", @@ -1963,7 +1984,7 @@ impl SalesChannels { pub async fn deprecated_202001_get_checkouts_param_token_payment( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/checkouts/{}/payments.json", @@ -2009,7 +2030,7 @@ impl SalesChannels { session_id_required: &str, unique_token_required: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !amount_required.is_empty() { query_args.push(( @@ -2078,7 +2099,7 @@ impl SalesChannels { &self, token: &str, payment_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/checkouts/{}/payments/{}/json", @@ -2111,7 +2132,7 @@ impl SalesChannels { pub async fn deprecated_202001_get_checkouts_param_token_payments_count( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/checkouts/{}/payments/count.json", @@ -2143,7 +2164,7 @@ impl SalesChannels { pub async fn deprecated_202004_get_checkouts_param_token_payment( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/checkouts/{}/payments.json", @@ -2189,7 +2210,7 @@ impl SalesChannels { session_id_required: &str, unique_token_required: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !amount_required.is_empty() { query_args.push(( @@ -2258,7 +2279,7 @@ impl SalesChannels { &self, token: &str, payment_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/checkouts/{}/payments/{}/json", @@ -2291,7 +2312,7 @@ impl SalesChannels { pub async fn deprecated_202004_get_checkouts_param_token_payments_count( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/checkouts/{}/payments/count.json", @@ -2323,7 +2344,7 @@ impl SalesChannels { pub async fn deprecated_202007_get_checkouts_param_token_payment( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/checkouts/{}/payments.json", @@ -2369,7 +2390,7 @@ impl SalesChannels { session_id_required: &str, unique_token_required: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !amount_required.is_empty() { query_args.push(( @@ -2438,7 +2459,7 @@ impl SalesChannels { &self, token: &str, payment_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/checkouts/{}/payments/{}/json", @@ -2471,7 +2492,7 @@ impl SalesChannels { pub async fn deprecated_202007_get_checkouts_param_token_payments_count( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/checkouts/{}/payments/count.json", @@ -2500,7 +2521,10 @@ impl SalesChannels { * * * `token: &str` -- storefront_access_token_id. */ - pub async fn get_checkouts_param_token_payment(&self, token: &str) -> ClientResult<()> { + pub async fn get_checkouts_param_token_payment( + &self, + token: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/checkouts/{}/payments.json", @@ -2546,7 +2570,7 @@ impl SalesChannels { session_id_required: &str, unique_token_required: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !amount_required.is_empty() { query_args.push(( @@ -2615,7 +2639,7 @@ impl SalesChannels { &self, token: &str, payment_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/checkouts/{}/payments/{}/json", @@ -2645,7 +2669,10 @@ impl SalesChannels { * * * `token: &str` -- storefront_access_token_id. */ - pub async fn get_checkouts_param_token_payments_count(&self, token: &str) -> ClientResult<()> { + pub async fn get_checkouts_param_token_payments_count( + &self, + token: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/checkouts/{}/payments/count.json", @@ -2677,7 +2704,7 @@ impl SalesChannels { pub async fn deprecated_202101_get_checkouts_param_token_payment( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/checkouts/{}/payments.json", @@ -2723,7 +2750,7 @@ impl SalesChannels { session_id_required: &str, unique_token_required: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !amount_required.is_empty() { query_args.push(( @@ -2792,7 +2819,7 @@ impl SalesChannels { &self, token: &str, payment_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/checkouts/{}/payments/{}/json", @@ -2825,7 +2852,7 @@ impl SalesChannels { pub async fn deprecated_202101_get_checkouts_param_token_payments_count( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/checkouts/{}/payments/count.json", @@ -2857,7 +2884,7 @@ impl SalesChannels { pub async fn deprecated_unstable_get_checkouts_param_token_payment( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/checkouts/{}/payments.json", @@ -2903,7 +2930,7 @@ impl SalesChannels { session_id_required: &str, unique_token_required: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !amount_required.is_empty() { query_args.push(( @@ -2972,7 +2999,7 @@ impl SalesChannels { &self, token: &str, payment_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/checkouts/{}/payments/{}/json", @@ -3005,7 +3032,7 @@ impl SalesChannels { pub async fn deprecated_unstable_get_checkouts_param_token_payments_count( &self, token: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/checkouts/{}/payments/count.json", @@ -3046,7 +3073,7 @@ impl SalesChannels { collection_id: &str, updated_at_min: &str, handle: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_id.is_empty() { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -3090,7 +3117,10 @@ impl SalesChannels { * * `limit: &str` -- Amount of results * (default: 50, maximum: 1000). */ - pub async fn deprecated_202001_get_product_listings_id(&self, limit: &str) -> ClientResult<()> { + pub async fn deprecated_202001_get_product_listings_id( + &self, + limit: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -3120,7 +3150,9 @@ impl SalesChannels { * * https://shopify.dev/docs/admin-api/rest/reference/sales-channels/productlisting#count-2020-01 */ - pub async fn deprecated_202001_get_product_listings_count(&self) -> ClientResult<()> { + pub async fn deprecated_202001_get_product_listings_count( + &self, + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/product_listings/count.json", None); @@ -3148,7 +3180,7 @@ impl SalesChannels { pub async fn deprecated_202001_get_product_listings_param_listing( &self, product_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/product_listings/{}/json", @@ -3181,7 +3213,7 @@ impl SalesChannels { &self, product_listing_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/product_listings/{}/json", @@ -3213,7 +3245,7 @@ impl SalesChannels { pub async fn deprecated_202001_delete_product_listings_param_listing( &self, product_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/product_listings/{}/json", @@ -3254,7 +3286,7 @@ impl SalesChannels { collection_id: &str, updated_at_min: &str, handle: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_id.is_empty() { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -3298,7 +3330,10 @@ impl SalesChannels { * * `limit: &str` -- Amount of results * (default: 50, maximum: 1000). */ - pub async fn deprecated_202004_get_product_listings_id(&self, limit: &str) -> ClientResult<()> { + pub async fn deprecated_202004_get_product_listings_id( + &self, + limit: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -3328,7 +3363,9 @@ impl SalesChannels { * * https://shopify.dev/docs/admin-api/rest/reference/sales-channels/productlisting#count-2020-04 */ - pub async fn deprecated_202004_get_product_listings_count(&self) -> ClientResult<()> { + pub async fn deprecated_202004_get_product_listings_count( + &self, + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/product_listings/count.json", None); @@ -3356,7 +3393,7 @@ impl SalesChannels { pub async fn deprecated_202004_get_product_listings_param_listing( &self, product_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/product_listings/{}/json", @@ -3389,7 +3426,7 @@ impl SalesChannels { &self, product_listing_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/product_listings/{}/json", @@ -3421,7 +3458,7 @@ impl SalesChannels { pub async fn deprecated_202004_delete_product_listings_param_listing( &self, product_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/product_listings/{}/json", @@ -3462,7 +3499,7 @@ impl SalesChannels { collection_id: &str, updated_at_min: &str, handle: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_id.is_empty() { query_args.push(("collection_id".to_string(), collection_id.to_string())); @@ -3506,7 +3543,10 @@ impl SalesChannels { * * `limit: &str` -- Amount of results * (default: 50, maximum: 1000). */ - pub async fn deprecated_202007_get_product_listings_id(&self, limit: &str) -> ClientResult<()> { + pub async fn deprecated_202007_get_product_listings_id( + &self, + limit: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -3536,7 +3576,9 @@ impl SalesChannels { * * https://shopify.dev/docs/admin-api/rest/reference/sales-channels/productlisting#count-2020-07 */ - pub async fn deprecated_202007_get_product_listings_count(&self) -> ClientResult<()> { + pub async fn deprecated_202007_get_product_listings_count( + &self, + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/product_listings/count.json", None); @@ -3564,7 +3606,7 @@ impl SalesChannels { pub async fn deprecated_202007_get_product_listings_param_listing( &self, product_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/product_listings/{}/json", @@ -3597,7 +3639,7 @@ impl SalesChannels { &self, product_listing_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/product_listings/{}/json", @@ -3629,7 +3671,7 @@ impl SalesChannels { pub async fn deprecated_202007_delete_product_listings_param_listing( &self, product_listing_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/product_listings/{}/json", diff --git a/shopify/src/shipping_and_fulfillment.rs b/shopify/src/shipping_and_fulfillment.rs index 67f6de5c..ac127cfd 100644 --- a/shopify/src/shipping_and_fulfillment.rs +++ b/shopify/src/shipping_and_fulfillment.rs @@ -32,7 +32,7 @@ impl ShippingAndFulfillment { &self, assignment_status: &str, location_ids: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !assignment_status.is_empty() { query_args.push(( @@ -82,7 +82,7 @@ impl ShippingAndFulfillment { &self, assignment_status: &str, location_ids: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !assignment_status.is_empty() { query_args.push(( @@ -132,7 +132,7 @@ impl ShippingAndFulfillment { &self, assignment_status: &str, location_ids: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !assignment_status.is_empty() { query_args.push(( @@ -182,7 +182,7 @@ impl ShippingAndFulfillment { &self, assignment_status: &str, location_ids: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !assignment_status.is_empty() { query_args.push(( @@ -232,7 +232,7 @@ impl ShippingAndFulfillment { &self, assignment_status: &str, location_ids: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !assignment_status.is_empty() { query_args.push(( @@ -282,7 +282,7 @@ impl ShippingAndFulfillment { &self, assignment_status: &str, location_ids: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !assignment_status.is_empty() { query_args.push(( @@ -328,7 +328,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -369,7 +369,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -410,7 +410,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -451,7 +451,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -492,7 +492,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -533,7 +533,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -574,7 +574,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -615,7 +615,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -656,7 +656,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -697,7 +697,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -738,7 +738,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -779,7 +779,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -820,7 +820,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -861,7 +861,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -902,7 +902,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -943,7 +943,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -984,7 +984,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -1025,7 +1025,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -1056,7 +1056,7 @@ impl ShippingAndFulfillment { * * https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/carrierservice#index-2020-01 */ - pub async fn deprecated_202001_get_carrier_service(&self) -> ClientResult<()> { + pub async fn deprecated_202001_get_carrier_service(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/carrier_services.json", None); @@ -1080,7 +1080,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202001_create_carrier_services( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/carrier_services.json", None); @@ -1108,7 +1108,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202001_get_carrier_services_param_service( &self, carrier_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/carrier_services/{}/json", @@ -1141,7 +1141,7 @@ impl ShippingAndFulfillment { &self, carrier_service_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/carrier_services/{}/json", @@ -1173,7 +1173,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202001_delete_carrier_services_param_service( &self, carrier_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/carrier_services/{}/json", @@ -1198,7 +1198,7 @@ impl ShippingAndFulfillment { * * https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/carrierservice#index-2020-04 */ - pub async fn deprecated_202004_get_carrier_service(&self) -> ClientResult<()> { + pub async fn deprecated_202004_get_carrier_service(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/carrier_services.json", None); @@ -1222,7 +1222,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202004_create_carrier_services( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/carrier_services.json", None); @@ -1250,7 +1250,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202004_get_carrier_services_param_service( &self, carrier_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/carrier_services/{}/json", @@ -1283,7 +1283,7 @@ impl ShippingAndFulfillment { &self, carrier_service_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/carrier_services/{}/json", @@ -1315,7 +1315,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202004_delete_carrier_services_param_service( &self, carrier_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/carrier_services/{}/json", @@ -1340,7 +1340,7 @@ impl ShippingAndFulfillment { * * https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/carrierservice#index-2020-07 */ - pub async fn deprecated_202007_get_carrier_service(&self) -> ClientResult<()> { + pub async fn deprecated_202007_get_carrier_service(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/carrier_services.json", None); @@ -1364,7 +1364,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202007_create_carrier_services( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/carrier_services.json", None); @@ -1392,7 +1392,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202007_get_carrier_services_param_service( &self, carrier_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/carrier_services/{}/json", @@ -1425,7 +1425,7 @@ impl ShippingAndFulfillment { &self, carrier_service_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/carrier_services/{}/json", @@ -1457,7 +1457,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202007_delete_carrier_services_param_service( &self, carrier_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/carrier_services/{}/json", @@ -1482,7 +1482,7 @@ impl ShippingAndFulfillment { * * https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/carrierservice#index-2020-10 */ - pub async fn get_carrier_service(&self) -> ClientResult<()> { + pub async fn get_carrier_service(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/carrier_services.json", None); @@ -1503,7 +1503,10 @@ impl ShippingAndFulfillment { * * https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/carrierservice#create-2020-10 */ - pub async fn create_carrier_services(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create_carrier_services( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/carrier_services.json", None); @@ -1531,7 +1534,7 @@ impl ShippingAndFulfillment { pub async fn get_carrier_services_param_service( &self, carrier_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/carrier_services/{}/json", @@ -1564,7 +1567,7 @@ impl ShippingAndFulfillment { &self, carrier_service_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/carrier_services/{}/json", @@ -1596,7 +1599,7 @@ impl ShippingAndFulfillment { pub async fn delete_carrier_services_param_service( &self, carrier_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/carrier_services/{}/json", @@ -1621,7 +1624,7 @@ impl ShippingAndFulfillment { * * https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/carrierservice#index-2021-01 */ - pub async fn deprecated_202101_get_carrier_service(&self) -> ClientResult<()> { + pub async fn deprecated_202101_get_carrier_service(&self) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/carrier_services.json", None); @@ -1645,7 +1648,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202101_create_carrier_services( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/carrier_services.json", None); @@ -1673,7 +1676,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202101_get_carrier_services_param_service( &self, carrier_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/carrier_services/{}/json", @@ -1706,7 +1709,7 @@ impl ShippingAndFulfillment { &self, carrier_service_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/carrier_services/{}/json", @@ -1738,7 +1741,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202101_delete_carrier_services_param_service( &self, carrier_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/carrier_services/{}/json", @@ -1763,7 +1766,9 @@ impl ShippingAndFulfillment { * * https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/carrierservice#index-unstable */ - pub async fn deprecated_unstable_get_carrier_service(&self) -> ClientResult<()> { + pub async fn deprecated_unstable_get_carrier_service( + &self, + ) -> ClientResult> { let url = self .client .url("/admin/api/unstable/carrier_services.json", None); @@ -1787,7 +1792,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_unstable_create_carrier_services( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/unstable/carrier_services.json", None); @@ -1815,7 +1820,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_unstable_get_carrier_services_param_service( &self, carrier_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/carrier_services/{}/json", @@ -1848,7 +1853,7 @@ impl ShippingAndFulfillment { &self, carrier_service_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/carrier_services/{}/json", @@ -1880,7 +1885,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_unstable_delete_carrier_services_param_service( &self, carrier_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/carrier_services/{}/json", @@ -1927,7 +1932,7 @@ impl ShippingAndFulfillment { since_id: &str, updated_at_max: &str, updated_at_min: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -2006,7 +2011,7 @@ impl ShippingAndFulfillment { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/fulfillments.json", @@ -2039,7 +2044,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202001_get_fulfillment_orders_param_order_fulfillment( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/fulfillment_orders/{}/fulfillments.json", @@ -2079,7 +2084,7 @@ impl ShippingAndFulfillment { created_at_max: &str, updated_at_min: &str, updated_at_max: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -2130,7 +2135,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2172,7 +2177,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/fulfillments/{}/json", @@ -2201,7 +2206,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202001_create_fulfillments( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/fulfillments.json", None); @@ -2230,7 +2235,7 @@ impl ShippingAndFulfillment { &self, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/fulfillments/{}/update_tracking.json", @@ -2265,7 +2270,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/fulfillments/{}/complete.json", @@ -2301,7 +2306,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/fulfillments/{}/open.json", @@ -2337,7 +2342,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/fulfillments/{}/cancel.json", @@ -2371,7 +2376,7 @@ impl ShippingAndFulfillment { &self, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/fulfillments/{}/cancel.json", @@ -2418,7 +2423,7 @@ impl ShippingAndFulfillment { since_id: &str, updated_at_max: &str, updated_at_min: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -2497,7 +2502,7 @@ impl ShippingAndFulfillment { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/fulfillments.json", @@ -2530,7 +2535,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202004_get_fulfillment_orders_param_order_fulfillment( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/fulfillment_orders/{}/fulfillments.json", @@ -2570,7 +2575,7 @@ impl ShippingAndFulfillment { created_at_max: &str, updated_at_min: &str, updated_at_max: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -2621,7 +2626,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2663,7 +2668,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/fulfillments/{}/json", @@ -2692,7 +2697,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202004_create_fulfillments( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/fulfillments.json", None); @@ -2721,7 +2726,7 @@ impl ShippingAndFulfillment { &self, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/fulfillments/{}/update_tracking.json", @@ -2756,7 +2761,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/fulfillments/{}/complete.json", @@ -2792,7 +2797,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/fulfillments/{}/open.json", @@ -2828,7 +2833,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/fulfillments/{}/cancel.json", @@ -2862,7 +2867,7 @@ impl ShippingAndFulfillment { &self, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/fulfillments/{}/cancel.json", @@ -2909,7 +2914,7 @@ impl ShippingAndFulfillment { since_id: &str, updated_at_max: &str, updated_at_min: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -2988,7 +2993,7 @@ impl ShippingAndFulfillment { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/orders/{}/fulfillments.json", @@ -3021,7 +3026,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202007_get_fulfillment_orders_param_order_fulfillment( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/fulfillment_orders/{}/fulfillments.json", @@ -3061,7 +3066,7 @@ impl ShippingAndFulfillment { created_at_max: &str, updated_at_min: &str, updated_at_max: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -3112,7 +3117,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3154,7 +3159,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/orders/{}/fulfillments/{}/json", @@ -3183,7 +3188,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202007_create_fulfillments( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/fulfillments.json", None); @@ -3212,7 +3217,7 @@ impl ShippingAndFulfillment { &self, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/fulfillments/{}/update_tracking.json", @@ -3247,7 +3252,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/orders/{}/fulfillments/{}/complete.json", @@ -3283,7 +3288,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/orders/{}/fulfillments/{}/open.json", @@ -3319,7 +3324,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/orders/{}/fulfillments/{}/cancel.json", @@ -3353,7 +3358,7 @@ impl ShippingAndFulfillment { &self, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/fulfillments/{}/cancel.json", @@ -3400,7 +3405,7 @@ impl ShippingAndFulfillment { since_id: &str, updated_at_max: &str, updated_at_min: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -3479,7 +3484,7 @@ impl ShippingAndFulfillment { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/orders/{}/fulfillments.json", @@ -3512,7 +3517,7 @@ impl ShippingAndFulfillment { pub async fn get_fulfillment_orders_param_order_fulfillment( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/fulfillment_orders/{}/fulfillments.json", @@ -3552,7 +3557,7 @@ impl ShippingAndFulfillment { created_at_max: &str, updated_at_min: &str, updated_at_max: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -3603,7 +3608,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -3645,7 +3650,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/orders/{}/fulfillments/{}/json", @@ -3671,7 +3676,10 @@ impl ShippingAndFulfillment { * * https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/fulfillment#createV2-2020-10 */ - pub async fn create_fulfillments(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create_fulfillments( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/fulfillments.json", None); @@ -3700,7 +3708,7 @@ impl ShippingAndFulfillment { &self, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/fulfillments/{}/update_tracking.json", @@ -3735,7 +3743,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/orders/{}/fulfillments/{}/complete.json", @@ -3771,7 +3779,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/orders/{}/fulfillments/{}/open.json", @@ -3807,7 +3815,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/orders/{}/fulfillments/{}/cancel.json", @@ -3841,7 +3849,7 @@ impl ShippingAndFulfillment { &self, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/fulfillments/{}/cancel.json", @@ -3888,7 +3896,7 @@ impl ShippingAndFulfillment { since_id: &str, updated_at_max: &str, updated_at_min: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -3967,7 +3975,7 @@ impl ShippingAndFulfillment { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/orders/{}/fulfillments.json", @@ -4000,7 +4008,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202101_get_fulfillment_orders_param_order_fulfillment( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/fulfillment_orders/{}/fulfillments.json", @@ -4040,7 +4048,7 @@ impl ShippingAndFulfillment { created_at_max: &str, updated_at_min: &str, updated_at_max: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -4091,7 +4099,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4133,7 +4141,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/orders/{}/fulfillments/{}/json", @@ -4162,7 +4170,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202101_create_fulfillments( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/fulfillments.json", None); @@ -4191,7 +4199,7 @@ impl ShippingAndFulfillment { &self, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/fulfillments/{}/update_tracking.json", @@ -4226,7 +4234,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/orders/{}/fulfillments/{}/complete.json", @@ -4262,7 +4270,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/orders/{}/fulfillments/{}/open.json", @@ -4298,7 +4306,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/orders/{}/fulfillments/{}/cancel.json", @@ -4332,7 +4340,7 @@ impl ShippingAndFulfillment { &self, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/fulfillments/{}/cancel.json", @@ -4379,7 +4387,7 @@ impl ShippingAndFulfillment { since_id: &str, updated_at_max: &str, updated_at_min: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -4458,7 +4466,7 @@ impl ShippingAndFulfillment { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/orders/{}/fulfillments.json", @@ -4491,7 +4499,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_unstable_get_fulfillment_orders_param_order_fulfillment( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/fulfillment_orders/{}/fulfillments.json", @@ -4531,7 +4539,7 @@ impl ShippingAndFulfillment { created_at_max: &str, updated_at_min: &str, updated_at_max: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !created_at_max.is_empty() { query_args.push(("created_at_max".to_string(), created_at_max.to_string())); @@ -4582,7 +4590,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -4624,7 +4632,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/orders/{}/fulfillments/{}/json", @@ -4653,7 +4661,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_unstable_create_fulfillments( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/unstable/fulfillments.json", None); @@ -4682,7 +4690,7 @@ impl ShippingAndFulfillment { &self, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/fulfillments/{}/update_tracking.json", @@ -4717,7 +4725,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/orders/{}/fulfillments/{}/complete.json", @@ -4753,7 +4761,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/orders/{}/fulfillments/{}/open.json", @@ -4789,7 +4797,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/orders/{}/fulfillments/{}/cancel.json", @@ -4823,7 +4831,7 @@ impl ShippingAndFulfillment { &self, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/fulfillments/{}/cancel.json", @@ -4859,7 +4867,7 @@ impl ShippingAndFulfillment { &self, order_id: &str, fulfillment_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/fulfillments/{}/events.json", @@ -4895,7 +4903,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/fulfillments/{}/events.json", @@ -4933,7 +4941,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, event_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/fulfillments/{}/events/{}/json", @@ -4971,7 +4979,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, event_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/fulfillments/{}/events/{}/json", @@ -5009,7 +5017,7 @@ impl ShippingAndFulfillment { &self, order_id: &str, fulfillment_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/fulfillments/{}/events.json", @@ -5045,7 +5053,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/fulfillments/{}/events.json", @@ -5083,7 +5091,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, event_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/fulfillments/{}/events/{}/json", @@ -5121,7 +5129,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, event_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/fulfillments/{}/events/{}/json", @@ -5159,7 +5167,7 @@ impl ShippingAndFulfillment { &self, order_id: &str, fulfillment_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/orders/{}/fulfillments/{}/events.json", @@ -5195,7 +5203,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/orders/{}/fulfillments/{}/events.json", @@ -5233,7 +5241,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, event_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/orders/{}/fulfillments/{}/events/{}/json", @@ -5271,7 +5279,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, event_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/orders/{}/fulfillments/{}/events/{}/json", @@ -5309,7 +5317,7 @@ impl ShippingAndFulfillment { &self, order_id: &str, fulfillment_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/orders/{}/fulfillments/{}/events.json", @@ -5345,7 +5353,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/orders/{}/fulfillments/{}/events.json", @@ -5383,7 +5391,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, event_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/orders/{}/fulfillments/{}/events/{}/json", @@ -5421,7 +5429,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, event_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/orders/{}/fulfillments/{}/events/{}/json", @@ -5459,7 +5467,7 @@ impl ShippingAndFulfillment { &self, order_id: &str, fulfillment_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/orders/{}/fulfillments/{}/events.json", @@ -5495,7 +5503,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/orders/{}/fulfillments/{}/events.json", @@ -5533,7 +5541,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, event_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/orders/{}/fulfillments/{}/events/{}/json", @@ -5571,7 +5579,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, event_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/orders/{}/fulfillments/{}/events/{}/json", @@ -5609,7 +5617,7 @@ impl ShippingAndFulfillment { &self, order_id: &str, fulfillment_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/orders/{}/fulfillments/{}/events.json", @@ -5645,7 +5653,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/orders/{}/fulfillments/{}/events.json", @@ -5683,7 +5691,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, event_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/orders/{}/fulfillments/{}/events/{}/json", @@ -5721,7 +5729,7 @@ impl ShippingAndFulfillment { order_id: &str, fulfillment_id: &str, event_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/orders/{}/fulfillments/{}/events/{}/json", @@ -5756,7 +5764,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202001_get_orders_param_order_fulfillment_shipping_and_fulfillment( &self, order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/orders/{}/fulfillment_orders.json", @@ -5788,7 +5796,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202001_get_fulfillment_orders_param_order( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/fulfillment_orders/{}/json", @@ -5821,7 +5829,7 @@ impl ShippingAndFulfillment { &self, fulfillment_order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/fulfillment_orders/{}/cancel.json", @@ -5857,7 +5865,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -5898,7 +5906,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, new_location_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !new_location_id.is_empty() { query_args.push(("new_location_id".to_string(), new_location_id.to_string())); @@ -5937,7 +5945,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202004_get_orders_param_order_fulfillment_shipping_and_fulfillment( &self, order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/orders/{}/fulfillment_orders.json", @@ -5969,7 +5977,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202004_get_fulfillment_orders_param_order( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/fulfillment_orders/{}/json", @@ -6002,7 +6010,7 @@ impl ShippingAndFulfillment { &self, fulfillment_order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/fulfillment_orders/{}/cancel.json", @@ -6038,7 +6046,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -6079,7 +6087,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, new_location_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !new_location_id.is_empty() { query_args.push(("new_location_id".to_string(), new_location_id.to_string())); @@ -6118,7 +6126,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202007_get_orders_param_order_fulfillment_shipping_and_fulfillment( &self, order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/orders/{}/fulfillment_orders.json", @@ -6150,7 +6158,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202007_get_fulfillment_orders_param_order( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/fulfillment_orders/{}/json", @@ -6183,7 +6191,7 @@ impl ShippingAndFulfillment { &self, fulfillment_order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/fulfillment_orders/{}/cancel.json", @@ -6219,7 +6227,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -6260,7 +6268,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, new_location_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !new_location_id.is_empty() { query_args.push(("new_location_id".to_string(), new_location_id.to_string())); @@ -6299,7 +6307,7 @@ impl ShippingAndFulfillment { pub async fn get_orders_param_order_fulfillment_shipping_and_fulfillment( &self, order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/orders/{}/fulfillment_orders.json", @@ -6331,7 +6339,7 @@ impl ShippingAndFulfillment { pub async fn get_fulfillment_orders_param_order( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/fulfillment_orders/{}/json", @@ -6364,7 +6372,7 @@ impl ShippingAndFulfillment { &self, fulfillment_order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/fulfillment_orders/{}/cancel.json", @@ -6400,7 +6408,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -6441,7 +6449,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, new_location_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !new_location_id.is_empty() { query_args.push(("new_location_id".to_string(), new_location_id.to_string())); @@ -6480,7 +6488,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202101_get_orders_param_order_fulfillment_shipping_and_fulfillment( &self, order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/orders/{}/fulfillment_orders.json", @@ -6512,7 +6520,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202101_get_fulfillment_orders_param_order( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/fulfillment_orders/{}/json", @@ -6545,7 +6553,7 @@ impl ShippingAndFulfillment { &self, fulfillment_order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/fulfillment_orders/{}/cancel.json", @@ -6581,7 +6589,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -6622,7 +6630,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, new_location_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !new_location_id.is_empty() { query_args.push(("new_location_id".to_string(), new_location_id.to_string())); @@ -6662,7 +6670,7 @@ impl ShippingAndFulfillment { &self, fulfillment_order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/fulfillment_orders/{}/open.json", @@ -6696,7 +6704,7 @@ impl ShippingAndFulfillment { &self, fulfillment_order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/fulfillment_orders/{}/reschedule.json", @@ -6729,7 +6737,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_unstable_get_orders_param_order_fulfillment_shipping_and_fulfillment( &self, order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/orders/{}/fulfillment_orders.json", @@ -6761,7 +6769,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_unstable_get_fulfillment_orders_param_order( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/fulfillment_orders/{}/json", @@ -6794,7 +6802,7 @@ impl ShippingAndFulfillment { &self, fulfillment_order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/fulfillment_orders/{}/cancel.json", @@ -6828,7 +6836,7 @@ impl ShippingAndFulfillment { &self, order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !order_id.is_empty() { query_args.push(("order_id".to_string(), order_id.to_string())); @@ -6869,7 +6877,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -6910,7 +6918,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, new_location_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !new_location_id.is_empty() { query_args.push(("new_location_id".to_string(), new_location_id.to_string())); @@ -6950,7 +6958,7 @@ impl ShippingAndFulfillment { &self, fulfillment_order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/fulfillment_orders/{}/open.json", @@ -6984,7 +6992,7 @@ impl ShippingAndFulfillment { &self, fulfillment_order_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/fulfillment_orders/{}/reschedule.json", @@ -7021,7 +7029,7 @@ impl ShippingAndFulfillment { message: &str, fulfillment_order_line_items: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fulfillment_order_line_items.is_empty() { query_args.push(( @@ -7068,7 +7076,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -7109,7 +7117,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -7152,7 +7160,7 @@ impl ShippingAndFulfillment { message: &str, fulfillment_order_line_items: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fulfillment_order_line_items.is_empty() { query_args.push(( @@ -7199,7 +7207,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -7240,7 +7248,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -7283,7 +7291,7 @@ impl ShippingAndFulfillment { message: &str, fulfillment_order_line_items: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fulfillment_order_line_items.is_empty() { query_args.push(( @@ -7330,7 +7338,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -7371,7 +7379,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -7414,7 +7422,7 @@ impl ShippingAndFulfillment { message: &str, fulfillment_order_line_items: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fulfillment_order_line_items.is_empty() { query_args.push(( @@ -7461,7 +7469,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -7502,7 +7510,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -7545,7 +7553,7 @@ impl ShippingAndFulfillment { message: &str, fulfillment_order_line_items: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fulfillment_order_line_items.is_empty() { query_args.push(( @@ -7592,7 +7600,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -7633,7 +7641,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -7676,7 +7684,7 @@ impl ShippingAndFulfillment { message: &str, fulfillment_order_line_items: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fulfillment_order_line_items.is_empty() { query_args.push(( @@ -7723,7 +7731,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -7764,7 +7772,7 @@ impl ShippingAndFulfillment { fulfillment_order_id: &str, message: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !message.is_empty() { query_args.push(("message".to_string(), message.to_string())); @@ -7804,7 +7812,7 @@ impl ShippingAndFulfillment { &self, order_names: &str, shop: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !order_names.is_empty() { query_args.push(("order_names".to_string(), order_names.to_string())); @@ -7846,7 +7854,7 @@ impl ShippingAndFulfillment { shop: &str, sku: &str, timestamp: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !max_retries.is_empty() { query_args.push(("max_retries".to_string(), max_retries.to_string())); @@ -7884,7 +7892,10 @@ impl ShippingAndFulfillment { * * `scope: &str` -- current_client: Returns fulfillment providers that have been created by the app sending the request (default) * all: Returns all the fulfillment providers. */ - pub async fn deprecated_202001_get_fulfillment_service(&self, scope: &str) -> ClientResult<()> { + pub async fn deprecated_202001_get_fulfillment_service( + &self, + scope: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !scope.is_empty() { query_args.push(("scope".to_string(), scope.to_string())); @@ -7917,7 +7928,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202001_create_fulfillment_services( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/fulfillment_services.json", None); @@ -7945,7 +7956,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202001_get_fulfillment_services_param_service( &self, fulfillment_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/fulfillment_services/{}/json", @@ -7978,7 +7989,7 @@ impl ShippingAndFulfillment { &self, fulfillment_service_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/fulfillment_services/{}/json", @@ -8010,7 +8021,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202001_delete_fulfillment_services_param_service( &self, fulfillment_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/fulfillment_services/{}/json", @@ -8040,7 +8051,10 @@ impl ShippingAndFulfillment { * * `scope: &str` -- current_client: Returns fulfillment providers that have been created by the app sending the request (default) * all: Returns all the fulfillment providers. */ - pub async fn deprecated_202004_get_fulfillment_service(&self, scope: &str) -> ClientResult<()> { + pub async fn deprecated_202004_get_fulfillment_service( + &self, + scope: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !scope.is_empty() { query_args.push(("scope".to_string(), scope.to_string())); @@ -8073,7 +8087,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202004_create_fulfillment_services( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/fulfillment_services.json", None); @@ -8101,7 +8115,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202004_get_fulfillment_services_param_service( &self, fulfillment_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/fulfillment_services/{}/json", @@ -8134,7 +8148,7 @@ impl ShippingAndFulfillment { &self, fulfillment_service_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/fulfillment_services/{}/json", @@ -8166,7 +8180,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202004_delete_fulfillment_services_param_service( &self, fulfillment_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/fulfillment_services/{}/json", @@ -8196,7 +8210,10 @@ impl ShippingAndFulfillment { * * `scope: &str` -- current_client: Returns fulfillment providers that have been created by the app sending the request (default) * all: Returns all the fulfillment providers. */ - pub async fn deprecated_202007_get_fulfillment_service(&self, scope: &str) -> ClientResult<()> { + pub async fn deprecated_202007_get_fulfillment_service( + &self, + scope: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !scope.is_empty() { query_args.push(("scope".to_string(), scope.to_string())); @@ -8229,7 +8246,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202007_create_fulfillment_services( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/fulfillment_services.json", None); @@ -8257,7 +8274,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202007_get_fulfillment_services_param_service( &self, fulfillment_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/fulfillment_services/{}/json", @@ -8290,7 +8307,7 @@ impl ShippingAndFulfillment { &self, fulfillment_service_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/fulfillment_services/{}/json", @@ -8322,7 +8339,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202007_delete_fulfillment_services_param_service( &self, fulfillment_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/fulfillment_services/{}/json", @@ -8352,7 +8369,7 @@ impl ShippingAndFulfillment { * * `scope: &str` -- current_client: Returns fulfillment providers that have been created by the app sending the request (default) * all: Returns all the fulfillment providers. */ - pub async fn get_fulfillment_service(&self, scope: &str) -> ClientResult<()> { + pub async fn get_fulfillment_service(&self, scope: &str) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !scope.is_empty() { query_args.push(("scope".to_string(), scope.to_string())); @@ -8382,7 +8399,10 @@ impl ShippingAndFulfillment { * * https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/fulfillmentservice#create-2020-10 */ - pub async fn create_fulfillment_services(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create_fulfillment_services( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/fulfillment_services.json", None); @@ -8410,7 +8430,7 @@ impl ShippingAndFulfillment { pub async fn get_fulfillment_services_param_service( &self, fulfillment_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/fulfillment_services/{}/json", @@ -8443,7 +8463,7 @@ impl ShippingAndFulfillment { &self, fulfillment_service_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/fulfillment_services/{}/json", @@ -8475,7 +8495,7 @@ impl ShippingAndFulfillment { pub async fn delete_fulfillment_services_param_service( &self, fulfillment_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/fulfillment_services/{}/json", @@ -8505,7 +8525,10 @@ impl ShippingAndFulfillment { * * `scope: &str` -- current_client: Returns fulfillment providers that have been created by the app sending the request (default) * all: Returns all the fulfillment providers. */ - pub async fn deprecated_202101_get_fulfillment_service(&self, scope: &str) -> ClientResult<()> { + pub async fn deprecated_202101_get_fulfillment_service( + &self, + scope: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !scope.is_empty() { query_args.push(("scope".to_string(), scope.to_string())); @@ -8538,7 +8561,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202101_create_fulfillment_services( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/fulfillment_services.json", None); @@ -8566,7 +8589,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202101_get_fulfillment_services_param_service( &self, fulfillment_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/fulfillment_services/{}/json", @@ -8599,7 +8622,7 @@ impl ShippingAndFulfillment { &self, fulfillment_service_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/fulfillment_services/{}/json", @@ -8631,7 +8654,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202101_delete_fulfillment_services_param_service( &self, fulfillment_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/fulfillment_services/{}/json", @@ -8664,7 +8687,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_unstable_get_fulfillment_service( &self, scope: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !scope.is_empty() { query_args.push(("scope".to_string(), scope.to_string())); @@ -8697,7 +8720,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_unstable_create_fulfillment_services( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self .client .url("/admin/api/unstable/fulfillment_services.json", None); @@ -8725,7 +8748,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_unstable_get_fulfillment_services_param_service( &self, fulfillment_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/fulfillment_services/{}/json", @@ -8758,7 +8781,7 @@ impl ShippingAndFulfillment { &self, fulfillment_service_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/fulfillment_services/{}/json", @@ -8790,7 +8813,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_unstable_delete_fulfillment_services_param_service( &self, fulfillment_service_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/fulfillment_services/{}/json", @@ -8824,7 +8847,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202001_get_fulfillment_orders_param_order_locations_for_move( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/fulfillment_orders/{}/locations_for_move.json", @@ -8858,7 +8881,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202004_get_fulfillment_orders_param_order_locations_for_move( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/fulfillment_orders/{}/locations_for_move.json", @@ -8892,7 +8915,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202007_get_fulfillment_orders_param_order_locations_for_move( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/fulfillment_orders/{}/locations_for_move.json", @@ -8926,7 +8949,7 @@ impl ShippingAndFulfillment { pub async fn get_fulfillment_orders_param_order_locations_for_move( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/fulfillment_orders/{}/locations_for_move.json", @@ -8960,7 +8983,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_202101_get_fulfillment_orders_param_order_locations_for_move( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/fulfillment_orders/{}/locations_for_move.json", @@ -8994,7 +9017,7 @@ impl ShippingAndFulfillment { pub async fn deprecated_unstable_get_fulfillment_orders_param_order_locations_for_move( &self, fulfillment_order_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/fulfillment_orders/{}/locations_for_move.json", diff --git a/shopify/src/shopify_payments.rs b/shopify/src/shopify_payments.rs index 3a289cc0..be1b9821 100644 --- a/shopify/src/shopify_payments.rs +++ b/shopify/src/shopify_payments.rs @@ -18,7 +18,7 @@ impl ShopifyPayments { * * https://shopify.dev/docs/admin-api/rest/reference/shopify_payments/balance#show-2020-01 */ - pub async fn deprecated_202001_get_balance(&self) -> ClientResult<()> { + pub async fn deprecated_202001_get_balance(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/shopify_payments/balance.json", None); @@ -39,7 +39,7 @@ impl ShopifyPayments { * * https://shopify.dev/docs/admin-api/rest/reference/shopify_payments/balance#show-2020-04 */ - pub async fn deprecated_202004_get_balance(&self) -> ClientResult<()> { + pub async fn deprecated_202004_get_balance(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/shopify_payments/balance.json", None); @@ -60,7 +60,7 @@ impl ShopifyPayments { * * https://shopify.dev/docs/admin-api/rest/reference/shopify_payments/balance#show-2020-07 */ - pub async fn deprecated_202007_get_balance(&self) -> ClientResult<()> { + pub async fn deprecated_202007_get_balance(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/shopify_payments/balance.json", None); @@ -81,7 +81,7 @@ impl ShopifyPayments { * * https://shopify.dev/docs/admin-api/rest/reference/shopify_payments/balance#show-2020-10 */ - pub async fn get_balance(&self) -> ClientResult<()> { + pub async fn get_balance(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/shopify_payments/balance.json", None); @@ -102,7 +102,7 @@ impl ShopifyPayments { * * https://shopify.dev/docs/admin-api/rest/reference/shopify_payments/balance#show-2021-01 */ - pub async fn deprecated_202101_get_balance(&self) -> ClientResult<()> { + pub async fn deprecated_202101_get_balance(&self) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/shopify_payments/balance.json", None); @@ -123,7 +123,7 @@ impl ShopifyPayments { * * https://shopify.dev/docs/admin-api/rest/reference/shopify_payments/balance#show-unstable */ - pub async fn deprecated_unstable_get_balance(&self) -> ClientResult<()> { + pub async fn deprecated_unstable_get_balance(&self) -> ClientResult> { let url = self .client .url("/admin/api/unstable/shopify_payments/balance.json", None); @@ -158,7 +158,7 @@ impl ShopifyPayments { last_id: &str, status: &str, initiated_at: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !initiated_at.is_empty() { query_args.push(("initiated_at".to_string(), initiated_at.to_string())); @@ -204,7 +204,7 @@ impl ShopifyPayments { pub async fn deprecated_202001_get_disputes_param_dispute( &self, dispute_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/shopify_payments/disputes/{}/json", @@ -243,7 +243,7 @@ impl ShopifyPayments { last_id: &str, status: &str, initiated_at: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !initiated_at.is_empty() { query_args.push(("initiated_at".to_string(), initiated_at.to_string())); @@ -300,7 +300,7 @@ impl ShopifyPayments { date_max: &str, date: &str, status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !date.is_empty() { query_args.push(("date".to_string(), date.to_string())); @@ -352,7 +352,7 @@ impl ShopifyPayments { pub async fn deprecated_202001_get_payouts_param_payout( &self, payout_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/shopify_payments/payouts/{}/json", @@ -395,7 +395,7 @@ impl ShopifyPayments { date_max: &str, date: &str, status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !date.is_empty() { query_args.push(("date".to_string(), date.to_string())); @@ -447,7 +447,7 @@ impl ShopifyPayments { pub async fn deprecated_202004_get_payouts_param_payout( &self, payout_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/shopify_payments/payouts/{}/json", @@ -490,7 +490,7 @@ impl ShopifyPayments { date_max: &str, date: &str, status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !date.is_empty() { query_args.push(("date".to_string(), date.to_string())); @@ -542,7 +542,7 @@ impl ShopifyPayments { pub async fn deprecated_202007_get_payouts_param_payout( &self, payout_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/shopify_payments/payouts/{}/json", @@ -585,7 +585,7 @@ impl ShopifyPayments { date_max: &str, date: &str, status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !date.is_empty() { query_args.push(("date".to_string(), date.to_string())); @@ -634,7 +634,10 @@ impl ShopifyPayments { * * * `payout_id: &str` -- storefront_access_token_id. */ - pub async fn get_payouts_param_payout(&self, payout_id: &str) -> ClientResult<()> { + pub async fn get_payouts_param_payout( + &self, + payout_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/shopify_payments/payouts/{}/json", @@ -677,7 +680,7 @@ impl ShopifyPayments { date_max: &str, date: &str, status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !date.is_empty() { query_args.push(("date".to_string(), date.to_string())); @@ -729,7 +732,7 @@ impl ShopifyPayments { pub async fn deprecated_202101_get_payouts_param_payout( &self, payout_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/shopify_payments/payouts/{}/json", @@ -772,7 +775,7 @@ impl ShopifyPayments { date_max: &str, date: &str, status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !date.is_empty() { query_args.push(("date".to_string(), date.to_string())); @@ -824,7 +827,7 @@ impl ShopifyPayments { pub async fn deprecated_unstable_get_payouts_param_payout( &self, payout_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/shopify_payments/payouts/{}/json", @@ -866,7 +869,7 @@ impl ShopifyPayments { test: &str, payout_id: &str, payout_status: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !last_id.is_empty() { query_args.push(("last_id".to_string(), last_id.to_string())); diff --git a/shopify/src/store_properties.rs b/shopify/src/store_properties.rs index 2191f44b..c4e38a13 100644 --- a/shopify/src/store_properties.rs +++ b/shopify/src/store_properties.rs @@ -27,7 +27,7 @@ impl StoreProperties { &self, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -63,7 +63,7 @@ impl StoreProperties { pub async fn deprecated_202001_create_countries( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-01/countries.json", None); self.client .post( @@ -82,7 +82,7 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#count-2020-01 */ - pub async fn deprecated_202001_get_countries_count(&self) -> ClientResult<()> { + pub async fn deprecated_202001_get_countries_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-01/countries/count.json", None); @@ -112,7 +112,7 @@ impl StoreProperties { &self, country_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -154,7 +154,7 @@ impl StoreProperties { &self, country_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/countries/{}/json", @@ -186,7 +186,7 @@ impl StoreProperties { pub async fn deprecated_202001_delete_countries_param_country( &self, country_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/countries/{}/json", @@ -220,7 +220,7 @@ impl StoreProperties { &self, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -256,7 +256,7 @@ impl StoreProperties { pub async fn deprecated_202004_create_countries( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-04/countries.json", None); self.client .post( @@ -275,7 +275,7 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#count-2020-04 */ - pub async fn deprecated_202004_get_countries_count(&self) -> ClientResult<()> { + pub async fn deprecated_202004_get_countries_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-04/countries/count.json", None); @@ -305,7 +305,7 @@ impl StoreProperties { &self, country_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -347,7 +347,7 @@ impl StoreProperties { &self, country_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/countries/{}/json", @@ -379,7 +379,7 @@ impl StoreProperties { pub async fn deprecated_202004_delete_countries_param_country( &self, country_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/countries/{}/json", @@ -413,7 +413,7 @@ impl StoreProperties { &self, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -449,7 +449,7 @@ impl StoreProperties { pub async fn deprecated_202007_create_countries( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-07/countries.json", None); self.client .post( @@ -468,7 +468,7 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#count-2020-07 */ - pub async fn deprecated_202007_get_countries_count(&self) -> ClientResult<()> { + pub async fn deprecated_202007_get_countries_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-07/countries/count.json", None); @@ -498,7 +498,7 @@ impl StoreProperties { &self, country_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -540,7 +540,7 @@ impl StoreProperties { &self, country_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/countries/{}/json", @@ -572,7 +572,7 @@ impl StoreProperties { pub async fn deprecated_202007_delete_countries_param_country( &self, country_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/countries/{}/json", @@ -602,7 +602,11 @@ impl StoreProperties { * * `since_id: &str` -- Restrict results to after the specified ID. * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ - pub async fn get_countrie(&self, since_id: &str, fields: &str) -> ClientResult<()> { + pub async fn get_countrie( + &self, + since_id: &str, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -635,7 +639,10 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#create-2020-10 */ - pub async fn create_countries(&self, body: &serde_json::Value) -> ClientResult<()> { + pub async fn create_countries( + &self, + body: &serde_json::Value, + ) -> ClientResult> { let url = self.client.url("/admin/api/2020-10/countries.json", None); self.client .post( @@ -654,7 +661,7 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#count-2020-10 */ - pub async fn get_countries_count(&self) -> ClientResult<()> { + pub async fn get_countries_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2020-10/countries/count.json", None); @@ -684,7 +691,7 @@ impl StoreProperties { &self, country_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -726,7 +733,7 @@ impl StoreProperties { &self, country_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/countries/{}/json", @@ -755,7 +762,10 @@ impl StoreProperties { * * * `country_id: &str` -- storefront_access_token_id. */ - pub async fn delete_countries_param_country(&self, country_id: &str) -> ClientResult<()> { + pub async fn delete_countries_param_country( + &self, + country_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/countries/{}/json", @@ -789,7 +799,7 @@ impl StoreProperties { &self, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -825,7 +835,7 @@ impl StoreProperties { pub async fn deprecated_202101_create_countries( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/2021-01/countries.json", None); self.client .post( @@ -844,7 +854,7 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#count-2021-01 */ - pub async fn deprecated_202101_get_countries_count(&self) -> ClientResult<()> { + pub async fn deprecated_202101_get_countries_count(&self) -> ClientResult> { let url = self .client .url("/admin/api/2021-01/countries/count.json", None); @@ -874,7 +884,7 @@ impl StoreProperties { &self, country_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -916,7 +926,7 @@ impl StoreProperties { &self, country_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/countries/{}/json", @@ -948,7 +958,7 @@ impl StoreProperties { pub async fn deprecated_202101_delete_countries_param_country( &self, country_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/countries/{}/json", @@ -982,7 +992,7 @@ impl StoreProperties { &self, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1018,7 +1028,7 @@ impl StoreProperties { pub async fn deprecated_unstable_create_countries( &self, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/admin/api/unstable/countries.json", None); self.client .post( @@ -1037,7 +1047,9 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#count-unstable */ - pub async fn deprecated_unstable_get_countries_count(&self) -> ClientResult<()> { + pub async fn deprecated_unstable_get_countries_count( + &self, + ) -> ClientResult> { let url = self .client .url("/admin/api/unstable/countries/count.json", None); @@ -1067,7 +1079,7 @@ impl StoreProperties { &self, country_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1109,7 +1121,7 @@ impl StoreProperties { &self, country_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/countries/{}/json", @@ -1141,7 +1153,7 @@ impl StoreProperties { pub async fn deprecated_unstable_delete_countries_param_country( &self, country_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/countries/{}/json", @@ -1166,7 +1178,7 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/currency#index-2020-01 */ - pub async fn deprecated_202001_get_currencie(&self) -> ClientResult<()> { + pub async fn deprecated_202001_get_currencie(&self) -> ClientResult> { let url = self.client.url("/admin/api/2020-01/currencies.json", None); self.client .get( @@ -1185,7 +1197,7 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/currency#index-2020-04 */ - pub async fn deprecated_202004_get_currencie(&self) -> ClientResult<()> { + pub async fn deprecated_202004_get_currencie(&self) -> ClientResult> { let url = self.client.url("/admin/api/2020-04/currencies.json", None); self.client .get( @@ -1204,7 +1216,7 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/currency#index-2020-07 */ - pub async fn deprecated_202007_get_currencie(&self) -> ClientResult<()> { + pub async fn deprecated_202007_get_currencie(&self) -> ClientResult> { let url = self.client.url("/admin/api/2020-07/currencies.json", None); self.client .get( @@ -1223,7 +1235,7 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/currency#index-2020-10 */ - pub async fn get_currencie(&self) -> ClientResult<()> { + pub async fn get_currencie(&self) -> ClientResult> { let url = self.client.url("/admin/api/2020-10/currencies.json", None); self.client .get( @@ -1242,7 +1254,7 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/currency#index-2021-01 */ - pub async fn deprecated_202101_get_currencie(&self) -> ClientResult<()> { + pub async fn deprecated_202101_get_currencie(&self) -> ClientResult> { let url = self.client.url("/admin/api/2021-01/currencies.json", None); self.client .get( @@ -1261,7 +1273,7 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/currency#index-unstable */ - pub async fn deprecated_unstable_get_currencie(&self) -> ClientResult<()> { + pub async fn deprecated_unstable_get_currencie(&self) -> ClientResult> { let url = self.client.url("/admin/api/unstable/currencies.json", None); self.client .get( @@ -1280,7 +1292,7 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/policy#index-2020-01 */ - pub async fn deprecated_202001_get_policie(&self) -> ClientResult<()> { + pub async fn deprecated_202001_get_policie(&self) -> ClientResult> { let url = self.client.url("/admin/api/2020-01/policies.json", None); self.client .get( @@ -1299,7 +1311,7 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/policy#index-2020-04 */ - pub async fn deprecated_202004_get_policie(&self) -> ClientResult<()> { + pub async fn deprecated_202004_get_policie(&self) -> ClientResult> { let url = self.client.url("/admin/api/2020-04/policies.json", None); self.client .get( @@ -1318,7 +1330,7 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/policy#index-2020-07 */ - pub async fn deprecated_202007_get_policie(&self) -> ClientResult<()> { + pub async fn deprecated_202007_get_policie(&self) -> ClientResult> { let url = self.client.url("/admin/api/2020-07/policies.json", None); self.client .get( @@ -1337,7 +1349,7 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/policy#index-2020-10 */ - pub async fn get_policie(&self) -> ClientResult<()> { + pub async fn get_policie(&self) -> ClientResult> { let url = self.client.url("/admin/api/2020-10/policies.json", None); self.client .get( @@ -1356,7 +1368,7 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/policy#index-2021-01 */ - pub async fn deprecated_202101_get_policie(&self) -> ClientResult<()> { + pub async fn deprecated_202101_get_policie(&self) -> ClientResult> { let url = self.client.url("/admin/api/2021-01/policies.json", None); self.client .get( @@ -1375,7 +1387,7 @@ impl StoreProperties { * * https://shopify.dev/docs/admin-api/rest/reference/store-properties/policy#index-unstable */ - pub async fn deprecated_unstable_get_policie(&self) -> ClientResult<()> { + pub async fn deprecated_unstable_get_policie(&self) -> ClientResult> { let url = self.client.url("/admin/api/unstable/policies.json", None); self.client .get( @@ -1405,7 +1417,7 @@ impl StoreProperties { country_id: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1446,7 +1458,7 @@ impl StoreProperties { pub async fn deprecated_202001_get_countries_param_country_provinces_count( &self, country_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/countries/{}/provinces/count.json", @@ -1482,7 +1494,7 @@ impl StoreProperties { country_id: &str, province_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1527,7 +1539,7 @@ impl StoreProperties { country_id: &str, province_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-01/countries/{}/provinces/{}/json", @@ -1564,7 +1576,7 @@ impl StoreProperties { country_id: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1605,7 +1617,7 @@ impl StoreProperties { pub async fn deprecated_202004_get_countries_param_country_provinces_count( &self, country_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/countries/{}/provinces/count.json", @@ -1641,7 +1653,7 @@ impl StoreProperties { country_id: &str, province_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1686,7 +1698,7 @@ impl StoreProperties { country_id: &str, province_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-04/countries/{}/provinces/{}/json", @@ -1723,7 +1735,7 @@ impl StoreProperties { country_id: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1764,7 +1776,7 @@ impl StoreProperties { pub async fn deprecated_202007_get_countries_param_country_provinces_count( &self, country_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/countries/{}/provinces/count.json", @@ -1800,7 +1812,7 @@ impl StoreProperties { country_id: &str, province_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1845,7 +1857,7 @@ impl StoreProperties { country_id: &str, province_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-07/countries/{}/provinces/{}/json", @@ -1882,7 +1894,7 @@ impl StoreProperties { country_id: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -1923,7 +1935,7 @@ impl StoreProperties { pub async fn get_countries_param_country_provinces_count( &self, country_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/countries/{}/provinces/count.json", @@ -1959,7 +1971,7 @@ impl StoreProperties { country_id: &str, province_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2004,7 +2016,7 @@ impl StoreProperties { country_id: &str, province_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2020-10/countries/{}/provinces/{}/json", @@ -2041,7 +2053,7 @@ impl StoreProperties { country_id: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2082,7 +2094,7 @@ impl StoreProperties { pub async fn deprecated_202101_get_countries_param_country_provinces_count( &self, country_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/countries/{}/provinces/count.json", @@ -2118,7 +2130,7 @@ impl StoreProperties { country_id: &str, province_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2163,7 +2175,7 @@ impl StoreProperties { country_id: &str, province_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/2021-01/countries/{}/provinces/{}/json", @@ -2200,7 +2212,7 @@ impl StoreProperties { country_id: &str, since_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2241,7 +2253,7 @@ impl StoreProperties { pub async fn deprecated_unstable_get_countries_param_country_provinces_count( &self, country_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/countries/{}/provinces/count.json", @@ -2277,7 +2289,7 @@ impl StoreProperties { country_id: &str, province_id: &str, fields: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2322,7 +2334,7 @@ impl StoreProperties { country_id: &str, province_id: &str, body: &serde_json::Value, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/admin/api/unstable/countries/{}/provinces/{}/json", @@ -2352,7 +2364,10 @@ impl StoreProperties { * * * `fields: &str` -- comma-separated list of fields to include in the response. */ - pub async fn deprecated_202001_get_shipping_zone(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_202001_get_shipping_zone( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2383,7 +2398,10 @@ impl StoreProperties { * * * `fields: &str` -- comma-separated list of fields to include in the response. */ - pub async fn deprecated_202004_get_shipping_zone(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_202004_get_shipping_zone( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2414,7 +2432,10 @@ impl StoreProperties { * * * `fields: &str` -- comma-separated list of fields to include in the response. */ - pub async fn deprecated_202007_get_shipping_zone(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_202007_get_shipping_zone( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2445,7 +2466,7 @@ impl StoreProperties { * * * `fields: &str` -- comma-separated list of fields to include in the response. */ - pub async fn get_shipping_zone(&self, fields: &str) -> ClientResult<()> { + pub async fn get_shipping_zone(&self, fields: &str) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2476,7 +2497,10 @@ impl StoreProperties { * * * `fields: &str` -- comma-separated list of fields to include in the response. */ - pub async fn deprecated_202101_get_shipping_zone(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_202101_get_shipping_zone( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2507,7 +2531,10 @@ impl StoreProperties { * * * `fields: &str` -- comma-separated list of fields to include in the response. */ - pub async fn deprecated_unstable_get_shipping_zone(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_unstable_get_shipping_zone( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2538,7 +2565,10 @@ impl StoreProperties { * * * `fields: &str` -- A comma-separated list of fields to include in the response. */ - pub async fn deprecated_202001_get_shop(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_202001_get_shop( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2568,7 +2598,10 @@ impl StoreProperties { * * * `fields: &str` -- A comma-separated list of fields to include in the response. */ - pub async fn deprecated_202004_get_shop(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_202004_get_shop( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2598,7 +2631,10 @@ impl StoreProperties { * * * `fields: &str` -- A comma-separated list of fields to include in the response. */ - pub async fn deprecated_202007_get_shop(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_202007_get_shop( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2628,7 +2664,7 @@ impl StoreProperties { * * * `fields: &str` -- A comma-separated list of fields to include in the response. */ - pub async fn get_shop(&self, fields: &str) -> ClientResult<()> { + pub async fn get_shop(&self, fields: &str) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2658,7 +2694,10 @@ impl StoreProperties { * * * `fields: &str` -- A comma-separated list of fields to include in the response. */ - pub async fn deprecated_202101_get_shop(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_202101_get_shop( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); @@ -2688,7 +2727,10 @@ impl StoreProperties { * * * `fields: &str` -- A comma-separated list of fields to include in the response. */ - pub async fn deprecated_unstable_get_shop(&self, fields: &str) -> ClientResult<()> { + pub async fn deprecated_unstable_get_shop( + &self, + fields: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !fields.is_empty() { query_args.push(("fields".to_string(), fields.to_string())); diff --git a/shopify/src/tendertransaction.rs b/shopify/src/tendertransaction.rs index f6c3c5bf..6e2e95bd 100644 --- a/shopify/src/tendertransaction.rs +++ b/shopify/src/tendertransaction.rs @@ -36,7 +36,7 @@ impl Tendertransaction { processed_at_max: &str, processed_at: &str, order: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -96,7 +96,7 @@ impl Tendertransaction { processed_at_max: &str, processed_at: &str, order: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -156,7 +156,7 @@ impl Tendertransaction { processed_at_max: &str, processed_at: &str, order: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -216,7 +216,7 @@ impl Tendertransaction { processed_at_max: &str, processed_at: &str, order: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -276,7 +276,7 @@ impl Tendertransaction { processed_at_max: &str, processed_at: &str, order: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); @@ -336,7 +336,7 @@ impl Tendertransaction { processed_at_max: &str, processed_at: &str, order: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !limit.is_empty() { query_args.push(("limit".to_string(), limit.to_string())); diff --git a/slack/src/admin_apps.rs b/slack/src/admin_apps.rs index 7cb1407b..8c3dc8ad 100644 --- a/slack/src/admin_apps.rs +++ b/slack/src/admin_apps.rs @@ -22,7 +22,7 @@ impl AdminApps { * * * `token: &str` -- Authentication token. Requires scope: `admin.apps:write`. */ - pub async fn approve(&self) -> ClientResult { + pub async fn approve(&self) -> ClientResult> { let url = self.client.url("/admin.apps.approve", None); self.client .post( @@ -45,7 +45,7 @@ impl AdminApps { * * * `token: &str` -- Authentication token. Requires scope: `admin.apps:write`. */ - pub async fn restrict(&self) -> ClientResult { + pub async fn restrict(&self) -> ClientResult> { let url = self.client.url("/admin.apps.restrict", None); self.client .post( diff --git a/slack/src/admin_apps_approved.rs b/slack/src/admin_apps_approved.rs index 06aa810a..eb70f62f 100644 --- a/slack/src/admin_apps_approved.rs +++ b/slack/src/admin_apps_approved.rs @@ -32,7 +32,7 @@ impl AdminAppsApproved { cursor: &str, team_id: &str, enterprise_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); diff --git a/slack/src/admin_apps_requests.rs b/slack/src/admin_apps_requests.rs index e26eb6e0..b70c3881 100644 --- a/slack/src/admin_apps_requests.rs +++ b/slack/src/admin_apps_requests.rs @@ -30,7 +30,7 @@ impl AdminAppsRequests { limit: i64, cursor: &str, team_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); diff --git a/slack/src/admin_apps_restricted.rs b/slack/src/admin_apps_restricted.rs index 1159ae6a..253c4f3a 100644 --- a/slack/src/admin_apps_restricted.rs +++ b/slack/src/admin_apps_restricted.rs @@ -32,7 +32,7 @@ impl AdminAppsRestricted { cursor: &str, team_id: &str, enterprise_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); diff --git a/slack/src/admin_conversations.rs b/slack/src/admin_conversations.rs index c7bf8de4..d9f4411c 100644 --- a/slack/src/admin_conversations.rs +++ b/slack/src/admin_conversations.rs @@ -22,7 +22,7 @@ impl AdminConversations { * * * `token: &str` -- Authentication token. Requires scope: `admin.conversations:write`. */ - pub async fn archive(&self) -> ClientResult { + pub async fn archive(&self) -> ClientResult> { let url = self.client.url("/admin.conversations.archive", None); self.client .post( @@ -45,7 +45,9 @@ impl AdminConversations { * * * `token: &str` -- Authentication token. Requires scope: `admin.conversations:write`. */ - pub async fn convert_private(&self) -> ClientResult { + pub async fn convert_private( + &self, + ) -> ClientResult> { let url = self .client .url("/admin.conversations.convertToPrivate", None); @@ -70,7 +72,9 @@ impl AdminConversations { * * * `token: &str` -- Authentication token. Requires scope: `admin.conversations:write`. */ - pub async fn create(&self) -> ClientResult { + pub async fn create( + &self, + ) -> ClientResult> { let url = self.client.url("/admin.conversations.create", None); self.client .post( @@ -93,7 +97,7 @@ impl AdminConversations { * * * `token: &str` -- Authentication token. Requires scope: `admin.conversations:write`. */ - pub async fn delete(&self) -> ClientResult { + pub async fn delete(&self) -> ClientResult> { let url = self.client.url("/admin.conversations.delete", None); self.client .post( @@ -116,7 +120,9 @@ impl AdminConversations { * * * `token: &str` -- Authentication token. Requires scope: `admin.conversations:write`. */ - pub async fn disconnect_shared(&self) -> ClientResult { + pub async fn disconnect_shared( + &self, + ) -> ClientResult> { let url = self .client .url("/admin.conversations.disconnectShared", None); @@ -145,7 +151,8 @@ impl AdminConversations { pub async fn get_conversation_pref( &self, channel_id: &str, - ) -> ClientResult { + ) -> ClientResult> + { let mut query_args: Vec<(String, String)> = Default::default(); if !channel_id.is_empty() { query_args.push(("channel_id".to_string(), channel_id.to_string())); @@ -184,7 +191,7 @@ impl AdminConversations { channel_id: &str, cursor: &str, limit: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !channel_id.is_empty() { query_args.push(("channel_id".to_string(), channel_id.to_string())); @@ -220,7 +227,7 @@ impl AdminConversations { * * * `token: &str` -- Authentication token. Requires scope: `admin.conversations:write`. */ - pub async fn invite(&self) -> ClientResult { + pub async fn invite(&self) -> ClientResult> { let url = self.client.url("/admin.conversations.invite", None); self.client .post( @@ -243,7 +250,7 @@ impl AdminConversations { * * * `token: &str` -- Authentication token. Requires scope: `admin.conversations:write`. */ - pub async fn rename(&self) -> ClientResult { + pub async fn rename(&self) -> ClientResult> { let url = self.client.url("/admin.conversations.rename", None); self.client .post( @@ -282,7 +289,7 @@ impl AdminConversations { search_channel_types: &str, sort: &str, sort_dir: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); @@ -333,7 +340,9 @@ impl AdminConversations { * * * `token: &str` -- Authentication token. Requires scope: `admin.conversations:write`. */ - pub async fn set_conversation_prefs(&self) -> ClientResult { + pub async fn set_conversation_prefs( + &self, + ) -> ClientResult> { let url = self .client .url("/admin.conversations.setConversationPrefs", None); @@ -358,7 +367,7 @@ impl AdminConversations { * * * `token: &str` -- Authentication token. Requires scope: `admin.conversations:write`. */ - pub async fn set_teams(&self) -> ClientResult { + pub async fn set_teams(&self) -> ClientResult> { let url = self.client.url("/admin.conversations.setTeams", None); self.client .post( @@ -381,7 +390,7 @@ impl AdminConversations { * * * `token: &str` -- Authentication token. Requires scope: `admin.conversations:write`. */ - pub async fn unarchive(&self) -> ClientResult { + pub async fn unarchive(&self) -> ClientResult> { let url = self.client.url("/admin.conversations.unarchive", None); self.client .post( diff --git a/slack/src/admin_conversations_ekm.rs b/slack/src/admin_conversations_ekm.rs index 1c95072d..750330e2 100644 --- a/slack/src/admin_conversations_ekm.rs +++ b/slack/src/admin_conversations_ekm.rs @@ -32,7 +32,7 @@ impl AdminConversationsEkm { team_ids: &str, limit: i64, cursor: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !channel_ids.is_empty() { query_args.push(("channel_ids".to_string(), channel_ids.to_string())); diff --git a/slack/src/admin_conversations_restrict_access.rs b/slack/src/admin_conversations_restrict_access.rs index f2257cdb..ad34eee9 100644 --- a/slack/src/admin_conversations_restrict_access.rs +++ b/slack/src/admin_conversations_restrict_access.rs @@ -18,7 +18,7 @@ impl AdminConversationsRestrictAccess { * * FROM: */ - pub async fn add_group(&self) -> ClientResult { + pub async fn add_group(&self) -> ClientResult> { let url = self .client .url("/admin.conversations.restrictAccess.addGroup", None); @@ -49,7 +49,7 @@ impl AdminConversationsRestrictAccess { &self, channel_id: &str, team_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !channel_id.is_empty() { query_args.push(("channel_id".to_string(), channel_id.to_string())); @@ -79,7 +79,7 @@ impl AdminConversationsRestrictAccess { * * FROM: */ - pub async fn remove_group(&self) -> ClientResult { + pub async fn remove_group(&self) -> ClientResult> { let url = self .client .url("/admin.conversations.restrictAccess.removeGroup", None); diff --git a/slack/src/admin_emoji.rs b/slack/src/admin_emoji.rs index 226a1a38..2c72de45 100644 --- a/slack/src/admin_emoji.rs +++ b/slack/src/admin_emoji.rs @@ -18,7 +18,7 @@ impl AdminEmoji { * * FROM: */ - pub async fn add(&self) -> ClientResult { + pub async fn add(&self) -> ClientResult> { let url = self.client.url("/admin.emoji.add", None); self.client .post( @@ -37,7 +37,7 @@ impl AdminEmoji { * * FROM: */ - pub async fn add_alias(&self) -> ClientResult { + pub async fn add_alias(&self) -> ClientResult> { let url = self.client.url("/admin.emoji.addAlias", None); self.client .post( @@ -62,7 +62,11 @@ impl AdminEmoji { * * `cursor: &str` -- Set `cursor` to `next_cursor` returned by the previous call to list items in the next page. * * `limit: i64` -- The maximum number of items to return. Must be between 1 - 1000 both inclusive. */ - pub async fn list(&self, cursor: &str, limit: i64) -> ClientResult { + pub async fn list( + &self, + cursor: &str, + limit: i64, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); @@ -91,7 +95,7 @@ impl AdminEmoji { * * FROM: */ - pub async fn remove(&self) -> ClientResult { + pub async fn remove(&self) -> ClientResult> { let url = self.client.url("/admin.emoji.remove", None); self.client .post( @@ -110,7 +114,7 @@ impl AdminEmoji { * * FROM: */ - pub async fn rename(&self) -> ClientResult { + pub async fn rename(&self) -> ClientResult> { let url = self.client.url("/admin.emoji.rename", None); self.client .post( diff --git a/slack/src/admin_invite_requests.rs b/slack/src/admin_invite_requests.rs index 116fde1e..dcfc8e27 100644 --- a/slack/src/admin_invite_requests.rs +++ b/slack/src/admin_invite_requests.rs @@ -25,7 +25,7 @@ impl AdminInviteRequests { pub async fn approve( &self, body: &crate::types::AdminInviteRequestsApproveRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/admin.inviteRequests.approve", None); self.client .post( @@ -51,7 +51,7 @@ impl AdminInviteRequests { pub async fn deny( &self, body: &crate::types::AdminInviteRequestsApproveRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/admin.inviteRequests.deny", None); self.client .post( @@ -82,7 +82,7 @@ impl AdminInviteRequests { team_id: &str, cursor: &str, limit: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); diff --git a/slack/src/admin_invite_requests_approved.rs b/slack/src/admin_invite_requests_approved.rs index da148004..2d2f6428 100644 --- a/slack/src/admin_invite_requests_approved.rs +++ b/slack/src/admin_invite_requests_approved.rs @@ -30,7 +30,7 @@ impl AdminInviteRequestsApproved { team_id: &str, cursor: &str, limit: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); diff --git a/slack/src/admin_invite_requests_denied.rs b/slack/src/admin_invite_requests_denied.rs index 2740d2ec..a8247e6b 100644 --- a/slack/src/admin_invite_requests_denied.rs +++ b/slack/src/admin_invite_requests_denied.rs @@ -30,7 +30,7 @@ impl AdminInviteRequestsDenied { team_id: &str, cursor: &str, limit: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); diff --git a/slack/src/admin_teams.rs b/slack/src/admin_teams.rs index 5b5706d8..1090c758 100644 --- a/slack/src/admin_teams.rs +++ b/slack/src/admin_teams.rs @@ -22,7 +22,7 @@ impl AdminTeams { * * * `token: &str` -- Authentication token. Requires scope: `admin.teams:write`. */ - pub async fn create(&self) -> ClientResult { + pub async fn create(&self) -> ClientResult> { let url = self.client.url("/admin.teams.create", None); self.client .post( @@ -47,7 +47,11 @@ impl AdminTeams { * * `limit: i64` -- The maximum number of items to return. Must be between 1 - 100 both inclusive. * * `cursor: &str` -- Set `cursor` to `next_cursor` returned by the previous call to list items in the next page. */ - pub async fn list(&self, limit: i64, cursor: &str) -> ClientResult { + pub async fn list( + &self, + limit: i64, + cursor: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); diff --git a/slack/src/admin_teams_admins.rs b/slack/src/admin_teams_admins.rs index a16a2e0b..a52388ce 100644 --- a/slack/src/admin_teams_admins.rs +++ b/slack/src/admin_teams_admins.rs @@ -30,7 +30,7 @@ impl AdminTeamsAdmins { limit: i64, cursor: &str, team_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); diff --git a/slack/src/admin_teams_owners.rs b/slack/src/admin_teams_owners.rs index 79f2186a..7c8877ff 100644 --- a/slack/src/admin_teams_owners.rs +++ b/slack/src/admin_teams_owners.rs @@ -30,7 +30,7 @@ impl AdminTeamsOwners { team_id: &str, limit: i64, cursor: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); diff --git a/slack/src/admin_teams_settings.rs b/slack/src/admin_teams_settings.rs index 5ec2b208..35d195d9 100644 --- a/slack/src/admin_teams_settings.rs +++ b/slack/src/admin_teams_settings.rs @@ -23,7 +23,10 @@ impl AdminTeamsSettings { * * `token: &str` -- Authentication token. Requires scope: `admin.teams:read`. * * `team_id: &str` */ - pub async fn info(&self, team_id: &str) -> ClientResult { + pub async fn info( + &self, + team_id: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !team_id.is_empty() { query_args.push(("team_id".to_string(), team_id.to_string())); @@ -49,7 +52,9 @@ impl AdminTeamsSettings { * * FROM: */ - pub async fn set_default_channels(&self) -> ClientResult { + pub async fn set_default_channels( + &self, + ) -> ClientResult> { let url = self .client .url("/admin.teams.settings.setDefaultChannels", None); @@ -74,7 +79,9 @@ impl AdminTeamsSettings { * * * `token: &str` -- Authentication token. Requires scope: `admin.teams:write`. */ - pub async fn set_description(&self) -> ClientResult { + pub async fn set_description( + &self, + ) -> ClientResult> { let url = self .client .url("/admin.teams.settings.setDescription", None); @@ -99,7 +106,9 @@ impl AdminTeamsSettings { * * * `token: &str` -- Authentication token. Requires scope: `admin.teams:write`. */ - pub async fn set_discoverability(&self) -> ClientResult { + pub async fn set_discoverability( + &self, + ) -> ClientResult> { let url = self .client .url("/admin.teams.settings.setDiscoverability", None); @@ -120,7 +129,7 @@ impl AdminTeamsSettings { * * FROM: */ - pub async fn set_icon(&self) -> ClientResult { + pub async fn set_icon(&self) -> ClientResult> { let url = self.client.url("/admin.teams.settings.setIcon", None); self.client .post( @@ -143,7 +152,7 @@ impl AdminTeamsSettings { * * * `token: &str` -- Authentication token. Requires scope: `admin.teams:write`. */ - pub async fn set_name(&self) -> ClientResult { + pub async fn set_name(&self) -> ClientResult> { let url = self.client.url("/admin.teams.settings.setName", None); self.client .post( diff --git a/slack/src/admin_usergroups.rs b/slack/src/admin_usergroups.rs index 976603e3..c4a83fa0 100644 --- a/slack/src/admin_usergroups.rs +++ b/slack/src/admin_usergroups.rs @@ -22,7 +22,7 @@ impl AdminUsergroups { * * * `token: &str` -- Authentication token. Requires scope: `admin.usergroups:write`. */ - pub async fn add_channels(&self) -> ClientResult { + pub async fn add_channels(&self) -> ClientResult> { let url = self.client.url("/admin.usergroups.addChannels", None); self.client .post( @@ -45,7 +45,7 @@ impl AdminUsergroups { * * * `token: &str` -- Authentication token. Requires scope: `admin.teams:write`. */ - pub async fn add_teams(&self) -> ClientResult { + pub async fn add_teams(&self) -> ClientResult> { let url = self.client.url("/admin.usergroups.addTeams", None); self.client .post( @@ -76,7 +76,7 @@ impl AdminUsergroups { usergroup_id: &str, team_id: &str, include_num_members: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if include_num_members { query_args.push(( @@ -115,7 +115,9 @@ impl AdminUsergroups { * * * `token: &str` -- Authentication token. Requires scope: `admin.usergroups:write`. */ - pub async fn remove_channels(&self) -> ClientResult { + pub async fn remove_channels( + &self, + ) -> ClientResult> { let url = self.client.url("/admin.usergroups.removeChannels", None); self.client .post( diff --git a/slack/src/admin_users.rs b/slack/src/admin_users.rs index 163c3a39..a33767ef 100644 --- a/slack/src/admin_users.rs +++ b/slack/src/admin_users.rs @@ -22,7 +22,7 @@ impl AdminUsers { * * * `token: &str` -- Authentication token. Requires scope: `admin.users:write`. */ - pub async fn assign(&self) -> ClientResult { + pub async fn assign(&self) -> ClientResult> { let url = self.client.url("/admin.users.assign", None); self.client .post( @@ -45,7 +45,7 @@ impl AdminUsers { * * * `token: &str` -- Authentication token. Requires scope: `admin.users:write`. */ - pub async fn invite(&self) -> ClientResult { + pub async fn invite(&self) -> ClientResult> { let url = self.client.url("/admin.users.invite", None); self.client .post( @@ -76,7 +76,7 @@ impl AdminUsers { team_id: &str, cursor: &str, limit: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); @@ -112,7 +112,7 @@ impl AdminUsers { * * * `token: &str` -- Authentication token. Requires scope: `admin.users:write`. */ - pub async fn remove(&self) -> ClientResult { + pub async fn remove(&self) -> ClientResult> { let url = self.client.url("/admin.users.remove", None); self.client .post( @@ -135,7 +135,7 @@ impl AdminUsers { * * * `token: &str` -- Authentication token. Requires scope: `admin.users:write`. */ - pub async fn set(&self) -> ClientResult { + pub async fn set(&self) -> ClientResult> { let url = self.client.url("/admin.users.setAdmin", None); self.client .post( @@ -158,7 +158,9 @@ impl AdminUsers { * * * `token: &str` -- Authentication token. Requires scope: `admin.users:write`. */ - pub async fn set_expiration(&self) -> ClientResult { + pub async fn set_expiration( + &self, + ) -> ClientResult> { let url = self.client.url("/admin.users.setExpiration", None); self.client .post( @@ -181,7 +183,7 @@ impl AdminUsers { * * * `token: &str` -- Authentication token. Requires scope: `admin.users:write`. */ - pub async fn set_owner(&self) -> ClientResult { + pub async fn set_owner(&self) -> ClientResult> { let url = self.client.url("/admin.users.setOwner", None); self.client .post( @@ -204,7 +206,7 @@ impl AdminUsers { * * * `token: &str` -- Authentication token. Requires scope: `admin.users:write`. */ - pub async fn set_regular(&self) -> ClientResult { + pub async fn set_regular(&self) -> ClientResult> { let url = self.client.url("/admin.users.setRegular", None); self.client .post( diff --git a/slack/src/admin_users_session.rs b/slack/src/admin_users_session.rs index a1993895..214a9a0d 100644 --- a/slack/src/admin_users_session.rs +++ b/slack/src/admin_users_session.rs @@ -22,7 +22,7 @@ impl AdminUsersSession { * * * `token: &str` -- Authentication token. Requires scope: `admin.users:write`. */ - pub async fn invalidate(&self) -> ClientResult { + pub async fn invalidate(&self) -> ClientResult> { let url = self.client.url("/admin.users.session.invalidate", None); self.client .post( @@ -45,7 +45,7 @@ impl AdminUsersSession { * * * `token: &str` -- Authentication token. Requires scope: `admin.users:write`. */ - pub async fn reset(&self) -> ClientResult { + pub async fn reset(&self) -> ClientResult> { let url = self.client.url("/admin.users.session.reset", None); self.client .post( diff --git a/slack/src/api.rs b/slack/src/api.rs index d199aa07..7895078d 100644 --- a/slack/src/api.rs +++ b/slack/src/api.rs @@ -23,7 +23,11 @@ impl Api { * * `error: &str` -- Error response to return. * * `foo_: &str` -- example property to return. */ - pub async fn test(&self, error: &str, foo_: &str) -> ClientResult { + pub async fn test( + &self, + error: &str, + foo_: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !error.is_empty() { query_args.push(("error".to_string(), error.to_string())); diff --git a/slack/src/apps.rs b/slack/src/apps.rs index 2f1c0247..a402db6c 100644 --- a/slack/src/apps.rs +++ b/slack/src/apps.rs @@ -28,7 +28,7 @@ impl Apps { &self, client_id: &str, client_secret: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !client_id.is_empty() { query_args.push(("client_id".to_string(), client_id.to_string())); diff --git a/slack/src/apps_event_authorizations.rs b/slack/src/apps_event_authorizations.rs index 26b3a8f4..60665567 100644 --- a/slack/src/apps_event_authorizations.rs +++ b/slack/src/apps_event_authorizations.rs @@ -30,7 +30,7 @@ impl AppsEventAuthorizations { event_context: &str, cursor: &str, limit: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); diff --git a/slack/src/apps_permissions.rs b/slack/src/apps_permissions.rs index 09dc966c..7c3079bb 100644 --- a/slack/src/apps_permissions.rs +++ b/slack/src/apps_permissions.rs @@ -22,7 +22,9 @@ impl AppsPermissions { * * * `token: &str` -- Authentication token. Requires scope: `none`. */ - pub async fn info(&self) -> ClientResult { + pub async fn info( + &self, + ) -> ClientResult> { let url = self.client.url("/apps.permissions.info", None); self.client .get( @@ -51,7 +53,7 @@ impl AppsPermissions { &self, scopes: &str, trigger_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !scopes.is_empty() { query_args.push(("scopes".to_string(), scopes.to_string())); diff --git a/slack/src/apps_permissions_resources.rs b/slack/src/apps_permissions_resources.rs index b2214ad2..cdbd97f2 100644 --- a/slack/src/apps_permissions_resources.rs +++ b/slack/src/apps_permissions_resources.rs @@ -28,7 +28,8 @@ impl AppsPermissionsResources { &self, cursor: &str, limit: i64, - ) -> ClientResult { + ) -> ClientResult> + { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); diff --git a/slack/src/apps_permissions_scopes.rs b/slack/src/apps_permissions_scopes.rs index 2c5e3899..63db378b 100644 --- a/slack/src/apps_permissions_scopes.rs +++ b/slack/src/apps_permissions_scopes.rs @@ -22,7 +22,9 @@ impl AppsPermissionsScopes { * * * `token: &str` -- Authentication token. Requires scope: `none`. */ - pub async fn list(&self) -> ClientResult { + pub async fn list( + &self, + ) -> ClientResult> { let url = self.client.url("/apps.permissions.scopes.list", None); self.client .get( diff --git a/slack/src/apps_permissions_users.rs b/slack/src/apps_permissions_users.rs index 5f40a143..a66e7be0 100644 --- a/slack/src/apps_permissions_users.rs +++ b/slack/src/apps_permissions_users.rs @@ -24,7 +24,11 @@ impl AppsPermissionsUsers { * * `cursor: &str` -- Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](/docs/pagination) for more detail. * * `limit: i64` -- The maximum number of items to return. */ - pub async fn list(&self, cursor: &str, limit: i64) -> ClientResult { + pub async fn list( + &self, + cursor: &str, + limit: i64, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); @@ -65,7 +69,7 @@ impl AppsPermissionsUsers { scopes: &str, trigger_id: &str, user: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !scopes.is_empty() { query_args.push(("scopes".to_string(), scopes.to_string())); diff --git a/slack/src/auth.rs b/slack/src/auth.rs index a66d6e35..3e6a948e 100644 --- a/slack/src/auth.rs +++ b/slack/src/auth.rs @@ -23,7 +23,10 @@ impl Auth { * * `token: &str` -- Authentication token. Requires scope: `none`. * * `test: bool` -- Setting this parameter to `1` triggers a _testing mode_ where the specified token will not actually be revoked. */ - pub async fn revoke(&self, test: bool) -> ClientResult { + pub async fn revoke( + &self, + test: bool, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if test { query_args.push(("test".to_string(), test.to_string())); @@ -51,7 +54,7 @@ impl Auth { * * * `token: &str` -- Authentication token. Requires scope: `none`. */ - pub async fn test(&self) -> ClientResult { + pub async fn test(&self) -> ClientResult> { let url = self.client.url("/auth.test", None); self.client .get( diff --git a/slack/src/bots.rs b/slack/src/bots.rs index b90705fd..ef23fe10 100644 --- a/slack/src/bots.rs +++ b/slack/src/bots.rs @@ -23,7 +23,10 @@ impl Bots { * * `token: &str` -- Authentication token. Requires scope: `users:read`. * * `bot: &str` -- Bot user to get info on. */ - pub async fn info(&self, bot: &str) -> ClientResult { + pub async fn info( + &self, + bot: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !bot.is_empty() { query_args.push(("bot".to_string(), bot.to_string())); diff --git a/slack/src/calls.rs b/slack/src/calls.rs index d48d21f2..e6d9edd4 100644 --- a/slack/src/calls.rs +++ b/slack/src/calls.rs @@ -22,7 +22,7 @@ impl Calls { * * * `token: &str` -- Authentication token. Requires scope: `calls:write`. */ - pub async fn add(&self) -> ClientResult { + pub async fn add(&self) -> ClientResult> { let url = self.client.url("/calls.add", None); self.client .post( @@ -45,7 +45,7 @@ impl Calls { * * * `token: &str` -- Authentication token. Requires scope: `calls:write`. */ - pub async fn end(&self) -> ClientResult { + pub async fn end(&self) -> ClientResult> { let url = self.client.url("/calls.end", None); self.client .post( @@ -69,7 +69,10 @@ impl Calls { * * `token: &str` -- Authentication token. Requires scope: `calls:read`. * * `id: &str` -- `id` of the Call returned by the [`calls.add`](/methods/calls.add) method. */ - pub async fn info(&self, id: &str) -> ClientResult { + pub async fn info( + &self, + id: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !id.is_empty() { query_args.push(("id".to_string(), id.to_string())); @@ -97,7 +100,7 @@ impl Calls { * * * `token: &str` -- Authentication token. Requires scope: `calls:write`. */ - pub async fn update(&self) -> ClientResult { + pub async fn update(&self) -> ClientResult> { let url = self.client.url("/calls.update", None); self.client .post( diff --git a/slack/src/calls_participants.rs b/slack/src/calls_participants.rs index a2879d49..7898dee9 100644 --- a/slack/src/calls_participants.rs +++ b/slack/src/calls_participants.rs @@ -22,7 +22,7 @@ impl CallsParticipants { * * * `token: &str` -- Authentication token. Requires scope: `calls:write`. */ - pub async fn add(&self) -> ClientResult { + pub async fn add(&self) -> ClientResult> { let url = self.client.url("/calls.participants.add", None); self.client .post( @@ -45,7 +45,7 @@ impl CallsParticipants { * * * `token: &str` -- Authentication token. Requires scope: `calls:write`. */ - pub async fn remove(&self) -> ClientResult { + pub async fn remove(&self) -> ClientResult> { let url = self.client.url("/calls.participants.remove", None); self.client .post( diff --git a/slack/src/chat.rs b/slack/src/chat.rs index b96774a2..bd3a0e25 100644 --- a/slack/src/chat.rs +++ b/slack/src/chat.rs @@ -22,7 +22,9 @@ impl Chat { * * * `token: &str` -- Authentication token. Requires scope: `chat:write`. */ - pub async fn delete(&self) -> ClientResult { + pub async fn delete( + &self, + ) -> ClientResult> { let url = self.client.url("/chat.delete", None); self.client .post( @@ -45,7 +47,9 @@ impl Chat { * * * `token: &str` -- Authentication token. Requires scope: `chat:write`. */ - pub async fn delete_scheduled_message(&self) -> ClientResult { + pub async fn delete_scheduled_message( + &self, + ) -> ClientResult> { let url = self.client.url("/chat.deleteScheduledMessage", None); self.client .post( @@ -74,7 +78,7 @@ impl Chat { &self, channel: &str, message_ts: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !channel.is_empty() { query_args.push(("channel".to_string(), channel.to_string())); @@ -107,7 +111,9 @@ impl Chat { * * * `token: &str` -- Authentication token. Requires scope: `chat:write`. */ - pub async fn me_message(&self) -> ClientResult { + pub async fn me_message( + &self, + ) -> ClientResult> { let url = self.client.url("/chat.meMessage", None); self.client .post( @@ -132,7 +138,7 @@ impl Chat { */ pub async fn post_ephemeral( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/chat.postEphemeral", None); self.client .post( @@ -155,7 +161,9 @@ impl Chat { * * * `token: &str` -- Authentication token. Requires scope: `chat:write`. */ - pub async fn post_message(&self) -> ClientResult { + pub async fn post_message( + &self, + ) -> ClientResult> { let url = self.client.url("/chat.postMessage", None); self.client .post( @@ -180,7 +188,7 @@ impl Chat { */ pub async fn schedule_message( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/chat.scheduleMessage", None); self.client .post( @@ -203,7 +211,7 @@ impl Chat { * * * `token: &str` -- Authentication token. Requires scope: `links:write`. */ - pub async fn unfurl(&self) -> ClientResult { + pub async fn unfurl(&self) -> ClientResult> { let url = self.client.url("/chat.unfurl", None); self.client .post( @@ -226,7 +234,9 @@ impl Chat { * * * `token: &str` -- Authentication token. Requires scope: `chat:write`. */ - pub async fn update(&self) -> ClientResult { + pub async fn update( + &self, + ) -> ClientResult> { let url = self.client.url("/chat.update", None); self.client .post( diff --git a/slack/src/chat_scheduled_messages.rs b/slack/src/chat_scheduled_messages.rs index be798c21..987b6942 100644 --- a/slack/src/chat_scheduled_messages.rs +++ b/slack/src/chat_scheduled_messages.rs @@ -34,7 +34,7 @@ impl ChatScheduledMessages { oldest: f64, limit: i64, cursor: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !channel.is_empty() { query_args.push(("channel".to_string(), channel.to_string())); diff --git a/slack/src/conversations.rs b/slack/src/conversations.rs index e6602a78..9fe832df 100644 --- a/slack/src/conversations.rs +++ b/slack/src/conversations.rs @@ -22,7 +22,7 @@ impl Conversations { * * * `token: &str` -- Authentication token. Requires scope: `conversations:write`. */ - pub async fn archive(&self) -> ClientResult { + pub async fn archive(&self) -> ClientResult> { let url = self.client.url("/conversations.archive", None); self.client .post( @@ -45,7 +45,9 @@ impl Conversations { * * * `token: &str` -- Authentication token. Requires scope: `conversations:write`. */ - pub async fn close(&self) -> ClientResult { + pub async fn close( + &self, + ) -> ClientResult> { let url = self.client.url("/conversations.close", None); self.client .post( @@ -68,7 +70,9 @@ impl Conversations { * * * `token: &str` -- Authentication token. Requires scope: `conversations:write`. */ - pub async fn create(&self) -> ClientResult { + pub async fn create( + &self, + ) -> ClientResult> { let url = self.client.url("/conversations.create", None); self.client .post( @@ -105,7 +109,7 @@ impl Conversations { inclusive: bool, limit: i64, cursor: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !channel.is_empty() { query_args.push(("channel".to_string(), channel.to_string())); @@ -158,7 +162,7 @@ impl Conversations { channel: &str, include_locale: bool, include_num_members: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !channel.is_empty() { query_args.push(("channel".to_string(), channel.to_string())); @@ -197,7 +201,9 @@ impl Conversations { * * * `token: &str` -- Authentication token. Requires scope: `conversations:write`. */ - pub async fn invite(&self) -> ClientResult { + pub async fn invite( + &self, + ) -> ClientResult> { let url = self.client.url("/conversations.invite", None); self.client .post( @@ -220,7 +226,9 @@ impl Conversations { * * * `token: &str` -- Authentication token. Requires scope: `channels:write`. */ - pub async fn join(&self) -> ClientResult { + pub async fn join( + &self, + ) -> ClientResult> { let url = self.client.url("/conversations.join", None); self.client .post( @@ -243,7 +251,7 @@ impl Conversations { * * * `token: &str` -- Authentication token. Requires scope: `conversations:write`. */ - pub async fn kick(&self) -> ClientResult { + pub async fn kick(&self) -> ClientResult> { let url = self.client.url("/conversations.kick", None); self.client .post( @@ -266,7 +274,9 @@ impl Conversations { * * * `token: &str` -- Authentication token. Requires scope: `conversations:write`. */ - pub async fn leave(&self) -> ClientResult { + pub async fn leave( + &self, + ) -> ClientResult> { let url = self.client.url("/conversations.leave", None); self.client .post( @@ -299,7 +309,7 @@ impl Conversations { types: &str, limit: i64, cursor: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); @@ -338,7 +348,7 @@ impl Conversations { * * * `token: &str` -- Authentication token. Requires scope: `conversations:write`. */ - pub async fn mark(&self) -> ClientResult { + pub async fn mark(&self) -> ClientResult> { let url = self.client.url("/conversations.mark", None); self.client .post( @@ -369,7 +379,7 @@ impl Conversations { channel: &str, limit: i64, cursor: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !channel.is_empty() { query_args.push(("channel".to_string(), channel.to_string())); @@ -405,7 +415,9 @@ impl Conversations { * * * `token: &str` -- Authentication token. Requires scope: `conversations:write`. */ - pub async fn open(&self) -> ClientResult { + pub async fn open( + &self, + ) -> ClientResult> { let url = self.client.url("/conversations.open", None); self.client .post( @@ -428,7 +440,9 @@ impl Conversations { * * * `token: &str` -- Authentication token. Requires scope: `conversations:write`. */ - pub async fn rename(&self) -> ClientResult { + pub async fn rename( + &self, + ) -> ClientResult> { let url = self.client.url("/conversations.rename", None); self.client .post( @@ -467,7 +481,7 @@ impl Conversations { inclusive: bool, limit: i64, cursor: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !channel.is_empty() { query_args.push(("channel".to_string(), channel.to_string())); @@ -515,7 +529,9 @@ impl Conversations { * * * `token: &str` -- Authentication token. Requires scope: `conversations:write`. */ - pub async fn set_purpose(&self) -> ClientResult { + pub async fn set_purpose( + &self, + ) -> ClientResult> { let url = self.client.url("/conversations.setPurpose", None); self.client .post( @@ -538,7 +554,9 @@ impl Conversations { * * * `token: &str` -- Authentication token. Requires scope: `conversations:write`. */ - pub async fn set_topic(&self) -> ClientResult { + pub async fn set_topic( + &self, + ) -> ClientResult> { let url = self.client.url("/conversations.setTopic", None); self.client .post( @@ -561,7 +579,7 @@ impl Conversations { * * * `token: &str` -- Authentication token. Requires scope: `conversations:write`. */ - pub async fn unarchive(&self) -> ClientResult { + pub async fn unarchive(&self) -> ClientResult> { let url = self.client.url("/conversations.unarchive", None); self.client .post( diff --git a/slack/src/dialog.rs b/slack/src/dialog.rs index b4715daa..30774139 100644 --- a/slack/src/dialog.rs +++ b/slack/src/dialog.rs @@ -28,7 +28,7 @@ impl Dialog { &self, dialog: &str, trigger_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !dialog.is_empty() { query_args.push(("dialog".to_string(), dialog.to_string())); diff --git a/slack/src/dnd.rs b/slack/src/dnd.rs index b198e311..f1e5671b 100644 --- a/slack/src/dnd.rs +++ b/slack/src/dnd.rs @@ -22,7 +22,7 @@ impl Dnd { * * * `token: &str` -- Authentication token. Requires scope: `dnd:write`. */ - pub async fn end(&self) -> ClientResult { + pub async fn end(&self) -> ClientResult> { let url = self.client.url("/dnd.endDnd", None); self.client .post( @@ -45,7 +45,9 @@ impl Dnd { * * * `token: &str` -- Authentication token. Requires scope: `dnd:write`. */ - pub async fn end_snooze(&self) -> ClientResult { + pub async fn end_snooze( + &self, + ) -> ClientResult> { let url = self.client.url("/dnd.endSnooze", None); self.client .post( @@ -69,7 +71,10 @@ impl Dnd { * * `token: &str` -- Authentication token. Requires scope: `dnd:read`. * * `user: &str` -- User to fetch status for (defaults to current user). */ - pub async fn info(&self, user: &str) -> ClientResult { + pub async fn info( + &self, + user: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !user.is_empty() { query_args.push(("user".to_string(), user.to_string())); @@ -93,7 +98,9 @@ impl Dnd { * * FROM: */ - pub async fn set_snooze(&self) -> ClientResult { + pub async fn set_snooze( + &self, + ) -> ClientResult> { let url = self.client.url("/dnd.setSnooze", None); self.client .post( @@ -117,7 +124,10 @@ impl Dnd { * * `token: &str` -- Authentication token. Requires scope: `dnd:read`. * * `users: &str` -- Comma-separated list of users to fetch Do Not Disturb status for. */ - pub async fn team_info(&self, users: &str) -> ClientResult { + pub async fn team_info( + &self, + users: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !users.is_empty() { query_args.push(("users".to_string(), users.to_string())); diff --git a/slack/src/emoji.rs b/slack/src/emoji.rs index d63b0d30..98590105 100644 --- a/slack/src/emoji.rs +++ b/slack/src/emoji.rs @@ -22,7 +22,7 @@ impl Emoji { * * * `token: &str` -- Authentication token. Requires scope: `emoji:read`. */ - pub async fn list(&self) -> ClientResult { + pub async fn list(&self) -> ClientResult> { let url = self.client.url("/emoji.list", None); self.client .get( diff --git a/slack/src/files.rs b/slack/src/files.rs index ac8ca475..19618347 100644 --- a/slack/src/files.rs +++ b/slack/src/files.rs @@ -22,7 +22,7 @@ impl Files { * * * `token: &str` -- Authentication token. Requires scope: `files:write:user`. */ - pub async fn delete(&self) -> ClientResult { + pub async fn delete(&self) -> ClientResult> { let url = self.client.url("/files.delete", None); self.client .post( @@ -57,7 +57,7 @@ impl Files { page: &str, limit: i64, cursor: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !count.is_empty() { query_args.push(("count".to_string(), count.to_string())); @@ -115,7 +115,7 @@ impl Files { count: &str, page: &str, show_files_hidden_by_limit: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !channel.is_empty() { query_args.push(("channel".to_string(), channel.to_string())); @@ -167,7 +167,9 @@ impl Files { * * * `token: &str` -- Authentication token. Requires scope: `files:write:user`. */ - pub async fn revoke_public_url(&self) -> ClientResult { + pub async fn revoke_public_url( + &self, + ) -> ClientResult> { let url = self.client.url("/files.revokePublicURL", None); self.client .post( @@ -190,7 +192,9 @@ impl Files { * * * `token: &str` -- Authentication token. Requires scope: `files:write:user`. */ - pub async fn shared_public_url(&self) -> ClientResult { + pub async fn shared_public_url( + &self, + ) -> ClientResult> { let url = self.client.url("/files.sharedPublicURL", None); self.client .post( @@ -209,7 +213,7 @@ impl Files { * * FROM: */ - pub async fn upload(&self) -> ClientResult { + pub async fn upload(&self) -> ClientResult> { let url = self.client.url("/files.upload", None); self.client .post( diff --git a/slack/src/files_comments.rs b/slack/src/files_comments.rs index 5203cd22..2cc781f1 100644 --- a/slack/src/files_comments.rs +++ b/slack/src/files_comments.rs @@ -22,7 +22,7 @@ impl FilesComments { * * * `token: &str` -- Authentication token. Requires scope: `files:write:user`. */ - pub async fn delete(&self) -> ClientResult { + pub async fn delete(&self) -> ClientResult> { let url = self.client.url("/files.comments.delete", None); self.client .post( diff --git a/slack/src/files_remote.rs b/slack/src/files_remote.rs index 83d31413..15fb80c7 100644 --- a/slack/src/files_remote.rs +++ b/slack/src/files_remote.rs @@ -18,7 +18,7 @@ impl FilesRemote { * * FROM: */ - pub async fn add(&self) -> ClientResult { + pub async fn add(&self) -> ClientResult> { let url = self.client.url("/files.remote.add", None); self.client .post( @@ -47,7 +47,7 @@ impl FilesRemote { &self, file: &str, external_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !external_id.is_empty() { query_args.push(("external_id".to_string(), external_id.to_string())); @@ -92,7 +92,7 @@ impl FilesRemote { ts_to: f64, limit: i64, cursor: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !channel.is_empty() { query_args.push(("channel".to_string(), channel.to_string())); @@ -130,7 +130,7 @@ impl FilesRemote { * * FROM: */ - pub async fn remove(&self) -> ClientResult { + pub async fn remove(&self) -> ClientResult> { let url = self.client.url("/files.remote.remove", None); self.client .post( @@ -161,7 +161,7 @@ impl FilesRemote { file: &str, external_id: &str, channels: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !channels.is_empty() { query_args.push(("channels".to_string(), channels.to_string())); @@ -193,7 +193,7 @@ impl FilesRemote { * * FROM: */ - pub async fn update(&self) -> ClientResult { + pub async fn update(&self) -> ClientResult> { let url = self.client.url("/files.remote.update", None); self.client .post( diff --git a/slack/src/lib.rs b/slack/src/lib.rs index ccce3f38..64986071 100644 --- a/slack/src/lib.rs +++ b/slack/src/lib.rs @@ -162,9 +162,27 @@ pub mod utils; pub mod views; pub mod workflows; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -667,13 +685,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -686,7 +705,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -709,13 +728,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -736,7 +756,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -755,7 +775,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -780,6 +804,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -796,7 +821,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -821,7 +846,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -844,6 +869,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -860,7 +886,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -886,7 +912,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -929,6 +955,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -941,7 +968,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -964,7 +991,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -973,7 +1000,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -981,7 +1008,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -991,32 +1018,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1028,7 +1059,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1037,7 +1068,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1045,7 +1076,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1053,7 +1084,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1061,7 +1092,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/slack/src/migration.rs b/slack/src/migration.rs index 4f15efc5..98fffa14 100644 --- a/slack/src/migration.rs +++ b/slack/src/migration.rs @@ -30,7 +30,7 @@ impl Migration { users: &str, team_id: &str, to_old: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !team_id.is_empty() { query_args.push(("team_id".to_string(), team_id.to_string())); diff --git a/slack/src/oauth.rs b/slack/src/oauth.rs index 430a1e33..c9e1cd4c 100644 --- a/slack/src/oauth.rs +++ b/slack/src/oauth.rs @@ -33,7 +33,7 @@ impl Oauth { code: &str, redirect_uri: &str, single_channel: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !client_id.is_empty() { query_args.push(("client_id".to_string(), client_id.to_string())); @@ -84,7 +84,7 @@ impl Oauth { code: &str, redirect_uri: &str, single_channel: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !client_id.is_empty() { query_args.push(("client_id".to_string(), client_id.to_string())); diff --git a/slack/src/oauth_v_2.rs b/slack/src/oauth_v_2.rs index 03f85aec..f02c136e 100644 --- a/slack/src/oauth_v_2.rs +++ b/slack/src/oauth_v_2.rs @@ -31,7 +31,7 @@ impl OauthV2 { client_secret: &str, code: &str, redirect_uri: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !client_id.is_empty() { query_args.push(("client_id".to_string(), client_id.to_string())); diff --git a/slack/src/pins.rs b/slack/src/pins.rs index 18252e9f..c0dc8194 100644 --- a/slack/src/pins.rs +++ b/slack/src/pins.rs @@ -22,7 +22,7 @@ impl Pins { * * * `token: &str` -- Authentication token. Requires scope: `pins:write`. */ - pub async fn add(&self) -> ClientResult { + pub async fn add(&self) -> ClientResult> { let url = self.client.url("/pins.add", None); self.client .post( @@ -49,7 +49,7 @@ impl Pins { pub async fn list( &self, channel: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !channel.is_empty() { query_args.push(("channel".to_string(), channel.to_string())); @@ -78,7 +78,7 @@ impl Pins { pub async fn list_all( &self, channel: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !channel.is_empty() { query_args.push(("channel".to_string(), channel.to_string())); @@ -106,7 +106,7 @@ impl Pins { * * * `token: &str` -- Authentication token. Requires scope: `pins:write`. */ - pub async fn remove(&self) -> ClientResult { + pub async fn remove(&self) -> ClientResult> { let url = self.client.url("/pins.remove", None); self.client .post( diff --git a/slack/src/reactions.rs b/slack/src/reactions.rs index c36004dc..db0ac3be 100644 --- a/slack/src/reactions.rs +++ b/slack/src/reactions.rs @@ -22,7 +22,7 @@ impl Reactions { * * * `token: &str` -- Authentication token. Requires scope: `reactions:write`. */ - pub async fn add(&self) -> ClientResult { + pub async fn add(&self) -> ClientResult> { let url = self.client.url("/reactions.add", None); self.client .post( @@ -57,7 +57,7 @@ impl Reactions { file_comment: &str, full: bool, timestamp: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !channel.is_empty() { query_args.push(("channel".to_string(), channel.to_string())); @@ -111,7 +111,7 @@ impl Reactions { page: i64, cursor: &str, limit: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); @@ -156,7 +156,7 @@ impl Reactions { * * * `token: &str` -- Authentication token. Requires scope: `reactions:write`. */ - pub async fn remove(&self) -> ClientResult { + pub async fn remove(&self) -> ClientResult> { let url = self.client.url("/reactions.remove", None); self.client .post( diff --git a/slack/src/reminders.rs b/slack/src/reminders.rs index c9289efc..5acf8c30 100644 --- a/slack/src/reminders.rs +++ b/slack/src/reminders.rs @@ -22,7 +22,7 @@ impl Reminders { * * * `token: &str` -- Authentication token. Requires scope: `reminders:write`. */ - pub async fn add(&self) -> ClientResult { + pub async fn add(&self) -> ClientResult> { let url = self.client.url("/reminders.add", None); self.client .post( @@ -45,7 +45,7 @@ impl Reminders { * * * `token: &str` -- Authentication token. Requires scope: `reminders:write`. */ - pub async fn complete(&self) -> ClientResult { + pub async fn complete(&self) -> ClientResult> { let url = self.client.url("/reminders.complete", None); self.client .post( @@ -68,7 +68,7 @@ impl Reminders { * * * `token: &str` -- Authentication token. Requires scope: `reminders:write`. */ - pub async fn delete(&self) -> ClientResult { + pub async fn delete(&self) -> ClientResult> { let url = self.client.url("/reminders.delete", None); self.client .post( @@ -92,7 +92,10 @@ impl Reminders { * * `token: &str` -- Authentication token. Requires scope: `reminders:read`. * * `reminder: &str` -- The ID of the reminder. */ - pub async fn info(&self, reminder: &str) -> ClientResult { + pub async fn info( + &self, + reminder: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !reminder.is_empty() { query_args.push(("reminder".to_string(), reminder.to_string())); @@ -122,7 +125,7 @@ impl Reminders { * * * `token: &str` -- Authentication token. Requires scope: `reminders:read`. */ - pub async fn list(&self) -> ClientResult { + pub async fn list(&self) -> ClientResult> { let url = self.client.url("/reminders.list", None); self.client .get( diff --git a/slack/src/rtm.rs b/slack/src/rtm.rs index fc4bde4d..e80afdeb 100644 --- a/slack/src/rtm.rs +++ b/slack/src/rtm.rs @@ -28,7 +28,7 @@ impl Rtm { &self, batch_presence_aware: bool, presence_sub: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if batch_presence_aware { query_args.push(( diff --git a/slack/src/search.rs b/slack/src/search.rs index e545078a..49d1949f 100644 --- a/slack/src/search.rs +++ b/slack/src/search.rs @@ -36,7 +36,7 @@ impl Search { query: &str, sort: &str, sort_dir: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if count > 0 { query_args.push(("count".to_string(), count.to_string())); diff --git a/slack/src/stars.rs b/slack/src/stars.rs index afe6614b..c9dece52 100644 --- a/slack/src/stars.rs +++ b/slack/src/stars.rs @@ -22,7 +22,7 @@ impl Stars { * * * `token: &str` -- Authentication token. Requires scope: `stars:write`. */ - pub async fn add(&self) -> ClientResult { + pub async fn add(&self) -> ClientResult> { let url = self.client.url("/stars.add", None); self.client .post( @@ -55,7 +55,7 @@ impl Stars { page: &str, cursor: &str, limit: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !count.is_empty() { query_args.push(("count".to_string(), count.to_string())); @@ -92,7 +92,7 @@ impl Stars { * * * `token: &str` -- Authentication token. Requires scope: `stars:write`. */ - pub async fn remove(&self) -> ClientResult { + pub async fn remove(&self) -> ClientResult> { let url = self.client.url("/stars.remove", None); self.client .post( diff --git a/slack/src/team.rs b/slack/src/team.rs index 47cea629..5cfefbe4 100644 --- a/slack/src/team.rs +++ b/slack/src/team.rs @@ -30,7 +30,7 @@ impl Team { before: &str, count: &str, page: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !before.is_empty() { query_args.push(("before".to_string(), before.to_string())); @@ -67,7 +67,10 @@ impl Team { * * `token: &str` -- Authentication token. Requires scope: `admin`. * * `user: &str` -- A user to retrieve the billable information for. Defaults to all users. */ - pub async fn billable_info(&self, user: &str) -> ClientResult { + pub async fn billable_info( + &self, + user: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !user.is_empty() { query_args.push(("user".to_string(), user.to_string())); @@ -98,7 +101,10 @@ impl Team { * * `token: &str` -- Authentication token. Requires scope: `team:read`. * * `team: &str` -- Team to get info on, if omitted, will return information about the current team. Will only return team that the authenticated token is allowed to see through external shared channels. */ - pub async fn info(&self, team: &str) -> ClientResult { + pub async fn info( + &self, + team: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !team.is_empty() { query_args.push(("team".to_string(), team.to_string())); @@ -140,7 +146,7 @@ impl Team { page: &str, service_id: &str, user: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !app_id.is_empty() { query_args.push(("app_id".to_string(), app_id.to_string())); diff --git a/slack/src/team_profile.rs b/slack/src/team_profile.rs index 1a463505..31d7f3e4 100644 --- a/slack/src/team_profile.rs +++ b/slack/src/team_profile.rs @@ -26,7 +26,7 @@ impl TeamProfile { pub async fn get( &self, visibility: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !visibility.is_empty() { query_args.push(("visibility".to_string(), visibility.to_string())); diff --git a/slack/src/usergroups.rs b/slack/src/usergroups.rs index 46118507..f70f9714 100644 --- a/slack/src/usergroups.rs +++ b/slack/src/usergroups.rs @@ -22,7 +22,9 @@ impl Usergroups { * * * `token: &str` -- Authentication token. Requires scope: `usergroups:write`. */ - pub async fn create(&self) -> ClientResult { + pub async fn create( + &self, + ) -> ClientResult> { let url = self.client.url("/usergroups.create", None); self.client .post( @@ -45,7 +47,9 @@ impl Usergroups { * * * `token: &str` -- Authentication token. Requires scope: `usergroups:write`. */ - pub async fn disable(&self) -> ClientResult { + pub async fn disable( + &self, + ) -> ClientResult> { let url = self.client.url("/usergroups.disable", None); self.client .post( @@ -68,7 +72,9 @@ impl Usergroups { * * * `token: &str` -- Authentication token. Requires scope: `usergroups:write`. */ - pub async fn enable(&self) -> ClientResult { + pub async fn enable( + &self, + ) -> ClientResult> { let url = self.client.url("/usergroups.enable", None); self.client .post( @@ -99,7 +105,7 @@ impl Usergroups { include_users: bool, include_count: bool, include_disabled: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if include_count { query_args.push(("include_count".to_string(), include_count.to_string())); @@ -135,7 +141,9 @@ impl Usergroups { * * * `token: &str` -- Authentication token. Requires scope: `usergroups:write`. */ - pub async fn update(&self) -> ClientResult { + pub async fn update( + &self, + ) -> ClientResult> { let url = self.client.url("/usergroups.update", None); self.client .post( diff --git a/slack/src/usergroups_users.rs b/slack/src/usergroups_users.rs index 6edb5ded..fd2303b5 100644 --- a/slack/src/usergroups_users.rs +++ b/slack/src/usergroups_users.rs @@ -28,7 +28,7 @@ impl UsergroupsUsers { &self, include_disabled: bool, usergroup: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if include_disabled { query_args.push(("include_disabled".to_string(), include_disabled.to_string())); @@ -61,7 +61,9 @@ impl UsergroupsUsers { * * * `token: &str` -- Authentication token. Requires scope: `usergroups:write`. */ - pub async fn update(&self) -> ClientResult { + pub async fn update( + &self, + ) -> ClientResult> { let url = self.client.url("/usergroups.users.update", None); self.client .post( diff --git a/slack/src/users.rs b/slack/src/users.rs index 9bbc98b2..bbd1177e 100644 --- a/slack/src/users.rs +++ b/slack/src/users.rs @@ -34,7 +34,7 @@ impl Users { exclude_archived: bool, limit: i64, cursor: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); @@ -72,7 +72,7 @@ impl Users { * * FROM: */ - pub async fn delete_photo(&self) -> ClientResult { + pub async fn delete_photo(&self) -> ClientResult> { let url = self.client.url("/users.deletePhoto", None); self.client .post( @@ -99,7 +99,7 @@ impl Users { pub async fn get_presence( &self, user: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !user.is_empty() { query_args.push(("user".to_string(), user.to_string())); @@ -129,7 +129,9 @@ impl Users { * * * `token: &str` -- Authentication token. Requires scope: `identity.basic`. */ - pub async fn identity(&self) -> ClientResult> { + pub async fn identity( + &self, + ) -> ClientResult>> { let url = self.client.url("/users.identity", None); self.client .get( @@ -152,7 +154,7 @@ impl Users { */ pub async fn get_all_identity( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/users.identity", None); self.client .get_all_pages( @@ -181,7 +183,7 @@ impl Users { &self, include_locale: bool, user: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if include_locale { query_args.push(("include_locale".to_string(), include_locale.to_string())); @@ -220,7 +222,7 @@ impl Users { limit: i64, cursor: &str, include_locale: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cursor.is_empty() { query_args.push(("cursor".to_string(), cursor.to_string())); @@ -258,7 +260,7 @@ impl Users { pub async fn lookup_email( &self, email: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !email.is_empty() { query_args.push(("email".to_string(), email.to_string())); @@ -288,7 +290,7 @@ impl Users { * * * `token: &str` -- Authentication token. Requires scope: `users:write`. */ - pub async fn set_active(&self) -> ClientResult { + pub async fn set_active(&self) -> ClientResult> { let url = self.client.url("/users.setActive", None); self.client .post( @@ -307,7 +309,9 @@ impl Users { * * FROM: */ - pub async fn set_photo(&self) -> ClientResult { + pub async fn set_photo( + &self, + ) -> ClientResult> { let url = self.client.url("/users.setPhoto", None); self.client .post( @@ -330,7 +334,7 @@ impl Users { * * * `token: &str` -- Authentication token. Requires scope: `users:write`. */ - pub async fn set_presence(&self) -> ClientResult { + pub async fn set_presence(&self) -> ClientResult> { let url = self.client.url("/users.setPresence", None); self.client .post( diff --git a/slack/src/users_profile.rs b/slack/src/users_profile.rs index 9baf3ebf..10f983f1 100644 --- a/slack/src/users_profile.rs +++ b/slack/src/users_profile.rs @@ -28,7 +28,7 @@ impl UsersProfile { &self, include_labels: bool, user: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if include_labels { query_args.push(("include_labels".to_string(), include_labels.to_string())); @@ -61,7 +61,7 @@ impl UsersProfile { * * * `token: &str` -- Authentication token. Requires scope: `users.profile:write`. */ - pub async fn set(&self) -> ClientResult { + pub async fn set(&self) -> ClientResult> { let url = self.client.url("/users.profile.set", None); self.client .post( diff --git a/slack/src/views.rs b/slack/src/views.rs index b27e4a24..f5396a18 100644 --- a/slack/src/views.rs +++ b/slack/src/views.rs @@ -28,7 +28,7 @@ impl Views { &self, trigger_id: &str, view: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !trigger_id.is_empty() { query_args.push(("trigger_id".to_string(), trigger_id.to_string())); @@ -67,7 +67,7 @@ impl Views { user_id: &str, view: &str, hash: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !hash.is_empty() { query_args.push(("hash".to_string(), hash.to_string())); @@ -107,7 +107,7 @@ impl Views { &self, trigger_id: &str, view: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !trigger_id.is_empty() { query_args.push(("trigger_id".to_string(), trigger_id.to_string())); @@ -148,7 +148,7 @@ impl Views { external_id: &str, view: &str, hash: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !external_id.is_empty() { query_args.push(("external_id".to_string(), external_id.to_string())); diff --git a/slack/src/workflows.rs b/slack/src/workflows.rs index 6517c116..99f80d2a 100644 --- a/slack/src/workflows.rs +++ b/slack/src/workflows.rs @@ -28,7 +28,7 @@ impl Workflows { &self, workflow_step_execute_id: &str, outputs: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !outputs.is_empty() { query_args.push(("outputs".to_string(), outputs.to_string())); @@ -70,7 +70,7 @@ impl Workflows { &self, workflow_step_execute_id: &str, error: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !error.is_empty() { query_args.push(("error".to_string(), error.to_string())); @@ -118,7 +118,7 @@ impl Workflows { outputs: &str, step_name: &str, step_image_url: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !inputs.is_empty() { query_args.push(("inputs".to_string(), inputs.to_string())); diff --git a/stripe/src/account.rs b/stripe/src/account.rs index 8bedc609..a7b954a8 100644 --- a/stripe/src/account.rs +++ b/stripe/src/account.rs @@ -20,7 +20,7 @@ impl Account { * * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. */ - pub async fn get(&self) -> ClientResult { + pub async fn get(&self) -> ClientResult> { let url = self.client.url("/v1/account", None); self.client .get( @@ -39,7 +39,7 @@ impl Account { * *

To update your own account, use the Dashboard. Refer to our Connect documentation to learn more about updating accounts.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/account", None); self.client .post( @@ -60,7 +60,7 @@ impl Account { * *

If you want to delete your own account, use the account information tab in your account settings instead.

*/ - pub async fn delete(&self) -> ClientResult { + pub async fn delete(&self) -> ClientResult> { let url = self.client.url("/v1/account", None); self.client .delete( @@ -77,7 +77,7 @@ impl Account { * *

Create an external account for a given account.

*/ - pub async fn post_bank(&self) -> ClientResult { + pub async fn post_bank(&self) -> ClientResult> { let url = self.client.url("/v1/account/bank_accounts", None); self.client .post( @@ -99,7 +99,10 @@ impl Account { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `id: &str` -- The account's country. */ - pub async fn get_bank(&self, id: &str) -> ClientResult { + pub async fn get_bank( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/account/bank_accounts/{}", @@ -128,7 +131,10 @@ impl Account { * * * `id: &str` -- The account's country. */ - pub async fn post_bank_account(&self, id: &str) -> ClientResult { + pub async fn post_bank_account( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/account/bank_accounts/{}", @@ -158,7 +164,7 @@ impl Account { pub async fn delete_bank( &self, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/account/bank_accounts/{}", @@ -185,9 +191,11 @@ impl Account { * * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. */ - pub async fn get_capabilities(&self) -> ClientResult> { + pub async fn get_capabilities( + &self, + ) -> ClientResult>> { let url = self.client.url("/v1/account/capabilities", None); - let resp: crate::types::ListAccountCapability = self + let resp: crate::Response = self .client .get( &url, @@ -199,7 +207,11 @@ impl Account { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/account/capabilities` endpoint. @@ -208,9 +220,15 @@ impl Account { * *

Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first.

*/ - pub async fn get_all_capabilities(&self) -> ClientResult> { + pub async fn get_all_capabilities( + &self, + ) -> ClientResult>> { let url = self.client.url("/v1/account/capabilities", None); - let mut resp: crate::types::ListAccountCapability = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -221,8 +239,8 @@ impl Account { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -238,7 +256,11 @@ impl Account { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -249,7 +271,11 @@ impl Account { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -261,13 +287,13 @@ impl Account { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/account/capabilities/{capability}` endpoint. @@ -282,7 +308,7 @@ impl Account { pub async fn get_capabilities_capability( &self, capability: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/account/capabilities/{}", @@ -312,7 +338,7 @@ impl Account { pub async fn post_capabilities_capability( &self, capability: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/account/capabilities/{}", @@ -347,7 +373,7 @@ impl Account { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -362,7 +388,7 @@ impl Account { let url = self .client .url(&format!("/v1/account/external_accounts?{}", query_), None); - let resp: crate::types::ExternalAccounts = self + let resp: crate::Response = self .client .get( &url, @@ -374,7 +400,11 @@ impl Account { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/account/external_accounts` endpoint. @@ -383,9 +413,15 @@ impl Account { * *

List external accounts for an account.

*/ - pub async fn get_all_external(&self) -> ClientResult> { + pub async fn get_all_external( + &self, + ) -> ClientResult>> { let url = self.client.url("/v1/account/external_accounts", None); - let mut resp: crate::types::ExternalAccounts = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -396,8 +432,8 @@ impl Account { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -413,7 +449,11 @@ impl Account { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -424,7 +464,11 @@ impl Account { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -436,20 +480,20 @@ impl Account { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/account/external_accounts` endpoint. * *

Create an external account for a given account.

*/ - pub async fn post_external(&self) -> ClientResult { + pub async fn post_external(&self) -> ClientResult> { let url = self.client.url("/v1/account/external_accounts", None); self.client .post( @@ -471,7 +515,10 @@ impl Account { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `id: &str` -- The account's country. */ - pub async fn get_external_account(&self, id: &str) -> ClientResult { + pub async fn get_external_account( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/account/external_accounts/{}", @@ -500,7 +547,10 @@ impl Account { * * * `id: &str` -- The account's country. */ - pub async fn post_external_account(&self, id: &str) -> ClientResult { + pub async fn post_external_account( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/account/external_accounts/{}", @@ -530,7 +580,7 @@ impl Account { pub async fn delete_external( &self, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/account/external_accounts/{}", @@ -555,7 +605,7 @@ impl Account { * *

You may only create login links for Express accounts connected to your platform.

*/ - pub async fn post_login_link(&self) -> ClientResult { + pub async fn post_login_link(&self) -> ClientResult> { let url = self.client.url("/v1/account/login_links", None); self.client .post( @@ -586,7 +636,7 @@ impl Account { limit: i64, _relationship: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -601,7 +651,7 @@ impl Account { let url = self .client .url(&format!("/v1/account/people?{}", query_), None); - let resp: crate::types::GetAccountPeopleResponse = self + let resp: crate::Response = self .client .get( &url, @@ -613,7 +663,11 @@ impl Account { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/account/people` endpoint. @@ -625,9 +679,13 @@ impl Account { pub async fn get_all_people( &self, _relationship: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/v1/account/people", None); - let mut resp: crate::types::GetAccountPeopleResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -638,8 +696,8 @@ impl Account { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -655,7 +713,11 @@ impl Account { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -666,7 +728,11 @@ impl Account { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -678,20 +744,20 @@ impl Account { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/account/people` endpoint. * *

Creates a new person.

*/ - pub async fn post_people(&self) -> ClientResult { + pub async fn post_people(&self) -> ClientResult> { let url = self.client.url("/v1/account/people", None); self.client .post( @@ -713,7 +779,10 @@ impl Account { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `person: &str` -- The account's country. */ - pub async fn get_people_person(&self, person: &str) -> ClientResult { + pub async fn get_people_person( + &self, + person: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/account/people/{}", @@ -740,7 +809,10 @@ impl Account { * * * `person: &str` -- The account's country. */ - pub async fn post_people_person(&self, person: &str) -> ClientResult { + pub async fn post_people_person( + &self, + person: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/account/people/{}", @@ -770,7 +842,7 @@ impl Account { pub async fn delete_people_person( &self, person: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/account/people/{}", @@ -807,7 +879,7 @@ impl Account { limit: i64, _relationship: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -822,7 +894,7 @@ impl Account { let url = self .client .url(&format!("/v1/account/persons?{}", query_), None); - let resp: crate::types::GetAccountPeopleResponse = self + let resp: crate::Response = self .client .get( &url, @@ -834,7 +906,11 @@ impl Account { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/account/persons` endpoint. @@ -846,9 +922,13 @@ impl Account { pub async fn get_all_persons( &self, _relationship: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/v1/account/persons", None); - let mut resp: crate::types::GetAccountPeopleResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -859,8 +939,8 @@ impl Account { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -876,7 +956,11 @@ impl Account { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -887,7 +971,11 @@ impl Account { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -899,20 +987,20 @@ impl Account { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/account/persons` endpoint. * *

Creates a new person.

*/ - pub async fn post_person(&self) -> ClientResult { + pub async fn post_person(&self) -> ClientResult> { let url = self.client.url("/v1/account/persons", None); self.client .post( @@ -934,7 +1022,10 @@ impl Account { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `person: &str` -- The account's country. */ - pub async fn get_persons_person(&self, person: &str) -> ClientResult { + pub async fn get_persons_person( + &self, + person: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/account/persons/{}", @@ -961,7 +1052,10 @@ impl Account { * * * `person: &str` -- The account's country. */ - pub async fn post_persons_person(&self, person: &str) -> ClientResult { + pub async fn post_persons_person( + &self, + person: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/account/persons/{}", @@ -991,7 +1085,7 @@ impl Account { pub async fn delete_persons_person( &self, person: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/account/persons/{}", diff --git a/stripe/src/account_links.rs b/stripe/src/account_links.rs index 84390491..a03db164 100644 --- a/stripe/src/account_links.rs +++ b/stripe/src/account_links.rs @@ -16,7 +16,7 @@ impl AccountLinks { * *

Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/account_links", None); self.client .post( diff --git a/stripe/src/accounts.rs b/stripe/src/accounts.rs index 77c89981..52723103 100644 --- a/stripe/src/accounts.rs +++ b/stripe/src/accounts.rs @@ -30,7 +30,7 @@ impl Accounts { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -43,7 +43,7 @@ impl Accounts { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/accounts?{}", query_), None); - let resp: crate::types::GetAccountsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -55,7 +55,11 @@ impl Accounts { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/accounts` endpoint. @@ -64,9 +68,16 @@ impl Accounts { * *

Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is empty.

*/ - pub async fn get_all(&self, _created: &str) -> ClientResult> { + pub async fn get_all( + &self, + _created: &str, + ) -> ClientResult>> { let url = self.client.url("/v1/accounts", None); - let mut resp: crate::types::GetAccountsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -77,8 +88,8 @@ impl Accounts { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -94,7 +105,11 @@ impl Accounts { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -105,7 +120,11 @@ impl Accounts { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -117,13 +136,13 @@ impl Accounts { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/accounts` endpoint. @@ -131,7 +150,7 @@ impl Accounts { *

With Connect, you can create Stripe accounts for your users. * To do this, you’ll first need to register your platform.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/accounts", None); self.client .post( @@ -153,7 +172,7 @@ impl Accounts { * * `account: &str` -- The account's country. * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. */ - pub async fn get(&self, account: &str) -> ClientResult { + pub async fn get(&self, account: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}", @@ -182,7 +201,10 @@ impl Accounts { * * * `account: &str` -- The account's country. */ - pub async fn post_accounts(&self, account: &str) -> ClientResult { + pub async fn post_accounts( + &self, + account: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}", @@ -213,7 +235,10 @@ impl Accounts { * * * `account: &str` -- The account's country. */ - pub async fn delete(&self, account: &str) -> ClientResult { + pub async fn delete( + &self, + account: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}", @@ -240,7 +265,10 @@ impl Accounts { * * * `account: &str` -- The account's country. */ - pub async fn post_bank(&self, account: &str) -> ClientResult { + pub async fn post_bank( + &self, + account: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/bank_accounts", @@ -269,7 +297,11 @@ impl Accounts { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `id: &str` -- The account's country. */ - pub async fn get_bank(&self, account: &str, id: &str) -> ClientResult { + pub async fn get_bank( + &self, + account: &str, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/bank_accounts/{}", @@ -304,7 +336,7 @@ impl Accounts { &self, account: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/bank_accounts/{}", @@ -337,7 +369,7 @@ impl Accounts { &self, account: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/bank_accounts/{}", @@ -369,7 +401,7 @@ impl Accounts { pub async fn get_capabilities( &self, account: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/accounts/{}/capabilities", @@ -377,7 +409,7 @@ impl Accounts { ), None, ); - let resp: crate::types::ListAccountCapability = self + let resp: crate::Response = self .client .get( &url, @@ -389,7 +421,11 @@ impl Accounts { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/accounts/{account}/capabilities` endpoint. @@ -401,7 +437,7 @@ impl Accounts { pub async fn get_all_capabilities( &self, account: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/accounts/{}/capabilities", @@ -409,7 +445,11 @@ impl Accounts { ), None, ); - let mut resp: crate::types::ListAccountCapability = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -420,8 +460,8 @@ impl Accounts { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -437,7 +477,11 @@ impl Accounts { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -448,7 +492,11 @@ impl Accounts { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -460,13 +508,13 @@ impl Accounts { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/accounts/{account}/capabilities/{capability}` endpoint. @@ -483,7 +531,7 @@ impl Accounts { &self, account: &str, capability: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/capabilities/{}", @@ -516,7 +564,7 @@ impl Accounts { &self, account: &str, capability: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/capabilities/{}", @@ -554,7 +602,7 @@ impl Accounts { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -574,7 +622,7 @@ impl Accounts { ), None, ); - let resp: crate::types::ExternalAccounts = self + let resp: crate::Response = self .client .get( &url, @@ -586,7 +634,11 @@ impl Accounts { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/accounts/{account}/external_accounts` endpoint. @@ -598,7 +650,7 @@ impl Accounts { pub async fn get_all_external( &self, account: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/accounts/{}/external_accounts", @@ -606,7 +658,11 @@ impl Accounts { ), None, ); - let mut resp: crate::types::ExternalAccounts = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -617,8 +673,8 @@ impl Accounts { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -634,7 +690,11 @@ impl Accounts { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -645,7 +705,11 @@ impl Accounts { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -657,13 +721,13 @@ impl Accounts { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/accounts/{account}/external_accounts` endpoint. @@ -674,7 +738,10 @@ impl Accounts { * * * `account: &str` -- The account's country. */ - pub async fn post_external(&self, account: &str) -> ClientResult { + pub async fn post_external( + &self, + account: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/external_accounts", @@ -707,7 +774,7 @@ impl Accounts { &self, account: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/external_accounts/{}", @@ -742,7 +809,7 @@ impl Accounts { &self, account: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/external_accounts/{}", @@ -775,7 +842,7 @@ impl Accounts { &self, account: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/external_accounts/{}", @@ -805,7 +872,10 @@ impl Accounts { * * * `account: &str` -- The account's country. */ - pub async fn post_login_link(&self, account: &str) -> ClientResult { + pub async fn post_login_link( + &self, + account: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/login_links", @@ -844,7 +914,7 @@ impl Accounts { limit: i64, _relationship: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -864,7 +934,7 @@ impl Accounts { ), None, ); - let resp: crate::types::GetAccountPeopleResponse = self + let resp: crate::Response = self .client .get( &url, @@ -876,7 +946,11 @@ impl Accounts { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/accounts/{account}/people` endpoint. @@ -889,7 +963,7 @@ impl Accounts { &self, account: &str, _relationship: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/accounts/{}/people", @@ -897,7 +971,11 @@ impl Accounts { ), None, ); - let mut resp: crate::types::GetAccountPeopleResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -908,8 +986,8 @@ impl Accounts { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -925,7 +1003,11 @@ impl Accounts { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -936,7 +1018,11 @@ impl Accounts { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -948,13 +1034,13 @@ impl Accounts { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/accounts/{account}/people` endpoint. @@ -965,7 +1051,10 @@ impl Accounts { * * * `account: &str` -- The account's country. */ - pub async fn post_people(&self, account: &str) -> ClientResult { + pub async fn post_people( + &self, + account: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/people", @@ -998,7 +1087,7 @@ impl Accounts { &self, account: &str, person: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/people/{}", @@ -1031,7 +1120,7 @@ impl Accounts { &self, account: &str, person: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/people/{}", @@ -1064,7 +1153,7 @@ impl Accounts { &self, account: &str, person: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/people/{}", @@ -1104,7 +1193,7 @@ impl Accounts { limit: i64, _relationship: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -1124,7 +1213,7 @@ impl Accounts { ), None, ); - let resp: crate::types::GetAccountPeopleResponse = self + let resp: crate::Response = self .client .get( &url, @@ -1136,7 +1225,11 @@ impl Accounts { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/accounts/{account}/persons` endpoint. @@ -1149,7 +1242,7 @@ impl Accounts { &self, account: &str, _relationship: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/accounts/{}/persons", @@ -1157,7 +1250,11 @@ impl Accounts { ), None, ); - let mut resp: crate::types::GetAccountPeopleResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -1168,8 +1265,8 @@ impl Accounts { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -1185,7 +1282,11 @@ impl Accounts { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -1196,7 +1297,11 @@ impl Accounts { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -1208,13 +1313,13 @@ impl Accounts { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/accounts/{account}/persons` endpoint. @@ -1225,7 +1330,10 @@ impl Accounts { * * * `account: &str` -- The account's country. */ - pub async fn post_person(&self, account: &str) -> ClientResult { + pub async fn post_person( + &self, + account: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/persons", @@ -1258,7 +1366,7 @@ impl Accounts { &self, account: &str, person: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/persons/{}", @@ -1291,7 +1399,7 @@ impl Accounts { &self, account: &str, person: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/persons/{}", @@ -1324,7 +1432,7 @@ impl Accounts { &self, account: &str, person: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/persons/{}", @@ -1354,7 +1462,10 @@ impl Accounts { * * * `account: &str` -- The account's country. */ - pub async fn post_reject(&self, account: &str) -> ClientResult { + pub async fn post_reject( + &self, + account: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/accounts/{}/reject", diff --git a/stripe/src/apple_pay.rs b/stripe/src/apple_pay.rs index 2b72fdcd..6cda526f 100644 --- a/stripe/src/apple_pay.rs +++ b/stripe/src/apple_pay.rs @@ -30,7 +30,7 @@ impl ApplePay { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !domain_name.is_empty() { query_args.push(("domain_name".to_string(), domain_name.to_string())); @@ -48,7 +48,7 @@ impl ApplePay { let url = self .client .url(&format!("/v1/apple_pay/domains?{}", query_), None); - let resp: crate::types::ApplePayDomainList = self + let resp: crate::Response = self .client .get( &url, @@ -60,7 +60,11 @@ impl ApplePay { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/apple_pay/domains` endpoint. @@ -72,7 +76,7 @@ impl ApplePay { pub async fn get_all_domains( &self, domain_name: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !domain_name.is_empty() { query_args.push(("domain_name".to_string(), domain_name.to_string())); @@ -81,7 +85,11 @@ impl ApplePay { let url = self .client .url(&format!("/v1/apple_pay/domains?{}", query_), None); - let mut resp: crate::types::ApplePayDomainList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -92,8 +100,8 @@ impl ApplePay { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -109,7 +117,11 @@ impl ApplePay { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -120,7 +132,11 @@ impl ApplePay { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -132,20 +148,20 @@ impl ApplePay { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/apple_pay/domains` endpoint. * *

Create an apple pay domain.

*/ - pub async fn post_domain(&self) -> ClientResult { + pub async fn post_domain(&self) -> ClientResult> { let url = self.client.url("/v1/apple_pay/domains", None); self.client .post( @@ -170,7 +186,7 @@ impl ApplePay { pub async fn get_domains_domain( &self, domain: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/apple_pay/domains/{}", @@ -200,7 +216,7 @@ impl ApplePay { pub async fn delete_domains_domain( &self, domain: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/apple_pay/domains/{}", diff --git a/stripe/src/application_fees.rs b/stripe/src/application_fees.rs index 21733472..88ae588e 100644 --- a/stripe/src/application_fees.rs +++ b/stripe/src/application_fees.rs @@ -32,7 +32,7 @@ impl ApplicationFees { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !charge.is_empty() { query_args.push(("charge".to_string(), charge.to_string())); @@ -50,7 +50,7 @@ impl ApplicationFees { let url = self .client .url(&format!("/v1/application_fees?{}", query_), None); - let resp: crate::types::GetApplicationFeesResponse = self + let resp: crate::Response = self .client .get( &url, @@ -62,7 +62,11 @@ impl ApplicationFees { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/application_fees` endpoint. @@ -75,7 +79,7 @@ impl ApplicationFees { &self, charge: &str, _created: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !charge.is_empty() { query_args.push(("charge".to_string(), charge.to_string())); @@ -84,7 +88,11 @@ impl ApplicationFees { let url = self .client .url(&format!("/v1/application_fees?{}", query_), None); - let mut resp: crate::types::GetApplicationFeesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -95,8 +103,8 @@ impl ApplicationFees { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -112,7 +120,11 @@ impl ApplicationFees { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -123,7 +135,11 @@ impl ApplicationFees { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -135,13 +151,13 @@ impl ApplicationFees { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/application_fees/{fee}/refunds/{id}` endpoint. @@ -158,7 +174,7 @@ impl ApplicationFees { &self, fee: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/application_fees/{}/refunds/{}", @@ -193,7 +209,7 @@ impl ApplicationFees { &self, fee: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/application_fees/{}/refunds/{}", @@ -222,7 +238,7 @@ impl ApplicationFees { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `id: &str` -- The account's country. */ - pub async fn get(&self, id: &str) -> ClientResult { + pub async fn get(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/application_fees/{}", @@ -249,7 +265,10 @@ impl ApplicationFees { * * * `id: &str` -- The account's country. */ - pub async fn post_refund(&self, id: &str) -> ClientResult { + pub async fn post_refund( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/application_fees/{}/refund", @@ -286,7 +305,7 @@ impl ApplicationFees { id: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -306,7 +325,7 @@ impl ApplicationFees { ), None, ); - let resp: crate::types::Refunds = self + let resp: crate::Response = self .client .get( &url, @@ -318,7 +337,11 @@ impl ApplicationFees { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/application_fees/{id}/refunds` endpoint. @@ -327,7 +350,10 @@ impl ApplicationFees { * *

You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds.

*/ - pub async fn get_all_refunds(&self, id: &str) -> ClientResult> { + pub async fn get_all_refunds( + &self, + id: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/application_fees/{}/refunds", @@ -335,7 +361,11 @@ impl ApplicationFees { ), None, ); - let mut resp: crate::types::Refunds = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -346,8 +376,8 @@ impl ApplicationFees { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -363,7 +393,11 @@ impl ApplicationFees { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -374,7 +408,11 @@ impl ApplicationFees { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -386,13 +424,13 @@ impl ApplicationFees { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/application_fees/{id}/refunds` endpoint. @@ -414,7 +452,7 @@ impl ApplicationFees { pub async fn post_refund_application_fees( &self, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/application_fees/{}/refunds", diff --git a/stripe/src/balance.rs b/stripe/src/balance.rs index c4232cd9..d02ed0ce 100644 --- a/stripe/src/balance.rs +++ b/stripe/src/balance.rs @@ -21,7 +21,7 @@ impl Balance { * * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. */ - pub async fn get(&self) -> ClientResult { + pub async fn get(&self) -> ClientResult> { let url = self.client.url("/v1/balance", None); self.client .get( @@ -62,7 +62,7 @@ impl Balance { source: &str, starting_after: &str, type_: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !currency.is_empty() { query_args.push(("currency".to_string(), currency.to_string())); @@ -89,7 +89,7 @@ impl Balance { let url = self .client .url(&format!("/v1/balance/history?{}", query_), None); - let resp: crate::types::BalanceTransactionsList = self + let resp: crate::Response = self .client .get( &url, @@ -101,7 +101,11 @@ impl Balance { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/balance/history` endpoint. @@ -119,7 +123,7 @@ impl Balance { payout: &str, source: &str, type_: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !currency.is_empty() { query_args.push(("currency".to_string(), currency.to_string())); @@ -137,7 +141,11 @@ impl Balance { let url = self .client .url(&format!("/v1/balance/history?{}", query_), None); - let mut resp: crate::types::BalanceTransactionsList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -148,8 +156,8 @@ impl Balance { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -165,7 +173,11 @@ impl Balance { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -176,7 +188,11 @@ impl Balance { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -188,13 +204,13 @@ impl Balance { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/balance/history/{id}` endpoint. @@ -211,7 +227,7 @@ impl Balance { pub async fn get_history_balance( &self, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/balance/history/{}", diff --git a/stripe/src/balance_transactions.rs b/stripe/src/balance_transactions.rs index f6aa46bb..0fd8e382 100644 --- a/stripe/src/balance_transactions.rs +++ b/stripe/src/balance_transactions.rs @@ -40,7 +40,7 @@ impl BalanceTransactions { source: &str, starting_after: &str, type_: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !currency.is_empty() { query_args.push(("currency".to_string(), currency.to_string())); @@ -67,7 +67,7 @@ impl BalanceTransactions { let url = self .client .url(&format!("/v1/balance_transactions?{}", query_), None); - let resp: crate::types::BalanceTransactionsList = self + let resp: crate::Response = self .client .get( &url, @@ -79,7 +79,11 @@ impl BalanceTransactions { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/balance_transactions` endpoint. @@ -97,7 +101,7 @@ impl BalanceTransactions { payout: &str, source: &str, type_: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !currency.is_empty() { query_args.push(("currency".to_string(), currency.to_string())); @@ -115,7 +119,11 @@ impl BalanceTransactions { let url = self .client .url(&format!("/v1/balance_transactions?{}", query_), None); - let mut resp: crate::types::BalanceTransactionsList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -126,8 +134,8 @@ impl BalanceTransactions { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -143,7 +151,11 @@ impl BalanceTransactions { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -154,7 +166,11 @@ impl BalanceTransactions { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -166,13 +182,13 @@ impl BalanceTransactions { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/balance_transactions/{id}` endpoint. @@ -186,7 +202,10 @@ impl BalanceTransactions { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `id: &str` -- The account's country. */ - pub async fn get(&self, id: &str) -> ClientResult { + pub async fn get( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/balance_transactions/{}", diff --git a/stripe/src/billing_portal.rs b/stripe/src/billing_portal.rs index 57678e36..81d91103 100644 --- a/stripe/src/billing_portal.rs +++ b/stripe/src/billing_portal.rs @@ -32,7 +32,7 @@ impl BillingPortal { is_default: bool, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -54,7 +54,7 @@ impl BillingPortal { &format!("/v1/billing_portal/configurations?{}", query_), None, ); - let resp: crate::types::GetBillingPortalConfigurationsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -66,7 +66,11 @@ impl BillingPortal { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/billing_portal/configurations` endpoint. @@ -79,7 +83,7 @@ impl BillingPortal { &self, active: bool, is_default: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -92,7 +96,11 @@ impl BillingPortal { &format!("/v1/billing_portal/configurations?{}", query_), None, ); - let mut resp: crate::types::GetBillingPortalConfigurationsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -103,8 +111,8 @@ impl BillingPortal { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -120,7 +128,11 @@ impl BillingPortal { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -131,7 +143,11 @@ impl BillingPortal { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -143,20 +159,22 @@ impl BillingPortal { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/billing_portal/configurations` endpoint. * *

Creates a configuration that describes the functionality and behavior of a PortalSession

*/ - pub async fn post_configuration(&self) -> ClientResult { + pub async fn post_configuration( + &self, + ) -> ClientResult> { let url = self.client.url("/v1/billing_portal/configurations", None); self.client .post( @@ -181,7 +199,7 @@ impl BillingPortal { pub async fn get_configurations_configuration( &self, configuration: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/billing_portal/configurations/{}", @@ -211,7 +229,7 @@ impl BillingPortal { pub async fn post_configurations_configuration( &self, configuration: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/billing_portal/configurations/{}", @@ -234,7 +252,7 @@ impl BillingPortal { * *

Creates a session of the customer portal.

*/ - pub async fn post_session(&self) -> ClientResult { + pub async fn post_session(&self) -> ClientResult> { let url = self.client.url("/v1/billing_portal/sessions", None); self.client .post( diff --git a/stripe/src/bitcoin.rs b/stripe/src/bitcoin.rs index e1573e00..6f12fa52 100644 --- a/stripe/src/bitcoin.rs +++ b/stripe/src/bitcoin.rs @@ -34,7 +34,7 @@ impl Bitcoin { limit: i64, starting_after: &str, uncaptured_funds: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -58,7 +58,7 @@ impl Bitcoin { let url = self .client .url(&format!("/v1/bitcoin/receivers?{}", query_), None); - let resp: crate::types::GetBitcoinReceiversResponse = self + let resp: crate::Response = self .client .get( &url, @@ -70,7 +70,11 @@ impl Bitcoin { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/bitcoin/receivers` endpoint. @@ -84,7 +88,7 @@ impl Bitcoin { active: bool, filled: bool, uncaptured_funds: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -99,7 +103,11 @@ impl Bitcoin { let url = self .client .url(&format!("/v1/bitcoin/receivers?{}", query_), None); - let mut resp: crate::types::GetBitcoinReceiversResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -110,8 +118,8 @@ impl Bitcoin { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -127,7 +135,11 @@ impl Bitcoin { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -138,7 +150,11 @@ impl Bitcoin { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -150,13 +166,13 @@ impl Bitcoin { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/bitcoin/receivers/{id}` endpoint. @@ -168,7 +184,10 @@ impl Bitcoin { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `id: &str` -- The account's country. */ - pub async fn get_receiver(&self, id: &str) -> ClientResult { + pub async fn get_receiver( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/bitcoin/receivers/{}", @@ -207,7 +226,7 @@ impl Bitcoin { limit: i64, receiver: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -230,7 +249,7 @@ impl Bitcoin { ), None, ); - let resp: crate::types::Transactions = self + let resp: crate::Response = self .client .get( &url, @@ -242,7 +261,11 @@ impl Bitcoin { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/bitcoin/receivers/{receiver}/transactions` endpoint. @@ -255,7 +278,7 @@ impl Bitcoin { &self, customer: &str, receiver: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -269,7 +292,11 @@ impl Bitcoin { ), None, ); - let mut resp: crate::types::Transactions = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -280,8 +307,8 @@ impl Bitcoin { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -297,7 +324,11 @@ impl Bitcoin { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -308,7 +339,11 @@ impl Bitcoin { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -320,13 +355,13 @@ impl Bitcoin { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/bitcoin/transactions` endpoint. @@ -349,7 +384,7 @@ impl Bitcoin { limit: i64, receiver: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -370,7 +405,7 @@ impl Bitcoin { let url = self .client .url(&format!("/v1/bitcoin/transactions?{}", query_), None); - let resp: crate::types::Transactions = self + let resp: crate::Response = self .client .get( &url, @@ -382,7 +417,11 @@ impl Bitcoin { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/bitcoin/transactions` endpoint. @@ -395,7 +434,7 @@ impl Bitcoin { &self, customer: &str, receiver: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -407,7 +446,11 @@ impl Bitcoin { let url = self .client .url(&format!("/v1/bitcoin/transactions?{}", query_), None); - let mut resp: crate::types::Transactions = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -418,8 +461,8 @@ impl Bitcoin { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -435,7 +478,11 @@ impl Bitcoin { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -446,7 +493,11 @@ impl Bitcoin { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -458,12 +509,12 @@ impl Bitcoin { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } } diff --git a/stripe/src/charges.rs b/stripe/src/charges.rs index 30f9ec8b..aac5e876 100644 --- a/stripe/src/charges.rs +++ b/stripe/src/charges.rs @@ -36,7 +36,7 @@ impl Charges { payment_intent: &str, starting_after: &str, transfer_group: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -58,7 +58,7 @@ impl Charges { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/charges?{}", query_), None); - let resp: crate::types::Charges = self + let resp: crate::Response = self .client .get( &url, @@ -70,7 +70,11 @@ impl Charges { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/charges` endpoint. @@ -85,7 +89,7 @@ impl Charges { customer: &str, payment_intent: &str, transfer_group: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -98,7 +102,11 @@ impl Charges { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/charges?{}", query_), None); - let mut resp: crate::types::Charges = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -109,8 +117,8 @@ impl Charges { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -126,7 +134,11 @@ impl Charges { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -137,7 +149,11 @@ impl Charges { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -149,20 +165,20 @@ impl Charges { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/charges` endpoint. * *

To charge a credit card or other payment source, you create a Charge object. If your API key is in test mode, the supplied payment source (e.g., card) won’t actually be charged, although everything else will occur as if in live mode. (Stripe assumes that the charge would have completed successfully).

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/charges", None); self.client .post( @@ -194,7 +210,7 @@ impl Charges { limit: i64, page: &str, query: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); @@ -209,7 +225,7 @@ impl Charges { let url = self .client .url(&format!("/v1/charges/search?{}", query_), None); - let resp: crate::types::SearchResult = self + let resp: crate::Response = self .client .get( &url, @@ -221,7 +237,11 @@ impl Charges { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/charges/search` endpoint. @@ -233,7 +253,10 @@ impl Charges { * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up * to an hour behind during outages. Search functionality is not available to merchants in India.

*/ - pub async fn get_all_search(&self, query: &str) -> ClientResult> { + pub async fn get_all_search( + &self, + query: &str, + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !query.is_empty() { query_args.push(("query".to_string(), query.to_string())); @@ -242,7 +265,11 @@ impl Charges { let url = self .client .url(&format!("/v1/charges/search?{}", query_), None); - let mut resp: crate::types::SearchResult = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -253,8 +280,8 @@ impl Charges { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -270,7 +297,11 @@ impl Charges { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -281,7 +312,11 @@ impl Charges { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -293,13 +328,13 @@ impl Charges { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/charges/{charge}` endpoint. @@ -311,7 +346,7 @@ impl Charges { * * `charge: &str` -- The account's country. * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. */ - pub async fn get(&self, charge: &str) -> ClientResult { + pub async fn get(&self, charge: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/charges/{}", @@ -338,7 +373,10 @@ impl Charges { * * * `charge: &str` -- The account's country. */ - pub async fn post_charges(&self, charge: &str) -> ClientResult { + pub async fn post_charges( + &self, + charge: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/charges/{}", @@ -367,7 +405,10 @@ impl Charges { * * * `charge: &str` -- The account's country. */ - pub async fn post_capture(&self, charge: &str) -> ClientResult { + pub async fn post_capture( + &self, + charge: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/charges/{}/capture", @@ -395,7 +436,10 @@ impl Charges { * * `charge: &str` -- The account's country. * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. */ - pub async fn get_dispute(&self, charge: &str) -> ClientResult { + pub async fn get_dispute( + &self, + charge: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/charges/{}/dispute", @@ -422,7 +466,10 @@ impl Charges { * * * `charge: &str` -- The account's country. */ - pub async fn post_dispute(&self, charge: &str) -> ClientResult { + pub async fn post_dispute( + &self, + charge: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/charges/{}/dispute", @@ -449,7 +496,10 @@ impl Charges { * * * `charge: &str` -- The account's country. */ - pub async fn post_dispute_close(&self, charge: &str) -> ClientResult { + pub async fn post_dispute_close( + &self, + charge: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/charges/{}/dispute/close", @@ -486,7 +536,10 @@ impl Charges { * * * `charge: &str` -- The account's country. */ - pub async fn post_refund(&self, charge: &str) -> ClientResult { + pub async fn post_refund( + &self, + charge: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/charges/{}/refund", @@ -523,7 +576,7 @@ impl Charges { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -543,7 +596,7 @@ impl Charges { ), None, ); - let resp: crate::types::RefundList = self + let resp: crate::Response = self .client .get( &url, @@ -555,7 +608,11 @@ impl Charges { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/charges/{charge}/refunds` endpoint. @@ -564,7 +621,10 @@ impl Charges { * *

You can see a list of the refunds belonging to a specific charge. Note that the 10 most recent refunds are always available by default on the charge object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds.

*/ - pub async fn get_all_refunds(&self, charge: &str) -> ClientResult> { + pub async fn get_all_refunds( + &self, + charge: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/charges/{}/refunds", @@ -572,7 +632,11 @@ impl Charges { ), None, ); - let mut resp: crate::types::RefundList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -583,8 +647,8 @@ impl Charges { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -600,7 +664,11 @@ impl Charges { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -611,7 +679,11 @@ impl Charges { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -623,13 +695,13 @@ impl Charges { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/charges/{charge}/refunds` endpoint. @@ -640,7 +712,10 @@ impl Charges { * * * `charge: &str` -- The account's country. */ - pub async fn post_refund_charges(&self, charge: &str) -> ClientResult { + pub async fn post_refund_charges( + &self, + charge: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/charges/{}/refunds", @@ -673,7 +748,7 @@ impl Charges { &self, charge: &str, refund: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/charges/{}/refunds/{}", @@ -706,7 +781,7 @@ impl Charges { &self, charge: &str, refund: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/charges/{}/refunds/{}", diff --git a/stripe/src/checkout.rs b/stripe/src/checkout.rs index 659a3a5a..1749fef0 100644 --- a/stripe/src/checkout.rs +++ b/stripe/src/checkout.rs @@ -32,7 +32,7 @@ impl Checkout { payment_intent: &str, starting_after: &str, subscription: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -53,7 +53,7 @@ impl Checkout { let url = self .client .url(&format!("/v1/checkout/sessions?{}", query_), None); - let resp: crate::types::PaymentPagesCheckoutSessionList = self + let resp: crate::Response = self .client .get( &url, @@ -65,7 +65,11 @@ impl Checkout { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/checkout/sessions` endpoint. @@ -78,7 +82,7 @@ impl Checkout { &self, payment_intent: &str, subscription: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !payment_intent.is_empty() { query_args.push(("payment_intent".to_string(), payment_intent.to_string())); @@ -90,7 +94,11 @@ impl Checkout { let url = self .client .url(&format!("/v1/checkout/sessions?{}", query_), None); - let mut resp: crate::types::PaymentPagesCheckoutSessionList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -101,8 +109,8 @@ impl Checkout { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -118,7 +126,11 @@ impl Checkout { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -129,7 +141,11 @@ impl Checkout { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -141,20 +157,20 @@ impl Checkout { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/checkout/sessions` endpoint. * *

Creates a Session object.

*/ - pub async fn post_session(&self) -> ClientResult { + pub async fn post_session(&self) -> ClientResult> { let url = self.client.url("/v1/checkout/sessions", None); self.client .post( @@ -176,7 +192,10 @@ impl Checkout { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `session: &str` -- The account's country. */ - pub async fn get_sessions_session(&self, session: &str) -> ClientResult { + pub async fn get_sessions_session( + &self, + session: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/checkout/sessions/{}", @@ -208,7 +227,7 @@ impl Checkout { pub async fn post_sessions_session_expire( &self, session: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/checkout/sessions/{}/expire", @@ -245,7 +264,7 @@ impl Checkout { limit: i64, session: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -265,7 +284,7 @@ impl Checkout { ), None, ); - let resp: crate::types::LineItems = self + let resp: crate::Response = self .client .get( &url, @@ -277,7 +296,11 @@ impl Checkout { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/checkout/sessions/{session}/line_items` endpoint. @@ -289,7 +312,7 @@ impl Checkout { pub async fn get_all_sessions_session_line_items( &self, session: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/checkout/sessions/{}/line_items", @@ -297,7 +320,11 @@ impl Checkout { ), None, ); - let mut resp: crate::types::LineItems = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -308,8 +335,8 @@ impl Checkout { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -325,7 +352,11 @@ impl Checkout { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -336,7 +367,11 @@ impl Checkout { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -348,12 +383,12 @@ impl Checkout { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } } diff --git a/stripe/src/country_specs.rs b/stripe/src/country_specs.rs index 8cf9a267..ca0d0225 100644 --- a/stripe/src/country_specs.rs +++ b/stripe/src/country_specs.rs @@ -28,7 +28,7 @@ impl CountrySpecs { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -43,7 +43,7 @@ impl CountrySpecs { let url = self .client .url(&format!("/v1/country_specs?{}", query_), None); - let resp: crate::types::GetCountrySpecsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -55,7 +55,11 @@ impl CountrySpecs { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/country_specs` endpoint. @@ -64,9 +68,13 @@ impl CountrySpecs { * *

Lists all Country Spec objects available in the API.

*/ - pub async fn get_all(&self) -> ClientResult> { + pub async fn get_all(&self) -> ClientResult>> { let url = self.client.url("/v1/country_specs", None); - let mut resp: crate::types::GetCountrySpecsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -77,8 +85,8 @@ impl CountrySpecs { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -94,7 +102,11 @@ impl CountrySpecs { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -105,7 +117,11 @@ impl CountrySpecs { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -117,13 +133,13 @@ impl CountrySpecs { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/country_specs/{country}` endpoint. @@ -135,7 +151,10 @@ impl CountrySpecs { * * `country: &str` -- The account's country. * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. */ - pub async fn get(&self, country: &str) -> ClientResult { + pub async fn get( + &self, + country: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/country_specs/{}", diff --git a/stripe/src/coupons.rs b/stripe/src/coupons.rs index 6368be77..ecb9fba0 100644 --- a/stripe/src/coupons.rs +++ b/stripe/src/coupons.rs @@ -30,7 +30,7 @@ impl Coupons { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -43,7 +43,7 @@ impl Coupons { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/coupons?{}", query_), None); - let resp: crate::types::GetCouponsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -55,7 +55,11 @@ impl Coupons { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/coupons` endpoint. @@ -64,9 +68,16 @@ impl Coupons { * *

Returns a list of your coupons.

*/ - pub async fn get_all(&self, _created: &str) -> ClientResult> { + pub async fn get_all( + &self, + _created: &str, + ) -> ClientResult>> { let url = self.client.url("/v1/coupons", None); - let mut resp: crate::types::GetCouponsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -77,8 +88,8 @@ impl Coupons { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -94,7 +105,11 @@ impl Coupons { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -105,7 +120,11 @@ impl Coupons { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -117,13 +136,13 @@ impl Coupons { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/coupons` endpoint. @@ -132,7 +151,7 @@ impl Coupons { * *

A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice’s subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/coupons", None); self.client .post( @@ -154,7 +173,7 @@ impl Coupons { * * `coupon: &str` -- The account's country. * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. */ - pub async fn get(&self, coupon: &str) -> ClientResult { + pub async fn get(&self, coupon: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/coupons/{}", @@ -181,7 +200,10 @@ impl Coupons { * * * `coupon: &str` -- The account's country. */ - pub async fn post_coupons(&self, coupon: &str) -> ClientResult { + pub async fn post_coupons( + &self, + coupon: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/coupons/{}", @@ -208,7 +230,10 @@ impl Coupons { * * * `coupon: &str` -- The account's country. */ - pub async fn delete(&self, coupon: &str) -> ClientResult { + pub async fn delete( + &self, + coupon: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/coupons/{}", diff --git a/stripe/src/credit_notes.rs b/stripe/src/credit_notes.rs index df5f7172..a073748d 100644 --- a/stripe/src/credit_notes.rs +++ b/stripe/src/credit_notes.rs @@ -32,7 +32,7 @@ impl CreditNotes { invoice: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -53,7 +53,7 @@ impl CreditNotes { let url = self .client .url(&format!("/v1/credit_notes?{}", query_), None); - let resp: crate::types::CreditNotesList = self + let resp: crate::Response = self .client .get( &url, @@ -65,7 +65,11 @@ impl CreditNotes { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/credit_notes` endpoint. @@ -78,7 +82,7 @@ impl CreditNotes { &self, customer: &str, invoice: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -90,7 +94,11 @@ impl CreditNotes { let url = self .client .url(&format!("/v1/credit_notes?{}", query_), None); - let mut resp: crate::types::CreditNotesList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -101,8 +109,8 @@ impl CreditNotes { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -118,7 +126,11 @@ impl CreditNotes { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -129,7 +141,11 @@ impl CreditNotes { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -141,13 +157,13 @@ impl CreditNotes { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/credit_notes` endpoint. @@ -167,7 +183,7 @@ impl CreditNotes { *

You may issue multiple credit notes for an invoice. Each credit note will increment the invoice’s pre_payment_credit_notes_amount * or post_payment_credit_notes_amount depending on its status at the time of credit note creation.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/credit_notes", None); self.client .post( @@ -210,7 +226,7 @@ impl CreditNotes { reason: crate::types::Reason, refund: &str, refund_amount: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if amount > 0 { query_args.push(("amount".to_string(), amount.to_string())); @@ -290,7 +306,7 @@ impl CreditNotes { refund: &str, refund_amount: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if amount > 0 { query_args.push(("amount".to_string(), amount.to_string())); @@ -332,7 +348,7 @@ impl CreditNotes { let url = self .client .url(&format!("/v1/credit_notes/preview/lines?{}", query_), None); - let resp: crate::types::Lines = self + let resp: crate::Response = self .client .get( &url, @@ -344,7 +360,11 @@ impl CreditNotes { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/credit_notes/preview/lines` endpoint. @@ -365,7 +385,7 @@ impl CreditNotes { reason: crate::types::Reason, refund: &str, refund_amount: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if amount > 0 { query_args.push(("amount".to_string(), amount.to_string())); @@ -398,7 +418,11 @@ impl CreditNotes { let url = self .client .url(&format!("/v1/credit_notes/preview/lines?{}", query_), None); - let mut resp: crate::types::Lines = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -409,8 +433,8 @@ impl CreditNotes { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -426,7 +450,11 @@ impl CreditNotes { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -437,7 +465,11 @@ impl CreditNotes { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -449,13 +481,13 @@ impl CreditNotes { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/credit_notes/{credit_note}/lines` endpoint. @@ -476,7 +508,7 @@ impl CreditNotes { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -496,7 +528,7 @@ impl CreditNotes { ), None, ); - let resp: crate::types::Lines = self + let resp: crate::Response = self .client .get( &url, @@ -508,7 +540,11 @@ impl CreditNotes { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/credit_notes/{credit_note}/lines` endpoint. @@ -520,7 +556,7 @@ impl CreditNotes { pub async fn get_all_note_lines( &self, credit_note: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/credit_notes/{}/lines", @@ -528,7 +564,11 @@ impl CreditNotes { ), None, ); - let mut resp: crate::types::Lines = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -539,8 +579,8 @@ impl CreditNotes { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -556,7 +596,11 @@ impl CreditNotes { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -567,7 +611,11 @@ impl CreditNotes { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -579,13 +627,13 @@ impl CreditNotes { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/credit_notes/{id}` endpoint. @@ -597,7 +645,7 @@ impl CreditNotes { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `id: &str` -- The account's country. */ - pub async fn get(&self, id: &str) -> ClientResult { + pub async fn get(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/credit_notes/{}", @@ -624,7 +672,10 @@ impl CreditNotes { * * * `id: &str` -- The account's country. */ - pub async fn post_credit_notes(&self, id: &str) -> ClientResult { + pub async fn post_credit_notes( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/credit_notes/{}", @@ -651,7 +702,10 @@ impl CreditNotes { * * * `id: &str` -- The account's country. */ - pub async fn post_void(&self, id: &str) -> ClientResult { + pub async fn post_void( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/credit_notes/{}/void", diff --git a/stripe/src/customers.rs b/stripe/src/customers.rs index 06245139..ea9b297c 100644 --- a/stripe/src/customers.rs +++ b/stripe/src/customers.rs @@ -34,7 +34,7 @@ impl Customers { limit: i64, starting_after: &str, test_clock: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !email.is_empty() { query_args.push(("email".to_string(), email.to_string())); @@ -53,7 +53,7 @@ impl Customers { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/customers?{}", query_), None); - let resp: crate::types::GetCustomersResponse = self + let resp: crate::Response = self .client .get( &url, @@ -65,7 +65,11 @@ impl Customers { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/customers` endpoint. @@ -79,7 +83,7 @@ impl Customers { _created: &str, email: &str, test_clock: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !email.is_empty() { query_args.push(("email".to_string(), email.to_string())); @@ -89,7 +93,11 @@ impl Customers { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/customers?{}", query_), None); - let mut resp: crate::types::GetCustomersResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -100,8 +108,8 @@ impl Customers { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -117,7 +125,11 @@ impl Customers { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -128,7 +140,11 @@ impl Customers { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -140,20 +156,20 @@ impl Customers { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/customers` endpoint. * *

Creates a new customer object.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/customers", None); self.client .post( @@ -185,7 +201,7 @@ impl Customers { limit: i64, page: &str, query: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); @@ -200,7 +216,7 @@ impl Customers { let url = self .client .url(&format!("/v1/customers/search?{}", query_), None); - let resp: crate::types::SearchResult = self + let resp: crate::Response = self .client .get( &url, @@ -212,7 +228,11 @@ impl Customers { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/customers/search` endpoint. @@ -224,7 +244,10 @@ impl Customers { * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up * to an hour behind during outages. Search functionality is not available to merchants in India.

*/ - pub async fn get_all_search(&self, query: &str) -> ClientResult> { + pub async fn get_all_search( + &self, + query: &str, + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !query.is_empty() { query_args.push(("query".to_string(), query.to_string())); @@ -233,7 +256,11 @@ impl Customers { let url = self .client .url(&format!("/v1/customers/search?{}", query_), None); - let mut resp: crate::types::SearchResult = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -244,8 +271,8 @@ impl Customers { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -261,7 +288,11 @@ impl Customers { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -272,7 +303,11 @@ impl Customers { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -284,13 +319,13 @@ impl Customers { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/customers/{customer}` endpoint. @@ -305,7 +340,7 @@ impl Customers { pub async fn get( &self, customer: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}", @@ -334,7 +369,10 @@ impl Customers { * * * `customer: &str` -- The account's country. */ - pub async fn post_customers(&self, customer: &str) -> ClientResult { + pub async fn post_customers( + &self, + customer: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}", @@ -361,7 +399,10 @@ impl Customers { * * * `customer: &str` -- The account's country. */ - pub async fn delete(&self, customer: &str) -> ClientResult { + pub async fn delete( + &self, + customer: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}", @@ -398,7 +439,7 @@ impl Customers { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -418,7 +459,7 @@ impl Customers { ), None, ); - let resp: crate::types::CustomerBalanceTransactionList = self + let resp: crate::Response = self .client .get( &url, @@ -430,7 +471,11 @@ impl Customers { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/customers/{customer}/balance_transactions` endpoint. @@ -442,7 +487,7 @@ impl Customers { pub async fn get_all_balance_transactions( &self, customer: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/customers/{}/balance_transactions", @@ -450,7 +495,11 @@ impl Customers { ), None, ); - let mut resp: crate::types::CustomerBalanceTransactionList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -461,8 +510,8 @@ impl Customers { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -478,7 +527,11 @@ impl Customers { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -489,7 +542,11 @@ impl Customers { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -501,13 +558,13 @@ impl Customers { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/customers/{customer}/balance_transactions` endpoint. @@ -521,7 +578,7 @@ impl Customers { pub async fn post_balance_transaction( &self, customer: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/balance_transactions", @@ -554,7 +611,7 @@ impl Customers { &self, customer: &str, transaction: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/balance_transactions/{}", @@ -587,7 +644,7 @@ impl Customers { &self, customer: &str, transaction: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/balance_transactions/{}", @@ -625,7 +682,7 @@ impl Customers { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -645,7 +702,7 @@ impl Customers { ), None, ); - let resp: crate::types::BankAccountList = self + let resp: crate::Response = self .client .get( &url, @@ -657,7 +714,11 @@ impl Customers { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/customers/{customer}/bank_accounts` endpoint. @@ -669,7 +730,7 @@ impl Customers { pub async fn get_all_bank_accounts( &self, customer: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/customers/{}/bank_accounts", @@ -677,7 +738,11 @@ impl Customers { ), None, ); - let mut resp: crate::types::BankAccountList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -688,8 +753,8 @@ impl Customers { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -705,7 +770,11 @@ impl Customers { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -716,7 +785,11 @@ impl Customers { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -728,13 +801,13 @@ impl Customers { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/customers/{customer}/bank_accounts` endpoint. @@ -752,7 +825,7 @@ impl Customers { pub async fn post_bank_account( &self, customer: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/bank_accounts", @@ -785,7 +858,7 @@ impl Customers { &self, customer: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/bank_accounts/{}", @@ -818,7 +891,7 @@ impl Customers { &self, customer: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/bank_accounts/{}", @@ -851,7 +924,8 @@ impl Customers { &self, customer: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> + { let url = self.client.url( &format!( "/v1/customers/{}/bank_accounts/{}", @@ -884,7 +958,7 @@ impl Customers { &self, customer: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/bank_accounts/{}/verify", @@ -924,7 +998,7 @@ impl Customers { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -944,7 +1018,7 @@ impl Customers { ), None, ); - let resp: crate::types::Cards = self + let resp: crate::Response = self .client .get( &url, @@ -956,7 +1030,11 @@ impl Customers { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/customers/{customer}/cards` endpoint. @@ -967,7 +1045,10 @@ impl Customers { * Note that the 10 most recent sources are always available on the Customer object. * If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional cards.

*/ - pub async fn get_all_cards(&self, customer: &str) -> ClientResult> { + pub async fn get_all_cards( + &self, + customer: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/customers/{}/cards", @@ -975,7 +1056,11 @@ impl Customers { ), None, ); - let mut resp: crate::types::Cards = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -986,8 +1071,8 @@ impl Customers { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -1003,7 +1088,11 @@ impl Customers { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -1014,7 +1103,11 @@ impl Customers { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -1026,13 +1119,13 @@ impl Customers { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/customers/{customer}/cards` endpoint. @@ -1050,7 +1143,7 @@ impl Customers { pub async fn post_card( &self, customer: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/cards", @@ -1079,7 +1172,11 @@ impl Customers { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `id: &str` -- The account's country. */ - pub async fn get_card(&self, customer: &str, id: &str) -> ClientResult { + pub async fn get_card( + &self, + customer: &str, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/cards/{}", @@ -1112,7 +1209,7 @@ impl Customers { &self, customer: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/cards/{}", @@ -1145,7 +1242,8 @@ impl Customers { &self, customer: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> + { let url = self.client.url( &format!( "/v1/customers/{}/cards/{}", @@ -1174,7 +1272,10 @@ impl Customers { * * `customer: &str` -- The account's country. * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. */ - pub async fn get_discount(&self, customer: &str) -> ClientResult { + pub async fn get_discount( + &self, + customer: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/discount", @@ -1204,7 +1305,7 @@ impl Customers { pub async fn delete_discount( &self, customer: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/discount", @@ -1243,7 +1344,7 @@ impl Customers { limit: i64, starting_after: &str, type_: crate::types::GetCustomersCustomerPaymentMethodsType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -1266,7 +1367,7 @@ impl Customers { ), None, ); - let resp: crate::types::PaymentFlowsMethodList = self + let resp: crate::Response = self .client .get( &url, @@ -1278,7 +1379,11 @@ impl Customers { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/customers/{customer}/payment_methods` endpoint. @@ -1291,7 +1396,7 @@ impl Customers { &self, customer: &str, type_: crate::types::GetCustomersCustomerPaymentMethodsType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !type_.to_string().is_empty() { query_args.push(("type".to_string(), type_.to_string())); @@ -1305,7 +1410,11 @@ impl Customers { ), None, ); - let mut resp: crate::types::PaymentFlowsMethodList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -1316,8 +1425,8 @@ impl Customers { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -1333,7 +1442,11 @@ impl Customers { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -1344,7 +1457,11 @@ impl Customers { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -1356,13 +1473,13 @@ impl Customers { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/customers/{customer}/sources` endpoint. @@ -1385,7 +1502,7 @@ impl Customers { limit: i64, object: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -1408,7 +1525,7 @@ impl Customers { ), None, ); - let resp: crate::types::Sources = self + let resp: crate::Response = self .client .get( &url, @@ -1420,7 +1537,11 @@ impl Customers { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/customers/{customer}/sources` endpoint. @@ -1433,7 +1554,7 @@ impl Customers { &self, customer: &str, object: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !object.is_empty() { query_args.push(("object".to_string(), object.to_string())); @@ -1447,7 +1568,11 @@ impl Customers { ), None, ); - let mut resp: crate::types::Sources = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -1458,8 +1583,8 @@ impl Customers { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -1475,7 +1600,11 @@ impl Customers { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -1486,7 +1615,11 @@ impl Customers { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -1498,13 +1631,13 @@ impl Customers { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/customers/{customer}/sources` endpoint. @@ -1522,7 +1655,7 @@ impl Customers { pub async fn post_source( &self, customer: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/sources", @@ -1555,7 +1688,7 @@ impl Customers { &self, customer: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/sources/{}", @@ -1588,7 +1721,7 @@ impl Customers { &self, customer: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/sources/{}", @@ -1621,7 +1754,8 @@ impl Customers { &self, customer: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> + { let url = self.client.url( &format!( "/v1/customers/{}/sources/{}", @@ -1654,7 +1788,7 @@ impl Customers { &self, customer: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/sources/{}/verify", @@ -1692,7 +1826,7 @@ impl Customers { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -1712,7 +1846,7 @@ impl Customers { ), None, ); - let resp: crate::types::Subscriptions = self + let resp: crate::Response = self .client .get( &url, @@ -1724,7 +1858,11 @@ impl Customers { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/customers/{customer}/subscriptions` endpoint. @@ -1736,7 +1874,7 @@ impl Customers { pub async fn get_all_subscriptions( &self, customer: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/customers/{}/subscriptions", @@ -1744,7 +1882,11 @@ impl Customers { ), None, ); - let mut resp: crate::types::Subscriptions = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -1755,8 +1897,8 @@ impl Customers { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -1772,7 +1914,11 @@ impl Customers { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -1783,7 +1929,11 @@ impl Customers { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -1795,13 +1945,13 @@ impl Customers { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/customers/{customer}/subscriptions` endpoint. @@ -1815,7 +1965,7 @@ impl Customers { pub async fn post_subscription( &self, customer: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/subscriptions", @@ -1848,7 +1998,7 @@ impl Customers { &self, customer: &str, subscription_exposed_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/subscriptions/{}", @@ -1881,7 +2031,7 @@ impl Customers { &self, customer: &str, subscription_exposed_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/subscriptions/{}", @@ -1918,7 +2068,7 @@ impl Customers { &self, customer: &str, subscription_exposed_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/subscriptions/{}", @@ -1952,7 +2102,7 @@ impl Customers { &self, customer: &str, subscription_exposed_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/subscriptions/{}/discount", @@ -1985,7 +2135,7 @@ impl Customers { &self, customer: &str, subscription_exposed_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/subscriptions/{}/discount", @@ -2023,7 +2173,7 @@ impl Customers { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -2043,7 +2193,7 @@ impl Customers { ), None, ); - let resp: crate::types::TaxIds = self + let resp: crate::Response = self .client .get( &url, @@ -2055,7 +2205,11 @@ impl Customers { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/customers/{customer}/tax_ids` endpoint. @@ -2064,7 +2218,10 @@ impl Customers { * *

Returns a list of tax IDs for a customer.

*/ - pub async fn get_all_tax_ids(&self, customer: &str) -> ClientResult> { + pub async fn get_all_tax_ids( + &self, + customer: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/customers/{}/tax_ids", @@ -2072,7 +2229,11 @@ impl Customers { ), None, ); - let mut resp: crate::types::TaxIds = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -2083,8 +2244,8 @@ impl Customers { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -2100,7 +2261,11 @@ impl Customers { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -2111,7 +2276,11 @@ impl Customers { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -2123,13 +2292,13 @@ impl Customers { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/customers/{customer}/tax_ids` endpoint. @@ -2140,7 +2309,10 @@ impl Customers { * * * `customer: &str` -- The account's country. */ - pub async fn post_tax_id(&self, customer: &str) -> ClientResult { + pub async fn post_tax_id( + &self, + customer: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/tax_ids", @@ -2169,7 +2341,11 @@ impl Customers { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `id: &str` -- The account's country. */ - pub async fn get_tax_id(&self, customer: &str, id: &str) -> ClientResult { + pub async fn get_tax_id( + &self, + customer: &str, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/tax_ids/{}", @@ -2202,7 +2378,7 @@ impl Customers { &self, customer: &str, id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/customers/{}/tax_ids/{}", diff --git a/stripe/src/disputes.rs b/stripe/src/disputes.rs index 8002df36..ed9188f9 100644 --- a/stripe/src/disputes.rs +++ b/stripe/src/disputes.rs @@ -34,7 +34,7 @@ impl Disputes { limit: i64, payment_intent: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !charge.is_empty() { query_args.push(("charge".to_string(), charge.to_string())); @@ -53,7 +53,7 @@ impl Disputes { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/disputes?{}", query_), None); - let resp: crate::types::GetDisputesResponse = self + let resp: crate::Response = self .client .get( &url, @@ -65,7 +65,11 @@ impl Disputes { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/disputes` endpoint. @@ -79,7 +83,7 @@ impl Disputes { charge: &str, _created: &str, payment_intent: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !charge.is_empty() { query_args.push(("charge".to_string(), charge.to_string())); @@ -89,7 +93,11 @@ impl Disputes { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/disputes?{}", query_), None); - let mut resp: crate::types::GetDisputesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -100,8 +108,8 @@ impl Disputes { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -117,7 +125,11 @@ impl Disputes { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -128,7 +140,11 @@ impl Disputes { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -140,13 +156,13 @@ impl Disputes { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/disputes/{dispute}` endpoint. @@ -158,7 +174,7 @@ impl Disputes { * * `dispute: &str` -- The account's country. * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. */ - pub async fn get(&self, dispute: &str) -> ClientResult { + pub async fn get(&self, dispute: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/disputes/{}", @@ -187,7 +203,10 @@ impl Disputes { * * * `dispute: &str` -- The account's country. */ - pub async fn post(&self, dispute: &str) -> ClientResult { + pub async fn post( + &self, + dispute: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/disputes/{}", @@ -216,7 +235,10 @@ impl Disputes { * * * `dispute: &str` -- The account's country. */ - pub async fn post_close(&self, dispute: &str) -> ClientResult { + pub async fn post_close( + &self, + dispute: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/disputes/{}/close", diff --git a/stripe/src/ephemeral_keys.rs b/stripe/src/ephemeral_keys.rs index 077a804b..7fc7499b 100644 --- a/stripe/src/ephemeral_keys.rs +++ b/stripe/src/ephemeral_keys.rs @@ -16,7 +16,7 @@ impl EphemeralKeys { * *

Creates a short-lived API key for a given resource.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/ephemeral_keys", None); self.client .post( @@ -37,7 +37,10 @@ impl EphemeralKeys { * * * `key: &str` -- The account's country. */ - pub async fn delete_key(&self, key: &str) -> ClientResult { + pub async fn delete_key( + &self, + key: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/ephemeral_keys/{}", diff --git a/stripe/src/events.rs b/stripe/src/events.rs index a789b83e..3a1f2e57 100644 --- a/stripe/src/events.rs +++ b/stripe/src/events.rs @@ -36,7 +36,7 @@ impl Events { starting_after: &str, type_: &str, _types: &[String], - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if delivery_success { query_args.push(("delivery_success".to_string(), delivery_success.to_string())); @@ -55,7 +55,7 @@ impl Events { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/events?{}", query_), None); - let resp: crate::types::NotificationEventList = self + let resp: crate::Response = self .client .get( &url, @@ -67,7 +67,11 @@ impl Events { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/events` endpoint. @@ -82,7 +86,7 @@ impl Events { delivery_success: bool, type_: &str, _types: &[String], - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if delivery_success { query_args.push(("delivery_success".to_string(), delivery_success.to_string())); @@ -92,7 +96,11 @@ impl Events { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/events?{}", query_), None); - let mut resp: crate::types::NotificationEventList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -103,8 +111,8 @@ impl Events { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -120,7 +128,11 @@ impl Events { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -131,7 +143,11 @@ impl Events { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -143,13 +159,13 @@ impl Events { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/events/{id}` endpoint. @@ -161,7 +177,7 @@ impl Events { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `id: &str` -- The account's country. */ - pub async fn get(&self, id: &str) -> ClientResult { + pub async fn get(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!("/v1/events/{}", crate::progenitor_support::encode_path(id),), None, diff --git a/stripe/src/exchange_rates.rs b/stripe/src/exchange_rates.rs index 263fa515..8c428759 100644 --- a/stripe/src/exchange_rates.rs +++ b/stripe/src/exchange_rates.rs @@ -28,7 +28,7 @@ impl ExchangeRates { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -43,7 +43,7 @@ impl ExchangeRates { let url = self .client .url(&format!("/v1/exchange_rates?{}", query_), None); - let resp: crate::types::GetExchangeRatesResponse = self + let resp: crate::Response = self .client .get( &url, @@ -55,7 +55,11 @@ impl ExchangeRates { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/exchange_rates` endpoint. @@ -64,9 +68,13 @@ impl ExchangeRates { * *

Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports.

*/ - pub async fn get_all(&self) -> ClientResult> { + pub async fn get_all(&self) -> ClientResult>> { let url = self.client.url("/v1/exchange_rates", None); - let mut resp: crate::types::GetExchangeRatesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -77,8 +85,8 @@ impl ExchangeRates { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -94,7 +102,11 @@ impl ExchangeRates { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -105,7 +117,11 @@ impl ExchangeRates { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -117,13 +133,13 @@ impl ExchangeRates { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/exchange_rates/{rate_id}` endpoint. @@ -135,7 +151,10 @@ impl ExchangeRates { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `rate_id: &str` -- The account's country. */ - pub async fn get_rate(&self, rate_id: &str) -> ClientResult { + pub async fn get_rate( + &self, + rate_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/exchange_rates/{}", diff --git a/stripe/src/file_links.rs b/stripe/src/file_links.rs index 1456ffb4..68872cae 100644 --- a/stripe/src/file_links.rs +++ b/stripe/src/file_links.rs @@ -34,7 +34,7 @@ impl FileLinks { file: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -53,7 +53,7 @@ impl FileLinks { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/file_links?{}", query_), None); - let resp: crate::types::Links = self + let resp: crate::Response = self .client .get( &url, @@ -65,7 +65,11 @@ impl FileLinks { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/file_links` endpoint. @@ -79,7 +83,7 @@ impl FileLinks { _created: &str, expired: bool, file: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if expired { query_args.push(("expired".to_string(), expired.to_string())); @@ -89,7 +93,11 @@ impl FileLinks { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/file_links?{}", query_), None); - let mut resp: crate::types::Links = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -100,8 +108,8 @@ impl FileLinks { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -117,7 +125,11 @@ impl FileLinks { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -128,7 +140,11 @@ impl FileLinks { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -140,20 +156,20 @@ impl FileLinks { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/file_links` endpoint. * *

Creates a new file link object.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/file_links", None); self.client .post( @@ -175,7 +191,10 @@ impl FileLinks { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `link: &str` -- The account's country. */ - pub async fn get_link(&self, link: &str) -> ClientResult { + pub async fn get_link( + &self, + link: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/file_links/{}", @@ -202,7 +221,10 @@ impl FileLinks { * * * `link: &str` -- The account's country. */ - pub async fn post_link(&self, link: &str) -> ClientResult { + pub async fn post_link( + &self, + link: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/file_links/{}", diff --git a/stripe/src/files.rs b/stripe/src/files.rs index e5dba1e5..ef4bcab0 100644 --- a/stripe/src/files.rs +++ b/stripe/src/files.rs @@ -41,7 +41,7 @@ impl Files { limit: i64, purpose: crate::types::Purpose, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -57,7 +57,7 @@ impl Files { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/files?{}", query_), None); - let resp: crate::types::GetFilesResponse = self + let resp: crate::Response = self .client .get( &url, @@ -69,7 +69,11 @@ impl Files { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/files` endpoint. @@ -82,14 +86,18 @@ impl Files { &self, _created: &str, purpose: crate::types::Purpose, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !purpose.to_string().is_empty() { query_args.push(("purpose".to_string(), purpose.to_string())); } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/files?{}", query_), None); - let mut resp: crate::types::GetFilesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -100,8 +108,8 @@ impl Files { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -117,7 +125,11 @@ impl Files { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -128,7 +140,11 @@ impl Files { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -140,13 +156,13 @@ impl Files { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/files` endpoint. @@ -155,7 +171,7 @@ impl Files { * *

All of Stripe’s officially supported Client libraries should have support for sending multipart/form-data.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url( "/v1/files", Some(PostFilesDefaultServer::default().default_url()), @@ -180,7 +196,7 @@ impl Files { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `file: &str` -- The account's country. */ - pub async fn get(&self, file: &str) -> ClientResult { + pub async fn get(&self, file: &str) -> ClientResult> { let url = self.client.url( &format!("/v1/files/{}", crate::progenitor_support::encode_path(file),), None, diff --git a/stripe/src/identity.rs b/stripe/src/identity.rs index f0aa4654..648bf474 100644 --- a/stripe/src/identity.rs +++ b/stripe/src/identity.rs @@ -34,7 +34,7 @@ impl Identity { starting_after: &str, type_: crate::types::GelatoVerificationReportType, verification_session: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -59,7 +59,7 @@ impl Identity { &format!("/v1/identity/verification_reports?{}", query_), None, ); - let resp: crate::types::GetIdentityVerificationReportsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -71,7 +71,11 @@ impl Identity { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/identity/verification_reports` endpoint. @@ -85,7 +89,7 @@ impl Identity { _created: &str, type_: crate::types::GelatoVerificationReportType, verification_session: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !type_.to_string().is_empty() { query_args.push(("type".to_string(), type_.to_string())); @@ -101,7 +105,11 @@ impl Identity { &format!("/v1/identity/verification_reports?{}", query_), None, ); - let mut resp: crate::types::GetIdentityVerificationReportsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -112,8 +120,8 @@ impl Identity { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -129,7 +137,11 @@ impl Identity { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -140,7 +152,11 @@ impl Identity { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -152,13 +168,13 @@ impl Identity { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/identity/verification_reports/{report}` endpoint. @@ -173,7 +189,7 @@ impl Identity { pub async fn get_verification_reports_report( &self, report: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/identity/verification_reports/{}", @@ -212,7 +228,7 @@ impl Identity { limit: i64, starting_after: &str, status: crate::types::GelatoVerificationSessionStatus, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -231,7 +247,7 @@ impl Identity { &format!("/v1/identity/verification_sessions?{}", query_), None, ); - let resp: crate::types::GetIdentityVerificationSessionsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -243,7 +259,11 @@ impl Identity { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/identity/verification_sessions` endpoint. @@ -256,7 +276,7 @@ impl Identity { &self, _created: &str, status: crate::types::GelatoVerificationSessionStatus, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !status.to_string().is_empty() { query_args.push(("status".to_string(), status.to_string())); @@ -266,7 +286,11 @@ impl Identity { &format!("/v1/identity/verification_sessions?{}", query_), None, ); - let mut resp: crate::types::GetIdentityVerificationSessionsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -277,8 +301,8 @@ impl Identity { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -294,7 +318,11 @@ impl Identity { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -305,7 +333,11 @@ impl Identity { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -317,13 +349,13 @@ impl Identity { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/identity/verification_sessions` endpoint. @@ -338,7 +370,7 @@ impl Identity { */ pub async fn post_verification_session( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/v1/identity/verification_sessions", None); self.client .post( @@ -366,7 +398,7 @@ impl Identity { pub async fn get_verification_sessions_session( &self, session: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/identity/verification_sessions/{}", @@ -399,7 +431,7 @@ impl Identity { pub async fn post_verification_sessions_session( &self, session: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/identity/verification_sessions/{}", @@ -431,7 +463,7 @@ impl Identity { pub async fn post_verification_sessions_session_cancel( &self, session: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/identity/verification_sessions/{}/cancel", @@ -479,7 +511,7 @@ impl Identity { pub async fn post_verification_sessions_session_redact( &self, session: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/identity/verification_sessions/{}/redact", diff --git a/stripe/src/invoiceitems.rs b/stripe/src/invoiceitems.rs index 875cfb4e..67855153 100644 --- a/stripe/src/invoiceitems.rs +++ b/stripe/src/invoiceitems.rs @@ -36,7 +36,7 @@ impl Invoiceitems { limit: i64, pending: bool, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -60,7 +60,7 @@ impl Invoiceitems { let url = self .client .url(&format!("/v1/invoiceitems?{}", query_), None); - let resp: crate::types::GetInvoiceitemsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -72,7 +72,11 @@ impl Invoiceitems { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/invoiceitems` endpoint. @@ -87,7 +91,7 @@ impl Invoiceitems { customer: &str, invoice: &str, pending: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -102,7 +106,11 @@ impl Invoiceitems { let url = self .client .url(&format!("/v1/invoiceitems?{}", query_), None); - let mut resp: crate::types::GetInvoiceitemsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -113,8 +121,8 @@ impl Invoiceitems { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -130,7 +138,11 @@ impl Invoiceitems { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -141,7 +153,11 @@ impl Invoiceitems { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -153,20 +169,20 @@ impl Invoiceitems { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/invoiceitems` endpoint. * *

Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/invoiceitems", None); self.client .post( @@ -188,7 +204,10 @@ impl Invoiceitems { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `invoiceitem: &str` -- The account's country. */ - pub async fn get(&self, invoiceitem: &str) -> ClientResult { + pub async fn get( + &self, + invoiceitem: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/invoiceitems/{}", @@ -218,7 +237,7 @@ impl Invoiceitems { pub async fn post_invoiceitems( &self, invoiceitem: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/invoiceitems/{}", @@ -248,7 +267,7 @@ impl Invoiceitems { pub async fn delete( &self, invoiceitem: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/invoiceitems/{}", diff --git a/stripe/src/invoices.rs b/stripe/src/invoices.rs index 87671f2d..67a74839 100644 --- a/stripe/src/invoices.rs +++ b/stripe/src/invoices.rs @@ -40,7 +40,7 @@ impl Invoices { starting_after: &str, status: crate::types::GetInvoicesStatus, subscription: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_method.to_string().is_empty() { query_args.push(( @@ -68,7 +68,7 @@ impl Invoices { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/invoices?{}", query_), None); - let resp: crate::types::InvoicesList = self + let resp: crate::Response = self .client .get( &url, @@ -80,7 +80,11 @@ impl Invoices { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/invoices` endpoint. @@ -97,7 +101,7 @@ impl Invoices { _due_date: &str, status: crate::types::GetInvoicesStatus, subscription: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_method.to_string().is_empty() { query_args.push(( @@ -116,7 +120,11 @@ impl Invoices { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/invoices?{}", query_), None); - let mut resp: crate::types::InvoicesList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -127,8 +135,8 @@ impl Invoices { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -144,7 +152,11 @@ impl Invoices { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -155,7 +167,11 @@ impl Invoices { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -167,20 +183,20 @@ impl Invoices { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/invoices` endpoint. * *

This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in all pending invoice items on that customer, including prorations. The invoice remains a draft until you finalize the invoice, which allows you to pay or send the invoice to your customers.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/invoices", None); self.client .post( @@ -212,7 +228,7 @@ impl Invoices { limit: i64, page: &str, query: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); @@ -227,7 +243,7 @@ impl Invoices { let url = self .client .url(&format!("/v1/invoices/search?{}", query_), None); - let resp: crate::types::SearchResult = self + let resp: crate::Response = self .client .get( &url, @@ -239,7 +255,11 @@ impl Invoices { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/invoices/search` endpoint. @@ -251,7 +271,10 @@ impl Invoices { * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up * to an hour behind during outages. Search functionality is not available to merchants in India.

*/ - pub async fn get_all_search(&self, query: &str) -> ClientResult> { + pub async fn get_all_search( + &self, + query: &str, + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !query.is_empty() { query_args.push(("query".to_string(), query.to_string())); @@ -260,7 +283,11 @@ impl Invoices { let url = self .client .url(&format!("/v1/invoices/search?{}", query_), None); - let mut resp: crate::types::SearchResult = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -271,8 +298,8 @@ impl Invoices { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -288,7 +315,11 @@ impl Invoices { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -299,7 +330,11 @@ impl Invoices { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -311,13 +346,13 @@ impl Invoices { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/invoices/upcoming` endpoint. @@ -376,7 +411,7 @@ impl Invoices { subscription_start_date: i64, _subscription_trial_end: &str, subscription_trial_from_plan: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !coupon.is_empty() { query_args.push(("coupon".to_string(), coupon.to_string())); @@ -499,7 +534,7 @@ impl Invoices { subscription_start_date: i64, _subscription_trial_end: &str, subscription_trial_from_plan: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !coupon.is_empty() { query_args.push(("coupon".to_string(), coupon.to_string())); @@ -562,7 +597,7 @@ impl Invoices { let url = self .client .url(&format!("/v1/invoices/upcoming/lines?{}", query_), None); - let resp: crate::types::InvoiceLinesList = self + let resp: crate::Response = self .client .get( &url, @@ -574,7 +609,11 @@ impl Invoices { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/invoices/upcoming/lines` endpoint. @@ -604,7 +643,7 @@ impl Invoices { subscription_start_date: i64, _subscription_trial_end: &str, subscription_trial_from_plan: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !coupon.is_empty() { query_args.push(("coupon".to_string(), coupon.to_string())); @@ -658,7 +697,11 @@ impl Invoices { let url = self .client .url(&format!("/v1/invoices/upcoming/lines?{}", query_), None); - let mut resp: crate::types::InvoiceLinesList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -669,8 +712,8 @@ impl Invoices { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -686,7 +729,11 @@ impl Invoices { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -697,7 +744,11 @@ impl Invoices { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -709,13 +760,13 @@ impl Invoices { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/invoices/{invoice}` endpoint. @@ -727,7 +778,7 @@ impl Invoices { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `invoice: &str` -- The account's country. */ - pub async fn get(&self, invoice: &str) -> ClientResult { + pub async fn get(&self, invoice: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/invoices/{}", @@ -759,7 +810,10 @@ impl Invoices { * * * `invoice: &str` -- The account's country. */ - pub async fn post_invoices(&self, invoice: &str) -> ClientResult { + pub async fn post_invoices( + &self, + invoice: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/invoices/{}", @@ -786,7 +840,10 @@ impl Invoices { * * * `invoice: &str` -- The account's country. */ - pub async fn delete(&self, invoice: &str) -> ClientResult { + pub async fn delete( + &self, + invoice: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/invoices/{}", @@ -813,7 +870,10 @@ impl Invoices { * * * `invoice: &str` -- The account's country. */ - pub async fn post_finalize(&self, invoice: &str) -> ClientResult { + pub async fn post_finalize( + &self, + invoice: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/invoices/{}/finalize", @@ -850,7 +910,7 @@ impl Invoices { invoice: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -870,7 +930,7 @@ impl Invoices { ), None, ); - let resp: crate::types::InvoiceLinesList = self + let resp: crate::Response = self .client .get( &url, @@ -882,7 +942,11 @@ impl Invoices { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/invoices/{invoice}/lines` endpoint. @@ -891,7 +955,10 @@ impl Invoices { * *

When retrieving an invoice, you’ll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.

*/ - pub async fn get_all_lines(&self, invoice: &str) -> ClientResult> { + pub async fn get_all_lines( + &self, + invoice: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/invoices/{}/lines", @@ -899,7 +966,11 @@ impl Invoices { ), None, ); - let mut resp: crate::types::InvoiceLinesList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -910,8 +981,8 @@ impl Invoices { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -927,7 +998,11 @@ impl Invoices { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -938,7 +1013,11 @@ impl Invoices { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -950,13 +1029,13 @@ impl Invoices { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/invoices/{invoice}/mark_uncollectible` endpoint. @@ -970,7 +1049,7 @@ impl Invoices { pub async fn post_mark_uncollectible( &self, invoice: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/invoices/{}/mark_uncollectible", @@ -997,7 +1076,10 @@ impl Invoices { * * * `invoice: &str` -- The account's country. */ - pub async fn post_pay(&self, invoice: &str) -> ClientResult { + pub async fn post_pay( + &self, + invoice: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/invoices/{}/pay", @@ -1026,7 +1108,10 @@ impl Invoices { * * * `invoice: &str` -- The account's country. */ - pub async fn post_send(&self, invoice: &str) -> ClientResult { + pub async fn post_send( + &self, + invoice: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/invoices/{}/send", @@ -1053,7 +1138,10 @@ impl Invoices { * * * `invoice: &str` -- The account's country. */ - pub async fn post_void(&self, invoice: &str) -> ClientResult { + pub async fn post_void( + &self, + invoice: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/invoices/{}/void", diff --git a/stripe/src/issuer_fraud_records.rs b/stripe/src/issuer_fraud_records.rs index 220f7520..3f5cf026 100644 --- a/stripe/src/issuer_fraud_records.rs +++ b/stripe/src/issuer_fraud_records.rs @@ -30,7 +30,7 @@ impl IssuerFraudRecords { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !charge.is_empty() { query_args.push(("charge".to_string(), charge.to_string())); @@ -48,7 +48,7 @@ impl IssuerFraudRecords { let url = self .client .url(&format!("/v1/issuer_fraud_records?{}", query_), None); - let resp: crate::types::RadarIssuerFraudRecordList = self + let resp: crate::Response = self .client .get( &url, @@ -60,7 +60,11 @@ impl IssuerFraudRecords { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/issuer_fraud_records` endpoint. @@ -72,7 +76,7 @@ impl IssuerFraudRecords { pub async fn get_all( &self, charge: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !charge.is_empty() { query_args.push(("charge".to_string(), charge.to_string())); @@ -81,7 +85,11 @@ impl IssuerFraudRecords { let url = self .client .url(&format!("/v1/issuer_fraud_records?{}", query_), None); - let mut resp: crate::types::RadarIssuerFraudRecordList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -92,8 +100,8 @@ impl IssuerFraudRecords { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -109,7 +117,11 @@ impl IssuerFraudRecords { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -120,7 +132,11 @@ impl IssuerFraudRecords { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -132,13 +148,13 @@ impl IssuerFraudRecords { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/issuer_fraud_records/{issuer_fraud_record}` endpoint. @@ -155,7 +171,7 @@ impl IssuerFraudRecords { pub async fn get_record( &self, issuer_fraud_record: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/issuer_fraud_records/{}", diff --git a/stripe/src/issuing.rs b/stripe/src/issuing.rs index bc5b2b4e..7e496b6a 100644 --- a/stripe/src/issuing.rs +++ b/stripe/src/issuing.rs @@ -36,7 +36,7 @@ impl Issuing { limit: i64, starting_after: &str, status: crate::types::IssuingAuthorizationStatus, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !card.is_empty() { query_args.push(("card".to_string(), card.to_string())); @@ -60,7 +60,7 @@ impl Issuing { let url = self .client .url(&format!("/v1/issuing/authorizations?{}", query_), None); - let resp: crate::types::GetIssuingAuthorizationsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -72,7 +72,11 @@ impl Issuing { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/issuing/authorizations` endpoint. @@ -87,7 +91,7 @@ impl Issuing { cardholder: &str, _created: &str, status: crate::types::IssuingAuthorizationStatus, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !card.is_empty() { query_args.push(("card".to_string(), card.to_string())); @@ -102,7 +106,11 @@ impl Issuing { let url = self .client .url(&format!("/v1/issuing/authorizations?{}", query_), None); - let mut resp: crate::types::GetIssuingAuthorizationsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -113,8 +121,8 @@ impl Issuing { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -130,7 +138,11 @@ impl Issuing { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -141,7 +153,11 @@ impl Issuing { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -153,13 +169,13 @@ impl Issuing { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/issuing/authorizations/{authorization}` endpoint. @@ -174,7 +190,7 @@ impl Issuing { pub async fn get_authorizations_authorization( &self, authorization: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/issuing/authorizations/{}", @@ -204,7 +220,7 @@ impl Issuing { pub async fn post_authorizations_authorization( &self, authorization: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/issuing/authorizations/{}", @@ -234,7 +250,7 @@ impl Issuing { pub async fn post_authorizations_authorization_approve( &self, authorization: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/issuing/authorizations/{}/approve", @@ -264,7 +280,7 @@ impl Issuing { pub async fn post_authorizations_authorization_decline( &self, authorization: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/issuing/authorizations/{}/decline", @@ -309,7 +325,7 @@ impl Issuing { starting_after: &str, status: crate::types::IssuingCardholderStatus, type_: crate::types::AccountHolderType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !email.is_empty() { query_args.push(("email".to_string(), email.to_string())); @@ -336,7 +352,7 @@ impl Issuing { let url = self .client .url(&format!("/v1/issuing/cardholders?{}", query_), None); - let resp: crate::types::GetIssuingCardholdersResponse = self + let resp: crate::Response = self .client .get( &url, @@ -348,7 +364,11 @@ impl Issuing { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/issuing/cardholders` endpoint. @@ -364,7 +384,7 @@ impl Issuing { phone_number: &str, status: crate::types::IssuingCardholderStatus, type_: crate::types::AccountHolderType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !email.is_empty() { query_args.push(("email".to_string(), email.to_string())); @@ -382,7 +402,11 @@ impl Issuing { let url = self .client .url(&format!("/v1/issuing/cardholders?{}", query_), None); - let mut resp: crate::types::GetIssuingCardholdersResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -393,8 +417,8 @@ impl Issuing { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -410,7 +434,11 @@ impl Issuing { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -421,7 +449,11 @@ impl Issuing { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -433,20 +465,22 @@ impl Issuing { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/issuing/cardholders` endpoint. * *

Creates a new Issuing Cardholder object that can be issued cards.

*/ - pub async fn post_cardholder(&self) -> ClientResult { + pub async fn post_cardholder( + &self, + ) -> ClientResult> { let url = self.client.url("/v1/issuing/cardholders", None); self.client .post( @@ -471,7 +505,7 @@ impl Issuing { pub async fn get_cardholders_cardholder( &self, cardholder: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/issuing/cardholders/{}", @@ -501,7 +535,7 @@ impl Issuing { pub async fn post_cardholders_cardholder( &self, cardholder: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/issuing/cardholders/{}", @@ -550,7 +584,7 @@ impl Issuing { starting_after: &str, status: crate::types::IssuingCardStatus, type_: crate::types::IssuingCardType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !cardholder.is_empty() { query_args.push(("cardholder".to_string(), cardholder.to_string())); @@ -583,7 +617,7 @@ impl Issuing { let url = self .client .url(&format!("/v1/issuing/cards?{}", query_), None); - let resp: crate::types::GetIssuingCardsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -595,7 +629,11 @@ impl Issuing { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/issuing/cards` endpoint. @@ -613,7 +651,7 @@ impl Issuing { last_4: &str, status: crate::types::IssuingCardStatus, type_: crate::types::IssuingCardType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !cardholder.is_empty() { query_args.push(("cardholder".to_string(), cardholder.to_string())); @@ -637,7 +675,11 @@ impl Issuing { let url = self .client .url(&format!("/v1/issuing/cards?{}", query_), None); - let mut resp: crate::types::GetIssuingCardsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -648,8 +690,8 @@ impl Issuing { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -665,7 +707,11 @@ impl Issuing { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -676,7 +722,11 @@ impl Issuing { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -688,20 +738,20 @@ impl Issuing { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/issuing/cards` endpoint. * *

Creates an Issuing Card object.

*/ - pub async fn post_card(&self) -> ClientResult { + pub async fn post_card(&self) -> ClientResult> { let url = self.client.url("/v1/issuing/cards", None); self.client .post( @@ -723,7 +773,10 @@ impl Issuing { * * `card: &str` -- The account's country. * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. */ - pub async fn get_cards_card(&self, card: &str) -> ClientResult { + pub async fn get_cards_card( + &self, + card: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/issuing/cards/{}", @@ -750,7 +803,10 @@ impl Issuing { * * * `card: &str` -- The account's country. */ - pub async fn post_cards_card(&self, card: &str) -> ClientResult { + pub async fn post_cards_card( + &self, + card: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/issuing/cards/{}", @@ -791,7 +847,7 @@ impl Issuing { starting_after: &str, status: crate::types::IssuingDisputeStatus, transaction: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -812,7 +868,7 @@ impl Issuing { let url = self .client .url(&format!("/v1/issuing/disputes?{}", query_), None); - let resp: crate::types::IssuingDisputeList = self + let resp: crate::Response = self .client .get( &url, @@ -824,7 +880,11 @@ impl Issuing { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/issuing/disputes` endpoint. @@ -838,7 +898,7 @@ impl Issuing { _created: &str, status: crate::types::IssuingDisputeStatus, transaction: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !status.to_string().is_empty() { query_args.push(("status".to_string(), status.to_string())); @@ -850,7 +910,11 @@ impl Issuing { let url = self .client .url(&format!("/v1/issuing/disputes?{}", query_), None); - let mut resp: crate::types::IssuingDisputeList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -861,8 +925,8 @@ impl Issuing { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -878,7 +942,11 @@ impl Issuing { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -889,7 +957,11 @@ impl Issuing { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -901,20 +973,22 @@ impl Issuing { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/issuing/disputes` endpoint. * *

Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to Dispute reasons and evidence for more details about evidence requirements.

*/ - pub async fn post_dispute(&self) -> ClientResult { + pub async fn post_dispute( + &self, + ) -> ClientResult> { let url = self.client.url("/v1/issuing/disputes", None); self.client .post( @@ -939,7 +1013,7 @@ impl Issuing { pub async fn get_disputes_dispute( &self, dispute: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/issuing/disputes/{}", @@ -969,7 +1043,7 @@ impl Issuing { pub async fn post_disputes_dispute( &self, dispute: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/issuing/disputes/{}", @@ -999,7 +1073,7 @@ impl Issuing { pub async fn post_disputes_dispute_submit( &self, dispute: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/issuing/disputes/{}/submit", @@ -1036,7 +1110,7 @@ impl Issuing { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -1051,7 +1125,7 @@ impl Issuing { let url = self .client .url(&format!("/v1/issuing/settlements?{}", query_), None); - let resp: crate::types::GetIssuingSettlementsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -1063,7 +1137,11 @@ impl Issuing { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/issuing/settlements` endpoint. @@ -1075,9 +1153,13 @@ impl Issuing { pub async fn get_all_settlements( &self, _created: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/v1/issuing/settlements", None); - let mut resp: crate::types::GetIssuingSettlementsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -1088,8 +1170,8 @@ impl Issuing { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -1105,7 +1187,11 @@ impl Issuing { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -1116,7 +1202,11 @@ impl Issuing { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -1128,13 +1218,13 @@ impl Issuing { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/issuing/settlements/{settlement}` endpoint. @@ -1149,7 +1239,7 @@ impl Issuing { pub async fn get_settlements_settlement( &self, settlement: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/issuing/settlements/{}", @@ -1179,7 +1269,7 @@ impl Issuing { pub async fn post_settlements_settlement( &self, settlement: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/issuing/settlements/{}", @@ -1222,7 +1312,7 @@ impl Issuing { limit: i64, starting_after: &str, type_: crate::types::IssuingTransactionType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !card.is_empty() { query_args.push(("card".to_string(), card.to_string())); @@ -1246,7 +1336,7 @@ impl Issuing { let url = self .client .url(&format!("/v1/issuing/transactions?{}", query_), None); - let resp: crate::types::GetIssuingTransactionsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -1258,7 +1348,11 @@ impl Issuing { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/issuing/transactions` endpoint. @@ -1273,7 +1367,7 @@ impl Issuing { cardholder: &str, _created: &str, type_: crate::types::IssuingTransactionType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !card.is_empty() { query_args.push(("card".to_string(), card.to_string())); @@ -1288,7 +1382,11 @@ impl Issuing { let url = self .client .url(&format!("/v1/issuing/transactions?{}", query_), None); - let mut resp: crate::types::GetIssuingTransactionsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -1299,8 +1397,8 @@ impl Issuing { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -1316,7 +1414,11 @@ impl Issuing { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -1327,7 +1429,11 @@ impl Issuing { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -1339,13 +1445,13 @@ impl Issuing { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/issuing/transactions/{transaction}` endpoint. @@ -1360,7 +1466,7 @@ impl Issuing { pub async fn get_transactions_transaction( &self, transaction: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/issuing/transactions/{}", @@ -1390,7 +1496,7 @@ impl Issuing { pub async fn post_transactions_transaction( &self, transaction: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/issuing/transactions/{}", diff --git a/stripe/src/lib.rs b/stripe/src/lib.rs index ee2d2ac4..61dde937 100644 --- a/stripe/src/lib.rs +++ b/stripe/src/lib.rs @@ -131,9 +131,27 @@ pub mod types; pub mod utils; pub mod webhook_endpoints; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -337,13 +355,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -356,7 +375,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -379,13 +398,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -406,7 +426,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -425,7 +445,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -450,6 +474,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -466,7 +491,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -491,7 +516,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -514,6 +539,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -530,7 +556,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -556,7 +582,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -599,6 +625,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -611,7 +638,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -634,7 +661,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -643,7 +670,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -651,7 +678,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -661,32 +688,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -698,7 +729,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -707,7 +738,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -715,7 +746,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -723,7 +754,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -731,7 +762,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/stripe/src/mandates.rs b/stripe/src/mandates.rs index 4533669a..d1a9ce67 100644 --- a/stripe/src/mandates.rs +++ b/stripe/src/mandates.rs @@ -21,7 +21,7 @@ impl Mandates { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `mandate: &str` -- The account's country. */ - pub async fn get(&self, mandate: &str) -> ClientResult { + pub async fn get(&self, mandate: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/mandates/{}", diff --git a/stripe/src/order_returns.rs b/stripe/src/order_returns.rs index 405ab164..112f65cf 100644 --- a/stripe/src/order_returns.rs +++ b/stripe/src/order_returns.rs @@ -32,7 +32,7 @@ impl OrderReturns { limit: i64, order: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -50,7 +50,7 @@ impl OrderReturns { let url = self .client .url(&format!("/v1/order_returns?{}", query_), None); - let resp: crate::types::Returns = self + let resp: crate::Response = self .client .get( &url, @@ -62,7 +62,11 @@ impl OrderReturns { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/order_returns` endpoint. @@ -75,7 +79,7 @@ impl OrderReturns { &self, _created: &str, order: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !order.is_empty() { query_args.push(("order".to_string(), order.to_string())); @@ -84,7 +88,11 @@ impl OrderReturns { let url = self .client .url(&format!("/v1/order_returns?{}", query_), None); - let mut resp: crate::types::Returns = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -95,8 +103,8 @@ impl OrderReturns { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -112,7 +120,11 @@ impl OrderReturns { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -123,7 +135,11 @@ impl OrderReturns { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -135,13 +151,13 @@ impl OrderReturns { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/order_returns/{id}` endpoint. @@ -153,7 +169,7 @@ impl OrderReturns { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `id: &str` -- The account's country. */ - pub async fn get(&self, id: &str) -> ClientResult { + pub async fn get(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/order_returns/{}", diff --git a/stripe/src/orders.rs b/stripe/src/orders.rs index 3c550337..50cbf523 100644 --- a/stripe/src/orders.rs +++ b/stripe/src/orders.rs @@ -40,7 +40,7 @@ impl Orders { status: &str, _status_transitions: &str, _upstream_ids: &[String], - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -59,7 +59,7 @@ impl Orders { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/orders?{}", query_), None); - let resp: crate::types::OrdersLegacyResourceOrderList = self + let resp: crate::Response = self .client .get( &url, @@ -71,7 +71,11 @@ impl Orders { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/orders` endpoint. @@ -88,7 +92,7 @@ impl Orders { status: &str, _status_transitions: &str, _upstream_ids: &[String], - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -98,7 +102,11 @@ impl Orders { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/orders?{}", query_), None); - let mut resp: crate::types::OrdersLegacyResourceOrderList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -109,8 +117,8 @@ impl Orders { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -126,7 +134,11 @@ impl Orders { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -137,7 +149,11 @@ impl Orders { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -149,20 +165,20 @@ impl Orders { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/orders` endpoint. * *

Creates a new order object.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/orders", None); self.client .post( @@ -184,7 +200,7 @@ impl Orders { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `id: &str` -- The account's country. */ - pub async fn get(&self, id: &str) -> ClientResult { + pub async fn get(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!("/v1/orders/{}", crate::progenitor_support::encode_path(id),), None, @@ -208,7 +224,10 @@ impl Orders { * * * `id: &str` -- The account's country. */ - pub async fn post_orders(&self, id: &str) -> ClientResult { + pub async fn post_orders( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!("/v1/orders/{}", crate::progenitor_support::encode_path(id),), None, @@ -232,7 +251,7 @@ impl Orders { * * * `id: &str` -- The account's country. */ - pub async fn post_pay(&self, id: &str) -> ClientResult { + pub async fn post_pay(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/orders/{}/pay", @@ -259,7 +278,10 @@ impl Orders { * * * `id: &str` -- The account's country. */ - pub async fn post_return(&self, id: &str) -> ClientResult { + pub async fn post_return( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/orders/{}/returns", diff --git a/stripe/src/payment_intents.rs b/stripe/src/payment_intents.rs index 11b3d6f6..44838326 100644 --- a/stripe/src/payment_intents.rs +++ b/stripe/src/payment_intents.rs @@ -32,7 +32,7 @@ impl PaymentIntents { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -50,7 +50,7 @@ impl PaymentIntents { let url = self .client .url(&format!("/v1/payment_intents?{}", query_), None); - let resp: crate::types::PaymentFlowsIntentList = self + let resp: crate::Response = self .client .get( &url, @@ -62,7 +62,11 @@ impl PaymentIntents { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/payment_intents` endpoint. @@ -75,7 +79,7 @@ impl PaymentIntents { &self, _created: &str, customer: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -84,7 +88,11 @@ impl PaymentIntents { let url = self .client .url(&format!("/v1/payment_intents?{}", query_), None); - let mut resp: crate::types::PaymentFlowsIntentList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -95,8 +103,8 @@ impl PaymentIntents { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -112,7 +120,11 @@ impl PaymentIntents { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -123,7 +135,11 @@ impl PaymentIntents { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -135,13 +151,13 @@ impl PaymentIntents { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/payment_intents` endpoint. @@ -157,7 +173,7 @@ impl PaymentIntents { * available in the confirm API when confirm=true * is supplied.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/payment_intents", None); self.client .post( @@ -189,7 +205,7 @@ impl PaymentIntents { limit: i64, page: &str, query: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); @@ -204,7 +220,7 @@ impl PaymentIntents { let url = self .client .url(&format!("/v1/payment_intents/search?{}", query_), None); - let resp: crate::types::SearchResult = self + let resp: crate::Response = self .client .get( &url, @@ -216,7 +232,11 @@ impl PaymentIntents { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/payment_intents/search` endpoint. @@ -228,7 +248,10 @@ impl PaymentIntents { * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up * to an hour behind during outages. Search functionality is not available to merchants in India.

*/ - pub async fn get_all_search(&self, query: &str) -> ClientResult> { + pub async fn get_all_search( + &self, + query: &str, + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !query.is_empty() { query_args.push(("query".to_string(), query.to_string())); @@ -237,7 +260,11 @@ impl PaymentIntents { let url = self .client .url(&format!("/v1/payment_intents/search?{}", query_), None); - let mut resp: crate::types::SearchResult = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -248,8 +275,8 @@ impl PaymentIntents { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -265,7 +292,11 @@ impl PaymentIntents { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -276,7 +307,11 @@ impl PaymentIntents { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -288,13 +323,13 @@ impl PaymentIntents { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/payment_intents/{intent}` endpoint. @@ -315,7 +350,7 @@ impl PaymentIntents { &self, client_secret: &str, intent: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !client_secret.is_empty() { query_args.push(("client_secret".to_string(), client_secret.to_string())); @@ -354,7 +389,10 @@ impl PaymentIntents { * * * `intent: &str` -- The account's country. */ - pub async fn post_intent(&self, intent: &str) -> ClientResult { + pub async fn post_intent( + &self, + intent: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/payment_intents/{}", @@ -388,7 +426,7 @@ impl PaymentIntents { pub async fn post_intent_cancel( &self, intent: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/payment_intents/{}/cancel", @@ -422,7 +460,7 @@ impl PaymentIntents { pub async fn post_intent_capture( &self, intent: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/payment_intents/{}/capture", @@ -476,7 +514,7 @@ impl PaymentIntents { pub async fn post_intent_confirm( &self, intent: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/payment_intents/{}/confirm", @@ -506,7 +544,7 @@ impl PaymentIntents { pub async fn post_intent_verify_microdeposit( &self, intent: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/payment_intents/{}/verify_microdeposits", diff --git a/stripe/src/payment_links.rs b/stripe/src/payment_links.rs index 62568559..9c86c5ca 100644 --- a/stripe/src/payment_links.rs +++ b/stripe/src/payment_links.rs @@ -30,7 +30,7 @@ impl PaymentLinks { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -48,7 +48,7 @@ impl PaymentLinks { let url = self .client .url(&format!("/v1/payment_links?{}", query_), None); - let resp: crate::types::GetPaymentLinksResponse = self + let resp: crate::Response = self .client .get( &url, @@ -60,7 +60,11 @@ impl PaymentLinks { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/payment_links` endpoint. @@ -69,7 +73,10 @@ impl PaymentLinks { * *

Returns a list of your payment links.

*/ - pub async fn get_all(&self, active: bool) -> ClientResult> { + pub async fn get_all( + &self, + active: bool, + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -78,7 +85,11 @@ impl PaymentLinks { let url = self .client .url(&format!("/v1/payment_links?{}", query_), None); - let mut resp: crate::types::GetPaymentLinksResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -89,8 +100,8 @@ impl PaymentLinks { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -106,7 +117,11 @@ impl PaymentLinks { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -117,7 +132,11 @@ impl PaymentLinks { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -129,20 +148,20 @@ impl PaymentLinks { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/payment_links` endpoint. * *

Creates a payment link.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/payment_links", None); self.client .post( @@ -164,7 +183,10 @@ impl PaymentLinks { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `payment_link: &str` -- The account's country. */ - pub async fn get_link(&self, payment_link: &str) -> ClientResult { + pub async fn get_link( + &self, + payment_link: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/payment_links/{}", @@ -191,7 +213,10 @@ impl PaymentLinks { * * * `payment_link: &str` -- The account's country. */ - pub async fn post_link(&self, payment_link: &str) -> ClientResult { + pub async fn post_link( + &self, + payment_link: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/payment_links/{}", @@ -228,7 +253,7 @@ impl PaymentLinks { limit: i64, payment_link: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -248,7 +273,7 @@ impl PaymentLinks { ), None, ); - let resp: crate::types::LineItems = self + let resp: crate::Response = self .client .get( &url, @@ -260,7 +285,11 @@ impl PaymentLinks { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/payment_links/{payment_link}/line_items` endpoint. @@ -272,7 +301,7 @@ impl PaymentLinks { pub async fn get_all_link_line_items( &self, payment_link: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/payment_links/{}/line_items", @@ -280,7 +309,11 @@ impl PaymentLinks { ), None, ); - let mut resp: crate::types::LineItems = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -291,8 +324,8 @@ impl PaymentLinks { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -308,7 +341,11 @@ impl PaymentLinks { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -319,7 +356,11 @@ impl PaymentLinks { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -331,12 +372,12 @@ impl PaymentLinks { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } } diff --git a/stripe/src/payment_methods.rs b/stripe/src/payment_methods.rs index aa24dfe2..3cc43bbf 100644 --- a/stripe/src/payment_methods.rs +++ b/stripe/src/payment_methods.rs @@ -32,7 +32,7 @@ impl PaymentMethods { limit: i64, starting_after: &str, type_: crate::types::GetCustomersCustomerPaymentMethodsType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -53,7 +53,7 @@ impl PaymentMethods { let url = self .client .url(&format!("/v1/payment_methods?{}", query_), None); - let resp: crate::types::PaymentFlowsMethodList = self + let resp: crate::Response = self .client .get( &url, @@ -65,7 +65,11 @@ impl PaymentMethods { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/payment_methods` endpoint. @@ -78,7 +82,7 @@ impl PaymentMethods { &self, customer: &str, type_: crate::types::GetCustomersCustomerPaymentMethodsType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -90,7 +94,11 @@ impl PaymentMethods { let url = self .client .url(&format!("/v1/payment_methods?{}", query_), None); - let mut resp: crate::types::PaymentFlowsMethodList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -101,8 +109,8 @@ impl PaymentMethods { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -118,7 +126,11 @@ impl PaymentMethods { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -129,7 +141,11 @@ impl PaymentMethods { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -141,13 +157,13 @@ impl PaymentMethods { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/payment_methods` endpoint. @@ -156,7 +172,7 @@ impl PaymentMethods { * *

Instead of creating a PaymentMethod directly, we recommend using the PaymentIntents API to accept a payment immediately or the SetupIntent API to collect payment method details ahead of a future payment.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/payment_methods", None); self.client .post( @@ -181,7 +197,7 @@ impl PaymentMethods { pub async fn get_method( &self, payment_method: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/payment_methods/{}", @@ -211,7 +227,7 @@ impl PaymentMethods { pub async fn post_method( &self, payment_method: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/payment_methods/{}", @@ -251,7 +267,7 @@ impl PaymentMethods { pub async fn post_method_attach( &self, payment_method: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/payment_methods/{}/attach", @@ -281,7 +297,7 @@ impl PaymentMethods { pub async fn post_method_detach( &self, payment_method: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/payment_methods/{}/detach", diff --git a/stripe/src/payouts.rs b/stripe/src/payouts.rs index 1e917240..810ae00d 100644 --- a/stripe/src/payouts.rs +++ b/stripe/src/payouts.rs @@ -36,7 +36,7 @@ impl Payouts { limit: i64, starting_after: &str, status: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !destination.is_empty() { query_args.push(("destination".to_string(), destination.to_string())); @@ -55,7 +55,7 @@ impl Payouts { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/payouts?{}", query_), None); - let resp: crate::types::PayoutList = self + let resp: crate::Response = self .client .get( &url, @@ -67,7 +67,11 @@ impl Payouts { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/payouts` endpoint. @@ -82,7 +86,7 @@ impl Payouts { _created: &str, destination: &str, status: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !destination.is_empty() { query_args.push(("destination".to_string(), destination.to_string())); @@ -92,7 +96,11 @@ impl Payouts { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/payouts?{}", query_), None); - let mut resp: crate::types::PayoutList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -103,8 +111,8 @@ impl Payouts { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -120,7 +128,11 @@ impl Payouts { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -131,7 +143,11 @@ impl Payouts { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -143,13 +159,13 @@ impl Payouts { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/payouts` endpoint. @@ -160,7 +176,7 @@ impl Payouts { * *

If you are creating a manual payout on a Stripe account that uses multiple payment source types, you’ll need to specify the source type balance that the payout should draw from. The balance object details available and pending amounts by source type.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/payouts", None); self.client .post( @@ -182,7 +198,7 @@ impl Payouts { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `payout: &str` -- The account's country. */ - pub async fn get(&self, payout: &str) -> ClientResult { + pub async fn get(&self, payout: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/payouts/{}", @@ -209,7 +225,10 @@ impl Payouts { * * * `payout: &str` -- The account's country. */ - pub async fn post_payouts(&self, payout: &str) -> ClientResult { + pub async fn post_payouts( + &self, + payout: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/payouts/{}", @@ -236,7 +255,10 @@ impl Payouts { * * * `payout: &str` -- The account's country. */ - pub async fn post_cancel(&self, payout: &str) -> ClientResult { + pub async fn post_cancel( + &self, + payout: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/payouts/{}/cancel", @@ -265,7 +287,10 @@ impl Payouts { * * * `payout: &str` -- The account's country. */ - pub async fn post_reverse(&self, payout: &str) -> ClientResult { + pub async fn post_reverse( + &self, + payout: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/payouts/{}/reverse", diff --git a/stripe/src/plans.rs b/stripe/src/plans.rs index 99cf3135..2c5b2864 100644 --- a/stripe/src/plans.rs +++ b/stripe/src/plans.rs @@ -34,7 +34,7 @@ impl Plans { limit: i64, product: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -53,7 +53,7 @@ impl Plans { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/plans?{}", query_), None); - let resp: crate::types::PlanList = self + let resp: crate::Response = self .client .get( &url, @@ -65,7 +65,11 @@ impl Plans { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/plans` endpoint. @@ -79,7 +83,7 @@ impl Plans { active: bool, _created: &str, product: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -89,7 +93,11 @@ impl Plans { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/plans?{}", query_), None); - let mut resp: crate::types::PlanList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -100,8 +108,8 @@ impl Plans { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -117,7 +125,11 @@ impl Plans { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -128,7 +140,11 @@ impl Plans { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -140,20 +156,20 @@ impl Plans { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/plans` endpoint. * *

You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/plans", None); self.client .post( @@ -175,7 +191,7 @@ impl Plans { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `plan: &str` -- The account's country. */ - pub async fn get(&self, plan: &str) -> ClientResult { + pub async fn get(&self, plan: &str) -> ClientResult> { let url = self.client.url( &format!("/v1/plans/{}", crate::progenitor_support::encode_path(plan),), None, @@ -199,7 +215,10 @@ impl Plans { * * * `plan: &str` -- The account's country. */ - pub async fn post_plans(&self, plan: &str) -> ClientResult { + pub async fn post_plans( + &self, + plan: &str, + ) -> ClientResult> { let url = self.client.url( &format!("/v1/plans/{}", crate::progenitor_support::encode_path(plan),), None, @@ -223,7 +242,10 @@ impl Plans { * * * `plan: &str` -- The account's country. */ - pub async fn delete(&self, plan: &str) -> ClientResult { + pub async fn delete( + &self, + plan: &str, + ) -> ClientResult> { let url = self.client.url( &format!("/v1/plans/{}", crate::progenitor_support::encode_path(plan),), None, diff --git a/stripe/src/prices.rs b/stripe/src/prices.rs index c766c4d9..a1809aee 100644 --- a/stripe/src/prices.rs +++ b/stripe/src/prices.rs @@ -42,7 +42,7 @@ impl Prices { _recurring: &str, starting_after: &str, type_: crate::types::PriceType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -67,7 +67,7 @@ impl Prices { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/prices?{}", query_), None); - let resp: crate::types::PriceList = self + let resp: crate::Response = self .client .get( &url, @@ -79,7 +79,11 @@ impl Prices { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/prices` endpoint. @@ -97,7 +101,7 @@ impl Prices { product: &str, _recurring: &str, type_: crate::types::PriceType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -113,7 +117,11 @@ impl Prices { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/prices?{}", query_), None); - let mut resp: crate::types::PriceList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -124,8 +132,8 @@ impl Prices { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -141,7 +149,11 @@ impl Prices { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -152,7 +164,11 @@ impl Prices { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -164,20 +180,20 @@ impl Prices { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/prices` endpoint. * *

Creates a new price for an existing product. The price can be recurring or one-time.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/prices", None); self.client .post( @@ -209,7 +225,7 @@ impl Prices { limit: i64, page: &str, query: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); @@ -224,7 +240,7 @@ impl Prices { let url = self .client .url(&format!("/v1/prices/search?{}", query_), None); - let resp: crate::types::SearchResult = self + let resp: crate::Response = self .client .get( &url, @@ -236,7 +252,11 @@ impl Prices { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/prices/search` endpoint. @@ -248,7 +268,10 @@ impl Prices { * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up * to an hour behind during outages. Search functionality is not available to merchants in India.

*/ - pub async fn get_all_search(&self, query: &str) -> ClientResult> { + pub async fn get_all_search( + &self, + query: &str, + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !query.is_empty() { query_args.push(("query".to_string(), query.to_string())); @@ -257,7 +280,11 @@ impl Prices { let url = self .client .url(&format!("/v1/prices/search?{}", query_), None); - let mut resp: crate::types::SearchResult = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -268,8 +295,8 @@ impl Prices { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -285,7 +312,11 @@ impl Prices { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -296,7 +327,11 @@ impl Prices { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -308,13 +343,13 @@ impl Prices { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/prices/{price}` endpoint. @@ -326,7 +361,7 @@ impl Prices { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `price: &str` -- The account's country. */ - pub async fn get(&self, price: &str) -> ClientResult { + pub async fn get(&self, price: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/prices/{}", @@ -353,7 +388,10 @@ impl Prices { * * * `price: &str` -- The account's country. */ - pub async fn post_prices(&self, price: &str) -> ClientResult { + pub async fn post_prices( + &self, + price: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/prices/{}", diff --git a/stripe/src/products.rs b/stripe/src/products.rs index b6b80865..7308f149 100644 --- a/stripe/src/products.rs +++ b/stripe/src/products.rs @@ -38,7 +38,7 @@ impl Products { shippable: bool, starting_after: &str, url: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -60,7 +60,7 @@ impl Products { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/products?{}", query_), None); - let resp: crate::types::ProductList = self + let resp: crate::Response = self .client .get( &url, @@ -72,7 +72,11 @@ impl Products { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/products` endpoint. @@ -88,7 +92,7 @@ impl Products { _ids: &[String], shippable: bool, url: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -101,7 +105,11 @@ impl Products { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/products?{}", query_), None); - let mut resp: crate::types::ProductList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -112,8 +120,8 @@ impl Products { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -129,7 +137,11 @@ impl Products { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -140,7 +152,11 @@ impl Products { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -152,20 +168,20 @@ impl Products { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/products` endpoint. * *

Creates a new product object.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/products", None); self.client .post( @@ -197,7 +213,7 @@ impl Products { limit: i64, page: &str, query: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); @@ -212,7 +228,7 @@ impl Products { let url = self .client .url(&format!("/v1/products/search?{}", query_), None); - let resp: crate::types::SearchResult = self + let resp: crate::Response = self .client .get( &url, @@ -224,7 +240,11 @@ impl Products { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/products/search` endpoint. @@ -236,7 +256,10 @@ impl Products { * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up * to an hour behind during outages. Search functionality is not available to merchants in India.

*/ - pub async fn get_all_search(&self, query: &str) -> ClientResult> { + pub async fn get_all_search( + &self, + query: &str, + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !query.is_empty() { query_args.push(("query".to_string(), query.to_string())); @@ -245,7 +268,11 @@ impl Products { let url = self .client .url(&format!("/v1/products/search?{}", query_), None); - let mut resp: crate::types::SearchResult = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -256,8 +283,8 @@ impl Products { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -273,7 +300,11 @@ impl Products { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -284,7 +315,11 @@ impl Products { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -296,13 +331,13 @@ impl Products { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/products/{id}` endpoint. @@ -314,7 +349,7 @@ impl Products { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `id: &str` -- The account's country. */ - pub async fn get(&self, id: &str) -> ClientResult { + pub async fn get(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/products/{}", @@ -341,7 +376,10 @@ impl Products { * * * `id: &str` -- The account's country. */ - pub async fn post_products(&self, id: &str) -> ClientResult { + pub async fn post_products( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/products/{}", @@ -368,7 +406,10 @@ impl Products { * * * `id: &str` -- The account's country. */ - pub async fn delete(&self, id: &str) -> ClientResult { + pub async fn delete( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/products/{}", diff --git a/stripe/src/promotion_codes.rs b/stripe/src/promotion_codes.rs index 29cf9d4a..394618ba 100644 --- a/stripe/src/promotion_codes.rs +++ b/stripe/src/promotion_codes.rs @@ -38,7 +38,7 @@ impl PromotionCodes { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -65,7 +65,7 @@ impl PromotionCodes { let url = self .client .url(&format!("/v1/promotion_codes?{}", query_), None); - let resp: crate::types::GetPromotionCodesResponse = self + let resp: crate::Response = self .client .get( &url, @@ -77,7 +77,11 @@ impl PromotionCodes { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/promotion_codes` endpoint. @@ -93,7 +97,7 @@ impl PromotionCodes { coupon: &str, _created: &str, customer: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -111,7 +115,11 @@ impl PromotionCodes { let url = self .client .url(&format!("/v1/promotion_codes?{}", query_), None); - let mut resp: crate::types::GetPromotionCodesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -122,8 +130,8 @@ impl PromotionCodes { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -139,7 +147,11 @@ impl PromotionCodes { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -150,7 +162,11 @@ impl PromotionCodes { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -162,20 +178,20 @@ impl PromotionCodes { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/promotion_codes` endpoint. * *

A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/promotion_codes", None); self.client .post( @@ -200,7 +216,7 @@ impl PromotionCodes { pub async fn get_code( &self, promotion_code: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/promotion_codes/{}", @@ -230,7 +246,7 @@ impl PromotionCodes { pub async fn post_code( &self, promotion_code: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/promotion_codes/{}", diff --git a/stripe/src/quotes.rs b/stripe/src/quotes.rs index 5c060aa9..dc1165a3 100644 --- a/stripe/src/quotes.rs +++ b/stripe/src/quotes.rs @@ -34,7 +34,7 @@ impl Quotes { starting_after: &str, status: crate::types::QuoteStatus, test_clock: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -56,7 +56,7 @@ impl Quotes { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/quotes?{}", query_), None); - let resp: crate::types::GetQuotesResponse = self + let resp: crate::Response = self .client .get( &url, @@ -68,7 +68,11 @@ impl Quotes { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/quotes` endpoint. @@ -82,7 +86,7 @@ impl Quotes { customer: &str, status: crate::types::QuoteStatus, test_clock: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -95,7 +99,11 @@ impl Quotes { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/quotes?{}", query_), None); - let mut resp: crate::types::GetQuotesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -106,8 +114,8 @@ impl Quotes { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -123,7 +131,11 @@ impl Quotes { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -134,7 +146,11 @@ impl Quotes { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -146,20 +162,20 @@ impl Quotes { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/quotes` endpoint. * *

A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the quote template.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/quotes", None); self.client .post( @@ -181,7 +197,7 @@ impl Quotes { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `quote: &str` -- The account's country. */ - pub async fn get(&self, quote: &str) -> ClientResult { + pub async fn get(&self, quote: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/quotes/{}", @@ -208,7 +224,10 @@ impl Quotes { * * * `quote: &str` -- The account's country. */ - pub async fn post_quotes(&self, quote: &str) -> ClientResult { + pub async fn post_quotes( + &self, + quote: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/quotes/{}", @@ -235,7 +254,10 @@ impl Quotes { * * * `quote: &str` -- The account's country. */ - pub async fn post_accept(&self, quote: &str) -> ClientResult { + pub async fn post_accept( + &self, + quote: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/quotes/{}/accept", @@ -262,7 +284,10 @@ impl Quotes { * * * `quote: &str` -- The account's country. */ - pub async fn post_cancel(&self, quote: &str) -> ClientResult { + pub async fn post_cancel( + &self, + quote: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/quotes/{}/cancel", @@ -299,7 +324,7 @@ impl Quotes { limit: i64, quote: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -319,7 +344,7 @@ impl Quotes { ), None, ); - let resp: crate::types::LineItems = self + let resp: crate::Response = self .client .get( &url, @@ -331,7 +356,11 @@ impl Quotes { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/quotes/{quote}/computed_upfront_line_items` endpoint. @@ -343,7 +372,7 @@ impl Quotes { pub async fn get_all_computed_upfront_line_items( &self, quote: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/quotes/{}/computed_upfront_line_items", @@ -351,7 +380,11 @@ impl Quotes { ), None, ); - let mut resp: crate::types::LineItems = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -362,8 +395,8 @@ impl Quotes { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -379,7 +412,11 @@ impl Quotes { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -390,7 +427,11 @@ impl Quotes { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -402,13 +443,13 @@ impl Quotes { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/quotes/{quote}/finalize` endpoint. @@ -419,7 +460,10 @@ impl Quotes { * * * `quote: &str` -- The account's country. */ - pub async fn post_finalize(&self, quote: &str) -> ClientResult { + pub async fn post_finalize( + &self, + quote: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/quotes/{}/finalize", @@ -456,7 +500,7 @@ impl Quotes { limit: i64, quote: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -476,7 +520,7 @@ impl Quotes { ), None, ); - let resp: crate::types::LineItems = self + let resp: crate::Response = self .client .get( &url, @@ -488,7 +532,11 @@ impl Quotes { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/quotes/{quote}/line_items` endpoint. @@ -497,7 +545,10 @@ impl Quotes { * *

When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.

*/ - pub async fn get_all_line_items(&self, quote: &str) -> ClientResult> { + pub async fn get_all_line_items( + &self, + quote: &str, + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/quotes/{}/line_items", @@ -505,7 +556,11 @@ impl Quotes { ), None, ); - let mut resp: crate::types::LineItems = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -516,8 +571,8 @@ impl Quotes { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -533,7 +588,11 @@ impl Quotes { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -544,7 +603,11 @@ impl Quotes { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -556,13 +619,13 @@ impl Quotes { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/quotes/{quote}/pdf` endpoint. @@ -574,7 +637,7 @@ impl Quotes { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `quote: &str` -- The account's country. */ - pub async fn get_pdf(&self, quote: &str) -> ClientResult<()> { + pub async fn get_pdf(&self, quote: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/quotes/{}/pdf", diff --git a/stripe/src/radar.rs b/stripe/src/radar.rs index 94c82e1e..e2c7061c 100644 --- a/stripe/src/radar.rs +++ b/stripe/src/radar.rs @@ -32,7 +32,7 @@ impl Radar { limit: i64, payment_intent: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !charge.is_empty() { query_args.push(("charge".to_string(), charge.to_string())); @@ -53,7 +53,7 @@ impl Radar { let url = self .client .url(&format!("/v1/radar/early_fraud_warnings?{}", query_), None); - let resp: crate::types::RadarEarlyFraudWarningList = self + let resp: crate::Response = self .client .get( &url, @@ -65,7 +65,11 @@ impl Radar { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/radar/early_fraud_warnings` endpoint. @@ -78,7 +82,7 @@ impl Radar { &self, charge: &str, payment_intent: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !charge.is_empty() { query_args.push(("charge".to_string(), charge.to_string())); @@ -90,7 +94,11 @@ impl Radar { let url = self .client .url(&format!("/v1/radar/early_fraud_warnings?{}", query_), None); - let mut resp: crate::types::RadarEarlyFraudWarningList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -101,8 +109,8 @@ impl Radar { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -118,7 +126,11 @@ impl Radar { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -129,7 +141,11 @@ impl Radar { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -141,13 +157,13 @@ impl Radar { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/radar/early_fraud_warnings/{early_fraud_warning}` endpoint. @@ -164,7 +180,7 @@ impl Radar { pub async fn get_early_fraud_warnings_warning( &self, early_fraud_warning: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/radar/early_fraud_warnings/{}", @@ -205,7 +221,7 @@ impl Radar { starting_after: &str, value: &str, value_list: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -226,7 +242,7 @@ impl Radar { let url = self .client .url(&format!("/v1/radar/value_list_items?{}", query_), None); - let resp: crate::types::ListItems = self + let resp: crate::Response = self .client .get( &url, @@ -238,7 +254,11 @@ impl Radar { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/radar/value_list_items` endpoint. @@ -252,7 +272,7 @@ impl Radar { _created: &str, value: &str, value_list: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !value.is_empty() { query_args.push(("value".to_string(), value.to_string())); @@ -264,7 +284,11 @@ impl Radar { let url = self .client .url(&format!("/v1/radar/value_list_items?{}", query_), None); - let mut resp: crate::types::ListItems = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -275,8 +299,8 @@ impl Radar { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -292,7 +316,11 @@ impl Radar { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -303,7 +331,11 @@ impl Radar { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -315,20 +347,22 @@ impl Radar { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/radar/value_list_items` endpoint. * *

Creates a new ValueListItem object, which is added to the specified parent value list.

*/ - pub async fn post_value_list_item(&self) -> ClientResult { + pub async fn post_value_list_item( + &self, + ) -> ClientResult> { let url = self.client.url("/v1/radar/value_list_items", None); self.client .post( @@ -353,7 +387,7 @@ impl Radar { pub async fn get_value_list_items_item( &self, item: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/radar/value_list_items/{}", @@ -383,7 +417,7 @@ impl Radar { pub async fn delete_value_list_items_item( &self, item: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/radar/value_list_items/{}", @@ -424,7 +458,7 @@ impl Radar { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !alias.is_empty() { query_args.push(("alias".to_string(), alias.to_string())); @@ -445,7 +479,7 @@ impl Radar { let url = self .client .url(&format!("/v1/radar/value_lists?{}", query_), None); - let resp: crate::types::GetRadarValueListsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -457,7 +491,11 @@ impl Radar { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/radar/value_lists` endpoint. @@ -471,7 +509,7 @@ impl Radar { alias: &str, contains: &str, _created: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !alias.is_empty() { query_args.push(("alias".to_string(), alias.to_string())); @@ -483,7 +521,11 @@ impl Radar { let url = self .client .url(&format!("/v1/radar/value_lists?{}", query_), None); - let mut resp: crate::types::GetRadarValueListsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -494,8 +536,8 @@ impl Radar { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -511,7 +553,11 @@ impl Radar { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -522,7 +568,11 @@ impl Radar { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -534,20 +584,20 @@ impl Radar { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/radar/value_lists` endpoint. * *

Creates a new ValueList object, which can then be referenced in rules.

*/ - pub async fn post_value_list(&self) -> ClientResult { + pub async fn post_value_list(&self) -> ClientResult> { let url = self.client.url("/v1/radar/value_lists", None); self.client .post( @@ -572,7 +622,7 @@ impl Radar { pub async fn get_value_lists_list( &self, value_list: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/radar/value_lists/{}", @@ -602,7 +652,7 @@ impl Radar { pub async fn post_value_lists_list( &self, value_list: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/radar/value_lists/{}", @@ -632,7 +682,7 @@ impl Radar { pub async fn delete_value_lists_list( &self, value_list: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/radar/value_lists/{}", diff --git a/stripe/src/recipients.rs b/stripe/src/recipients.rs index 89733a57..bc777e44 100644 --- a/stripe/src/recipients.rs +++ b/stripe/src/recipients.rs @@ -34,7 +34,7 @@ impl Recipients { starting_after: &str, type_: crate::types::GetRecipientsType, verified: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -53,7 +53,7 @@ impl Recipients { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/recipients?{}", query_), None); - let resp: crate::types::GetRecipientsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -65,7 +65,11 @@ impl Recipients { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/recipients` endpoint. @@ -79,7 +83,7 @@ impl Recipients { _created: &str, type_: crate::types::GetRecipientsType, verified: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !type_.to_string().is_empty() { query_args.push(("type".to_string(), type_.to_string())); @@ -89,7 +93,11 @@ impl Recipients { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/recipients?{}", query_), None); - let mut resp: crate::types::GetRecipientsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -100,8 +108,8 @@ impl Recipients { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -117,7 +125,11 @@ impl Recipients { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -128,7 +140,11 @@ impl Recipients { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -140,13 +156,13 @@ impl Recipients { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/recipients` endpoint. @@ -154,7 +170,7 @@ impl Recipients { *

Creates a new Recipient object and verifies the recipient’s identity. * Also verifies the recipient’s bank account information or debit card, if either is provided.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/recipients", None); self.client .post( @@ -176,7 +192,10 @@ impl Recipients { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `id: &str` -- The account's country. */ - pub async fn get(&self, id: &str) -> ClientResult { + pub async fn get( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/recipients/{}", @@ -207,7 +226,10 @@ impl Recipients { * * * `id: &str` -- The account's country. */ - pub async fn post_recipients(&self, id: &str) -> ClientResult { + pub async fn post_recipients( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/recipients/{}", @@ -234,7 +256,10 @@ impl Recipients { * * * `id: &str` -- The account's country. */ - pub async fn delete(&self, id: &str) -> ClientResult { + pub async fn delete( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/recipients/{}", diff --git a/stripe/src/refunds.rs b/stripe/src/refunds.rs index 66c44486..509419bd 100644 --- a/stripe/src/refunds.rs +++ b/stripe/src/refunds.rs @@ -34,7 +34,7 @@ impl Refunds { limit: i64, payment_intent: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !charge.is_empty() { query_args.push(("charge".to_string(), charge.to_string())); @@ -53,7 +53,7 @@ impl Refunds { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/refunds?{}", query_), None); - let resp: crate::types::RefundList = self + let resp: crate::Response = self .client .get( &url, @@ -65,7 +65,11 @@ impl Refunds { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/refunds` endpoint. @@ -79,7 +83,7 @@ impl Refunds { charge: &str, _created: &str, payment_intent: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !charge.is_empty() { query_args.push(("charge".to_string(), charge.to_string())); @@ -89,7 +93,11 @@ impl Refunds { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/refunds?{}", query_), None); - let mut resp: crate::types::RefundList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -100,8 +108,8 @@ impl Refunds { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -117,7 +125,11 @@ impl Refunds { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -128,7 +140,11 @@ impl Refunds { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -140,20 +156,20 @@ impl Refunds { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/refunds` endpoint. * *

Create a refund.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/refunds", None); self.client .post( @@ -175,7 +191,7 @@ impl Refunds { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `refund: &str` -- The account's country. */ - pub async fn get(&self, refund: &str) -> ClientResult { + pub async fn get(&self, refund: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/refunds/{}", @@ -204,7 +220,10 @@ impl Refunds { * * * `refund: &str` -- The account's country. */ - pub async fn post_refunds(&self, refund: &str) -> ClientResult { + pub async fn post_refunds( + &self, + refund: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/refunds/{}", @@ -233,7 +252,10 @@ impl Refunds { * * * `refund: &str` -- The account's country. */ - pub async fn post_cancel(&self, refund: &str) -> ClientResult { + pub async fn post_cancel( + &self, + refund: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/refunds/{}/cancel", diff --git a/stripe/src/reporting.rs b/stripe/src/reporting.rs index 0b73c89e..946fd748 100644 --- a/stripe/src/reporting.rs +++ b/stripe/src/reporting.rs @@ -30,7 +30,7 @@ impl Reporting { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -45,7 +45,7 @@ impl Reporting { let url = self .client .url(&format!("/v1/reporting/report_runs?{}", query_), None); - let resp: crate::types::GetReportingReportRunsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -57,7 +57,11 @@ impl Reporting { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/reporting/report_runs` endpoint. @@ -69,9 +73,13 @@ impl Reporting { pub async fn get_all_report_runs( &self, _created: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/v1/reporting/report_runs", None); - let mut resp: crate::types::GetReportingReportRunsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -82,8 +90,8 @@ impl Reporting { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -99,7 +107,11 @@ impl Reporting { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -110,7 +122,11 @@ impl Reporting { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -122,20 +138,22 @@ impl Reporting { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/reporting/report_runs` endpoint. * *

Creates a new object and begin running the report. (Certain report types require a live-mode API key.)

*/ - pub async fn post_report_run(&self) -> ClientResult { + pub async fn post_report_run( + &self, + ) -> ClientResult> { let url = self.client.url("/v1/reporting/report_runs", None); self.client .post( @@ -160,7 +178,7 @@ impl Reporting { pub async fn get_report_runs_run( &self, report_run: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/reporting/report_runs/{}", @@ -187,9 +205,11 @@ impl Reporting { * * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. */ - pub async fn get_report_types(&self) -> ClientResult> { + pub async fn get_report_types( + &self, + ) -> ClientResult>> { let url = self.client.url("/v1/reporting/report_types", None); - let resp: crate::types::FinancialReportingFinanceReportTypeList = self + let resp: crate::Response = self .client .get( &url, @@ -201,7 +221,11 @@ impl Reporting { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/reporting/report_types` endpoint. @@ -212,9 +236,13 @@ impl Reporting { */ pub async fn get_all_report_types( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/v1/reporting/report_types", None); - let mut resp: crate::types::FinancialReportingFinanceReportTypeList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -225,8 +253,8 @@ impl Reporting { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -242,7 +270,11 @@ impl Reporting { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -253,7 +285,11 @@ impl Reporting { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -265,13 +301,13 @@ impl Reporting { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/reporting/report_types/{report_type}` endpoint. @@ -286,7 +322,7 @@ impl Reporting { pub async fn get_report_types_type( &self, report_type: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/reporting/report_types/{}", diff --git a/stripe/src/reviews.rs b/stripe/src/reviews.rs index 66daa2bb..2381453c 100644 --- a/stripe/src/reviews.rs +++ b/stripe/src/reviews.rs @@ -30,7 +30,7 @@ impl Reviews { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -43,7 +43,7 @@ impl Reviews { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/reviews?{}", query_), None); - let resp: crate::types::GetReviewsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -55,7 +55,11 @@ impl Reviews { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/reviews` endpoint. @@ -64,9 +68,16 @@ impl Reviews { * *

Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first.

*/ - pub async fn get_all(&self, _created: &str) -> ClientResult> { + pub async fn get_all( + &self, + _created: &str, + ) -> ClientResult>> { let url = self.client.url("/v1/reviews", None); - let mut resp: crate::types::GetReviewsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -77,8 +88,8 @@ impl Reviews { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -94,7 +105,11 @@ impl Reviews { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -105,7 +120,11 @@ impl Reviews { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -117,13 +136,13 @@ impl Reviews { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/reviews/{review}` endpoint. @@ -135,7 +154,7 @@ impl Reviews { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `review: &str` -- The account's country. */ - pub async fn get(&self, review: &str) -> ClientResult { + pub async fn get(&self, review: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/reviews/{}", @@ -162,7 +181,10 @@ impl Reviews { * * * `review: &str` -- The account's country. */ - pub async fn post_approve(&self, review: &str) -> ClientResult { + pub async fn post_approve( + &self, + review: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/reviews/{}/approve", diff --git a/stripe/src/setup_attempts.rs b/stripe/src/setup_attempts.rs index bdb4d0db..a6762756 100644 --- a/stripe/src/setup_attempts.rs +++ b/stripe/src/setup_attempts.rs @@ -35,7 +35,7 @@ impl SetupAttempts { limit: i64, setup_intent: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -53,7 +53,7 @@ impl SetupAttempts { let url = self .client .url(&format!("/v1/setup_attempts?{}", query_), None); - let resp: crate::types::PaymentFlowsSetupIntentAttemptList = self + let resp: crate::Response = self .client .get( &url, @@ -65,7 +65,11 @@ impl SetupAttempts { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/setup_attempts` endpoint. @@ -78,7 +82,7 @@ impl SetupAttempts { &self, _created: &str, setup_intent: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !setup_intent.is_empty() { query_args.push(("setup_intent".to_string(), setup_intent.to_string())); @@ -87,7 +91,11 @@ impl SetupAttempts { let url = self .client .url(&format!("/v1/setup_attempts?{}", query_), None); - let mut resp: crate::types::PaymentFlowsSetupIntentAttemptList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -98,8 +106,8 @@ impl SetupAttempts { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -115,7 +123,11 @@ impl SetupAttempts { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -126,7 +138,11 @@ impl SetupAttempts { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -138,12 +154,12 @@ impl SetupAttempts { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } } diff --git a/stripe/src/setup_intents.rs b/stripe/src/setup_intents.rs index 2eda5070..90cfc245 100644 --- a/stripe/src/setup_intents.rs +++ b/stripe/src/setup_intents.rs @@ -34,7 +34,7 @@ impl SetupIntents { limit: i64, payment_method: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -55,7 +55,7 @@ impl SetupIntents { let url = self .client .url(&format!("/v1/setup_intents?{}", query_), None); - let resp: crate::types::PaymentFlowsSetupIntentList = self + let resp: crate::Response = self .client .get( &url, @@ -67,7 +67,11 @@ impl SetupIntents { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/setup_intents` endpoint. @@ -81,7 +85,7 @@ impl SetupIntents { _created: &str, customer: &str, payment_method: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -93,7 +97,11 @@ impl SetupIntents { let url = self .client .url(&format!("/v1/setup_intents?{}", query_), None); - let mut resp: crate::types::PaymentFlowsSetupIntentList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -104,8 +112,8 @@ impl SetupIntents { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -121,7 +129,11 @@ impl SetupIntents { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -132,7 +144,11 @@ impl SetupIntents { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -144,13 +160,13 @@ impl SetupIntents { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/setup_intents` endpoint. @@ -160,7 +176,7 @@ impl SetupIntents { *

After the SetupIntent is created, attach a payment method and confirm * to collect any required permissions to charge the payment method later.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/setup_intents", None); self.client .post( @@ -191,7 +207,7 @@ impl SetupIntents { &self, client_secret: &str, intent: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !client_secret.is_empty() { query_args.push(("client_secret".to_string(), client_secret.to_string())); @@ -224,7 +240,10 @@ impl SetupIntents { * * * `intent: &str` -- The account's country. */ - pub async fn post_intent(&self, intent: &str) -> ClientResult { + pub async fn post_intent( + &self, + intent: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/setup_intents/{}", @@ -256,7 +275,7 @@ impl SetupIntents { pub async fn post_intent_cancel( &self, intent: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/setup_intents/{}/cancel", @@ -298,7 +317,7 @@ impl SetupIntents { pub async fn post_intent_confirm( &self, intent: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/setup_intents/{}/confirm", @@ -328,7 +347,7 @@ impl SetupIntents { pub async fn post_intent_verify_microdeposit( &self, intent: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/setup_intents/{}/verify_microdeposits", diff --git a/stripe/src/shipping_rates.rs b/stripe/src/shipping_rates.rs index 0a4d0425..f3f49af7 100644 --- a/stripe/src/shipping_rates.rs +++ b/stripe/src/shipping_rates.rs @@ -34,7 +34,7 @@ impl ShippingRates { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -55,7 +55,7 @@ impl ShippingRates { let url = self .client .url(&format!("/v1/shipping_rates?{}", query_), None); - let resp: crate::types::ShippingResourcesRateList = self + let resp: crate::Response = self .client .get( &url, @@ -67,7 +67,11 @@ impl ShippingRates { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/shipping_rates` endpoint. @@ -81,7 +85,7 @@ impl ShippingRates { active: bool, _created: &str, currency: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -93,7 +97,11 @@ impl ShippingRates { let url = self .client .url(&format!("/v1/shipping_rates?{}", query_), None); - let mut resp: crate::types::ShippingResourcesRateList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -104,8 +112,8 @@ impl ShippingRates { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -121,7 +129,11 @@ impl ShippingRates { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -132,7 +144,11 @@ impl ShippingRates { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -144,20 +160,20 @@ impl ShippingRates { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/shipping_rates` endpoint. * *

Creates a new shipping rate object.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/shipping_rates", None); self.client .post( @@ -182,7 +198,7 @@ impl ShippingRates { pub async fn get_rate_token( &self, shipping_rate_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/shipping_rates/{}", @@ -212,7 +228,7 @@ impl ShippingRates { pub async fn post_rate_token( &self, shipping_rate_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/shipping_rates/{}", diff --git a/stripe/src/sigma.rs b/stripe/src/sigma.rs index 37a92944..f0d456c2 100644 --- a/stripe/src/sigma.rs +++ b/stripe/src/sigma.rs @@ -28,7 +28,7 @@ impl Sigma { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -43,7 +43,7 @@ impl Sigma { let url = self .client .url(&format!("/v1/sigma/scheduled_query_runs?{}", query_), None); - let resp: crate::types::GetSigmaScheduledQueryRunsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -55,7 +55,11 @@ impl Sigma { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/sigma/scheduled_query_runs` endpoint. @@ -66,9 +70,13 @@ impl Sigma { */ pub async fn get_all_scheduled_query_runs( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/v1/sigma/scheduled_query_runs", None); - let mut resp: crate::types::GetSigmaScheduledQueryRunsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -79,8 +87,8 @@ impl Sigma { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -96,7 +104,11 @@ impl Sigma { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -107,7 +119,11 @@ impl Sigma { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -119,13 +135,13 @@ impl Sigma { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/sigma/scheduled_query_runs/{scheduled_query_run}` endpoint. @@ -140,7 +156,7 @@ impl Sigma { pub async fn get_scheduled_query_runs_run( &self, scheduled_query_run: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/sigma/scheduled_query_runs/{}", diff --git a/stripe/src/skus.rs b/stripe/src/skus.rs index 4abebf86..8725454d 100644 --- a/stripe/src/skus.rs +++ b/stripe/src/skus.rs @@ -38,7 +38,7 @@ impl Skus { limit: i64, product: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -60,7 +60,7 @@ impl Skus { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/skus?{}", query_), None); - let resp: crate::types::GetSkusResponse = self + let resp: crate::Response = self .client .get( &url, @@ -72,7 +72,11 @@ impl Skus { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/skus` endpoint. @@ -88,7 +92,7 @@ impl Skus { _ids: &[String], in_stock: bool, product: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -101,7 +105,11 @@ impl Skus { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/skus?{}", query_), None); - let mut resp: crate::types::GetSkusResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -112,8 +120,8 @@ impl Skus { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -129,7 +137,11 @@ impl Skus { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -140,7 +152,11 @@ impl Skus { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -152,20 +168,20 @@ impl Skus { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/skus` endpoint. * *

Creates a new SKU associated with a product.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/skus", None); self.client .post( @@ -187,7 +203,10 @@ impl Skus { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `id: &str` -- The account's country. */ - pub async fn get(&self, id: &str) -> ClientResult { + pub async fn get( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!("/v1/skus/{}", crate::progenitor_support::encode_path(id),), None, @@ -213,7 +232,7 @@ impl Skus { * * * `id: &str` -- The account's country. */ - pub async fn post_skus(&self, id: &str) -> ClientResult { + pub async fn post_skus(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!("/v1/skus/{}", crate::progenitor_support::encode_path(id),), None, @@ -237,7 +256,10 @@ impl Skus { * * * `id: &str` -- The account's country. */ - pub async fn delete(&self, id: &str) -> ClientResult { + pub async fn delete( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!("/v1/skus/{}", crate::progenitor_support::encode_path(id),), None, diff --git a/stripe/src/sources.rs b/stripe/src/sources.rs index 38109cd1..c479d632 100644 --- a/stripe/src/sources.rs +++ b/stripe/src/sources.rs @@ -16,7 +16,7 @@ impl Sources { * *

Creates a new source object.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/sources", None); self.client .post( @@ -43,7 +43,7 @@ impl Sources { &self, client_secret: &str, source: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !client_secret.is_empty() { query_args.push(("client_secret".to_string(), client_secret.to_string())); @@ -78,7 +78,10 @@ impl Sources { * * * `source: &str` -- The account's country. */ - pub async fn post_sources(&self, source: &str) -> ClientResult { + pub async fn post_sources( + &self, + source: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/sources/{}", @@ -111,7 +114,7 @@ impl Sources { &self, mandate_notification: &str, source: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/sources/{}/mandate_notifications/{}", @@ -149,7 +152,7 @@ impl Sources { limit: i64, source: &str, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -169,7 +172,7 @@ impl Sources { ), None, ); - let resp: crate::types::ApmsSourcesSourceTransactionList = self + let resp: crate::Response = self .client .get( &url, @@ -181,7 +184,11 @@ impl Sources { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/sources/{source}/source_transactions` endpoint. @@ -193,7 +200,7 @@ impl Sources { pub async fn get_all_transactions( &self, source: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/sources/{}/source_transactions", @@ -201,7 +208,11 @@ impl Sources { ), None, ); - let mut resp: crate::types::ApmsSourcesSourceTransactionList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -212,8 +223,8 @@ impl Sources { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -229,7 +240,11 @@ impl Sources { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -240,7 +255,11 @@ impl Sources { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -252,13 +271,13 @@ impl Sources { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/sources/{source}/source_transactions/{source_transaction}` endpoint. @@ -275,7 +294,7 @@ impl Sources { &self, source: &str, source_transaction: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/sources/{}/source_transactions/{}", @@ -303,7 +322,10 @@ impl Sources { * * * `source: &str` -- The account's country. */ - pub async fn post_verify(&self, source: &str) -> ClientResult { + pub async fn post_verify( + &self, + source: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/sources/{}/verify", diff --git a/stripe/src/subscription_items.rs b/stripe/src/subscription_items.rs index 4eb1736a..e84f383d 100644 --- a/stripe/src/subscription_items.rs +++ b/stripe/src/subscription_items.rs @@ -30,7 +30,7 @@ impl SubscriptionItems { limit: i64, starting_after: &str, subscription: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -48,7 +48,7 @@ impl SubscriptionItems { let url = self .client .url(&format!("/v1/subscription_items?{}", query_), None); - let resp: crate::types::Items = self + let resp: crate::Response = self .client .get( &url, @@ -60,7 +60,11 @@ impl SubscriptionItems { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/subscription_items` endpoint. @@ -72,7 +76,7 @@ impl SubscriptionItems { pub async fn get_all( &self, subscription: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !subscription.is_empty() { query_args.push(("subscription".to_string(), subscription.to_string())); @@ -81,7 +85,11 @@ impl SubscriptionItems { let url = self .client .url(&format!("/v1/subscription_items?{}", query_), None); - let mut resp: crate::types::Items = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -92,8 +100,8 @@ impl SubscriptionItems { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -109,7 +117,11 @@ impl SubscriptionItems { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -120,7 +132,11 @@ impl SubscriptionItems { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -132,20 +148,20 @@ impl SubscriptionItems { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/subscription_items` endpoint. * *

Adds a new item to an existing subscription. No existing items will be changed or replaced.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/subscription_items", None); self.client .post( @@ -167,7 +183,10 @@ impl SubscriptionItems { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `item: &str` -- The account's country. */ - pub async fn get_item(&self, item: &str) -> ClientResult { + pub async fn get_item( + &self, + item: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/subscription_items/{}", @@ -194,7 +213,10 @@ impl SubscriptionItems { * * * `item: &str` -- The account's country. */ - pub async fn post_item(&self, item: &str) -> ClientResult { + pub async fn post_item( + &self, + item: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/subscription_items/{}", @@ -224,7 +246,7 @@ impl SubscriptionItems { pub async fn delete_item( &self, item: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/subscription_items/{}", @@ -263,7 +285,7 @@ impl SubscriptionItems { limit: i64, starting_after: &str, subscription_item: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -283,7 +305,9 @@ impl SubscriptionItems { ), None, ); - let resp: crate::types::GetSubscriptionItemsItemUsageRecordSummariesResponse = self + let resp: crate::Response< + crate::types::GetSubscriptionItemsItemUsageRecordSummariesResponse, + > = self .client .get( &url, @@ -295,7 +319,11 @@ impl SubscriptionItems { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/subscription_items/{subscription_item}/usage_record_summaries` endpoint. @@ -309,7 +337,7 @@ impl SubscriptionItems { pub async fn get_all_item_usage_record_summaries( &self, subscription_item: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/subscription_items/{}/usage_record_summaries", @@ -317,7 +345,11 @@ impl SubscriptionItems { ), None, ); - let mut resp: crate::types::GetSubscriptionItemsItemUsageRecordSummariesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -328,8 +360,8 @@ impl SubscriptionItems { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -345,7 +377,13 @@ impl SubscriptionItems { } if !url.contains('?') { - resp = self + crate::Response::< + crate::types::GetSubscriptionItemsItemUsageRecordSummariesResponse, + > { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -356,7 +394,13 @@ impl SubscriptionItems { ) .await?; } else { - resp = self + crate::Response::< + crate::types::GetSubscriptionItemsItemUsageRecordSummariesResponse, + > { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -368,13 +412,13 @@ impl SubscriptionItems { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/subscription_items/{subscription_item}/usage_records` endpoint. @@ -394,7 +438,7 @@ impl SubscriptionItems { pub async fn post_item_usage_record( &self, subscription_item: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/subscription_items/{}/usage_records", diff --git a/stripe/src/subscription_schedules.rs b/stripe/src/subscription_schedules.rs index 35befbee..1bc6e64e 100644 --- a/stripe/src/subscription_schedules.rs +++ b/stripe/src/subscription_schedules.rs @@ -40,7 +40,7 @@ impl SubscriptionSchedules { _released_at: &str, scheduled: bool, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -61,7 +61,7 @@ impl SubscriptionSchedules { let url = self .client .url(&format!("/v1/subscription_schedules?{}", query_), None); - let resp: crate::types::GetSubscriptionSchedulesResponse = self + let resp: crate::Response = self .client .get( &url, @@ -73,7 +73,11 @@ impl SubscriptionSchedules { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/subscription_schedules` endpoint. @@ -90,7 +94,7 @@ impl SubscriptionSchedules { customer: &str, _released_at: &str, scheduled: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !customer.is_empty() { query_args.push(("customer".to_string(), customer.to_string())); @@ -102,7 +106,11 @@ impl SubscriptionSchedules { let url = self .client .url(&format!("/v1/subscription_schedules?{}", query_), None); - let mut resp: crate::types::GetSubscriptionSchedulesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -113,8 +121,8 @@ impl SubscriptionSchedules { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -130,7 +138,11 @@ impl SubscriptionSchedules { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -141,7 +153,11 @@ impl SubscriptionSchedules { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -153,20 +169,20 @@ impl SubscriptionSchedules { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/subscription_schedules` endpoint. * *

Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/subscription_schedules", None); self.client .post( @@ -191,7 +207,7 @@ impl SubscriptionSchedules { pub async fn get_schedule( &self, schedule: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/subscription_schedules/{}", @@ -221,7 +237,7 @@ impl SubscriptionSchedules { pub async fn post_schedule( &self, schedule: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/subscription_schedules/{}", @@ -251,7 +267,7 @@ impl SubscriptionSchedules { pub async fn post_schedule_cancel( &self, schedule: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/subscription_schedules/{}/cancel", @@ -281,7 +297,7 @@ impl SubscriptionSchedules { pub async fn post_schedule_release( &self, schedule: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/subscription_schedules/{}/release", diff --git a/stripe/src/subscriptions.rs b/stripe/src/subscriptions.rs index 37aebd1d..78a77f8d 100644 --- a/stripe/src/subscriptions.rs +++ b/stripe/src/subscriptions.rs @@ -44,7 +44,7 @@ impl Subscriptions { starting_after: &str, status: crate::types::GetSubscriptionsStatus, test_clock: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_method.to_string().is_empty() { query_args.push(( @@ -77,7 +77,7 @@ impl Subscriptions { let url = self .client .url(&format!("/v1/subscriptions?{}", query_), None); - let resp: crate::types::Subscriptions = self + let resp: crate::Response = self .client .get( &url, @@ -89,7 +89,11 @@ impl Subscriptions { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/subscriptions` endpoint. @@ -108,7 +112,7 @@ impl Subscriptions { price: &str, status: crate::types::GetSubscriptionsStatus, test_clock: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !collection_method.to_string().is_empty() { query_args.push(( @@ -132,7 +136,11 @@ impl Subscriptions { let url = self .client .url(&format!("/v1/subscriptions?{}", query_), None); - let mut resp: crate::types::Subscriptions = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -143,8 +151,8 @@ impl Subscriptions { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -160,7 +168,11 @@ impl Subscriptions { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -171,7 +183,11 @@ impl Subscriptions { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -183,13 +199,13 @@ impl Subscriptions { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/subscriptions` endpoint. @@ -202,7 +218,7 @@ impl Subscriptions { *

To start subscriptions where the first invoice always begins in a draft status, use subscription schedules instead. * Schedules provide the flexibility to model more complex billing configurations that change over time.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/subscriptions", None); self.client .post( @@ -234,7 +250,7 @@ impl Subscriptions { limit: i64, page: &str, query: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if limit > 0 { query_args.push(("limit".to_string(), limit.to_string())); @@ -249,7 +265,7 @@ impl Subscriptions { let url = self .client .url(&format!("/v1/subscriptions/search?{}", query_), None); - let resp: crate::types::SearchResult = self + let resp: crate::Response = self .client .get( &url, @@ -261,7 +277,11 @@ impl Subscriptions { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/subscriptions/search` endpoint. @@ -273,7 +293,10 @@ impl Subscriptions { * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up * to an hour behind during outages. Search functionality is not available to merchants in India.

*/ - pub async fn get_all_search(&self, query: &str) -> ClientResult> { + pub async fn get_all_search( + &self, + query: &str, + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !query.is_empty() { query_args.push(("query".to_string(), query.to_string())); @@ -282,7 +305,11 @@ impl Subscriptions { let url = self .client .url(&format!("/v1/subscriptions/search?{}", query_), None); - let mut resp: crate::types::SearchResult = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -293,8 +320,8 @@ impl Subscriptions { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -310,7 +337,11 @@ impl Subscriptions { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -321,7 +352,11 @@ impl Subscriptions { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -333,13 +368,13 @@ impl Subscriptions { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/subscriptions/{subscription_exposed_id}` endpoint. @@ -354,7 +389,7 @@ impl Subscriptions { pub async fn get_exposed( &self, subscription_exposed_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/subscriptions/{}", @@ -384,7 +419,7 @@ impl Subscriptions { pub async fn post_exposed( &self, subscription_exposed_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/subscriptions/{}", @@ -418,7 +453,7 @@ impl Subscriptions { pub async fn delete_exposed( &self, subscription_exposed_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/subscriptions/{}", @@ -448,7 +483,7 @@ impl Subscriptions { pub async fn delete_exposed_discount( &self, subscription_exposed_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/subscriptions/{}/discount", diff --git a/stripe/src/tax_codes.rs b/stripe/src/tax_codes.rs index 795572fd..149a9202 100644 --- a/stripe/src/tax_codes.rs +++ b/stripe/src/tax_codes.rs @@ -28,7 +28,7 @@ impl TaxCodes { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -41,7 +41,7 @@ impl TaxCodes { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/tax_codes?{}", query_), None); - let resp: crate::types::TaxProductResourceCodeList = self + let resp: crate::Response = self .client .get( &url, @@ -53,7 +53,11 @@ impl TaxCodes { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/tax_codes` endpoint. @@ -62,9 +66,13 @@ impl TaxCodes { * *

A list of all tax codes available to add to Products in order to allow specific tax calculations.

*/ - pub async fn get_all(&self) -> ClientResult> { + pub async fn get_all(&self) -> ClientResult>> { let url = self.client.url("/v1/tax_codes", None); - let mut resp: crate::types::TaxProductResourceCodeList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -75,8 +83,8 @@ impl TaxCodes { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -92,7 +100,11 @@ impl TaxCodes { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -103,7 +115,11 @@ impl TaxCodes { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -115,13 +131,13 @@ impl TaxCodes { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `GET` to the `/v1/tax_codes/{id}` endpoint. @@ -133,7 +149,7 @@ impl TaxCodes { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `id: &str` -- The account's country. */ - pub async fn get(&self, id: &str) -> ClientResult { + pub async fn get(&self, id: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/tax_codes/{}", diff --git a/stripe/src/tax_rates.rs b/stripe/src/tax_rates.rs index 5b35d7ee..bf65780e 100644 --- a/stripe/src/tax_rates.rs +++ b/stripe/src/tax_rates.rs @@ -34,7 +34,7 @@ impl TaxRates { inclusive: bool, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -53,7 +53,7 @@ impl TaxRates { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/tax_rates?{}", query_), None); - let resp: crate::types::GetTaxRatesResponse = self + let resp: crate::Response = self .client .get( &url, @@ -65,7 +65,11 @@ impl TaxRates { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/tax_rates` endpoint. @@ -79,7 +83,7 @@ impl TaxRates { active: bool, _created: &str, inclusive: bool, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if active { query_args.push(("active".to_string(), active.to_string())); @@ -89,7 +93,11 @@ impl TaxRates { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/tax_rates?{}", query_), None); - let mut resp: crate::types::GetTaxRatesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -100,8 +108,8 @@ impl TaxRates { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -117,7 +125,11 @@ impl TaxRates { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -128,7 +140,11 @@ impl TaxRates { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -140,20 +156,20 @@ impl TaxRates { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/tax_rates` endpoint. * *

Creates a new tax rate.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/tax_rates", None); self.client .post( @@ -175,7 +191,10 @@ impl TaxRates { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `tax_rate: &str` -- The account's country. */ - pub async fn get_rate(&self, tax_rate: &str) -> ClientResult { + pub async fn get_rate( + &self, + tax_rate: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/tax_rates/{}", @@ -202,7 +221,10 @@ impl TaxRates { * * * `tax_rate: &str` -- The account's country. */ - pub async fn post_rate(&self, tax_rate: &str) -> ClientResult { + pub async fn post_rate( + &self, + tax_rate: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/tax_rates/{}", diff --git a/stripe/src/terminal.rs b/stripe/src/terminal.rs index dce3dc44..824452cc 100644 --- a/stripe/src/terminal.rs +++ b/stripe/src/terminal.rs @@ -18,7 +18,7 @@ impl Terminal { */ pub async fn post_connection_token( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/v1/terminal/connection_tokens", None); self.client .post( @@ -47,7 +47,7 @@ impl Terminal { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -62,7 +62,7 @@ impl Terminal { let url = self .client .url(&format!("/v1/terminal/locations?{}", query_), None); - let resp: crate::types::TerminalLocationList = self + let resp: crate::Response = self .client .get( &url, @@ -74,7 +74,11 @@ impl Terminal { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/terminal/locations` endpoint. @@ -83,9 +87,15 @@ impl Terminal { * *

Returns a list of Location objects.

*/ - pub async fn get_all_locations(&self) -> ClientResult> { + pub async fn get_all_locations( + &self, + ) -> ClientResult>> { let url = self.client.url("/v1/terminal/locations", None); - let mut resp: crate::types::TerminalLocationList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -96,8 +106,8 @@ impl Terminal { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -113,7 +123,11 @@ impl Terminal { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -124,7 +138,11 @@ impl Terminal { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -136,13 +154,13 @@ impl Terminal { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/terminal/locations` endpoint. @@ -150,7 +168,9 @@ impl Terminal { *

Creates a new Location object. * For further details, including which address fields are required in each country, see the Manage locations guide.

*/ - pub async fn post_location(&self) -> ClientResult { + pub async fn post_location( + &self, + ) -> ClientResult> { let url = self.client.url("/v1/terminal/locations", None); self.client .post( @@ -175,7 +195,7 @@ impl Terminal { pub async fn get_locations_location( &self, location: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/terminal/locations/{}", @@ -205,7 +225,7 @@ impl Terminal { pub async fn post_locations_location( &self, location: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/terminal/locations/{}", @@ -235,7 +255,7 @@ impl Terminal { pub async fn delete_locations_location( &self, location: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/terminal/locations/{}", @@ -276,7 +296,7 @@ impl Terminal { location: &str, starting_after: &str, status: crate::types::CustomerAcceptanceType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !device_type.to_string().is_empty() { query_args.push(("device_type".to_string(), device_type.to_string())); @@ -300,7 +320,7 @@ impl Terminal { let url = self .client .url(&format!("/v1/terminal/readers?{}", query_), None); - let resp: crate::types::TerminalReaderRetrieve = self + let resp: crate::Response = self .client .get( &url, @@ -312,7 +332,11 @@ impl Terminal { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/terminal/readers` endpoint. @@ -326,7 +350,7 @@ impl Terminal { device_type: crate::types::DeviceType, location: &str, status: crate::types::CustomerAcceptanceType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !device_type.to_string().is_empty() { query_args.push(("device_type".to_string(), device_type.to_string())); @@ -341,7 +365,11 @@ impl Terminal { let url = self .client .url(&format!("/v1/terminal/readers?{}", query_), None); - let mut resp: crate::types::TerminalReaderRetrieve = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -352,8 +380,8 @@ impl Terminal { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -369,7 +397,11 @@ impl Terminal { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -380,7 +412,11 @@ impl Terminal { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -392,20 +428,20 @@ impl Terminal { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/terminal/readers` endpoint. * *

Creates a new Reader object.

*/ - pub async fn post_reader(&self) -> ClientResult { + pub async fn post_reader(&self) -> ClientResult> { let url = self.client.url("/v1/terminal/readers", None); self.client .post( @@ -430,7 +466,7 @@ impl Terminal { pub async fn get_readers_reader( &self, reader: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/terminal/readers/{}", @@ -460,7 +496,7 @@ impl Terminal { pub async fn post_readers_reader( &self, reader: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/terminal/readers/{}", @@ -490,7 +526,7 @@ impl Terminal { pub async fn delete_readers_reader( &self, reader: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/terminal/readers/{}", @@ -520,7 +556,7 @@ impl Terminal { pub async fn post_readers_reader_cancel_action( &self, reader: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/terminal/readers/{}/cancel_action", @@ -550,7 +586,7 @@ impl Terminal { pub async fn post_readers_reader_process_payment_intent( &self, reader: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/terminal/readers/{}/process_payment_intent", @@ -580,7 +616,7 @@ impl Terminal { pub async fn post_readers_reader_process_setup_intent( &self, reader: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/terminal/readers/{}/process_setup_intent", @@ -610,7 +646,7 @@ impl Terminal { pub async fn post_readers_reader_set_display( &self, reader: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/terminal/readers/{}/set_reader_display", diff --git a/stripe/src/test_helpers.rs b/stripe/src/test_helpers.rs index 97365a43..4b764844 100644 --- a/stripe/src/test_helpers.rs +++ b/stripe/src/test_helpers.rs @@ -23,7 +23,7 @@ impl TestHelpers { pub async fn post_terminal_readers_reader_present_payment_method( &self, reader: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/test_helpers/terminal/readers/{}/present_payment_method", @@ -58,7 +58,7 @@ impl TestHelpers { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -73,7 +73,7 @@ impl TestHelpers { let url = self .client .url(&format!("/v1/test_helpers/test_clocks?{}", query_), None); - let resp: crate::types::GetTestHelpersClocksResponse = self + let resp: crate::Response = self .client .get( &url, @@ -85,7 +85,11 @@ impl TestHelpers { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/test_helpers/test_clocks` endpoint. @@ -94,9 +98,15 @@ impl TestHelpers { * *

Returns a list of your test clocks.

*/ - pub async fn get_all_clocks(&self) -> ClientResult> { + pub async fn get_all_clocks( + &self, + ) -> ClientResult>> { let url = self.client.url("/v1/test_helpers/test_clocks", None); - let mut resp: crate::types::GetTestHelpersClocksResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -107,8 +117,8 @@ impl TestHelpers { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -124,7 +134,11 @@ impl TestHelpers { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -135,7 +149,11 @@ impl TestHelpers { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -147,20 +165,20 @@ impl TestHelpers { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/test_helpers/test_clocks` endpoint. * *

Creates a new test clock that can be attached to new customers and quotes.

*/ - pub async fn post_clock(&self) -> ClientResult { + pub async fn post_clock(&self) -> ClientResult> { let url = self.client.url("/v1/test_helpers/test_clocks", None); self.client .post( @@ -185,7 +203,7 @@ impl TestHelpers { pub async fn get_clocks_clock( &self, test_clock: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/test_helpers/test_clocks/{}", @@ -215,7 +233,7 @@ impl TestHelpers { pub async fn delete_clocks_clock( &self, test_clock: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/test_helpers/test_clocks/{}", @@ -245,7 +263,7 @@ impl TestHelpers { pub async fn post_clocks_clock_advance( &self, test_clock: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/test_helpers/test_clocks/{}/advance", diff --git a/stripe/src/three_d_secure.rs b/stripe/src/three_d_secure.rs index d7ba1420..14b62a29 100644 --- a/stripe/src/three_d_secure.rs +++ b/stripe/src/three_d_secure.rs @@ -16,7 +16,9 @@ impl ThreeDSecure { * *

Initiate 3D Secure authentication.

*/ - pub async fn post_3d_secure(&self) -> ClientResult { + pub async fn post_3d_secure( + &self, + ) -> ClientResult> { let url = self.client.url("/v1/3d_secure", None); self.client .post( @@ -41,7 +43,7 @@ impl ThreeDSecure { pub async fn get_3d_secure_three_d( &self, three_d_secure: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/3d_secure/{}", diff --git a/stripe/src/tokens.rs b/stripe/src/tokens.rs index b2a95f08..16d61950 100644 --- a/stripe/src/tokens.rs +++ b/stripe/src/tokens.rs @@ -17,7 +17,7 @@ impl Tokens { *

Creates a single-use token that represents a bank account’s details. * This token can be used with any API method in place of a bank account dictionary. This token can be used only once, by attaching it to a Custom account.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/tokens", None); self.client .post( @@ -39,7 +39,7 @@ impl Tokens { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `token: &str` -- The account's country. */ - pub async fn get(&self, token: &str) -> ClientResult { + pub async fn get(&self, token: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/tokens/{}", diff --git a/stripe/src/topups.rs b/stripe/src/topups.rs index acf72495..ebbbb5a5 100644 --- a/stripe/src/topups.rs +++ b/stripe/src/topups.rs @@ -34,7 +34,7 @@ impl Topups { limit: i64, starting_after: &str, status: crate::types::GetTopupsStatus, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -50,7 +50,7 @@ impl Topups { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/topups?{}", query_), None); - let resp: crate::types::TopupList = self + let resp: crate::Response = self .client .get( &url, @@ -62,7 +62,11 @@ impl Topups { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/topups` endpoint. @@ -76,14 +80,18 @@ impl Topups { _amount: &str, _created: &str, status: crate::types::GetTopupsStatus, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !status.to_string().is_empty() { query_args.push(("status".to_string(), status.to_string())); } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/topups?{}", query_), None); - let mut resp: crate::types::TopupList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -94,8 +102,8 @@ impl Topups { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -111,7 +119,11 @@ impl Topups { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -122,7 +134,11 @@ impl Topups { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -134,20 +150,20 @@ impl Topups { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/topups` endpoint. * *

Top up the balance of an account

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/topups", None); self.client .post( @@ -169,7 +185,7 @@ impl Topups { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `topup: &str` -- The account's country. */ - pub async fn get(&self, topup: &str) -> ClientResult { + pub async fn get(&self, topup: &str) -> ClientResult> { let url = self.client.url( &format!( "/v1/topups/{}", @@ -196,7 +212,10 @@ impl Topups { * * * `topup: &str` -- The account's country. */ - pub async fn post_topups(&self, topup: &str) -> ClientResult { + pub async fn post_topups( + &self, + topup: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/topups/{}", @@ -223,7 +242,10 @@ impl Topups { * * * `topup: &str` -- The account's country. */ - pub async fn post_cancel(&self, topup: &str) -> ClientResult { + pub async fn post_cancel( + &self, + topup: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/topups/{}/cancel", diff --git a/stripe/src/transfers.rs b/stripe/src/transfers.rs index 8a770d21..69587dba 100644 --- a/stripe/src/transfers.rs +++ b/stripe/src/transfers.rs @@ -34,7 +34,7 @@ impl Transfers { limit: i64, starting_after: &str, transfer_group: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !destination.is_empty() { query_args.push(("destination".to_string(), destination.to_string())); @@ -53,7 +53,7 @@ impl Transfers { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/transfers?{}", query_), None); - let resp: crate::types::TransferList = self + let resp: crate::Response = self .client .get( &url, @@ -65,7 +65,11 @@ impl Transfers { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/transfers` endpoint. @@ -79,7 +83,7 @@ impl Transfers { _created: &str, destination: &str, transfer_group: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !destination.is_empty() { query_args.push(("destination".to_string(), destination.to_string())); @@ -89,7 +93,11 @@ impl Transfers { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/transfers?{}", query_), None); - let mut resp: crate::types::TransferList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -100,8 +108,8 @@ impl Transfers { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -117,7 +125,11 @@ impl Transfers { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -128,7 +140,11 @@ impl Transfers { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -140,20 +156,20 @@ impl Transfers { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/transfers` endpoint. * *

To send funds from your Stripe account to a connected account, you create a new transfer object. Your Stripe balance must be able to cover the transfer amount, or you’ll receive an “Insufficient Funds” error.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/transfers", None); self.client .post( @@ -184,7 +200,7 @@ impl Transfers { id: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -204,7 +220,7 @@ impl Transfers { ), None, ); - let resp: crate::types::Reversals = self + let resp: crate::Response = self .client .get( &url, @@ -216,7 +232,11 @@ impl Transfers { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/transfers/{id}/reversals` endpoint. @@ -228,7 +248,7 @@ impl Transfers { pub async fn get_all_reversals( &self, id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/v1/transfers/{}/reversals", @@ -236,7 +256,11 @@ impl Transfers { ), None, ); - let mut resp: crate::types::Reversals = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -247,8 +271,8 @@ impl Transfers { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -264,7 +288,11 @@ impl Transfers { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -275,7 +303,11 @@ impl Transfers { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -287,13 +319,13 @@ impl Transfers { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/transfers/{id}/reversals` endpoint. @@ -308,7 +340,10 @@ impl Transfers { * * * `id: &str` -- The account's country. */ - pub async fn post_reversal(&self, id: &str) -> ClientResult { + pub async fn post_reversal( + &self, + id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/transfers/{}/reversals", @@ -336,7 +371,10 @@ impl Transfers { * * `expand: &[String]` -- Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. * * `transfer: &str` -- The account's country. */ - pub async fn get(&self, transfer: &str) -> ClientResult { + pub async fn get( + &self, + transfer: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/transfers/{}", @@ -365,7 +403,10 @@ impl Transfers { * * * `transfer: &str` -- The account's country. */ - pub async fn post_transfers(&self, transfer: &str) -> ClientResult { + pub async fn post_transfers( + &self, + transfer: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/transfers/{}", @@ -398,7 +439,7 @@ impl Transfers { &self, id: &str, transfer: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/transfers/{}/reversals/{}", @@ -433,7 +474,7 @@ impl Transfers { &self, id: &str, transfer: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/transfers/{}/reversals/{}", diff --git a/stripe/src/webhook_endpoints.rs b/stripe/src/webhook_endpoints.rs index f25c7b34..a444d1de 100644 --- a/stripe/src/webhook_endpoints.rs +++ b/stripe/src/webhook_endpoints.rs @@ -28,7 +28,7 @@ impl WebhookEndpoints { ending_before: &str, limit: i64, starting_after: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !ending_before.is_empty() { query_args.push(("ending_before".to_string(), ending_before.to_string())); @@ -43,7 +43,7 @@ impl WebhookEndpoints { let url = self .client .url(&format!("/v1/webhook_endpoints?{}", query_), None); - let resp: crate::types::GetWebhookEndpointsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -55,7 +55,11 @@ impl WebhookEndpoints { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * This function performs a `GET` to the `/v1/webhook_endpoints` endpoint. @@ -64,9 +68,15 @@ impl WebhookEndpoints { * *

Returns a list of your webhook endpoints.

*/ - pub async fn get_all(&self) -> ClientResult> { + pub async fn get_all( + &self, + ) -> ClientResult>> { let url = self.client.url("/v1/webhook_endpoints", None); - let mut resp: crate::types::GetWebhookEndpointsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -77,8 +87,8 @@ impl WebhookEndpoints { ) .await?; - let mut data = resp.data; - let mut has_more = resp.has_more; + let mut data = body.data; + let mut has_more = body.has_more; let mut page = "".to_string(); // Paginate if we should. @@ -94,7 +104,11 @@ impl WebhookEndpoints { } if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?startng_after={}", url, page), @@ -105,7 +119,11 @@ impl WebhookEndpoints { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&starting_after={}", url, page), @@ -117,20 +135,20 @@ impl WebhookEndpoints { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - has_more = resp.has_more; + has_more = body.has_more; } // Return our response data. - Ok(data.to_vec()) + Ok(crate::Response::new(status, headers, data.to_vec())) } /** * This function performs a `POST` to the `/v1/webhook_endpoints` endpoint. * *

A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the webhooks settings section of the Dashboard.

*/ - pub async fn post(&self) -> ClientResult { + pub async fn post(&self) -> ClientResult> { let url = self.client.url("/v1/webhook_endpoints", None); self.client .post( @@ -155,7 +173,7 @@ impl WebhookEndpoints { pub async fn get_endpoint( &self, webhook_endpoint: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/webhook_endpoints/{}", @@ -185,7 +203,7 @@ impl WebhookEndpoints { pub async fn post_endpoint( &self, webhook_endpoint: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/webhook_endpoints/{}", @@ -215,7 +233,7 @@ impl WebhookEndpoints { pub async fn delete_endpoint( &self, webhook_endpoint: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/v1/webhook_endpoints/{}", diff --git a/tripactions/src/booking_data.rs b/tripactions/src/booking_data.rs index fefea9f9..14f2a966 100644 --- a/tripactions/src/booking_data.rs +++ b/tripactions/src/booking_data.rs @@ -39,7 +39,7 @@ impl BookingData { page: u64, size: i64, booking_type: crate::types::BookingType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !booking_status.to_string().is_empty() { query_args.push(("bookingStatus".to_string(), booking_status.to_string())); @@ -67,7 +67,7 @@ impl BookingData { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/bookings?{}", query_), None); - let resp: crate::types::BookingReportResponse = self + let resp: crate::Response = self .client .get( &url, @@ -79,7 +79,11 @@ impl BookingData { .await?; // Return our response data. - Ok(resp.data.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.data.to_vec(), + )) } /** * Your company's bookings. @@ -98,7 +102,7 @@ impl BookingData { start_date_to: &str, booking_status: crate::types::BookingStatus, booking_type: crate::types::BookingType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !booking_status.to_string().is_empty() { query_args.push(("bookingStatus".to_string(), booking_status.to_string())); @@ -121,7 +125,11 @@ impl BookingData { let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/v1/bookings?{}", query_), None); - let mut resp: crate::types::BookingReportResponse = if !url.contains('?') { + let crate::Response:: { + mut status, + mut headers, + mut body, + } = if !url.contains('?') { self.client .get( &format!("{}?page=0&size=100", url), @@ -143,13 +151,17 @@ impl BookingData { .await? }; - let mut data = resp.data; - let mut page = resp.page.current_page + 1; + let mut data = body.data; + let mut page = body.page.current_page + 1; // Paginate if we should. - while page <= (resp.page.total_pages - 1) { + while page <= (body.page.total_pages - 1) { if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?page={}&size=100", url, page), @@ -160,7 +172,11 @@ impl BookingData { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&page={}&size=100", url, page), @@ -172,12 +188,12 @@ impl BookingData { .await?; } - data.append(&mut resp.data); + data.append(&mut body.data); - page = resp.page.current_page + 1; + page = body.page.current_page + 1; } // Return our response data. - Ok(data) + Ok(crate::Response::new(status, headers, data)) } } diff --git a/tripactions/src/lib.rs b/tripactions/src/lib.rs index 6b418528..9035c764 100644 --- a/tripactions/src/lib.rs +++ b/tripactions/src/lib.rs @@ -87,9 +87,27 @@ pub mod types; #[doc(hidden)] pub mod utils; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -365,13 +383,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -384,7 +403,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -407,13 +426,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -434,7 +454,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -453,7 +473,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -478,6 +502,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -494,7 +519,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -519,7 +544,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -542,6 +567,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -558,7 +584,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -584,7 +610,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -627,6 +653,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -639,7 +666,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -662,7 +689,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -671,7 +698,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -679,7 +706,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -689,32 +716,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -726,7 +757,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -735,7 +766,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -743,7 +774,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -751,7 +782,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -759,7 +790,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/zoom/src/accounts.rs b/zoom/src/accounts.rs index 7e34f754..12993f91 100644 --- a/zoom/src/accounts.rs +++ b/zoom/src/accounts.rs @@ -40,7 +40,7 @@ impl Accounts { page_size: i64, page_number: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -83,7 +83,7 @@ impl Accounts { pub async fn create( &self, body: &crate::types::AccountCreateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/accounts", None); self.client .post( @@ -116,7 +116,10 @@ impl Accounts { * * * `account_id: &str` -- User's first name. */ - pub async fn account(&self, account_id: &str) -> ClientResult { + pub async fn account( + &self, + account_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}", @@ -156,7 +159,7 @@ impl Accounts { * * * `account_id: &str` -- User's first name. */ - pub async fn disassociate(&self, account_id: &str) -> ClientResult<()> { + pub async fn disassociate(&self, account_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}", @@ -199,7 +202,7 @@ impl Accounts { &self, account_id: &str, body: &crate::types::Options, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/options", @@ -250,7 +253,7 @@ impl Accounts { account_id: &str, option: crate::types::OptionData, custom_query_fields: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -313,7 +316,7 @@ impl Accounts { account_id: &str, option: crate::types::OptionData, custom_query_fields: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -376,7 +379,7 @@ impl Accounts { account_id: &str, option: crate::types::OptionData, custom_query_fields: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -439,7 +442,7 @@ impl Accounts { account_id: &str, option: crate::types::OptionData, custom_query_fields: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -502,7 +505,7 @@ impl Accounts { account_id: &str, option: crate::types::OptionData, custom_query_fields: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -554,7 +557,7 @@ impl Accounts { account_id: &str, option: crate::types::AccountSettingsUpdateOption, body: &crate::types::AccountSettingsUpdateRequestOneOf, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !option.to_string().is_empty() { query_args.push(("option".to_string(), option.to_string())); @@ -604,7 +607,7 @@ impl Accounts { pub async fn managed_domain( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/managed_domains", @@ -641,7 +644,7 @@ impl Accounts { pub async fn trusted_domain( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/trusted_domains", @@ -697,7 +700,7 @@ impl Accounts { account_id: &str, option: &str, custom_query_fields: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -748,7 +751,10 @@ impl Accounts { * * * `account_id: &str` -- Unique Identifier of the account. To retrieve locked settings of the master account or a regular account, provide "me" as the value of this field.
To retrieve locked settings of a sub account, provide the Account ID of the sub account in this field. */ - pub async fn update_lock_settings(&self, account_id: &str) -> ClientResult<()> { + pub async fn update_lock_settings( + &self, + account_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/lock_settings", @@ -789,7 +795,7 @@ impl Accounts { &self, account_id: &str, body: &crate::types::Members, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/owner", @@ -830,7 +836,7 @@ impl Accounts { &self, account_id: &str, body: &crate::types::UploadVbRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/settings/virtual_backgrounds", @@ -866,7 +872,11 @@ impl Accounts { * * * `file_ids: &str` -- Provide the id of the file that is to be deleted. To delete multiple files, provide comma separated values for this field. */ - pub async fn del_vb(&self, account_id: &str, file_ids: &str) -> ClientResult<()> { + pub async fn del_vb( + &self, + account_id: &str, + file_ids: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !file_ids.is_empty() { query_args.push(("file_ids".to_string(), file_ids.to_string())); diff --git a/zoom/src/archiving.rs b/zoom/src/archiving.rs index 7d7a7cd9..3fab5416 100644 --- a/zoom/src/archiving.rs +++ b/zoom/src/archiving.rs @@ -40,7 +40,7 @@ impl Archiving { from: &str, to: &str, query_date_type: crate::types::ListArchivedFilesQueryDateType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -59,7 +59,7 @@ impl Archiving { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/archive_files?{}", query_), None); - let resp: crate::types::ListArchivedFilesResponse = self + let resp: crate::Response = self .client .get( &url, @@ -71,7 +71,11 @@ impl Archiving { .await?; // Return our response data. - Ok(resp.meetings.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.meetings.to_vec(), + )) } /** * List archived files. @@ -94,7 +98,7 @@ impl Archiving { from: &str, to: &str, query_date_type: crate::types::ListArchivedFilesQueryDateType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -107,7 +111,11 @@ impl Archiving { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/archive_files?{}", query_), None); - let mut resp: crate::types::ListArchivedFilesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -118,14 +126,18 @@ impl Archiving { ) .await?; - let mut meetings = resp.meetings; - let mut page = resp.next_page_token; + let mut meetings = body.meetings; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -136,7 +148,11 @@ impl Archiving { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -148,17 +164,17 @@ impl Archiving { .await?; } - meetings.append(&mut resp.meetings); + meetings.append(&mut body.meetings); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(meetings) + Ok(crate::Response::new(status, headers, meetings)) } /** * Get meeting archived files. @@ -182,7 +198,7 @@ impl Archiving { pub async fn testget_record_archived_file( &self, meeting_uuid: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/past_meetings/{}/archive_files", diff --git a/zoom/src/billing.rs b/zoom/src/billing.rs index 6993b4a7..65960630 100644 --- a/zoom/src/billing.rs +++ b/zoom/src/billing.rs @@ -30,7 +30,10 @@ impl Billing { * * * `account_id: &str` -- User's first name. */ - pub async fn account(&self, account_id: &str) -> ClientResult { + pub async fn account( + &self, + account_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/billing", @@ -72,7 +75,7 @@ impl Billing { &self, account_id: &str, body: &crate::types::BillingContact, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/billing", @@ -109,7 +112,7 @@ impl Billing { pub async fn account_plans( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/plans", @@ -144,7 +147,7 @@ impl Billing { &self, account_id: &str, body: &crate::types::AccountPlanCreateRequestAllOf, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/plans", @@ -184,7 +187,7 @@ impl Billing { &self, account_id: &str, body: &crate::types::PlanBase, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/plans/base", @@ -228,7 +231,7 @@ impl Billing { &self, account_id: &str, body: &crate::types::PlanBase, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/plans/addons", @@ -267,7 +270,7 @@ impl Billing { &self, account_id: &str, body: &crate::types::AccountPlanAddonCreateRequestOneOf, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/plans/addons", @@ -308,7 +311,7 @@ impl Billing { &self, account_id: &str, body: &crate::types::AccountPlanBaseDeleteRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/plans/base/status", @@ -347,7 +350,7 @@ impl Billing { &self, account_id: &str, body: &crate::types::AccountPlanAddonCancelRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/plans/addons/status", @@ -380,7 +383,7 @@ impl Billing { pub async fn get_plan_usage( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/plans/usage", @@ -424,7 +427,7 @@ impl Billing { account_id: &str, from: chrono::NaiveDate, to: chrono::NaiveDate, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -469,7 +472,7 @@ impl Billing { &self, account_id: &str, invoice_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/billing/invoices/{}", @@ -499,7 +502,10 @@ impl Billing { * * You can make **one** request to this API every **30 minutes** until the daily limit is reached. * * This API has a daily limit of **100 requests per account**. */ - pub async fn download_invoice_pdf(&self, invoice_id: &str) -> ClientResult<()> { + pub async fn download_invoice_pdf( + &self, + invoice_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/api/download/billing/invoices/{}", diff --git a/zoom/src/chat_channels.rs b/zoom/src/chat_channels.rs index dc16a750..3c7aa87a 100644 --- a/zoom/src/chat_channels.rs +++ b/zoom/src/chat_channels.rs @@ -35,7 +35,7 @@ impl ChatChannels { user_id: &str, page_size: i64, next_page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -52,7 +52,7 @@ impl ChatChannels { ), None, ); - let resp: crate::types::GetChannelsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -64,7 +64,11 @@ impl ChatChannels { .await?; // Return our response data. - Ok(resp.channels.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.channels.to_vec(), + )) } /** * List user's channels. @@ -84,7 +88,7 @@ impl ChatChannels { pub async fn get_all_channels( &self, user_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/chat/users/{}/channels", @@ -92,7 +96,11 @@ impl ChatChannels { ), None, ); - let mut resp: crate::types::GetChannelsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -103,14 +111,18 @@ impl ChatChannels { ) .await?; - let mut channels = resp.channels; - let mut page = resp.next_page_token; + let mut channels = body.channels; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -121,7 +133,11 @@ impl ChatChannels { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -133,17 +149,17 @@ impl ChatChannels { .await?; } - channels.append(&mut resp.channels); + channels.append(&mut body.channels); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(channels) + Ok(crate::Response::new(status, headers, channels)) } /** * Create a channel. @@ -166,7 +182,7 @@ impl ChatChannels { &self, user_id: &str, body: &crate::types::CreateChannelRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/chat/users/{}/channels", @@ -206,7 +222,7 @@ impl ChatChannels { pub async fn get_user_level_channel( &self, channel_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/chat/channels/{}", @@ -243,7 +259,10 @@ impl ChatChannels { * * * `channel_id: &str` -- Channel ID: Unique Identifier of a channel. */ - pub async fn delete_user_level_channel(&self, channel_id: &str) -> ClientResult<()> { + pub async fn delete_user_level_channel( + &self, + channel_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/chat/channels/{}", @@ -283,7 +302,7 @@ impl ChatChannels { &self, channel_id: &str, body: &crate::types::Attendees, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/chat/channels/{}", @@ -324,7 +343,7 @@ impl ChatChannels { &self, channel_id: &str, member_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/chat/channels/{}/members/{}", @@ -362,7 +381,7 @@ impl ChatChannels { pub async fn join_channel( &self, channel_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/chat/channels/{}/members/me", @@ -396,7 +415,7 @@ impl ChatChannels { * * * `channel_id: &str` -- Channel ID: Unique Identifier of a channel. */ - pub async fn leave_channel(&self, channel_id: &str) -> ClientResult<()> { + pub async fn leave_channel(&self, channel_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/chat/channels/{}/members/me", diff --git a/zoom/src/chat_channels_account_level.rs b/zoom/src/chat_channels_account_level.rs index 31772216..a0a7fcd2 100644 --- a/zoom/src/chat_channels_account_level.rs +++ b/zoom/src/chat_channels_account_level.rs @@ -33,7 +33,7 @@ impl ChatChannelsAccountLevel { &self, user_id: &str, channel_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/chat/users/{}/channels/{}", @@ -69,7 +69,11 @@ impl ChatChannelsAccountLevel { * * * `channel_id: &str` -- Channel ID: Unique Identifier of a channel. */ - pub async fn delete_channel(&self, user_id: &str, channel_id: &str) -> ClientResult<()> { + pub async fn delete_channel( + &self, + user_id: &str, + channel_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/chat/users/{}/channels/{}", @@ -111,7 +115,7 @@ impl ChatChannelsAccountLevel { user_id: &str, channel_id: &str, body: &crate::types::Attendees, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/chat/users/{}/channels/{}", @@ -154,7 +158,7 @@ impl ChatChannelsAccountLevel { channel_id: &str, page_size: i64, next_page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -172,7 +176,7 @@ impl ChatChannelsAccountLevel { ), None, ); - let resp: crate::types::ListChannelMembersResponseData = self + let resp: crate::Response = self .client .get( &url, @@ -184,7 +188,11 @@ impl ChatChannelsAccountLevel { .await?; // Return our response data. - Ok(resp.members.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.members.to_vec(), + )) } /** * List channel members. @@ -203,7 +211,7 @@ impl ChatChannelsAccountLevel { &self, user_id: &str, channel_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/chat/users/{}/channels/{}/members", @@ -212,7 +220,11 @@ impl ChatChannelsAccountLevel { ), None, ); - let mut resp: crate::types::ListChannelMembersResponseData = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -223,14 +235,18 @@ impl ChatChannelsAccountLevel { ) .await?; - let mut members = resp.members; - let mut page = resp.next_page_token; + let mut members = body.members; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -241,7 +257,11 @@ impl ChatChannelsAccountLevel { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -253,17 +273,17 @@ impl ChatChannelsAccountLevel { .await?; } - members.append(&mut resp.members); + members.append(&mut body.members); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(members) + Ok(crate::Response::new(status, headers, members)) } /** * Invite channel members. @@ -286,7 +306,7 @@ impl ChatChannelsAccountLevel { user_id: &str, channel_id: &str, body: &crate::types::InviteChannelMembersRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/chat/users/{}/channels/{}/members", @@ -329,7 +349,7 @@ impl ChatChannelsAccountLevel { user_id: &str, channel_id: &str, member_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/chat/users/{}/channels/{}/members/{}", diff --git a/zoom/src/chat_messages.rs b/zoom/src/chat_messages.rs index f9eec038..5132878f 100644 --- a/zoom/src/chat_messages.rs +++ b/zoom/src/chat_messages.rs @@ -50,7 +50,7 @@ impl ChatMessages { page_size: i64, next_page_token: &str, include_deleted_and_edited_message: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !date.to_string().is_empty() { query_args.push(("date".to_string(), date.to_string())); @@ -82,7 +82,7 @@ impl ChatMessages { ), None, ); - let resp: crate::types::GetChatMessagesResponse = self + let resp: crate::Response = self .client .get( &url, @@ -94,7 +94,11 @@ impl ChatMessages { .await?; // Return our response data. - Ok(resp.messages.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.messages.to_vec(), + )) } /** * List user's chat messages. @@ -121,7 +125,7 @@ impl ChatMessages { to_channel: &str, date: chrono::NaiveDate, include_deleted_and_edited_message: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !date.to_string().is_empty() { query_args.push(("date".to_string(), date.to_string())); @@ -147,7 +151,11 @@ impl ChatMessages { ), None, ); - let mut resp: crate::types::GetChatMessagesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -158,14 +166,18 @@ impl ChatMessages { ) .await?; - let mut messages = resp.messages; - let mut page = resp.next_page_token; + let mut messages = body.messages; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -176,7 +188,11 @@ impl ChatMessages { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -188,17 +204,17 @@ impl ChatMessages { .await?; } - messages.append(&mut resp.messages); + messages.append(&mut body.messages); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(messages) + Ok(crate::Response::new(status, headers, messages)) } /** * Send a chat message. @@ -217,7 +233,7 @@ impl ChatMessages { &self, user_id: &str, body: &crate::types::SendaChatMessageRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/chat/users/{}/messages", @@ -256,7 +272,7 @@ impl ChatMessages { user_id: &str, message_id: &str, body: &crate::types::MarkMessageRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/chat/users/{}/messages/{}/status", @@ -296,7 +312,7 @@ impl ChatMessages { user_id: &str, message_id: &str, body: &crate::types::ReactMessageRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/chat/users/{}/messages/{}/emoji_reactions", @@ -342,7 +358,7 @@ impl ChatMessages { message_id: &str, to_contact: &str, to_channel: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !to_channel.is_empty() { query_args.push(("to_channel".to_string(), to_channel.to_string())); @@ -393,7 +409,7 @@ impl ChatMessages { user_id: &str, message_id: &str, body: &crate::types::EditMessageRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/chat/users/{}/messages/{}", @@ -446,7 +462,7 @@ impl ChatMessages { message_id: &str, to_contact: &str, to_channel: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !to_channel.is_empty() { query_args.push(("to_channel".to_string(), to_channel.to_string())); diff --git a/zoom/src/chatbot_messages.rs b/zoom/src/chatbot_messages.rs index ab153d69..a119b181 100644 --- a/zoom/src/chatbot_messages.rs +++ b/zoom/src/chatbot_messages.rs @@ -24,7 +24,10 @@ impl ChatbotMessages { * You will need to send your ClientID and Secret as a Basic base64 encoded AUthorization header. Ex. `Basic base64Encode({client_id}:{client_sceret})`

Next, use the token recieved (access_token) as a bearer token while making the POST /im/chat/messages request to send chatbot messages.

* Learn more about how to authorize chatbots in the [Chatbot Authorization](https://marketplace.zoom.us/docs/guides/chatbots/authorization) guide. */ - pub async fn sendchatbot(&self, body: &crate::types::SendchatbotRequest) -> ClientResult<()> { + pub async fn sendchatbot( + &self, + body: &crate::types::SendchatbotRequest, + ) -> ClientResult> { let url = self.client.url("/im/chat/messages", None); self.client .post( @@ -58,7 +61,7 @@ impl ChatbotMessages { &self, message_id: &str, body: &crate::types::EditChatbotMessageRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/im/chat/messages/{}", @@ -89,7 +92,7 @@ impl ChatbotMessages { &self, message_id: &str, body: &crate::types::DeleteChatbotMessageRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/im/chat/messages/{}", diff --git a/zoom/src/cloud_recording.rs b/zoom/src/cloud_recording.rs index 4d143ac0..15e3a024 100644 --- a/zoom/src/cloud_recording.rs +++ b/zoom/src/cloud_recording.rs @@ -53,7 +53,7 @@ impl CloudRecording { from: chrono::NaiveDate, to: chrono::NaiveDate, trash_type: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -121,7 +121,7 @@ impl CloudRecording { meeting_id: &str, include_fields: &str, ttl: u64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_fields.is_empty() { query_args.push(("include_fields".to_string(), include_fields.to_string())); @@ -174,7 +174,7 @@ impl CloudRecording { &self, meeting_id: &str, action: crate::types::RecordingDeleteAction, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !action.to_string().is_empty() { query_args.push(("action".to_string(), action.to_string())); @@ -222,7 +222,7 @@ impl CloudRecording { meeting_id: &str, recording_id: &str, action: crate::types::RecordingDeleteAction, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !action.to_string().is_empty() { query_args.push(("action".to_string(), action.to_string())); @@ -271,7 +271,7 @@ impl CloudRecording { &self, meeting_id: &str, body: &crate::types::RecordingStatusUpdateBodyRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/recordings/status", @@ -314,7 +314,7 @@ impl CloudRecording { meeting_id: &str, recording_id: &str, body: &crate::types::RecordingStatusUpdateBodyRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/recordings/{}/status", @@ -354,7 +354,7 @@ impl CloudRecording { pub async fn recording_setting_update( &self, meeting_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/recordings/settings", @@ -394,7 +394,7 @@ impl CloudRecording { &self, meeting_id: &str, body: &crate::types::RecordingSettings, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/recordings/settings", @@ -445,7 +445,7 @@ impl CloudRecording { page_size: i64, page_number: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -501,7 +501,7 @@ impl CloudRecording { pub async fn meeting_recording_registrant_create( &self, meeting_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/recordings/registrants", @@ -542,7 +542,7 @@ impl CloudRecording { &self, meeting_id: i64, body: &crate::types::RecordingRegistrantStatus, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/recordings/registrants/status", @@ -584,7 +584,7 @@ impl CloudRecording { pub async fn recording_registrants_questions_get( &self, meeting_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/recordings/registrants/questions", @@ -626,7 +626,7 @@ impl CloudRecording { &self, meeting_id: &str, body: &crate::types::RecordingRegistrantQuestionsData, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/recordings/registrants/questions", @@ -677,7 +677,8 @@ impl CloudRecording { next_page_token: &str, from: Option>, to: Option>, - ) -> ClientResult> { + ) -> ClientResult>> + { let mut query_args: Vec<(String, String)> = Default::default(); if let Some(date) = from { query_args.push(("from".to_string(), date.to_rfc3339())); @@ -700,7 +701,7 @@ impl CloudRecording { ), None, ); - let resp: crate::types::GetAccountCloudRecordingResponse = self + let resp: crate::Response = self .client .get( &url, @@ -712,7 +713,11 @@ impl CloudRecording { .await?; // Return our response data. - Ok(resp.meetings.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.meetings.to_vec(), + )) } /** * List recordings of an account. @@ -739,7 +744,8 @@ impl CloudRecording { account_id: &str, from: Option>, to: Option>, - ) -> ClientResult> { + ) -> ClientResult>> + { let mut query_args: Vec<(String, String)> = Default::default(); if let Some(date) = from { query_args.push(("from".to_string(), date.to_rfc3339())); @@ -756,7 +762,11 @@ impl CloudRecording { ), None, ); - let mut resp: crate::types::GetAccountCloudRecordingResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -767,14 +777,18 @@ impl CloudRecording { ) .await?; - let mut meetings = resp.meetings; - let mut page = resp.next_page_token; + let mut meetings = body.meetings; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -785,7 +799,11 @@ impl CloudRecording { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -797,16 +815,16 @@ impl CloudRecording { .await?; } - meetings.append(&mut resp.meetings); + meetings.append(&mut body.meetings); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(meetings) + Ok(crate::Response::new(status, headers, meetings)) } } diff --git a/zoom/src/common_area_phones.rs b/zoom/src/common_area_phones.rs index ec6f22fa..bd01e2b2 100644 --- a/zoom/src/common_area_phones.rs +++ b/zoom/src/common_area_phones.rs @@ -37,7 +37,7 @@ impl CommonAreaPhones { &self, page_size: i64, next_page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -49,7 +49,7 @@ impl CommonAreaPhones { let url = self .client .url(&format!("/phone/common_area_phones?{}", query_), None); - let resp: crate::types::ListCommonAreaPhonesResponse = self + let resp: crate::Response = self .client .get( &url, @@ -61,7 +61,11 @@ impl CommonAreaPhones { .await?; // Return our response data. - Ok(resp.common_area_phones.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.common_area_phones.to_vec(), + )) } /** * List common area phones. @@ -82,9 +86,15 @@ impl CommonAreaPhones { * * Account owner or admin permissions. * * A [supported device](https://support.zoom.us/hc/en-us/articles/360001299063-Zoom-Voice-Supported-Devices) */ - pub async fn list_all(&self) -> ClientResult> { + pub async fn list_all( + &self, + ) -> ClientResult>> { let url = self.client.url("/phone/common_area_phones", None); - let mut resp: crate::types::ListCommonAreaPhonesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -95,14 +105,18 @@ impl CommonAreaPhones { ) .await?; - let mut common_area_phones = resp.common_area_phones; - let mut page = resp.next_page_token; + let mut common_area_phones = body.common_area_phones; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -113,7 +127,11 @@ impl CommonAreaPhones { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -125,17 +143,17 @@ impl CommonAreaPhones { .await?; } - common_area_phones.append(&mut resp.common_area_phones); + common_area_phones.append(&mut body.common_area_phones); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(common_area_phones) + Ok(crate::Response::new(status, headers, common_area_phones)) } /** * Add a common area phone. @@ -157,7 +175,7 @@ impl CommonAreaPhones { pub async fn add( &self, body: &crate::types::AddCommonAreaPhoneRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/phone/common_area_phones", None); self.client .post( @@ -192,7 +210,7 @@ impl CommonAreaPhones { pub async fn get( &self, common_area_phone_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/common_area_phones/{}", @@ -228,7 +246,7 @@ impl CommonAreaPhones { * * * `common_area_phone_id: &str` -- Unique Identifier of the common area phone. */ - pub async fn delete(&self, common_area_phone_id: &str) -> ClientResult<()> { + pub async fn delete(&self, common_area_phone_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/phone/common_area_phones/{}", @@ -267,7 +285,7 @@ impl CommonAreaPhones { &self, common_area_phone_id: &str, body: &crate::types::UpdateCommonAreaPhoneRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/common_area_phones/{}", @@ -303,7 +321,7 @@ impl CommonAreaPhones { &self, common_area_phone_id: &str, body: &crate::types::AssignPhoneNumbersCommonAreaRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/common_area_phones/{}/phone_numbers", @@ -343,7 +361,7 @@ impl CommonAreaPhones { &self, common_area_phone_id: &str, phone_number_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/common_area_phones/{}/phone_numbers/{}", @@ -380,7 +398,8 @@ impl CommonAreaPhones { &self, common_area_phone_id: &str, body: &crate::types::AssignCallingPlansCommonAreaPhoneRequestData, - ) -> ClientResult { + ) -> ClientResult> + { let url = self.client.url( &format!( "/phone/common_area_phones/{}/calling_plans", @@ -420,7 +439,7 @@ impl CommonAreaPhones { &self, common_area_phone_id: &str, type_: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/common_area_phones/{}/calling_plans/{}", diff --git a/zoom/src/contacts.rs b/zoom/src/contacts.rs index 8a85896e..7658c406 100644 --- a/zoom/src/contacts.rs +++ b/zoom/src/contacts.rs @@ -35,7 +35,7 @@ impl Contacts { query_presence_status: &str, page_size: i64, next_page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -54,7 +54,7 @@ impl Contacts { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/contacts?{}", query_), None); - let resp: crate::types::SearchCompanyContactsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -66,7 +66,11 @@ impl Contacts { .await?; // Return our response data. - Ok(resp.contacts.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.contacts.to_vec(), + )) } /** * Search company contacts. @@ -85,7 +89,7 @@ impl Contacts { &self, search_key: &str, query_presence_status: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !query_presence_status.is_empty() { query_args.push(( @@ -98,7 +102,11 @@ impl Contacts { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/contacts?{}", query_), None); - let mut resp: crate::types::SearchCompanyContactsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -109,14 +117,18 @@ impl Contacts { ) .await?; - let mut contacts = resp.contacts; - let mut page = resp.next_page_token; + let mut contacts = body.contacts; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -127,7 +139,11 @@ impl Contacts { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -139,17 +155,17 @@ impl Contacts { .await?; } - contacts.append(&mut resp.contacts); + contacts.append(&mut body.contacts); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(contacts) + Ok(crate::Response::new(status, headers, contacts)) } /** * List user's contacts. @@ -177,7 +193,7 @@ impl Contacts { type_: &str, page_size: i64, next_page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -192,7 +208,7 @@ impl Contacts { let url = self .client .url(&format!("/chat/users/me/contacts?{}", query_), None); - let resp: crate::types::GetUserContactsResponseData = self + let resp: crate::Response = self .client .get( &url, @@ -204,7 +220,11 @@ impl Contacts { .await?; // Return our response data. - Ok(resp.contacts.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.contacts.to_vec(), + )) } /** * List user's contacts. @@ -224,7 +244,7 @@ impl Contacts { pub async fn get_all_user( &self, type_: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !type_.is_empty() { query_args.push(("type".to_string(), type_.to_string())); @@ -233,7 +253,11 @@ impl Contacts { let url = self .client .url(&format!("/chat/users/me/contacts?{}", query_), None); - let mut resp: crate::types::GetUserContactsResponseData = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -244,14 +268,18 @@ impl Contacts { ) .await?; - let mut contacts = resp.contacts; - let mut page = resp.next_page_token; + let mut contacts = body.contacts; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -262,7 +290,11 @@ impl Contacts { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -274,17 +306,17 @@ impl Contacts { .await?; } - contacts.append(&mut resp.contacts); + contacts.append(&mut body.contacts); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(contacts) + Ok(crate::Response::new(status, headers, contacts)) } /** * Get user's contact details. @@ -308,7 +340,7 @@ impl Contacts { &self, contact_id: &str, query_presence_status: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if query_presence_status { query_args.push(( diff --git a/zoom/src/dashboards.rs b/zoom/src/dashboards.rs index 53fac06d..26672ea8 100644 --- a/zoom/src/dashboards.rs +++ b/zoom/src/dashboards.rs @@ -41,7 +41,7 @@ impl Dashboards { page_size: i64, next_page_token: &str, include_fields: crate::types::IncludeFields, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -99,7 +99,7 @@ impl Dashboards { &self, meeting_id: &str, type_: crate::types::DashboardMeetingsType, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !type_.to_string().is_empty() { query_args.push(("type".to_string(), type_.to_string())); @@ -154,7 +154,8 @@ impl Dashboards { page_size: i64, next_page_token: &str, include_fields: crate::types::DashboardMeetingParticipantsIncludeFields, - ) -> ClientResult { + ) -> ClientResult> + { let mut query_args: Vec<(String, String)> = Default::default(); if !include_fields.to_string().is_empty() { query_args.push(("include_fields".to_string(), include_fields.to_string())); @@ -214,7 +215,7 @@ impl Dashboards { meeting_id: &str, participant_id: &str, type_: crate::types::DashboardMeetingsType, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !type_.to_string().is_empty() { query_args.push(("type".to_string(), type_.to_string())); @@ -267,7 +268,7 @@ impl Dashboards { type_: crate::types::DashboardMeetingsType, page_size: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -325,7 +326,8 @@ impl Dashboards { type_: crate::types::DashboardMeetingsType, page_size: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> + { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -384,7 +386,7 @@ impl Dashboards { to: chrono::NaiveDate, page_size: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -439,7 +441,7 @@ impl Dashboards { &self, webinar_id: &str, type_: crate::types::DashboardWebinarsType, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !type_.to_string().is_empty() { query_args.push(("type".to_string(), type_.to_string())); @@ -493,7 +495,8 @@ impl Dashboards { page_size: i64, next_page_token: &str, include_fields: crate::types::DashboardMeetingParticipantsIncludeFields, - ) -> ClientResult { + ) -> ClientResult> + { let mut query_args: Vec<(String, String)> = Default::default(); if !include_fields.to_string().is_empty() { query_args.push(("include_fields".to_string(), include_fields.to_string())); @@ -551,7 +554,7 @@ impl Dashboards { webinar_id: &str, participant_id: &str, type_: crate::types::DashboardWebinarsType, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !type_.to_string().is_empty() { query_args.push(("type".to_string(), type_.to_string())); @@ -604,7 +607,7 @@ impl Dashboards { type_: crate::types::DashboardWebinarsType, page_size: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -662,7 +665,8 @@ impl Dashboards { type_: crate::types::DashboardWebinarsType, page_size: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> + { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -718,7 +722,7 @@ impl Dashboards { page_size: i64, page_number: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -772,7 +776,7 @@ impl Dashboards { to: chrono::NaiveDate, page_size: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -828,7 +832,7 @@ impl Dashboards { &self, from: chrono::NaiveDate, to: chrono::NaiveDate, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -876,7 +880,7 @@ impl Dashboards { to: chrono::NaiveDate, page_size: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -932,7 +936,7 @@ impl Dashboards { to: chrono::NaiveDate, page_size: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -982,7 +986,7 @@ impl Dashboards { &self, from: chrono::NaiveDate, to: chrono::NaiveDate, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -1027,7 +1031,7 @@ impl Dashboards { &self, from: chrono::NaiveDate, to: chrono::NaiveDate, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -1070,7 +1074,7 @@ impl Dashboards { &self, from: chrono::NaiveDate, to: chrono::NaiveDate, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -1120,7 +1124,8 @@ impl Dashboards { to: chrono::NaiveDate, page_size: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> + { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -1184,7 +1189,8 @@ impl Dashboards { to: chrono::NaiveDate, page_size: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> + { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -1237,7 +1243,7 @@ impl Dashboards { &self, from: chrono::NaiveDate, to: chrono::NaiveDate, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -1299,7 +1305,7 @@ impl Dashboards { quality_type: &str, page_size: i64, next_page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -1323,7 +1329,7 @@ impl Dashboards { let url = self .client .url(&format!("/phone/metrics/call_logs?{}", query_), None); - let resp: crate::types::ListCallLogsMetricsResponseData = self + let resp: crate::Response = self .client .get( &url, @@ -1335,7 +1341,11 @@ impl Dashboards { .await?; // Return our response data. - Ok(resp.call_logs.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.call_logs.to_vec(), + )) } /** * List call logs. @@ -1361,7 +1371,7 @@ impl Dashboards { to: &str, site_id: &str, quality_type: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -1379,7 +1389,11 @@ impl Dashboards { let url = self .client .url(&format!("/phone/metrics/call_logs?{}", query_), None); - let mut resp: crate::types::ListCallLogsMetricsResponseData = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -1390,14 +1404,18 @@ impl Dashboards { ) .await?; - let mut call_logs = resp.call_logs; - let mut page = resp.next_page_token; + let mut call_logs = body.call_logs; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -1408,7 +1426,11 @@ impl Dashboards { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -1420,17 +1442,17 @@ impl Dashboards { .await?; } - call_logs.append(&mut resp.call_logs); + call_logs.append(&mut body.call_logs); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(call_logs) + Ok(crate::Response::new(status, headers, call_logs)) } /** * Get call details from call log. @@ -1456,7 +1478,7 @@ impl Dashboards { pub async fn get_call_log_metrics_details( &self, call_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/metrics/call_logs/{}", @@ -1494,7 +1516,7 @@ impl Dashboards { pub async fn get_call_qo( &self, call_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/metrics/call_logs/{}/qos", @@ -1544,7 +1566,8 @@ impl Dashboards { type_: crate::types::DashboardMeetingsType, next_page_token: &str, page_size: i64, - ) -> ClientResult> { + ) -> ClientResult>> + { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -1564,7 +1587,7 @@ impl Dashboards { ), None, ); - let resp: crate::types::ParticipantFeedbackResponse = self + let resp: crate::Response = self .client .get( &url, @@ -1576,7 +1599,11 @@ impl Dashboards { .await?; // Return our response data. - Ok(resp.participants.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.participants.to_vec(), + )) } /** * Get post meeting feedback. @@ -1599,7 +1626,8 @@ impl Dashboards { &self, meeting_id: &str, type_: crate::types::DashboardMeetingsType, - ) -> ClientResult> { + ) -> ClientResult>> + { let mut query_args: Vec<(String, String)> = Default::default(); if !type_.to_string().is_empty() { query_args.push(("type".to_string(), type_.to_string())); @@ -1613,7 +1641,11 @@ impl Dashboards { ), None, ); - let mut resp: crate::types::ParticipantFeedbackResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -1624,14 +1656,18 @@ impl Dashboards { ) .await?; - let mut participants = resp.participants; - let mut page = resp.next_page_token; + let mut participants = body.participants; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -1642,7 +1678,11 @@ impl Dashboards { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -1654,17 +1694,17 @@ impl Dashboards { .await?; } - participants.append(&mut resp.participants); + participants.append(&mut body.participants); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(participants) + Ok(crate::Response::new(status, headers, participants)) } /** * Get post webinar feedback. @@ -1699,7 +1739,8 @@ impl Dashboards { page_size: i64, next_page_token: &str, webinar_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> + { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -1719,7 +1760,7 @@ impl Dashboards { ), None, ); - let resp: crate::types::ParticipantFeedbackResponse = self + let resp: crate::Response = self .client .get( &url, @@ -1731,7 +1772,11 @@ impl Dashboards { .await?; // Return our response data. - Ok(resp.participants.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.participants.to_vec(), + )) } /** * Get post webinar feedback. @@ -1755,7 +1800,8 @@ impl Dashboards { &self, type_: crate::types::DashboardMeetingsType, webinar_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> + { let mut query_args: Vec<(String, String)> = Default::default(); if !type_.to_string().is_empty() { query_args.push(("type".to_string(), type_.to_string())); @@ -1769,7 +1815,11 @@ impl Dashboards { ), None, ); - let mut resp: crate::types::ParticipantFeedbackResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -1780,14 +1830,18 @@ impl Dashboards { ) .await?; - let mut participants = resp.participants; - let mut page = resp.next_page_token; + let mut participants = body.participants; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -1798,7 +1852,11 @@ impl Dashboards { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -1810,16 +1868,16 @@ impl Dashboards { .await?; } - participants.append(&mut resp.participants); + participants.append(&mut body.participants); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(participants) + Ok(crate::Response::new(status, headers, participants)) } } diff --git a/zoom/src/deprecated_api_endpoints.rs b/zoom/src/deprecated_api_endpoints.rs index 63122f78..0a8f1882 100644 --- a/zoom/src/deprecated_api_endpoints.rs +++ b/zoom/src/deprecated_api_endpoints.rs @@ -33,7 +33,7 @@ impl DeprecatedApiEndpoints { pub async fn list_past_meeting_files( &self, meeting_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/past_meetings/{}/files", @@ -73,7 +73,7 @@ impl DeprecatedApiEndpoints { pub async fn list_past_webinar_files( &self, webinar_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/past_webinars/{}/files", diff --git a/zoom/src/devices.rs b/zoom/src/devices.rs index dc0794ee..fcd52aef 100644 --- a/zoom/src/devices.rs +++ b/zoom/src/devices.rs @@ -35,7 +35,7 @@ impl Devices { page_size: i64, page_number: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -68,7 +68,7 @@ impl Devices { * * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`
*/ - pub async fn create(&self, body: &crate::types::Device) -> ClientResult<()> { + pub async fn create(&self, body: &crate::types::Device) -> ClientResult> { let url = self.client.url("/h323/devices", None); self.client .post( @@ -94,7 +94,7 @@ impl Devices { * * * `device_id: &str` -- User's first name. */ - pub async fn delete(&self, device_id: &str) -> ClientResult<()> { + pub async fn delete(&self, device_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/h323/devices/{}", @@ -126,7 +126,11 @@ impl Devices { * * * `device_id: &str` -- User's first name. */ - pub async fn update(&self, device_id: &str, body: &crate::types::Device) -> ClientResult<()> { + pub async fn update( + &self, + device_id: &str, + body: &crate::types::Device, + ) -> ClientResult> { let url = self.client.url( &format!( "/h323/devices/{}", diff --git a/zoom/src/groups.rs b/zoom/src/groups.rs index bf41aa76..8ef85124 100644 --- a/zoom/src/groups.rs +++ b/zoom/src/groups.rs @@ -23,7 +23,7 @@ impl Groups { * * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium` */ - pub async fn get(&self) -> ClientResult { + pub async fn get(&self) -> ClientResult> { let url = self.client.url("/groups", None); self.client .get( @@ -49,7 +49,10 @@ impl Groups { * * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light` */ - pub async fn create(&self, body: &crate::types::GroupCreateRequest) -> ClientResult<()> { + pub async fn create( + &self, + body: &crate::types::GroupCreateRequest, + ) -> ClientResult> { let url = self.client.url("/groups", None); self.client .post( @@ -78,7 +81,10 @@ impl Groups { * * `group_id: &str` -- The group ID.
* Can be retrieved by calling [GET /groups](https://marketplace.zoom.us/docs/api-reference/zoom-api/groups/groups). */ - pub async fn group(&self, group_id: &str) -> ClientResult { + pub async fn group( + &self, + group_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/groups/{}", @@ -113,7 +119,7 @@ impl Groups { * * `group_id: &str` -- The group ID.
* Can be retrieved by calling [GET /groups](https://marketplace.zoom.us/docs/api-reference/zoom-api/groups/groups). */ - pub async fn delete(&self, group_id: &str) -> ClientResult<()> { + pub async fn delete(&self, group_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/groups/{}", @@ -152,7 +158,7 @@ impl Groups { &self, group_id: &str, body: &crate::types::GroupCreateRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/groups/{}", @@ -199,7 +205,7 @@ impl Groups { page_size: i64, page_number: i64, next_page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -219,7 +225,7 @@ impl Groups { ), None, ); - let resp: crate::types::GroupMembersResponseData = self + let resp: crate::Response = self .client .get( &url, @@ -231,7 +237,11 @@ impl Groups { .await?; // Return our response data. - Ok(resp.members.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.members.to_vec(), + )) } /** * List group members . @@ -250,7 +260,7 @@ impl Groups { pub async fn get_all_members( &self, group_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/groups/{}/members", @@ -258,7 +268,11 @@ impl Groups { ), None, ); - let mut resp: crate::types::GroupMembersResponseData = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -269,14 +283,18 @@ impl Groups { ) .await?; - let mut members = resp.members; - let mut page = resp.next_page_token; + let mut members = body.members; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -287,7 +305,11 @@ impl Groups { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -299,17 +321,17 @@ impl Groups { .await?; } - members.append(&mut resp.members); + members.append(&mut body.members); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(members) + Ok(crate::Response::new(status, headers, members)) } /** * Add group members. @@ -332,7 +354,7 @@ impl Groups { &self, group_id: &str, body: &crate::types::AddRoleMembersRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/groups/{}/members", @@ -368,7 +390,11 @@ impl Groups { * Can be retrieved by calling [GET /groups](https://marketplace.zoom.us/docs/api-reference/zoom-api/groups/groups). * * `member_id: &str` -- User's first name. */ - pub async fn members_delete(&self, group_id: &str, member_id: &str) -> ClientResult<()> { + pub async fn members_delete( + &self, + group_id: &str, + member_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/groups/{}/members/{}", @@ -415,7 +441,7 @@ impl Groups { group_id: &str, member_id: &str, body: &crate::types::UpdateGroupMemberRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/groups/{}/members/{}", @@ -458,7 +484,7 @@ impl Groups { group_id: &str, custom_query_fields: &str, option: crate::types::OptionData, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -512,7 +538,7 @@ impl Groups { group_id: &str, custom_query_fields: &str, option: crate::types::OptionData, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -566,7 +592,7 @@ impl Groups { group_id: &str, custom_query_fields: &str, option: crate::types::OptionData, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -620,7 +646,7 @@ impl Groups { group_id: &str, custom_query_fields: &str, option: crate::types::OptionData, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -672,7 +698,7 @@ impl Groups { custom_query_fields: &str, option: crate::types::UpdateGroupSettingsOption, body: &crate::types::UpdateGroupSettingsRequestOneOf, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -724,7 +750,7 @@ impl Groups { group_id: &str, custom_query_fields: &str, option: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -776,7 +802,7 @@ impl Groups { group_id: &str, custom_query_fields: &str, option: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -828,7 +854,7 @@ impl Groups { group_id: &str, custom_query_fields: &str, option: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -881,7 +907,7 @@ impl Groups { custom_query_fields: &str, option: &str, body: &crate::types::GroupLockedSettingsRequestOneOf, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -936,7 +962,7 @@ impl Groups { file_ids: &str, group_id: &str, body: &crate::types::UploadVbRequest, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !file_ids.is_empty() { query_args.push(("file_ids".to_string(), file_ids.to_string())); @@ -979,7 +1005,11 @@ impl Groups { * * `group_id: &str` -- Unique identifier of the group. Retrieve the value for this field by calling the [List groups](https://marketplace.zoom.us/docs/api-reference/zoom-api/groups/groups) API. * * `file_ids: &str` -- Provide the id of the file that is to be deleted. To delete multiple files, provide comma separated values for this field. */ - pub async fn del_vb(&self, file_ids: &str, group_id: &str) -> ClientResult<()> { + pub async fn del_vb( + &self, + file_ids: &str, + group_id: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !file_ids.is_empty() { query_args.push(("file_ids".to_string(), file_ids.to_string())); diff --git a/zoom/src/im_chat.rs b/zoom/src/im_chat.rs index 62d43e5e..839c521b 100644 --- a/zoom/src/im_chat.rs +++ b/zoom/src/im_chat.rs @@ -38,7 +38,7 @@ impl ImChat { to: chrono::NaiveDate, page_size: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -99,7 +99,7 @@ impl ImChat { to: chrono::NaiveDate, page_size: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -161,7 +161,7 @@ impl ImChat { date: &str, page_size: i64, next_page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !channel.is_empty() { query_args.push(("channel".to_string(), channel.to_string())); @@ -187,7 +187,7 @@ impl ImChat { ), None, ); - let resp: crate::types::ListimmessagesResponse = self + let resp: crate::Response = self .client .get( &url, @@ -199,7 +199,11 @@ impl ImChat { .await?; // Return our response data. - Ok(resp.messages.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.messages.to_vec(), + )) } /** * Get user’s IM messages. @@ -221,7 +225,7 @@ impl ImChat { chat_user: &str, channel: &str, date: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !channel.is_empty() { query_args.push(("channel".to_string(), channel.to_string())); @@ -241,7 +245,11 @@ impl ImChat { ), None, ); - let mut resp: crate::types::ListimmessagesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -252,14 +260,18 @@ impl ImChat { ) .await?; - let mut messages = resp.messages; - let mut page = resp.next_page_token; + let mut messages = body.messages; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -270,7 +282,11 @@ impl ImChat { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -282,17 +298,17 @@ impl ImChat { .await?; } - messages.append(&mut resp.messages); + messages.append(&mut body.messages); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(messages) + Ok(crate::Response::new(status, headers, messages)) } /** * Send IM messages. @@ -311,7 +327,7 @@ impl ImChat { &self, chat_user: &str, body: &crate::types::SendimmessagesRequest, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !chat_user.is_empty() { query_args.push(("chat_user".to_string(), chat_user.to_string())); diff --git a/zoom/src/im_groups.rs b/zoom/src/im_groups.rs index a68ea356..52c06a67 100644 --- a/zoom/src/im_groups.rs +++ b/zoom/src/im_groups.rs @@ -21,7 +21,7 @@ impl ImGroups { * * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium` */ - pub async fn get(&self) -> ClientResult { + pub async fn get(&self) -> ClientResult> { let url = self.client.url("/im/groups", None); self.client .get( @@ -43,7 +43,10 @@ impl ImGroups { * * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light` */ - pub async fn create(&self, body: &crate::types::ImGroupCreateRequest) -> ClientResult<()> { + pub async fn create( + &self, + body: &crate::types::ImGroupCreateRequest, + ) -> ClientResult> { let url = self.client.url("/im/groups", None); self.client .post( @@ -73,7 +76,7 @@ impl ImGroups { pub async fn im_group( &self, group_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/im/groups/{}", @@ -106,7 +109,7 @@ impl ImGroups { * * `group_id: &str` -- The group ID.
* Can be retrieved by calling [GET /groups](https://marketplace.zoom.us/docs/api-reference/zoom-api/groups/groups). */ - pub async fn delete(&self, group_id: &str) -> ClientResult<()> { + pub async fn delete(&self, group_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/im/groups/{}", @@ -143,7 +146,7 @@ impl ImGroups { &self, group_id: &str, body: &crate::types::ImGroupCreateRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/im/groups/{}", @@ -188,7 +191,7 @@ impl ImGroups { page_size: i64, page_number: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -237,7 +240,7 @@ impl ImGroups { &self, group_id: &str, body: &crate::types::AddRoleMembersRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/im/groups/{}/members", @@ -271,7 +274,11 @@ impl ImGroups { * Can be retrieved by calling [GET /groups](https://marketplace.zoom.us/docs/api-reference/zoom-api/groups/groups). * * `member_id: &str` -- User's first name. */ - pub async fn members_delete(&self, group_id: &str, member_id: &str) -> ClientResult<()> { + pub async fn members_delete( + &self, + group_id: &str, + member_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/im/groups/{}/members/{}", diff --git a/zoom/src/lib.rs b/zoom/src/lib.rs index 743a72d2..bd43196c 100644 --- a/zoom/src/lib.rs +++ b/zoom/src/lib.rs @@ -154,9 +154,27 @@ pub mod users; pub mod utils; pub mod webinars; -use thiserror::Error; +#[derive(Debug)] +pub struct Response { + pub status: reqwest::StatusCode, + pub headers: reqwest::header::HeaderMap, + pub body: T, +} + +impl Response { + pub fn new(status: reqwest::StatusCode, headers: reqwest::header::HeaderMap, body: T) -> Self { + Self { + status, + headers, + body, + } + } +} + type ClientResult = Result; +use thiserror::Error; + /// Errors returned by the client #[derive(Debug, Error)] pub enum ClientError { @@ -650,13 +668,14 @@ impl Client { method: reqwest::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -669,7 +688,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -692,13 +711,14 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult<(Option, Out)> + ) -> ClientResult<(Option, crate::Response)> where Out: serde::de::DeserializeOwned + 'static + Send, { let response = self.request_raw(method, uri, message).await?; let status = response.status(); + let headers = response.headers().clone(); let link = response .headers() .get(http::header::LINK) @@ -719,7 +739,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok((link, parsed_response)) + Ok((link, crate::Response::new(status, headers, parsed_response))) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -738,7 +758,11 @@ impl Client { /* TODO: make this more DRY */ #[allow(dead_code)] - async fn post_form(&self, uri: &str, form: reqwest::multipart::Form) -> ClientResult + async fn post_form( + &self, + uri: &str, + form: reqwest::multipart::Form, + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -763,6 +787,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -779,7 +804,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -804,7 +829,7 @@ impl Client { method: reqwest::Method, uri: &str, accept_mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -827,6 +852,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -843,7 +869,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -869,7 +895,7 @@ impl Client { uri: &str, content: &[u8], mime_type: &str, - ) -> ClientResult + ) -> ClientResult> where Out: serde::de::DeserializeOwned + 'static + Send, { @@ -912,6 +938,7 @@ impl Client { let response = req.send().await?; let status = response.status(); + let headers = response.headers().clone(); let response_body = response.bytes().await?; @@ -924,7 +951,7 @@ impl Client { } else { serde_json::from_slice::(&response_body)? }; - Ok(parsed_response) + Ok(crate::Response::new(status, headers, parsed_response)) } else { let error = if response_body.is_empty() { ClientError::HttpError { @@ -947,7 +974,7 @@ impl Client { method: http::Method, uri: &str, message: Message, - ) -> ClientResult + ) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -956,7 +983,7 @@ impl Client { } #[allow(dead_code)] - async fn get(&self, uri: &str, message: Message) -> ClientResult + async fn get(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -964,7 +991,7 @@ impl Client { } #[allow(dead_code)] - async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult> + async fn get_all_pages(&self, uri: &str, _message: Message) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -974,32 +1001,36 @@ impl Client { /// "unfold" paginated results of a vector of items #[allow(dead_code)] - async fn unfold(&self, uri: &str) -> ClientResult> + async fn unfold(&self, uri: &str) -> ClientResult>> where D: serde::de::DeserializeOwned + 'static + Send, { let mut global_items = Vec::new(); - let (new_link, mut items) = self.get_pages(uri).await?; + let (new_link, mut response) = self.get_pages(uri).await?; let mut link = new_link; - while !items.is_empty() { - global_items.append(&mut items); + while !response.body.is_empty() { + global_items.append(&mut response.body); // We need to get the next link. - if let Some(url) = link.as_ref() { + if let Some(url) = &link { let url = reqwest::Url::parse(&url.0)?; - let (new_link, new_items) = self.get_pages_url(&url).await?; + let (new_link, new_response) = self.get_pages_url(&url).await?; link = new_link; - items = new_items; + response = new_response; } } - Ok(global_items) + Ok(Response::new( + response.status, + response.headers, + global_items, + )) } #[allow(dead_code)] async fn get_pages( &self, uri: &str, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1011,7 +1042,7 @@ impl Client { async fn get_pages_url( &self, url: &reqwest::Url, - ) -> ClientResult<(Option, Vec)> + ) -> ClientResult<(Option, crate::Response>)> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1020,7 +1051,7 @@ impl Client { } #[allow(dead_code)] - async fn post(&self, uri: &str, message: Message) -> ClientResult + async fn post(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1028,7 +1059,7 @@ impl Client { } #[allow(dead_code)] - async fn patch(&self, uri: &str, message: Message) -> ClientResult + async fn patch(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1036,7 +1067,7 @@ impl Client { } #[allow(dead_code)] - async fn put(&self, uri: &str, message: Message) -> ClientResult + async fn put(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { @@ -1044,7 +1075,7 @@ impl Client { } #[allow(dead_code)] - async fn delete(&self, uri: &str, message: Message) -> ClientResult + async fn delete(&self, uri: &str, message: Message) -> ClientResult> where D: serde::de::DeserializeOwned + 'static + Send, { diff --git a/zoom/src/meetings.rs b/zoom/src/meetings.rs index 27599189..e9b38b35 100644 --- a/zoom/src/meetings.rs +++ b/zoom/src/meetings.rs @@ -37,7 +37,7 @@ impl Meetings { page_size: i64, next_page_token: &str, page_number: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -96,7 +96,7 @@ impl Meetings { &self, user_id: &str, body: &crate::types::MeetingCreate, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/meetings", @@ -139,7 +139,7 @@ impl Meetings { meeting_id: i64, occurrence_id: &str, show_previous_occurrences: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !occurrence_id.is_empty() { query_args.push(("occurrence_id".to_string(), occurrence_id.to_string())); @@ -200,7 +200,7 @@ impl Meetings { occurrence_id: &str, schedule_for_reminder: bool, cancel_meeting_reminder: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cancel_meeting_reminder.is_empty() { query_args.push(( @@ -257,7 +257,7 @@ impl Meetings { meeting_id: i64, occurrence_id: &str, body: &crate::types::MeetingUpdateRequestAllOf, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !occurrence_id.is_empty() { query_args.push(("occurrence_id".to_string(), occurrence_id.to_string())); @@ -300,7 +300,7 @@ impl Meetings { &self, meeting_id: i64, body: &crate::types::MeetingStatusRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/status", @@ -350,7 +350,7 @@ impl Meetings { page_size: i64, page_number: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -410,7 +410,7 @@ impl Meetings { &self, meeting_id: i64, occurrence_ids: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !occurrence_ids.is_empty() { query_args.push(("occurrence_ids".to_string(), occurrence_ids.to_string())); @@ -455,7 +455,7 @@ impl Meetings { occurrence_id: &str, meeting_id: i64, registrant_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !occurrence_id.is_empty() { query_args.push(("occurrence_id".to_string(), occurrence_id.to_string())); @@ -501,7 +501,7 @@ impl Meetings { meeting_id: i64, occurrence_id: &str, body: &crate::types::RegistrantStatus, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !occurrence_id.is_empty() { query_args.push(("occurrence_id".to_string(), occurrence_id.to_string())); @@ -545,7 +545,7 @@ impl Meetings { pub async fn past_details( &self, meeting_uuid: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/past_meetings/{}", @@ -591,7 +591,7 @@ impl Meetings { meeting_uuid: &str, page_size: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -634,7 +634,10 @@ impl Meetings { * * While storing it in your database, store it as a **long** data type and **not as an integer**, as the Meeting IDs can be longer than 10 digits. */ - pub async fn past(&self, meeting_id: i64) -> ClientResult { + pub async fn past( + &self, + meeting_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/past_meetings/{}/instances", @@ -671,7 +674,10 @@ impl Meetings { * * While storing it in your database, store it as a **long** data type and **not as an integer**, as the Meeting IDs can be longer than 10 digits. */ - pub async fn poll(&self, meeting_id: i64) -> ClientResult { + pub async fn poll( + &self, + meeting_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/polls", @@ -713,7 +719,7 @@ impl Meetings { &self, meeting_id: i64, body: &crate::types::Poll, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/polls", @@ -755,7 +761,7 @@ impl Meetings { &self, meeting_id: i64, poll_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/polls/{}", @@ -798,7 +804,7 @@ impl Meetings { meeting_id: i64, poll_id: &str, body: &crate::types::Poll, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/polls/{}", @@ -837,7 +843,11 @@ impl Meetings { * While storing it in your database, store it as a **long** data type and **not as an integer**, as the Meeting IDs can be longer than 10 digits. * * `poll_id: &str` -- User's first name. */ - pub async fn poll_delete(&self, meeting_id: i64, poll_id: &str) -> ClientResult<()> { + pub async fn poll_delete( + &self, + meeting_id: i64, + poll_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/polls/{}", @@ -878,7 +888,7 @@ impl Meetings { pub async fn registrants_questions_get( &self, meeting_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/registrants/questions", @@ -918,7 +928,7 @@ impl Meetings { &self, meeting_id: i64, body: &crate::types::MeetingRegistrantQuestionsData, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/registrants/questions", @@ -957,7 +967,7 @@ impl Meetings { pub async fn invitation( &self, meeting_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/invitation", @@ -998,7 +1008,7 @@ impl Meetings { pub async fn get_live_stream_details( &self, meeting_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/livestream", @@ -1038,7 +1048,7 @@ impl Meetings { &self, meeting_id: &str, body: &crate::types::MeetingLiveStream, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/livestream", @@ -1079,7 +1089,7 @@ impl Meetings { &self, meeting_id: i64, body: &crate::types::MeetingLiveStreamStatus, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/livestream/status", @@ -1119,7 +1129,7 @@ impl Meetings { pub async fn list_past_polls( &self, meeting_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/past_meetings/{}/polls", @@ -1166,7 +1176,7 @@ impl Meetings { &self, meeting_id: &str, body: &crate::types::AddBatchRegistrantsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/batch_registrants", @@ -1207,7 +1217,7 @@ impl Meetings { &self, meeting_id: &str, body: &crate::types::InMeetingRecordingControlRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/live_meetings/{}/events", @@ -1232,7 +1242,7 @@ impl Meetings { * * Get the quality scores of a meeting. */ - pub async fn quality_score(&self) -> ClientResult { + pub async fn quality_score(&self) -> ClientResult> { let url = self.client.url("/metrics/quality", None); self.client .get( @@ -1266,7 +1276,7 @@ impl Meetings { &self, meeting_id: &str, body: &crate::types::CreateBatchPollsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/batch_polls", @@ -1301,7 +1311,7 @@ impl Meetings { pub async fn list_template( &self, user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/meeting_templates", @@ -1338,7 +1348,7 @@ impl Meetings { &self, meeting_id: i64, body: &crate::types::InviteLink, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/meetings/{}/invite_links", diff --git a/zoom/src/pac.rs b/zoom/src/pac.rs index c378b1fc..e549f246 100644 --- a/zoom/src/pac.rs +++ b/zoom/src/pac.rs @@ -30,7 +30,10 @@ impl Pac { * * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId. */ - pub async fn user_pa_cs(&self, user_id: &str) -> ClientResult { + pub async fn user_pa_cs( + &self, + user_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/pac", diff --git a/zoom/src/phone.rs b/zoom/src/phone.rs index b6f881af..d8508426 100644 --- a/zoom/src/phone.rs +++ b/zoom/src/phone.rs @@ -33,7 +33,7 @@ impl Phone { &self, account_id: &str, body: &crate::types::SetUpAccountRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/phone/setup", @@ -89,7 +89,7 @@ impl Phone { number_type: crate::types::Type, pending_numbers: bool, site_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !extension_type.to_string().is_empty() { query_args.push(("extension_type".to_string(), extension_type.to_string())); @@ -114,7 +114,7 @@ impl Phone { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/phone/numbers?{}", query_), None); - let resp: crate::types::ListAccountPhoneNumbersResponseData = self + let resp: crate::Response = self .client .get( &url, @@ -126,7 +126,11 @@ impl Phone { .await?; // Return our response data. - Ok(resp.phone_numbers.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.phone_numbers.to_vec(), + )) } /** * List phone numbers. @@ -150,7 +154,7 @@ impl Phone { number_type: crate::types::Type, pending_numbers: bool, site_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !extension_type.to_string().is_empty() { query_args.push(("extension_type".to_string(), extension_type.to_string())); @@ -169,7 +173,11 @@ impl Phone { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/phone/numbers?{}", query_), None); - let mut resp: crate::types::ListAccountPhoneNumbersResponseData = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -180,14 +188,18 @@ impl Phone { ) .await?; - let mut phone_numbers = resp.phone_numbers; - let mut page = resp.next_page_token; + let mut phone_numbers = body.phone_numbers; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -198,7 +210,11 @@ impl Phone { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -210,17 +226,17 @@ impl Phone { .await?; } - phone_numbers.append(&mut resp.phone_numbers); + phone_numbers.append(&mut body.phone_numbers); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(phone_numbers) + Ok(crate::Response::new(status, headers, phone_numbers)) } /** * Get user's profile. @@ -239,7 +255,10 @@ impl Phone { * * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId. */ - pub async fn user(&self, user_id: &str) -> ClientResult { + pub async fn user( + &self, + user_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/users/{}", @@ -274,7 +293,7 @@ impl Phone { &self, user_id: &str, body: &crate::types::UpdateUserProfileRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/users/{}", @@ -308,7 +327,7 @@ impl Phone { pub async fn setting( &self, _account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/phone/settings", None); self.client .get( @@ -340,7 +359,7 @@ impl Phone { &self, _account_id: &str, body: &crate::types::UpdatePhoneSettingsRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/phone/settings", None); self.client .patch( @@ -372,7 +391,7 @@ impl Phone { pub async fn user_settings( &self, user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/users/{}/settings", @@ -414,7 +433,7 @@ impl Phone { page_size: i64, next_page_token: &str, site_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -429,7 +448,7 @@ impl Phone { let url = self .client .url(&format!("/phone/setting_templates?{}", query_), None); - let resp: crate::types::ListSettingTemplatesResponse = self + let resp: crate::Response = self .client .get( &url, @@ -441,7 +460,11 @@ impl Phone { .await?; // Return our response data. - Ok(resp.templates.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.templates.to_vec(), + )) } /** * List setting templates. @@ -461,7 +484,7 @@ impl Phone { pub async fn list_all_setting_templates( &self, site_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !site_id.is_empty() { query_args.push(("site_id".to_string(), site_id.to_string())); @@ -470,7 +493,11 @@ impl Phone { let url = self .client .url(&format!("/phone/setting_templates?{}", query_), None); - let mut resp: crate::types::ListSettingTemplatesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -481,14 +508,18 @@ impl Phone { ) .await?; - let mut templates = resp.templates; - let mut page = resp.next_page_token; + let mut templates = body.templates; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -499,7 +530,11 @@ impl Phone { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -511,17 +546,17 @@ impl Phone { .await?; } - templates.append(&mut resp.templates); + templates.append(&mut body.templates); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(templates) + Ok(crate::Response::new(status, headers, templates)) } /** * Add a setting template. @@ -539,7 +574,7 @@ impl Phone { pub async fn add_setting_template( &self, body: &crate::types::AddSettingTemplateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/phone/setting_templates", None); self.client .post( @@ -561,7 +596,7 @@ impl Phone { pub async fn batch_add_locations( &self, body: &crate::types::BatchAddLocationsRequest, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/phone/batch_locations", None); self.client .post( @@ -595,7 +630,7 @@ impl Phone { &self, next_page_token: &str, page_size: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -607,7 +642,7 @@ impl Phone { let url = self .client .url(&format!("/phone/locations?{}", query_), None); - let resp: crate::types::ListLocationsResponseData = self + let resp: crate::Response = self .client .get( &url, @@ -619,7 +654,11 @@ impl Phone { .await?; // Return our response data. - Ok(resp.locations.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.locations.to_vec(), + )) } /** * List emergency service locations. @@ -638,9 +677,13 @@ impl Phone { */ pub async fn list_all_locations( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/phone/locations", None); - let mut resp: crate::types::ListLocationsResponseData = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -651,14 +694,18 @@ impl Phone { ) .await?; - let mut locations = resp.locations; - let mut page = resp.next_page_token; + let mut locations = body.locations; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -669,7 +716,11 @@ impl Phone { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -681,17 +732,17 @@ impl Phone { .await?; } - locations.append(&mut resp.locations); + locations.append(&mut body.locations); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(locations) + Ok(crate::Response::new(status, headers, locations)) } /** * Add emergency service location. @@ -709,7 +760,7 @@ impl Phone { pub async fn add_location( &self, body: &crate::types::AddLocationRequest, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/phone/locations", None); self.client .post( @@ -741,7 +792,7 @@ impl Phone { pub async fn get_location( &self, location_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/locations/{}", @@ -776,7 +827,7 @@ impl Phone { * * * `location_id: &str` -- The emergency service location's ID. */ - pub async fn delete_location(&self, location_id: &str) -> ClientResult<()> { + pub async fn delete_location(&self, location_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/phone/locations/{}", @@ -811,7 +862,7 @@ impl Phone { &self, location_id: &str, body: &crate::types::UpdateLocationRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/locations/{}", @@ -851,7 +902,7 @@ impl Phone { &self, next_page_token: &str, page_size: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -863,7 +914,7 @@ impl Phone { let url = self .client .url(&format!("/phone/sip_groups?{}", query_), None); - let resp: crate::types::ListSipGroupsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -875,7 +926,11 @@ impl Phone { .await?; // Return our response data. - Ok(resp.sip_groups.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.sip_groups.to_vec(), + )) } /** * List SIP groups. @@ -892,9 +947,15 @@ impl Phone { * * Pro or a higher account with Zoom Phone license * * Account owner or admin permissions */ - pub async fn list_all_sip_groups(&self) -> ClientResult> { + pub async fn list_all_sip_groups( + &self, + ) -> ClientResult>> { let url = self.client.url("/phone/sip_groups", None); - let mut resp: crate::types::ListSipGroupsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -905,14 +966,18 @@ impl Phone { ) .await?; - let mut sip_groups = resp.sip_groups; - let mut page = resp.next_page_token; + let mut sip_groups = body.sip_groups; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -923,7 +988,11 @@ impl Phone { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -935,17 +1004,17 @@ impl Phone { .await?; } - sip_groups.append(&mut resp.sip_groups); + sip_groups.append(&mut body.sip_groups); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(sip_groups) + Ok(crate::Response::new(status, headers, sip_groups)) } /** * Get setting template details. @@ -969,7 +1038,7 @@ impl Phone { &self, template_id: &str, custom_query_fields: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -1017,7 +1086,7 @@ impl Phone { &self, template_id: &str, body: &crate::types::UpdateSettingTemplateRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/setting_templates/{}", @@ -1069,7 +1138,7 @@ impl Phone { next_page_token: &str, phone_number: &str, time_type: crate::types::TimeType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -1101,7 +1170,7 @@ impl Phone { ), None, ); - let resp: crate::types::PhoneUserCallLogsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -1113,7 +1182,11 @@ impl Phone { .await?; // Return our response data. - Ok(resp.call_logs.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.call_logs.to_vec(), + )) } /** * Get user's call logs. @@ -1138,7 +1211,7 @@ impl Phone { type_: crate::types::PhoneUserCallLogsType, phone_number: &str, time_type: crate::types::TimeType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -1164,7 +1237,11 @@ impl Phone { ), None, ); - let mut resp: crate::types::PhoneUserCallLogsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -1175,14 +1252,18 @@ impl Phone { ) .await?; - let mut call_logs = resp.call_logs; - let mut page = resp.next_page_token; + let mut call_logs = body.call_logs; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -1193,7 +1274,11 @@ impl Phone { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -1205,17 +1290,17 @@ impl Phone { .await?; } - call_logs.append(&mut resp.call_logs); + call_logs.append(&mut body.call_logs); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(call_logs) + Ok(crate::Response::new(status, headers, call_logs)) } /** * Get user's recordings. @@ -1245,7 +1330,7 @@ impl Phone { next_page_token: &str, from: chrono::NaiveDate, to: chrono::NaiveDate, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -1268,7 +1353,7 @@ impl Phone { ), None, ); - let resp: crate::types::PhoneUserRecordingsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -1280,7 +1365,11 @@ impl Phone { .await?; // Return our response data. - Ok(resp.recordings.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.recordings.to_vec(), + )) } /** * Get user's recordings. @@ -1302,7 +1391,7 @@ impl Phone { user_id: &str, from: chrono::NaiveDate, to: chrono::NaiveDate, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -1319,7 +1408,11 @@ impl Phone { ), None, ); - let mut resp: crate::types::PhoneUserRecordingsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -1330,14 +1423,18 @@ impl Phone { ) .await?; - let mut recordings = resp.recordings; - let mut page = resp.next_page_token; + let mut recordings = body.recordings; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -1348,7 +1445,11 @@ impl Phone { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -1360,17 +1461,17 @@ impl Phone { .await?; } - recordings.append(&mut resp.recordings); + recordings.append(&mut body.recordings); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(recordings) + Ok(crate::Response::new(status, headers, recordings)) } /** * Get user's voicemails. @@ -1402,7 +1503,7 @@ impl Phone { next_page_token: &str, from: chrono::NaiveDate, to: chrono::NaiveDate, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -1428,7 +1529,7 @@ impl Phone { ), None, ); - let resp: crate::types::PhoneUserVoiceMailsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -1440,7 +1541,11 @@ impl Phone { .await?; // Return our response data. - Ok(resp.voice_mails.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.voice_mails.to_vec(), + )) } /** * Get user's voicemails. @@ -1463,7 +1568,7 @@ impl Phone { status: crate::types::PhoneUserVoiceMailsStatus, from: chrono::NaiveDate, to: chrono::NaiveDate, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -1483,7 +1588,11 @@ impl Phone { ), None, ); - let mut resp: crate::types::PhoneUserVoiceMailsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -1494,14 +1603,18 @@ impl Phone { ) .await?; - let mut voice_mails = resp.voice_mails; - let mut page = resp.next_page_token; + let mut voice_mails = body.voice_mails; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -1512,7 +1625,11 @@ impl Phone { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -1524,17 +1641,17 @@ impl Phone { .await?; } - voice_mails.append(&mut resp.voice_mails); + voice_mails.append(&mut body.voice_mails); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(voice_mails) + Ok(crate::Response::new(status, headers, voice_mails)) } /** * Set up shared access. @@ -1562,7 +1679,7 @@ impl Phone { user_id: &str, setting_type: &str, body: &crate::types::AddUserSettingRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/users/{}/settings/{}", @@ -1606,7 +1723,7 @@ impl Phone { user_id: &str, setting_type: &str, shared_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !shared_id.is_empty() { query_args.push(("shared_id".to_string(), shared_id.to_string())); @@ -1657,7 +1774,7 @@ impl Phone { setting_type: &str, user_id: &str, body: &crate::types::UpdateUserSettingRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/users/{}/settings/{}", @@ -1715,7 +1832,7 @@ impl Phone { path: &str, time_type: crate::types::TimeType, site_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -1745,7 +1862,7 @@ impl Phone { let url = self .client .url(&format!("/phone/call_logs?{}", query_), None); - let resp: crate::types::AccountCallLogsResponseData = self + let resp: crate::Response = self .client .get( &url, @@ -1757,7 +1874,11 @@ impl Phone { .await?; // Return our response data. - Ok(resp.call_logs.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.call_logs.to_vec(), + )) } /** * Get account's call logs. @@ -1783,7 +1904,7 @@ impl Phone { path: &str, time_type: crate::types::TimeType, site_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -1807,7 +1928,11 @@ impl Phone { let url = self .client .url(&format!("/phone/call_logs?{}", query_), None); - let mut resp: crate::types::AccountCallLogsResponseData = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -1818,14 +1943,18 @@ impl Phone { ) .await?; - let mut call_logs = resp.call_logs; - let mut page = resp.next_page_token; + let mut call_logs = body.call_logs; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -1836,7 +1965,11 @@ impl Phone { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -1848,17 +1981,17 @@ impl Phone { .await?; } - call_logs.append(&mut resp.call_logs); + call_logs.append(&mut body.call_logs); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(call_logs) + Ok(crate::Response::new(status, headers, call_logs)) } /** * Assign phone number to user. @@ -1877,7 +2010,7 @@ impl Phone { &self, user_id: &str, body: &crate::types::AddByocNumberResponse, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/users/{}/phone_numbers", @@ -1916,7 +2049,11 @@ impl Phone { * * `user_id: &str` -- Provide either userId or email address of the user. * * `phone_number_id: &str` -- Provide either phone number or phoneNumberId of the user. . */ - pub async fn unassign_number(&self, user_id: &str, phone_number_id: &str) -> ClientResult<()> { + pub async fn unassign_number( + &self, + user_id: &str, + phone_number_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/users/{}/phone_numbers/{}", @@ -1952,7 +2089,7 @@ impl Phone { &self, user_id: &str, body: &crate::types::AssignCallingPlanRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/users/{}/calling_plans", @@ -1988,7 +2125,11 @@ impl Phone { * * `type_: &str` -- The [type](https://marketplace.zoom.us/docs/api-reference/other-references/plans#zoom-phone-calling-plans) of the calling plan that was assigned to user. (e.g: The value of type would be "200" for Unlimited US/Canada calling plan.) * . */ - pub async fn unassign_calling_plan(&self, user_id: &str, type_: &str) -> ClientResult<()> { + pub async fn unassign_calling_plan( + &self, + user_id: &str, + type_: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/users/{}/calling_plans/{}", @@ -2047,7 +2188,7 @@ impl Phone { recording_type: &str, site_id: &str, query_date_type: crate::types::QueryDateType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -2077,7 +2218,7 @@ impl Phone { let url = self .client .url(&format!("/phone/recordings?{}", query_), None); - let resp: crate::types::GetPhoneRecordingsResponseData = self + let resp: crate::Response = self .client .get( &url, @@ -2089,7 +2230,11 @@ impl Phone { .await?; // Return our response data. - Ok(resp.recordings.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.recordings.to_vec(), + )) } /** * Get call recordings. @@ -2115,7 +2260,7 @@ impl Phone { recording_type: &str, site_id: &str, query_date_type: crate::types::QueryDateType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -2139,7 +2284,11 @@ impl Phone { let url = self .client .url(&format!("/phone/recordings?{}", query_), None); - let mut resp: crate::types::GetPhoneRecordingsResponseData = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -2150,14 +2299,18 @@ impl Phone { ) .await?; - let mut recordings = resp.recordings; - let mut page = resp.next_page_token; + let mut recordings = body.recordings; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -2168,7 +2321,11 @@ impl Phone { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -2180,17 +2337,17 @@ impl Phone { .await?; } - recordings.append(&mut resp.recordings); + recordings.append(&mut body.recordings); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(recordings) + Ok(crate::Response::new(status, headers, recordings)) } /** * List BYOC SIP trunks. @@ -2213,7 +2370,7 @@ impl Phone { &self, next_page_token: &str, page_size: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -2225,7 +2382,7 @@ impl Phone { let url = self .client .url(&format!("/phone/sip_trunk/trunks?{}", query_), None); - let resp: crate::types::ListByocsipTrunkResponse = self + let resp: crate::Response = self .client .get( &url, @@ -2237,7 +2394,11 @@ impl Phone { .await?; // Return our response data. - Ok(resp.byoc_sip_trunk.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.byoc_sip_trunk.to_vec(), + )) } /** * List BYOC SIP trunks. @@ -2253,9 +2414,15 @@ impl Phone { * **Prerequisites:** * * A Business or Enterprise account */ - pub async fn list_all_byocsip_trunk(&self) -> ClientResult> { + pub async fn list_all_byocsip_trunk( + &self, + ) -> ClientResult>> { let url = self.client.url("/phone/sip_trunk/trunks", None); - let mut resp: crate::types::ListByocsipTrunkResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -2266,14 +2433,18 @@ impl Phone { ) .await?; - let mut byoc_sip_trunk = resp.byoc_sip_trunk; - let mut page = resp.next_page_token; + let mut byoc_sip_trunk = body.byoc_sip_trunk; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -2284,7 +2455,11 @@ impl Phone { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -2296,17 +2471,17 @@ impl Phone { .await?; } - byoc_sip_trunk.append(&mut resp.byoc_sip_trunk); + byoc_sip_trunk.append(&mut body.byoc_sip_trunk); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(byoc_sip_trunk) + Ok(crate::Response::new(status, headers, byoc_sip_trunk)) } /** * Assign SIP trunks. @@ -2328,7 +2503,7 @@ impl Phone { &self, account_id: &str, body: &crate::types::PostPhoneSipTrunkRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/phone/sip_trunk/trunks", @@ -2368,7 +2543,7 @@ impl Phone { sip_trunk_id: &str, account_id: &str, body: &crate::types::UpdatePhoneSipTrunkRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/phone/sip_trunk/trunks/{}", @@ -2409,7 +2584,7 @@ impl Phone { &self, next_page_token: &str, page_size: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -2421,7 +2596,7 @@ impl Phone { let url = self .client .url(&format!("/phone/external_contacts?{}", query_), None); - let resp: crate::types::ListExternalContactsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -2433,7 +2608,11 @@ impl Phone { .await?; // Return our response data. - Ok(resp.external_contacts.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.external_contacts.to_vec(), + )) } /** * List external contacts. @@ -2452,9 +2631,13 @@ impl Phone { */ pub async fn list_all_external_contacts( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/phone/external_contacts", None); - let mut resp: crate::types::ListExternalContactsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -2465,14 +2648,18 @@ impl Phone { ) .await?; - let mut external_contacts = resp.external_contacts; - let mut page = resp.next_page_token; + let mut external_contacts = body.external_contacts; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -2483,7 +2670,11 @@ impl Phone { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -2495,17 +2686,17 @@ impl Phone { .await?; } - external_contacts.append(&mut resp.external_contacts); + external_contacts.append(&mut body.external_contacts); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(external_contacts) + Ok(crate::Response::new(status, headers, external_contacts)) } /** * Add an external contact. @@ -2523,7 +2714,7 @@ impl Phone { pub async fn add_external_contact( &self, body: &crate::types::AddExternalContactRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/phone/external_contacts", None); self.client .post( @@ -2555,7 +2746,7 @@ impl Phone { pub async fn get_external_contact( &self, external_contact_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/external_contacts/{}", @@ -2590,7 +2781,10 @@ impl Phone { * * * `external_contact_id: &str` -- The external contact's ID. */ - pub async fn delete_external_contact(&self, external_contact_id: &str) -> ClientResult<()> { + pub async fn delete_external_contact( + &self, + external_contact_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/external_contacts/{}", @@ -2629,7 +2823,7 @@ impl Phone { &self, external_contact_id: &str, body: &crate::types::UpdateExternalContactRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/external_contacts/{}", @@ -2667,7 +2861,7 @@ impl Phone { pub async fn get_number_details( &self, number_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/numbers/{}", @@ -2705,7 +2899,7 @@ impl Phone { &self, number_id: &str, body: &crate::types::UpdatePhoneNumberDetailsRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/numbers/{}", @@ -2741,7 +2935,7 @@ impl Phone { pub async fn change_main_company_number( &self, body: &crate::types::ChangeMainCompanyNumberRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/phone/company_number", None); self.client .put( @@ -2768,7 +2962,7 @@ impl Phone { */ pub async fn list_calling_plan( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/phone/calling_plans", None); self.client .get( @@ -2804,7 +2998,7 @@ impl Phone { page_size: i64, next_page_token: &str, site_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -2817,7 +3011,7 @@ impl Phone { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/phone/users?{}", query_), None); - let resp: crate::types::ListPhoneUsersResponseData = self + let resp: crate::Response = self .client .get( &url, @@ -2829,7 +3023,11 @@ impl Phone { .await?; // Return our response data. - Ok(resp.users.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.users.to_vec(), + )) } /** * List phone users. @@ -2849,14 +3047,18 @@ impl Phone { pub async fn list_all_users( &self, site_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !site_id.is_empty() { query_args.push(("site_id".to_string(), site_id.to_string())); } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/phone/users?{}", query_), None); - let mut resp: crate::types::ListPhoneUsersResponseData = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -2867,14 +3069,18 @@ impl Phone { ) .await?; - let mut users = resp.users; - let mut page = resp.next_page_token; + let mut users = body.users; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -2885,7 +3091,11 @@ impl Phone { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -2897,17 +3107,17 @@ impl Phone { .await?; } - users.append(&mut resp.users); + users.append(&mut body.users); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(users) + Ok(crate::Response::new(status, headers, users)) } /** * Get call log details. @@ -2929,7 +3139,7 @@ impl Phone { pub async fn get_call_log_details( &self, call_log_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/call_logs/{}", @@ -2965,7 +3175,11 @@ impl Phone { * * `user_id: &str` -- The user ID or email address of the user. * * `call_log_id: &str` -- Unique identifier of the call log. The value for this field can be retrieved from [account's call logs](https://marketplace.zoom.us/docs/api-reference/zoom-api/phone/accountcalllogs) or [user's call logs](https://marketplace.zoom.us/docs/api-reference/zoom-api/phone/phoneusercalllogs). */ - pub async fn delete_call_log(&self, user_id: &str, call_log_id: &str) -> ClientResult<()> { + pub async fn delete_call_log( + &self, + user_id: &str, + call_log_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/users/{}/call_logs/{}", @@ -3000,7 +3214,7 @@ impl Phone { pub async fn add_byoc_number( &self, body: &crate::types::AddByocNumberRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/phone/byoc_numbers", None); self.client .post( @@ -3028,7 +3242,7 @@ impl Phone { * * * `voicemail_id: &str` -- Unique identifier of the voicemail. Retrieve the value for this field by calling the [Get voicemails](https://marketplace.zoom.us/docs/api-reference/zoom-api/phone/phoneuservoicemails) API. */ - pub async fn delete_voicemail(&self, voicemail_id: &str) -> ClientResult<()> { + pub async fn delete_voicemail(&self, voicemail_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/phone/voice_mails/{}", diff --git a/zoom/src/phone_auto_receptionists.rs b/zoom/src/phone_auto_receptionists.rs index c0f5af1e..60f869ab 100644 --- a/zoom/src/phone_auto_receptionists.rs +++ b/zoom/src/phone_auto_receptionists.rs @@ -33,7 +33,7 @@ impl PhoneAutoReceptionists { &self, auto_receptionist_id: &str, body: &crate::types::UpdateAutoReceptionistRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/auto_receptionists/{}", @@ -74,7 +74,7 @@ impl PhoneAutoReceptionists { &self, auto_receptionist_id: &str, body: &crate::types::AddByocNumberResponse, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/auto_receptionists/{}/phone_numbers", @@ -110,7 +110,7 @@ impl PhoneAutoReceptionists { pub async fn unassign_all_phone_nums_auto_receptionist( &self, auto_receptionist_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/auto_receptionists/{}/phone_numbers", @@ -152,7 +152,7 @@ impl PhoneAutoReceptionists { &self, auto_receptionist_id: &str, phone_number_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/auto_receptionists/{}/phone_numbers/{}", @@ -188,7 +188,7 @@ impl PhoneAutoReceptionists { pub async fn add_auto_receptionist( &self, body: &crate::types::AddAutoReceptionistRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/phone/auto_receptionists", None); self.client .post( diff --git a/zoom/src/phone_blocked_list.rs b/zoom/src/phone_blocked_list.rs index 8e87be85..9bcf3532 100644 --- a/zoom/src/phone_blocked_list.rs +++ b/zoom/src/phone_blocked_list.rs @@ -33,7 +33,7 @@ impl PhoneBlockedList { &self, next_page_token: &str, page_size: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -45,7 +45,7 @@ impl PhoneBlockedList { let url = self .client .url(&format!("/phone/blocked_list?{}", query_), None); - let resp: crate::types::ListBlockedResponse = self + let resp: crate::Response = self .client .get( &url, @@ -57,7 +57,11 @@ impl PhoneBlockedList { .await?; // Return our response data. - Ok(resp.blocked_list.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.blocked_list.to_vec(), + )) } /** * List blocked lists. @@ -74,9 +78,15 @@ impl PhoneBlockedList { * * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium` */ - pub async fn list_all_blocked(&self) -> ClientResult> { + pub async fn list_all_blocked( + &self, + ) -> ClientResult>> { let url = self.client.url("/phone/blocked_list", None); - let mut resp: crate::types::ListBlockedResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -87,14 +97,18 @@ impl PhoneBlockedList { ) .await?; - let mut blocked_list = resp.blocked_list; - let mut page = resp.next_page_token; + let mut blocked_list = body.blocked_list; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -105,7 +119,11 @@ impl PhoneBlockedList { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -117,17 +135,17 @@ impl PhoneBlockedList { .await?; } - blocked_list.append(&mut resp.blocked_list); + blocked_list.append(&mut body.blocked_list); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(blocked_list) + Ok(crate::Response::new(status, headers, blocked_list)) } /** * Create a blocked list. @@ -145,7 +163,7 @@ impl PhoneBlockedList { pub async fn add_anumber_blocked_list( &self, body: &crate::types::UpdateBlockedListRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/phone/blocked_list", None); self.client .post( @@ -176,7 +194,7 @@ impl PhoneBlockedList { pub async fn get_blocked_list( &self, blocked_list_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/blocked_list/{}", @@ -212,7 +230,10 @@ impl PhoneBlockedList { * * * `blocked_list_id: &str` -- Unique Identifier of the blocked list. This can be retrieved from the List Blocked List API. */ - pub async fn delete_blocked_list(&self, blocked_list_id: &str) -> ClientResult<()> { + pub async fn delete_blocked_list( + &self, + blocked_list_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/blocked_list/{}", @@ -251,7 +272,7 @@ impl PhoneBlockedList { &self, blocked_list_id: &str, body: &crate::types::UpdateBlockedListRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/blocked_list/{}", diff --git a/zoom/src/phone_call_queues.rs b/zoom/src/phone_call_queues.rs index 1935dff1..122917e0 100644 --- a/zoom/src/phone_call_queues.rs +++ b/zoom/src/phone_call_queues.rs @@ -36,7 +36,7 @@ impl PhoneCallQueues { &self, next_page_token: &str, page_size: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -48,7 +48,7 @@ impl PhoneCallQueues { let url = self .client .url(&format!("/phone/call_queues?{}", query_), None); - let resp: crate::types::ListCallQueuesResponse = self + let resp: crate::Response = self .client .get( &url, @@ -60,7 +60,11 @@ impl PhoneCallQueues { .await?; // Return our response data. - Ok(resp.call_queues.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.call_queues.to_vec(), + )) } /** * List call queues. @@ -80,9 +84,15 @@ impl PhoneCallQueues { * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium` * */ - pub async fn list_all_call_queues(&self) -> ClientResult> { + pub async fn list_all_call_queues( + &self, + ) -> ClientResult>> { let url = self.client.url("/phone/call_queues", None); - let mut resp: crate::types::ListCallQueuesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -93,14 +103,18 @@ impl PhoneCallQueues { ) .await?; - let mut call_queues = resp.call_queues; - let mut page = resp.next_page_token; + let mut call_queues = body.call_queues; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -111,7 +125,11 @@ impl PhoneCallQueues { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -123,17 +141,17 @@ impl PhoneCallQueues { .await?; } - call_queues.append(&mut resp.call_queues); + call_queues.append(&mut body.call_queues); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(call_queues) + Ok(crate::Response::new(status, headers, call_queues)) } /** * Create a call queue. @@ -154,7 +172,7 @@ impl PhoneCallQueues { pub async fn create_call_queue( &self, body: &crate::types::CreateCallQueueRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/phone/call_queues", None); self.client .post( @@ -188,7 +206,7 @@ impl PhoneCallQueues { pub async fn get_call_queue( &self, call_queue_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/call_queues/{}", @@ -227,7 +245,10 @@ impl PhoneCallQueues { * * * `call_queue_id: &str` -- Unique Identifier of the call queue. */ - pub async fn delete_call_queue(&self, call_queue_id: &str) -> ClientResult<()> { + pub async fn delete_call_queue( + &self, + call_queue_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/call_queues/{}", @@ -268,7 +289,7 @@ impl PhoneCallQueues { &self, call_queue_id: &str, body: &crate::types::UpdateCallQueueRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/call_queues/{}", @@ -309,7 +330,7 @@ impl PhoneCallQueues { &self, call_queue_id: &str, body: &crate::types::AddByocNumberResponse, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/call_queues/{}/phone_numbers", @@ -348,7 +369,7 @@ impl PhoneCallQueues { pub async fn unassign_phone_num_call_queue( &self, call_queue_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/call_queues/{}/phone_numbers", @@ -389,7 +410,7 @@ impl PhoneCallQueues { &self, call_queue_id: &str, phone_number_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/call_queues/{}/phone_numbers/{}", @@ -430,7 +451,7 @@ impl PhoneCallQueues { &self, call_queue_id: &str, body: &crate::types::AddMembersCallQueueRequestData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/call_queues/{}/members", @@ -466,7 +487,10 @@ impl PhoneCallQueues { * * * `call_queue_id: &str` -- User's first name. */ - pub async fn unassign_all_members(&self, call_queue_id: &str) -> ClientResult<()> { + pub async fn unassign_all_members( + &self, + call_queue_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/call_queues/{}/members", @@ -507,7 +531,7 @@ impl PhoneCallQueues { &self, call_queue_id: &str, member_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/call_queues/{}/members/{}", @@ -550,7 +574,7 @@ impl PhoneCallQueues { &self, call_queue_id: &str, body: &crate::types::ChangeCallQueueManagerRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/call_queues/{}/manager", @@ -597,7 +621,7 @@ impl PhoneCallQueues { next_page_token: &str, from: chrono::NaiveDate, to: chrono::NaiveDate, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -620,7 +644,7 @@ impl PhoneCallQueues { ), None, ); - let resp: crate::types::GetCallQueueRecordingsResponseData = self + let resp: crate::Response = self .client .get( &url, @@ -632,7 +656,11 @@ impl PhoneCallQueues { .await?; // Return our response data. - Ok(resp.recordings.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.recordings.to_vec(), + )) } /** * Get call queue recordings. @@ -655,7 +683,7 @@ impl PhoneCallQueues { call_queue_id: &str, from: chrono::NaiveDate, to: chrono::NaiveDate, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -672,7 +700,11 @@ impl PhoneCallQueues { ), None, ); - let mut resp: crate::types::GetCallQueueRecordingsResponseData = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -683,14 +715,18 @@ impl PhoneCallQueues { ) .await?; - let mut recordings = resp.recordings; - let mut page = resp.next_page_token; + let mut recordings = body.recordings; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -701,7 +737,11 @@ impl PhoneCallQueues { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -713,16 +753,16 @@ impl PhoneCallQueues { .await?; } - recordings.append(&mut resp.recordings); + recordings.append(&mut body.recordings); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(recordings) + Ok(crate::Response::new(status, headers, recordings)) } } diff --git a/zoom/src/phone_devices.rs b/zoom/src/phone_devices.rs index 2524b6e5..7751e5e6 100644 --- a/zoom/src/phone_devices.rs +++ b/zoom/src/phone_devices.rs @@ -35,7 +35,7 @@ impl PhoneDevices { type_: crate::types::ListPhoneDevicesType, next_page_token: &str, page_size: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -48,7 +48,7 @@ impl PhoneDevices { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/phone/devices?{}", query_), None); - let resp: crate::types::ListPhoneDevicesResponseData = self + let resp: crate::Response = self .client .get( &url, @@ -60,7 +60,11 @@ impl PhoneDevices { .await?; // Return our response data. - Ok(resp.devices.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.devices.to_vec(), + )) } /** * List devices. @@ -80,14 +84,18 @@ impl PhoneDevices { pub async fn list_all( &self, type_: crate::types::ListPhoneDevicesType, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !type_.to_string().is_empty() { query_args.push(("type".to_string(), type_.to_string())); } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/phone/devices?{}", query_), None); - let mut resp: crate::types::ListPhoneDevicesResponseData = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -98,14 +106,18 @@ impl PhoneDevices { ) .await?; - let mut devices = resp.devices; - let mut page = resp.next_page_token; + let mut devices = body.devices; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -116,7 +128,11 @@ impl PhoneDevices { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -128,17 +144,17 @@ impl PhoneDevices { .await?; } - devices.append(&mut resp.devices); + devices.append(&mut body.devices); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(devices) + Ok(crate::Response::new(status, headers, devices)) } /** * Add a device. @@ -156,7 +172,10 @@ impl PhoneDevices { * * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light` */ - pub async fn add(&self, body: &crate::types::AddPhoneDeviceRequest) -> ClientResult<()> { + pub async fn add( + &self, + body: &crate::types::AddPhoneDeviceRequest, + ) -> ClientResult> { let url = self.client.url("/phone/devices", None); self.client .post( @@ -188,7 +207,7 @@ impl PhoneDevices { pub async fn get_device( &self, device_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/devices/{}", @@ -225,7 +244,7 @@ impl PhoneDevices { * * * `device_id: &str` -- Unique Identifier of the device. */ - pub async fn delete_device(&self, device_id: &str) -> ClientResult<()> { + pub async fn delete_device(&self, device_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/phone/devices/{}", @@ -265,7 +284,7 @@ impl PhoneDevices { &self, device_id: &str, body: &crate::types::UpdateDeviceRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/devices/{}", diff --git a/zoom/src/phone_reports.rs b/zoom/src/phone_reports.rs index f8aad51f..5f8b30d0 100644 --- a/zoom/src/phone_reports.rs +++ b/zoom/src/phone_reports.rs @@ -40,7 +40,7 @@ impl PhoneReports { category_type: &str, page_size: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !category_type.is_empty() { query_args.push(("category_type".to_string(), category_type.to_string())); diff --git a/zoom/src/phone_shared_line_groups.rs b/zoom/src/phone_shared_line_groups.rs index 06f59bde..21f39927 100644 --- a/zoom/src/phone_shared_line_groups.rs +++ b/zoom/src/phone_shared_line_groups.rs @@ -36,7 +36,7 @@ impl PhoneSharedLineGroups { &self, page_size: i64, next_page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -48,7 +48,7 @@ impl PhoneSharedLineGroups { let url = self .client .url(&format!("/phone/shared_line_groups?{}", query_), None); - let resp: crate::types::ListSharedLineGroupsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -60,7 +60,11 @@ impl PhoneSharedLineGroups { .await?; // Return our response data. - Ok(resp.shared_line_groups.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.shared_line_groups.to_vec(), + )) } /** * List shared line groups. @@ -82,9 +86,13 @@ impl PhoneSharedLineGroups { */ pub async fn list_all_shared_line_groups( &self, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url("/phone/shared_line_groups", None); - let mut resp: crate::types::ListSharedLineGroupsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -95,14 +103,18 @@ impl PhoneSharedLineGroups { ) .await?; - let mut shared_line_groups = resp.shared_line_groups; - let mut page = resp.next_page_token; + let mut shared_line_groups = body.shared_line_groups; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -113,7 +125,11 @@ impl PhoneSharedLineGroups { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -125,17 +141,17 @@ impl PhoneSharedLineGroups { .await?; } - shared_line_groups.append(&mut resp.shared_line_groups); + shared_line_groups.append(&mut body.shared_line_groups); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(shared_line_groups) + Ok(crate::Response::new(status, headers, shared_line_groups)) } /** * Create a shared line group. @@ -155,7 +171,7 @@ impl PhoneSharedLineGroups { pub async fn create_shared_line_group( &self, body: &crate::types::CreateSharedLineGroupRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/phone/shared_line_groups", None); self.client .post( @@ -190,7 +206,7 @@ impl PhoneSharedLineGroups { pub async fn get_shared_line_group( &self, shared_line_group_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/shared_line_groups/{}", @@ -227,7 +243,10 @@ impl PhoneSharedLineGroups { * * * `shared_line_group_id: &str` -- Unique Identifier of the shared line group that you would like to delete. */ - pub async fn delete_shared_line_group(&self, shared_line_group_id: &str) -> ClientResult<()> { + pub async fn delete_shared_line_group( + &self, + shared_line_group_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/shared_line_groups/{}", @@ -267,7 +286,7 @@ impl PhoneSharedLineGroups { &self, shared_line_group_id: &str, body: &crate::types::UpdateSharedLineGroupRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/shared_line_groups/{}", @@ -310,7 +329,7 @@ impl PhoneSharedLineGroups { &self, shared_line_group_id: &str, body: &crate::types::AddMembersSharedLineGroupRequestData, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/shared_line_groups/{}/members", @@ -348,7 +367,10 @@ impl PhoneSharedLineGroups { * * * `shared_line_group_id: &str` -- Unique identifier of the Shared Line Group that you would like to delete. */ - pub async fn delete_members_of_slg(&self, shared_line_group_id: &str) -> ClientResult<()> { + pub async fn delete_members_of_slg( + &self, + shared_line_group_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/shared_line_groups/{}/members", @@ -391,7 +413,7 @@ impl PhoneSharedLineGroups { &self, shared_line_group_id: &str, member_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/shared_line_groups/{}/members/{}", @@ -432,7 +454,7 @@ impl PhoneSharedLineGroups { &self, shared_line_group_id: &str, body: &crate::types::AddByocNumberResponse, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/shared_line_groups/{}/phone_numbers", @@ -468,7 +490,10 @@ impl PhoneSharedLineGroups { * * * `shared_line_group_id: &str` -- Unique Identifier of the Shared Line Group. */ - pub async fn delete_phone_numbers_slg(&self, shared_line_group_id: &str) -> ClientResult<()> { + pub async fn delete_phone_numbers_slg( + &self, + shared_line_group_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/shared_line_groups/{}/phone_numbers", @@ -509,7 +534,7 @@ impl PhoneSharedLineGroups { &self, shared_line_group_id: &str, phone_number_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/shared_line_groups/{}/phone_numbers/{}", diff --git a/zoom/src/phone_site.rs b/zoom/src/phone_site.rs index 2799f4da..b042a952 100644 --- a/zoom/src/phone_site.rs +++ b/zoom/src/phone_site.rs @@ -33,7 +33,7 @@ impl PhoneSite { &self, page_size: i64, next_page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -43,7 +43,7 @@ impl PhoneSite { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/phone/sites?{}", query_), None); - let resp: crate::types::ListPhoneSitesResponse = self + let resp: crate::Response = self .client .get( &url, @@ -55,7 +55,11 @@ impl PhoneSite { .await?; // Return our response data. - Ok(resp.sites.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.sites.to_vec(), + )) } /** * List phone sites. @@ -72,9 +76,13 @@ impl PhoneSite { * **Scope:** `phone:read:admin`
* **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium` */ - pub async fn list_all(&self) -> ClientResult> { + pub async fn list_all(&self) -> ClientResult>> { let url = self.client.url("/phone/sites", None); - let mut resp: crate::types::ListPhoneSitesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -85,14 +93,18 @@ impl PhoneSite { ) .await?; - let mut sites = resp.sites; - let mut page = resp.next_page_token; + let mut sites = body.sites; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -103,7 +115,11 @@ impl PhoneSite { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -115,17 +131,17 @@ impl PhoneSite { .await?; } - sites.append(&mut resp.sites); + sites.append(&mut body.sites); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(sites) + Ok(crate::Response::new(status, headers, sites)) } /** * Create a phone site. @@ -145,7 +161,7 @@ impl PhoneSite { pub async fn create( &self, body: &crate::types::CreatePhoneSiteRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/phone/sites", None); self.client .post( @@ -177,7 +193,10 @@ impl PhoneSite { * * * `site_id: &str` -- Unique Identifier of the Site. */ - pub async fn get_site(&self, site_id: &str) -> ClientResult { + pub async fn get_site( + &self, + site_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/sites/{}", @@ -216,7 +235,11 @@ impl PhoneSite { * * `site_id: &str` -- Unique Identifier of the Site. * * `transfer_site_id: &str` -- The Site ID of another site where the assets of the current site (users, numbers and phones) can be transferred to. */ - pub async fn delete(&self, site_id: &str, transfer_site_id: &str) -> ClientResult<()> { + pub async fn delete( + &self, + site_id: &str, + transfer_site_id: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !transfer_site_id.is_empty() { query_args.push(("transfer_site_id".to_string(), transfer_site_id.to_string())); @@ -263,7 +286,7 @@ impl PhoneSite { &self, site_id: &str, body: &crate::types::UpdateSiteDetailsRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/phone/sites/{}", diff --git a/zoom/src/reports.rs b/zoom/src/reports.rs index 1ae2b944..99e8ca70 100644 --- a/zoom/src/reports.rs +++ b/zoom/src/reports.rs @@ -32,7 +32,7 @@ impl Reports { &self, year: i64, month: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if month > 0 { query_args.push(("month".to_string(), month.to_string())); @@ -82,7 +82,7 @@ impl Reports { page_size: i64, page_number: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -145,7 +145,7 @@ impl Reports { page_size: i64, next_page_token: &str, type_: crate::types::ReportMeetingsType, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -203,7 +203,7 @@ impl Reports { pub async fn meeting_details( &self, meeting_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/report/meetings/{}", @@ -250,7 +250,7 @@ impl Reports { page_size: i64, next_page_token: &str, include_fields: crate::types::DashboardMeetingParticipantsIncludeFields, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_fields.to_string().is_empty() { query_args.push(("include_fields".to_string(), include_fields.to_string())); @@ -302,7 +302,7 @@ impl Reports { pub async fn meeting_polls( &self, meeting_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/report/meetings/{}/polls", @@ -341,7 +341,7 @@ impl Reports { pub async fn webinar_details( &self, webinar_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/report/webinars/{}", @@ -386,7 +386,7 @@ impl Reports { page_size: i64, next_page_token: &str, include_fields: crate::types::DashboardMeetingParticipantsIncludeFields, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_fields.to_string().is_empty() { query_args.push(("include_fields".to_string(), include_fields.to_string())); @@ -437,7 +437,7 @@ impl Reports { pub async fn webinar_polls( &self, webinar_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/report/webinars/{}/polls", @@ -478,7 +478,7 @@ impl Reports { pub async fn webinar_qa( &self, webinar_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/report/webinars/{}/qa", @@ -531,7 +531,7 @@ impl Reports { page_size: i64, page_number: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -589,7 +589,7 @@ impl Reports { &self, from: chrono::NaiveDate, to: chrono::NaiveDate, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -641,7 +641,7 @@ impl Reports { page_size: i64, next_page_token: &str, category_type: crate::types::CategoryType, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !category_type.to_string().is_empty() { query_args.push(("category_type".to_string(), category_type.to_string())); @@ -697,7 +697,7 @@ impl Reports { to: chrono::NaiveDate, page_size: i64, next_page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -715,7 +715,7 @@ impl Reports { let url = self .client .url(&format!("/report/activities?{}", query_), None); - let resp: crate::types::ReportSignInOutActivitiesResponse = self + let resp: crate::Response = self .client .get( &url, @@ -727,7 +727,11 @@ impl Reports { .await?; // Return our response data. - Ok(resp.activity_logs.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.activity_logs.to_vec(), + )) } /** * Get sign In / sign out activity report. @@ -747,7 +751,7 @@ impl Reports { &self, from: chrono::NaiveDate, to: chrono::NaiveDate, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !from.to_string().is_empty() { query_args.push(("from".to_string(), from.to_string())); @@ -759,7 +763,11 @@ impl Reports { let url = self .client .url(&format!("/report/activities?{}", query_), None); - let mut resp: crate::types::ReportSignInOutActivitiesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -770,14 +778,18 @@ impl Reports { ) .await?; - let mut activity_logs = resp.activity_logs; - let mut page = resp.next_page_token; + let mut activity_logs = body.activity_logs; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -788,7 +800,11 @@ impl Reports { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -800,17 +816,17 @@ impl Reports { .await?; } - activity_logs.append(&mut resp.activity_logs); + activity_logs.append(&mut body.activity_logs); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(activity_logs) + Ok(crate::Response::new(status, headers, activity_logs)) } /** * Get billing reports. @@ -826,7 +842,9 @@ impl Reports { * * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy` */ - pub async fn get_billing(&self) -> ClientResult { + pub async fn get_billing( + &self, + ) -> ClientResult> { let url = self.client.url("/report/billing", None); self.client .get( @@ -862,7 +880,7 @@ impl Reports { pub async fn get_billing_invoices( &self, billing_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !billing_id.is_empty() { query_args.push(("billing_id".to_string(), billing_id.to_string())); diff --git a/zoom/src/roles.rs b/zoom/src/roles.rs index c71cee6d..80639717 100644 --- a/zoom/src/roles.rs +++ b/zoom/src/roles.rs @@ -26,7 +26,7 @@ impl Roles { * * For setting the initial role, you must be the Account Owner. * * For subsequent role management, you must be the Account Owner or user with role management permissions. */ - pub async fn get(&self) -> ClientResult { + pub async fn get(&self) -> ClientResult> { let url = self.client.url("/roles", None); self.client .get( @@ -53,7 +53,10 @@ impl Roles { * * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light` */ - pub async fn create(&self, body: &crate::types::CreateRoleRequest) -> ClientResult<()> { + pub async fn create( + &self, + body: &crate::types::CreateRoleRequest, + ) -> ClientResult> { let url = self.client.url("/roles", None); self.client .post( @@ -95,7 +98,7 @@ impl Roles { page_number: i64, next_page_token: &str, page_size: i64, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -118,7 +121,7 @@ impl Roles { ), None, ); - let resp: crate::types::RoleMembersList = self + let resp: crate::Response = self .client .get( &url, @@ -130,7 +133,11 @@ impl Roles { .await?; // Return our response data. - Ok(resp.members.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.members.to_vec(), + )) } /** * List members in a role. @@ -150,7 +157,7 @@ impl Roles { &self, role_id: &str, page_count: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !page_count.is_empty() { query_args.push(("page_count".to_string(), page_count.to_string())); @@ -164,7 +171,11 @@ impl Roles { ), None, ); - let mut resp: crate::types::RoleMembersList = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -175,14 +186,18 @@ impl Roles { ) .await?; - let mut members = resp.members; - let mut page = resp.next_page_token; + let mut members = body.members; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -193,7 +208,11 @@ impl Roles { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -205,17 +224,17 @@ impl Roles { .await?; } - members.append(&mut resp.members); + members.append(&mut body.members); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(members) + Ok(crate::Response::new(status, headers, members)) } /** * Assign a role. @@ -238,7 +257,7 @@ impl Roles { &self, role_id: &str, body: &crate::types::AddRoleMembersRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/roles/{}/members", @@ -274,7 +293,11 @@ impl Roles { * * `role_id: &str` -- User's first name. * * `member_id: &str` -- User's first name. */ - pub async fn member_delete(&self, role_id: &str, member_id: &str) -> ClientResult<()> { + pub async fn member_delete( + &self, + role_id: &str, + member_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/roles/{}/members/{}", @@ -316,7 +339,7 @@ impl Roles { pub async fn get_information( &self, role_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!("/roles/{}", crate::progenitor_support::encode_path(role_id),), None, @@ -351,7 +374,7 @@ impl Roles { * * * `role_id: &str` -- User's first name. */ - pub async fn delete(&self, role_id: &str) -> ClientResult<()> { + pub async fn delete(&self, role_id: &str) -> ClientResult> { let url = self.client.url( &format!("/roles/{}", crate::progenitor_support::encode_path(role_id),), None, @@ -388,7 +411,7 @@ impl Roles { &self, role_id: &str, body: &crate::types::UpdateRoleRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!("/roles/{}", crate::progenitor_support::encode_path(role_id),), None, diff --git a/zoom/src/rooms.rs b/zoom/src/rooms.rs index 0a6432d5..ede5e585 100644 --- a/zoom/src/rooms.rs +++ b/zoom/src/rooms.rs @@ -39,7 +39,7 @@ impl Rooms { page_size: i64, next_page_token: &str, location_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !location_id.is_empty() { query_args.push(("location_id".to_string(), location_id.to_string())); @@ -61,7 +61,7 @@ impl Rooms { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/rooms?{}", query_), None); - let resp: crate::types::ListZoomRoomsResponseData = self + let resp: crate::Response = self .client .get( &url, @@ -73,7 +73,11 @@ impl Rooms { .await?; // Return our response data. - Ok(resp.rooms.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.rooms.to_vec(), + )) } /** * List Zoom Rooms. @@ -94,7 +98,7 @@ impl Rooms { type_: crate::types::ListZoomRoomsType, unassigned_rooms: bool, location_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !location_id.is_empty() { query_args.push(("location_id".to_string(), location_id.to_string())); @@ -110,7 +114,11 @@ impl Rooms { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/rooms?{}", query_), None); - let mut resp: crate::types::ListZoomRoomsResponseData = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -121,14 +129,18 @@ impl Rooms { ) .await?; - let mut rooms = resp.rooms; - let mut page = resp.next_page_token; + let mut rooms = body.rooms; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -139,7 +151,11 @@ impl Rooms { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -151,17 +167,17 @@ impl Rooms { .await?; } - rooms.append(&mut resp.rooms); + rooms.append(&mut body.rooms); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(rooms) + Ok(crate::Response::new(status, headers, rooms)) } /** * Add a Zoom Room. @@ -177,7 +193,7 @@ impl Rooms { pub async fn add( &self, body: &crate::types::AddRoomRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/rooms", None); self.client .post( @@ -209,7 +225,7 @@ impl Rooms { pub async fn get_zr_profile( &self, room_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!("/rooms/{}", crate::progenitor_support::encode_path(room_id),), None, @@ -239,7 +255,10 @@ impl Rooms { * * * `room_id: &str` -- Unique Identifier of a Zoom Room. */ - pub async fn delete_zoom(&self, room_id: &str) -> ClientResult { + pub async fn delete_zoom( + &self, + room_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!("/rooms/{}", crate::progenitor_support::encode_path(room_id),), None, @@ -274,7 +293,7 @@ impl Rooms { &self, room_id: &str, body: &crate::types::UpdateRoomProfileRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!("/rooms/{}", crate::progenitor_support::encode_path(room_id),), None, @@ -312,7 +331,7 @@ impl Rooms { &self, room_id: &str, setting_type: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !setting_type.is_empty() { query_args.push(("setting_type".to_string(), setting_type.to_string())); @@ -355,7 +374,11 @@ impl Rooms { * `meeting`: Meeting settings of the Zoom Room.
* `signage`: Digital signage settings applied on the Zoom Room. */ - pub async fn update_zr_settings(&self, room_id: &str, setting_type: &str) -> ClientResult<()> { + pub async fn update_zr_settings( + &self, + room_id: &str, + setting_type: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !setting_type.is_empty() { query_args.push(("setting_type".to_string(), setting_type.to_string())); @@ -399,7 +422,7 @@ impl Rooms { pub async fn list_zr_devices( &self, room_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/rooms/{}/devices", @@ -437,7 +460,7 @@ impl Rooms { &self, room_id: &str, body: &crate::types::ChangeZrLocationRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/rooms/{}/location", @@ -476,7 +499,7 @@ impl Rooms { &self, id: &str, body: &crate::types::CheckInRoomsRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/rooms/{}/events", @@ -523,7 +546,7 @@ impl Rooms { folder_id: &str, page_size: i64, next_page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !folder_id.is_empty() { query_args.push(("folder_id".to_string(), folder_id.to_string())); @@ -541,7 +564,7 @@ impl Rooms { let url = self .client .url(&format!("/rooms/digital_signage?{}", query_), None); - let resp: crate::types::ListDigitalSignageContentResponse = self + let resp: crate::Response = self .client .get( &url, @@ -553,7 +576,11 @@ impl Rooms { .await?; // Return our response data. - Ok(resp.contents.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.contents.to_vec(), + )) } /** * List digital signage contents. @@ -575,7 +602,7 @@ impl Rooms { &self, type_: &str, folder_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !folder_id.is_empty() { query_args.push(("folder_id".to_string(), folder_id.to_string())); @@ -587,7 +614,11 @@ impl Rooms { let url = self .client .url(&format!("/rooms/digital_signage?{}", query_), None); - let mut resp: crate::types::ListDigitalSignageContentResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -598,14 +629,18 @@ impl Rooms { ) .await?; - let mut contents = resp.contents; - let mut page = resp.next_page_token; + let mut contents = body.contents; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -616,7 +651,11 @@ impl Rooms { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -628,17 +667,17 @@ impl Rooms { .await?; } - contents.append(&mut resp.contents); + contents.append(&mut body.contents); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(contents) + Ok(crate::Response::new(status, headers, contents)) } /** * Update E911 digital signage. @@ -656,7 +695,7 @@ impl Rooms { */ pub async fn manage_e_91_1signage( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/rooms/events", None); self.client .patch( diff --git a/zoom/src/rooms_account.rs b/zoom/src/rooms_account.rs index 7be0bb94..c95a6b0c 100644 --- a/zoom/src/rooms_account.rs +++ b/zoom/src/rooms_account.rs @@ -26,7 +26,7 @@ impl RoomsAccount { */ pub async fn get_zr_account_profile( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/rooms/account_profile", None); self.client .get( @@ -54,7 +54,7 @@ impl RoomsAccount { pub async fn update_zr_acc_profile( &self, body: &crate::types::UpdateZrAccProfileRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/rooms/account_profile", None); self.client .patch( @@ -88,7 +88,7 @@ impl RoomsAccount { pub async fn get_zr_account_setting( &self, setting_type: crate::types::SettingType, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !setting_type.to_string().is_empty() { query_args.push(("setting_type".to_string(), setting_type.to_string())); @@ -129,7 +129,7 @@ impl RoomsAccount { pub async fn update_zoom_room_acc_settings( &self, setting_type: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !setting_type.is_empty() { query_args.push(("setting_type".to_string(), setting_type.to_string())); diff --git a/zoom/src/rooms_devices.rs b/zoom/src/rooms_devices.rs index 4a9762b3..317c3d11 100644 --- a/zoom/src/rooms_devices.rs +++ b/zoom/src/rooms_devices.rs @@ -32,7 +32,7 @@ impl RoomsDevices { room_id: &str, device_id: &str, body: &crate::types::ChangeZoomRoomsAppVersionRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/rooms/{}/devices/{}/app_version", diff --git a/zoom/src/rooms_location.rs b/zoom/src/rooms_location.rs index 927969f8..d9e66f2b 100644 --- a/zoom/src/rooms_location.rs +++ b/zoom/src/rooms_location.rs @@ -38,7 +38,7 @@ impl RoomsLocation { type_: &str, page_size: i64, next_page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -59,7 +59,7 @@ impl RoomsLocation { let url = self .client .url(&format!("/rooms/locations?{}", query_), None); - let resp: crate::types::ListZrLocationsResponseData = self + let resp: crate::Response = self .client .get( &url, @@ -71,7 +71,11 @@ impl RoomsLocation { .await?; // Return our response data. - Ok(resp.locations.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.locations.to_vec(), + )) } /** * List Zoom Room locations. @@ -92,7 +96,7 @@ impl RoomsLocation { &self, parent_location_id: &str, type_: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !parent_location_id.is_empty() { query_args.push(( @@ -107,7 +111,11 @@ impl RoomsLocation { let url = self .client .url(&format!("/rooms/locations?{}", query_), None); - let mut resp: crate::types::ListZrLocationsResponseData = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -118,14 +126,18 @@ impl RoomsLocation { ) .await?; - let mut locations = resp.locations; - let mut page = resp.next_page_token; + let mut locations = body.locations; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -136,7 +148,11 @@ impl RoomsLocation { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -148,17 +164,17 @@ impl RoomsLocation { .await?; } - locations.append(&mut resp.locations); + locations.append(&mut body.locations); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(locations) + Ok(crate::Response::new(status, headers, locations)) } /** * Add a location. @@ -178,7 +194,7 @@ impl RoomsLocation { pub async fn add_azr_location( &self, body: &crate::types::AddAzrLocationRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/rooms/locations", None); self.client .post( @@ -211,7 +227,7 @@ impl RoomsLocation { pub async fn get_zr_location_profile( &self, location_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/rooms/locations/{}", @@ -252,7 +268,7 @@ impl RoomsLocation { &self, location_id: &str, body: &crate::types::GetZrLocationProfileResponse, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/rooms/locations/{}", @@ -293,7 +309,7 @@ impl RoomsLocation { &self, location_id: &str, setting_type: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !setting_type.is_empty() { query_args.push(("setting_type".to_string(), setting_type.to_string())); @@ -340,7 +356,7 @@ impl RoomsLocation { &self, location_id: &str, setting_type: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !setting_type.is_empty() { query_args.push(("setting_type".to_string(), setting_type.to_string())); @@ -378,7 +394,7 @@ impl RoomsLocation { */ pub async fn get_zr_location_structure( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/rooms/locations/structure", None); self.client .get( @@ -405,7 +421,7 @@ impl RoomsLocation { pub async fn update_zoom_structure( &self, body: &crate::types::GetZrLocationStructureResponse, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url("/rooms/locations/structure", None); self.client .patch( @@ -437,7 +453,7 @@ impl RoomsLocation { &self, location_id: &str, body: &crate::types::ChangeParentLocationRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/rooms/locations/{}/location", diff --git a/zoom/src/sip_connected_audio.rs b/zoom/src/sip_connected_audio.rs index f0c1fef4..f3e6c631 100644 --- a/zoom/src/sip_connected_audio.rs +++ b/zoom/src/sip_connected_audio.rs @@ -27,7 +27,7 @@ impl SipConnectedAudio { */ pub async fn list_sip_trunk_numbers( &self, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/sip_trunk/numbers", None); self.client .get( @@ -58,7 +58,7 @@ impl SipConnectedAudio { &self, account_id: &str, body: &crate::types::AssignSipConfigRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/sip_trunk/settings", @@ -98,7 +98,7 @@ impl SipConnectedAudio { &self, account_id: &str, body: &crate::types::AssignSipTrunkNumbersRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/sip_trunk/numbers", @@ -133,7 +133,10 @@ impl SipConnectedAudio { * * * `account_id: &str` -- Account ID of the sub account from which the numbers are to be deleted. This can be retrieved from [List sub accounts](https://marketplace.zoom.us/docs/api-reference/zoom-api/accounts/account) API. */ - pub async fn delete_all_sip_numbers(&self, account_id: &str) -> ClientResult<()> { + pub async fn delete_all_sip_numbers( + &self, + account_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/sip_trunk/numbers", @@ -168,7 +171,7 @@ impl SipConnectedAudio { pub async fn list_sip_trunk( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/sip_trunk/trunks", @@ -203,7 +206,7 @@ impl SipConnectedAudio { &self, account_id: &str, body: &crate::types::AssignSipTrunksRequestData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/sip_trunk/trunks", @@ -240,7 +243,7 @@ impl SipConnectedAudio { &self, account_id: &str, trunk_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/sip_trunk/trunks/{}", @@ -276,7 +279,7 @@ impl SipConnectedAudio { pub async fn list_internal_callout_countries( &self, account_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/sip_trunk/callout_countries", @@ -312,7 +315,7 @@ impl SipConnectedAudio { &self, account_id: &str, body: &crate::types::AddCalloutCountriesRequestData, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/sip_trunk/callout_countries", @@ -350,7 +353,7 @@ impl SipConnectedAudio { &self, account_id: &str, country_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/sip_trunk/callout_countries/{}", @@ -393,7 +396,7 @@ impl SipConnectedAudio { account_id: &str, page_size: i64, next_page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -410,7 +413,7 @@ impl SipConnectedAudio { ), None, ); - let resp: crate::types::ListInternalNumbersResponse = self + let resp: crate::Response = self .client .get( &url, @@ -422,7 +425,11 @@ impl SipConnectedAudio { .await?; // Return our response data. - Ok(resp.internal_numbers.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.internal_numbers.to_vec(), + )) } /** * List internal numbers. @@ -442,7 +449,7 @@ impl SipConnectedAudio { pub async fn list_all_internal_numbers( &self, account_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/accounts/{}/sip_trunk/internal_numbers", @@ -450,7 +457,11 @@ impl SipConnectedAudio { ), None, ); - let mut resp: crate::types::ListInternalNumbersResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -461,14 +472,18 @@ impl SipConnectedAudio { ) .await?; - let mut internal_numbers = resp.internal_numbers; - let mut page = resp.next_page_token; + let mut internal_numbers = body.internal_numbers; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -479,7 +494,11 @@ impl SipConnectedAudio { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -491,17 +510,17 @@ impl SipConnectedAudio { .await?; } - internal_numbers.append(&mut resp.internal_numbers); + internal_numbers.append(&mut body.internal_numbers); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(internal_numbers) + Ok(crate::Response::new(status, headers, internal_numbers)) } /** * Add internal numbers. @@ -523,7 +542,7 @@ impl SipConnectedAudio { &self, account_id: &str, body: &crate::types::AddInternalNumbersRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/sip_trunk/internal_numbers", @@ -563,7 +582,7 @@ impl SipConnectedAudio { &self, account_id: &str, number_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/sip_trunk/internal_numbers/{}", diff --git a/zoom/src/sip_phone.rs b/zoom/src/sip_phone.rs index 99b7cec0..bfe8c476 100644 --- a/zoom/src/sip_phone.rs +++ b/zoom/src/sip_phone.rs @@ -39,7 +39,7 @@ impl SipPhone { search_key: &str, page_size: i64, next_page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -55,7 +55,7 @@ impl SipPhone { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/sip_phones?{}", query_), None); - let resp: crate::types::ListSipPhonesResponse = self + let resp: crate::Response = self .client .get( &url, @@ -67,7 +67,11 @@ impl SipPhone { .await?; // Return our response data. - Ok(resp.phones.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.phones.to_vec(), + )) } /** * List SIP phones. @@ -83,14 +87,21 @@ impl SipPhone { * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`
* */ - pub async fn list_all(&self, search_key: &str) -> ClientResult> { + pub async fn list_all( + &self, + search_key: &str, + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !search_key.is_empty() { query_args.push(("search_key".to_string(), search_key.to_string())); } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/sip_phones?{}", query_), None); - let mut resp: crate::types::ListSipPhonesResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -101,14 +112,18 @@ impl SipPhone { ) .await?; - let mut phones = resp.phones; - let mut page = resp.next_page_token; + let mut phones = body.phones; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -119,7 +134,11 @@ impl SipPhone { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -131,17 +150,17 @@ impl SipPhone { .await?; } - phones.append(&mut resp.phones); + phones.append(&mut body.phones); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(phones) + Ok(crate::Response::new(status, headers, phones)) } /** * Enable SIP phone. @@ -157,7 +176,10 @@ impl SipPhone { * * */ - pub async fn create(&self, body: &crate::types::CreateSipPhoneRequest) -> ClientResult<()> { + pub async fn create( + &self, + body: &crate::types::CreateSipPhoneRequest, + ) -> ClientResult> { let url = self.client.url("/sip_phones", None); self.client .post( @@ -185,7 +207,7 @@ impl SipPhone { * * * `phone_id: &str` -- Unique Identifier of the SIP Phone. It can be retrieved from the List SIP Phones API. */ - pub async fn delete(&self, phone_id: &str) -> ClientResult<()> { + pub async fn delete(&self, phone_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/sip_phones/{}", @@ -223,7 +245,7 @@ impl SipPhone { &self, phone_id: &str, body: &crate::types::UpdateSipPhoneRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/sip_phones/{}", diff --git a/zoom/src/tracking_field.rs b/zoom/src/tracking_field.rs index c42d3973..da87ab6e 100644 --- a/zoom/src/tracking_field.rs +++ b/zoom/src/tracking_field.rs @@ -23,7 +23,7 @@ impl TrackingField { * **Prerequisites:** * * Business, Education, API or higher plan */ - pub async fn trackingfield_list(&self) -> ClientResult { + pub async fn trackingfield_list(&self) -> ClientResult> { let url = self.client.url("/tracking_fields", None); self.client .get( @@ -50,7 +50,7 @@ impl TrackingField { pub async fn trackingfield_create( &self, body: &crate::types::TrackingField, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/tracking_fields", None); self.client .post( @@ -82,7 +82,7 @@ impl TrackingField { pub async fn trackingfield_get( &self, field_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/tracking_fields/{}", @@ -116,7 +116,7 @@ impl TrackingField { * * * `field_id: &str` -- The Tracking Field ID. */ - pub async fn trackingfield_delete(&self, field_id: &str) -> ClientResult<()> { + pub async fn trackingfield_delete(&self, field_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/tracking_fields/{}", @@ -154,7 +154,7 @@ impl TrackingField { &self, field_id: &str, body: &crate::types::TrackingField, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/tracking_fields/{}", diff --git a/zoom/src/tsp.rs b/zoom/src/tsp.rs index c60e978c..1fdd3837 100644 --- a/zoom/src/tsp.rs +++ b/zoom/src/tsp.rs @@ -24,7 +24,7 @@ impl Tsp { * **Prerequisites:**
* * A Pro or a higher plan. */ - pub async fn get(&self) -> ClientResult { + pub async fn get(&self) -> ClientResult> { let url = self.client.url("/tsp", None); self.client .get( @@ -49,7 +49,10 @@ impl Tsp { * **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light` * */ - pub async fn update(&self, body: &crate::types::TspUpdateRequest) -> ClientResult<()> { + pub async fn update( + &self, + body: &crate::types::TspUpdateRequest, + ) -> ClientResult> { let url = self.client.url("/tsp", None); self.client .patch( @@ -75,7 +78,10 @@ impl Tsp { * * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId. */ - pub async fn user_ts_ps(&self, user_id: &str) -> ClientResult { + pub async fn user_ts_ps( + &self, + user_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/tsp", @@ -112,7 +118,7 @@ impl Tsp { &self, user_id: &str, body: &crate::types::TspAccountsList, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/tsp", @@ -151,7 +157,7 @@ impl Tsp { &self, user_id: &str, tsp_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/tsp/{}", @@ -187,7 +193,11 @@ impl Tsp { * * `tsp_id: &str` -- Audio types:
`1` - Toll-free Call-in & Call-out.
`2` - Toll
* `3` - SIP Connected Audio. */ - pub async fn user_delete(&self, user_id: &str, tsp_id: &str) -> ClientResult<()> { + pub async fn user_delete( + &self, + user_id: &str, + tsp_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/tsp/{}", @@ -228,7 +238,7 @@ impl Tsp { user_id: &str, tsp_id: &str, body: &crate::types::TspAccountData, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/tsp/{}", @@ -266,7 +276,7 @@ impl Tsp { &self, user_id: &str, body: &crate::types::TspGlobalDialIn, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/tsp/settings", diff --git a/zoom/src/users.rs b/zoom/src/users.rs index 8a071341..30546521 100644 --- a/zoom/src/users.rs +++ b/zoom/src/users.rs @@ -44,7 +44,7 @@ impl Users { page_number: &str, include_fields: crate::types::UsersIncludeFields, next_page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_fields.to_string().is_empty() { query_args.push(("include_fields".to_string(), include_fields.to_string())); @@ -66,7 +66,7 @@ impl Users { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/users?{}", query_), None); - let resp: crate::types::UsersResponseData = self + let resp: crate::Response = self .client .get( &url, @@ -78,7 +78,11 @@ impl Users { .await?; // Return our response data. - Ok(resp.users.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.users.to_vec(), + )) } /** * List users. @@ -96,7 +100,7 @@ impl Users { status: crate::types::UsersStatus, role_id: &str, include_fields: crate::types::UsersIncludeFields, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !include_fields.to_string().is_empty() { query_args.push(("include_fields".to_string(), include_fields.to_string())); @@ -109,7 +113,11 @@ impl Users { } let query_ = serde_urlencoded::to_string(&query_args).unwrap(); let url = self.client.url(&format!("/users?{}", query_), None); - let mut resp: crate::types::UsersResponseData = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -120,14 +128,18 @@ impl Users { ) .await?; - let mut users = resp.users; - let mut page = resp.next_page_token; + let mut users = body.users; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -138,7 +150,11 @@ impl Users { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -150,17 +166,17 @@ impl Users { .await?; } - users.append(&mut resp.users); + users.append(&mut body.users); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(users) + Ok(crate::Response::new(status, headers, users)) } /** * Create users. @@ -177,7 +193,7 @@ impl Users { pub async fn create( &self, body: &crate::types::UserCreateRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url("/users", None); self.client .post( @@ -217,7 +233,7 @@ impl Users { user_id: &str, login_type: crate::types::LoginType, encrypted_email: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if encrypted_email { query_args.push(("encrypted_email".to_string(), encrypted_email.to_string())); @@ -274,7 +290,7 @@ impl Users { transfer_meeting: bool, transfer_webinar: bool, transfer_recording: bool, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !action.to_string().is_empty() { query_args.push(("action".to_string(), action.to_string())); @@ -338,7 +354,7 @@ impl Users { user_id: &str, login_type: crate::types::LoginType, body: &crate::types::UserUpdate, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !login_type.to_string().is_empty() { query_args.push(("login_type".to_string(), login_type.to_string())); @@ -374,7 +390,7 @@ impl Users { * * */ - pub async fn zak(&self) -> ClientResult { + pub async fn zak(&self) -> ClientResult> { let url = self.client.url("/users/me/zak", None); self.client .get( @@ -405,7 +421,10 @@ impl Users { * * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId. */ - pub async fn assistant(&self, user_id: &str) -> ClientResult { + pub async fn assistant( + &self, + user_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/assistants", @@ -446,7 +465,7 @@ impl Users { &self, user_id: &str, body: &crate::types::UserAssistantsList, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/assistants", @@ -483,7 +502,7 @@ impl Users { * * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId. */ - pub async fn assistants_delete(&self, user_id: &str) -> ClientResult<()> { + pub async fn assistants_delete(&self, user_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/assistants", @@ -521,7 +540,11 @@ impl Users { * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId. * * `assistant_id: &str` -- User's first name. */ - pub async fn assistant_delete(&self, user_id: &str, assistant_id: &str) -> ClientResult<()> { + pub async fn assistant_delete( + &self, + user_id: &str, + assistant_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/assistants/{}", @@ -558,7 +581,10 @@ impl Users { * * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId. */ - pub async fn scheduler(&self, user_id: &str) -> ClientResult { + pub async fn scheduler( + &self, + user_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/schedulers", @@ -594,7 +620,7 @@ impl Users { * * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId. */ - pub async fn schedulers_delete(&self, user_id: &str) -> ClientResult<()> { + pub async fn schedulers_delete(&self, user_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/schedulers", @@ -631,7 +657,11 @@ impl Users { * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId. * * `scheduler_id: &str` -- User's first name. */ - pub async fn scheduler_delete(&self, user_id: &str, scheduler_id: &str) -> ClientResult<()> { + pub async fn scheduler_delete( + &self, + user_id: &str, + scheduler_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/schedulers/{}", @@ -665,7 +695,7 @@ impl Users { * * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId. */ - pub async fn picture(&self, user_id: &str) -> ClientResult<()> { + pub async fn picture(&self, user_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/picture", @@ -721,7 +751,7 @@ impl Users { login_type: crate::types::LoginType, option: crate::types::OptionData, custom_query_fields: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -792,7 +822,7 @@ impl Users { login_type: crate::types::LoginType, option: crate::types::OptionData, custom_query_fields: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -863,7 +893,7 @@ impl Users { login_type: crate::types::LoginType, option: crate::types::OptionData, custom_query_fields: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -934,7 +964,7 @@ impl Users { login_type: crate::types::LoginType, option: crate::types::OptionData, custom_query_fields: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !custom_query_fields.is_empty() { query_args.push(( @@ -986,7 +1016,7 @@ impl Users { option: crate::types::UserSettingsUpdateOption, user_id: &str, body: &crate::types::UserSettingsUpdateRequestOneOf, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !option.to_string().is_empty() { query_args.push(("option".to_string(), option.to_string())); @@ -1029,7 +1059,7 @@ impl Users { &self, user_id: &str, body: &crate::types::UserStatusRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/status", @@ -1069,7 +1099,7 @@ impl Users { &self, user_id: &str, body: &crate::types::UserPasswordRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/password", @@ -1102,7 +1132,10 @@ impl Users { * * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId. */ - pub async fn permission(&self, user_id: &str) -> ClientResult { + pub async fn permission( + &self, + user_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/permissions", @@ -1142,7 +1175,7 @@ impl Users { user_id: &str, type_: crate::types::UserTokenType, ttl: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if ttl > 0 { query_args.push(("ttl".to_string(), ttl.to_string())); @@ -1184,7 +1217,7 @@ impl Users { * * * `user_id: &str` -- The user ID or email address of the user. For user-level apps, pass `me` as the value for userId. */ - pub async fn sso_token_delete(&self, user_id: &str) -> ClientResult<()> { + pub async fn sso_token_delete(&self, user_id: &str) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/token", @@ -1220,7 +1253,10 @@ impl Users { * * * `email: &str` -- The email address to be verified. */ - pub async fn email(&self, email: &str) -> ClientResult { + pub async fn email( + &self, + email: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !email.is_empty() { query_args.push(("email".to_string(), email.to_string())); @@ -1261,7 +1297,7 @@ impl Users { &self, user_id: &str, body: &crate::types::Members, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/email", @@ -1297,7 +1333,7 @@ impl Users { pub async fn vanity_name( &self, vanity_name: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !vanity_name.is_empty() { query_args.push(("vanity_name".to_string(), vanity_name.to_string())); @@ -1345,7 +1381,7 @@ impl Users { account_id: &str, user_id: &str, body: &crate::types::SwitchUserAccountRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/accounts/{}/users/{}/account", @@ -1390,7 +1426,7 @@ impl Users { &self, user_id: &str, body: &crate::types::UpdatePresenceStatusRequestData, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/presence_status", @@ -1431,7 +1467,7 @@ impl Users { &self, user_id: &str, body: &crate::types::UploadVbRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/settings/virtual_backgrounds", @@ -1466,7 +1502,7 @@ impl Users { * * `file_ids: &str` -- Provide the id of the file that is to be deleted. To delete multiple files, provide comma separated values for this field. * * `user_id: &str` -- Unique identifier of the user. Retrieve the value of this field by calling the [List users](https://marketplace.zoom.us/docs/api-reference/zoom-api/users/users) API. . */ - pub async fn del_vb(&self, user_id: &str, file_ids: &str) -> ClientResult<()> { + pub async fn del_vb(&self, user_id: &str, file_ids: &str) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !file_ids.is_empty() { query_args.push(("file_ids".to_string(), file_ids.to_string())); diff --git a/zoom/src/webinars.rs b/zoom/src/webinars.rs index 11e1db56..2d839d0a 100644 --- a/zoom/src/webinars.rs +++ b/zoom/src/webinars.rs @@ -39,7 +39,7 @@ impl Webinars { user_id: &str, page_size: i64, page_number: i64, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if page_number > 0 { query_args.push(("page_number".to_string(), page_number.to_string())); @@ -87,7 +87,7 @@ impl Webinars { pub async fn create( &self, user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/webinars", @@ -126,7 +126,7 @@ impl Webinars { webinar_id: i64, occurrence_id: &str, show_previous_occurrences: bool, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !occurrence_id.is_empty() { query_args.push(("occurrence_id".to_string(), occurrence_id.to_string())); @@ -183,7 +183,7 @@ impl Webinars { webinar_id: i64, occurrence_id: &str, cancel_webinar_reminder: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !cancel_webinar_reminder.is_empty() { query_args.push(( @@ -231,7 +231,11 @@ impl Webinars { * * `webinar_id: i64` -- The webinar ID in "**long**" format(represented as int64 data type in JSON). . * * `occurrence_id: &str` -- Webinar occurrence id. Support change of agenda, start_time, duration, settings: {host_video, panelist_video, hd_video, watermark, auto_recording}. */ - pub async fn update(&self, webinar_id: i64, occurrence_id: &str) -> ClientResult<()> { + pub async fn update( + &self, + webinar_id: i64, + occurrence_id: &str, + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !occurrence_id.is_empty() { query_args.push(("occurrence_id".to_string(), occurrence_id.to_string())); @@ -283,7 +287,7 @@ impl Webinars { webinar_id: &str, page_size: i64, next_page_token: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -300,7 +304,7 @@ impl Webinars { ), None, ); - let resp: crate::types::ListWebinarParticipantsResponse = self + let resp: crate::Response = self .client .get( &url, @@ -312,7 +316,11 @@ impl Webinars { .await?; // Return our response data. - Ok(resp.participants.to_vec()) + Ok(crate::Response::new( + resp.status, + resp.headers, + resp.body.participants.to_vec(), + )) } /** * List webinar participants. @@ -336,7 +344,7 @@ impl Webinars { pub async fn list_all_participants( &self, webinar_id: &str, - ) -> ClientResult> { + ) -> ClientResult>> { let url = self.client.url( &format!( "/past_webinars/{}/participants", @@ -344,7 +352,11 @@ impl Webinars { ), None, ); - let mut resp: crate::types::ListWebinarParticipantsResponse = self + let crate::Response:: { + mut status, + mut headers, + mut body, + } = self .client .get( &url, @@ -355,14 +367,18 @@ impl Webinars { ) .await?; - let mut participants = resp.participants; - let mut page = resp.next_page_token; + let mut participants = body.participants; + let mut page = body.next_page_token; // Paginate if we should. while !page.is_empty() { // Check if we already have URL params and need to concat the token. if !url.contains('?') { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}?next_page_token={}", url, page), @@ -373,7 +389,11 @@ impl Webinars { ) .await?; } else { - resp = self + crate::Response:: { + status, + headers, + body, + } = self .client .get( &format!("{}&next_page_token={}", url, page), @@ -385,17 +405,17 @@ impl Webinars { .await?; } - participants.append(&mut resp.participants); + participants.append(&mut body.participants); - if !resp.next_page_token.is_empty() && resp.next_page_token != page { - page = resp.next_page_token.to_string(); + if !body.next_page_token.is_empty() && body.next_page_token != page { + page = body.next_page_token.to_string(); } else { page = "".to_string(); } } // Return our response data. - Ok(participants) + Ok(crate::Response::new(status, headers, participants)) } /** * Update webinar status. @@ -417,7 +437,7 @@ impl Webinars { &self, webinar_id: i64, body: &crate::types::WebinarStatusRequest, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/status", @@ -453,7 +473,10 @@ impl Webinars { * * * `webinar_id: i64` -- The webinar ID in "**long**" format(represented as int64 data type in JSON). . */ - pub async fn panelist(&self, webinar_id: i64) -> ClientResult { + pub async fn panelist( + &self, + webinar_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/panelists", @@ -492,7 +515,7 @@ impl Webinars { &self, webinar_id: i64, body: &crate::types::WebinarPanelist, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/panelists", @@ -526,7 +549,7 @@ impl Webinars { * * * `webinar_id: i64` -- The webinar ID in "**long**" format(represented as int64 data type in JSON). . */ - pub async fn panelists_delete(&self, webinar_id: i64) -> ClientResult<()> { + pub async fn panelists_delete(&self, webinar_id: i64) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/panelists", @@ -563,7 +586,11 @@ impl Webinars { * * `webinar_id: i64` -- The webinar ID in "**long**" format(represented as int64 data type in JSON). . * * `panelist_id: i64` -- The panelist ID or panelist email. */ - pub async fn panelist_delete(&self, webinar_id: i64, panelist_id: i64) -> ClientResult<()> { + pub async fn panelist_delete( + &self, + webinar_id: i64, + panelist_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/panelists/{}", @@ -618,7 +645,7 @@ impl Webinars { page_size: i64, page_number: i64, next_page_token: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -681,7 +708,7 @@ impl Webinars { &self, webinar_id: &str, occurrence_ids: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !occurrence_ids.is_empty() { query_args.push(("occurrence_ids".to_string(), occurrence_ids.to_string())); @@ -734,7 +761,7 @@ impl Webinars { &self, webinar_id: &str, body: &crate::types::AddBatchRegistrantsRequest, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/batch_registrants", @@ -774,7 +801,7 @@ impl Webinars { webinar_id: i64, occurrence_id: &str, body: &crate::types::RegistrantStatus, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !occurrence_id.is_empty() { query_args.push(("occurrence_id".to_string(), occurrence_id.to_string())); @@ -814,7 +841,10 @@ impl Webinars { * * * `webinar_id: i64` -- The webinar ID in "**long**" format(represented as int64 data type in JSON). . */ - pub async fn past(&self, webinar_id: i64) -> ClientResult { + pub async fn past( + &self, + webinar_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/past_webinars/{}/instances", @@ -848,7 +878,10 @@ impl Webinars { * * * `webinar_id: i64` -- The webinar ID in "**long**" format(represented as int64 data type in JSON). . */ - pub async fn poll(&self, webinar_id: i64) -> ClientResult { + pub async fn poll( + &self, + webinar_id: i64, + ) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/polls", @@ -886,7 +919,7 @@ impl Webinars { &self, webinar_id: i64, body: &crate::types::Poll, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/polls", @@ -925,7 +958,7 @@ impl Webinars { &self, webinar_id: i64, poll_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/polls/{}", @@ -966,7 +999,7 @@ impl Webinars { webinar_id: i64, poll_id: &str, body: &crate::types::Poll, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/polls/{}", @@ -1002,7 +1035,11 @@ impl Webinars { * * `webinar_id: i64` -- The webinar ID in "**long**" format(represented as int64 data type in JSON). . * * `poll_id: &str` -- User's first name. */ - pub async fn poll_delete(&self, webinar_id: i64, poll_id: &str) -> ClientResult<()> { + pub async fn poll_delete( + &self, + webinar_id: i64, + poll_id: &str, + ) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/polls/{}", @@ -1042,7 +1079,7 @@ impl Webinars { pub async fn registrants_questions_get( &self, webinar_id: i64, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/registrants/questions", @@ -1083,7 +1120,7 @@ impl Webinars { &self, webinar_id: i64, body: &crate::types::WebinarRegistrantQuestions, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/registrants/questions", @@ -1124,7 +1161,7 @@ impl Webinars { webinar_id: &str, registrant_id: &str, occurrence_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !occurrence_id.is_empty() { query_args.push(("occurrence_id".to_string(), occurrence_id.to_string())); @@ -1170,7 +1207,7 @@ impl Webinars { webinar_id: &str, registrant_id: &str, occurrence_id: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !occurrence_id.is_empty() { query_args.push(("occurrence_id".to_string(), occurrence_id.to_string())); @@ -1217,7 +1254,7 @@ impl Webinars { page_size: i64, next_page_token: &str, webinar_uuid: &str, - ) -> ClientResult { + ) -> ClientResult> { let mut query_args: Vec<(String, String)> = Default::default(); if !next_page_token.is_empty() { query_args.push(("next_page_token".to_string(), next_page_token.to_string())); @@ -1268,7 +1305,7 @@ impl Webinars { pub async fn get_tracking_sources( &self, webinar_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/tracking_sources", @@ -1309,7 +1346,7 @@ impl Webinars { pub async fn list_past_poll_results( &self, webinar_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/past_webinars/{}/polls", @@ -1352,7 +1389,7 @@ impl Webinars { pub async fn list_past_qa( &self, webinar_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/past_webinars/{}/qa", @@ -1385,7 +1422,7 @@ impl Webinars { pub async fn list_templates( &self, user_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/users/{}/webinar_templates", @@ -1426,7 +1463,7 @@ impl Webinars { pub async fn get_live_stream_details( &self, webinar_id: &str, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/livestream", @@ -1467,7 +1504,7 @@ impl Webinars { &self, webinar_id: &str, body: &crate::types::MeetingLiveStream, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/livestream", @@ -1507,7 +1544,7 @@ impl Webinars { &self, webinar_id: i64, body: &crate::types::WebinarLiveStreamStatus, - ) -> ClientResult<()> { + ) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/livestream/status", @@ -1546,7 +1583,7 @@ impl Webinars { &self, webinar_id: i64, body: &crate::types::InviteLink, - ) -> ClientResult { + ) -> ClientResult> { let url = self.client.url( &format!( "/webinars/{}/invite_links", From ed29957acc1019b56890ec681959a0a37f88a0c6 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Fri, 17 Mar 2023 10:12:11 -0500 Subject: [PATCH 02/40] Remove trait. Update test --- generator/src/main.rs | 3 +-- github/src/lib.rs | 1 - github/src/traits.rs | 55 ------------------------------------------- github/tests/tests.rs | 27 ++++++++------------- 4 files changed, 11 insertions(+), 75 deletions(-) delete mode 100644 github/src/traits.rs diff --git a/generator/src/main.rs b/generator/src/main.rs index 3770e3e1..c9bf4ac8 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -2314,8 +2314,7 @@ fn gen( a(r#"#[cfg_attr(docsrs, doc(cfg(feature = "httpcache")))]"#); a("pub mod http_cache;"); } - if proper_name == "GitHub" - || proper_name == "Google Drive" + if proper_name == "Google Drive" || proper_name == "Google Sheets" || proper_name == "SendGrid" || proper_name == "Rev.ai" diff --git a/github/src/lib.rs b/github/src/lib.rs index 5c42c772..49f547cd 100644 --- a/github/src/lib.rs +++ b/github/src/lib.rs @@ -236,7 +236,6 @@ pub mod search; pub mod secret_scanning; /// Interact with GitHub Teams. pub mod teams; -pub mod traits; pub mod types; /// Interact with and view information about users and also current user. pub mod users; diff --git a/github/src/traits.rs b/github/src/traits.rs deleted file mode 100644 index dcc9e15e..00000000 --- a/github/src/traits.rs +++ /dev/null @@ -1,55 +0,0 @@ -use async_trait::async_trait; -use bytes::Bytes; - -use crate::{actions::Actions, ClientResult, Response}; - -#[async_trait] -pub trait ActionsExt { - async fn download_contents( - &self, - owner: &str, - repo: &str, - artifact_id: i64, - archive_format: &str, - ) -> ClientResult>; -} - -#[async_trait] -impl ActionsExt for Actions { - async fn download_contents( - &self, - owner: &str, - repo: &str, - artifact_id: i64, - archive_format: &str, - ) -> ClientResult> { - let response = self - .download_artifact(owner, repo, artifact_id, archive_format) - .await?; - - let location = response - .headers - .get("Location") - .map(|v| v.to_str().unwrap()) - .unwrap(); - - let download = self - .client - .make_request( - http::Method::GET, - location, - crate::Message::default(), - crate::utils::MediaType::Json, - crate::auth::AuthenticationConstraint::Unconstrained, - ) - .await? - .send() - .await?; - - Ok(Response::new( - download.status(), - download.headers().clone(), - download.bytes().await?, - )) - } -} diff --git a/github/tests/tests.rs b/github/tests/tests.rs index e7cbc76f..77565742 100644 --- a/github/tests/tests.rs +++ b/github/tests/tests.rs @@ -305,9 +305,7 @@ async fn test_ratelimit_error() { } #[tokio::test] -async fn test_downloads_artifact() { - use octorust::traits::ActionsExt; - +async fn test_does_not_follow_redirects() { let installation_id = installation_id(); let jwt = JWTCredentials::new(app_id(), private_key()).expect("JWT creation should succeed"); @@ -358,18 +356,6 @@ async fn test_downloads_artifact() { .mount(&server) .await; - Mock::given(method("GET")) - .and(path(download_path.to_string())) - .respond_with( - ResponseTemplate::new(200) - .set_delay(Duration::from_secs(1)) - .set_body_bytes(vec![1, 1, 1, 1, 1, 1, 1, 1]), - ) - .expect(1) - .named("Download location") - .mount(&server) - .await; - let token_generator = InstallationTokenGenerator::new(installation_id, jwt); let mut client = Client::new( concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), @@ -380,10 +366,17 @@ async fn test_downloads_artifact() { let res = client .actions() - .download_contents("test_owner", "test_repo", 12345, "test_fmt") + .download_artifact("test_owner", "test_repo", 12345, "test_fmt") .await; mem::drop(server); - assert_eq!(res.unwrap().body.len(), 8) + assert!(res + .unwrap() + .headers + .get("Location") + .unwrap() + .to_str() + .unwrap() + .ends_with("/fake-download-path")); } From 4e5a91771929c6eb0e11d0c8df5e519c30fb7782 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 23 Mar 2023 12:39:06 -0500 Subject: [PATCH 03/40] Do not generate empty serde attributes --- generator/src/types.rs | 29 +++++++-- github/src/types.rs | 140 ----------------------------------------- 2 files changed, 24 insertions(+), 145 deletions(-) diff --git a/generator/src/types.rs b/generator/src/types.rs index ec6f5669..dfbd2642 100644 --- a/generator/src/types.rs +++ b/generator/src/types.rs @@ -175,6 +175,9 @@ pub fn generate_types(ts: &mut TypeSpace, proper_name: &str) -> Result { let te = ts.id_to_entry.get(tid).unwrap(); + // Assume that we are going to output a serde attribute + let mut started_serde_attr = true; + // Render the serde string. if rt == "String" || rt.starts_with("Vec<") @@ -258,7 +261,9 @@ pub fn generate_types(ts: &mut TypeSpace, proper_name: &str) -> Result { a(&format!(r#"skip_serializing_if = "{}::is_noop","#, rt)); } } else { - a(r#"#[serde("#); + // In only this case do we switch to not outputting the start of + // a serde attribute + started_serde_attr = false } if !prop.ends_with('_') { @@ -281,12 +286,26 @@ pub fn generate_types(ts: &mut TypeSpace, proper_name: &str) -> Result { prop = format!("{}_", prop); } - // Close the serde string. + // Before closing, ensure that we have actually opened a serde attribute, + // otherwise print the full tag if *name != prop { - a(&format!(r#"rename = "{}")]"#, name)); + if !started_serde_attr { + a(r#"#[serde("#); + started_serde_attr = true; + } + + a(&format!(r#"rename = "{}""#, name)); } else if rt == "Page" && prop == "page" || rt.ends_with("Page") { - a(r#"default)]"#); - } else { + if !started_serde_attr { + a(r#"#[serde("#); + started_serde_attr = true; + } + + a(r#"default,"#); + } + + // Only output the closing if output has actually started + if started_serde_attr { a(r#")]"#); } diff --git a/github/src/types.rs b/github/src/types.rs index 06ba902d..fdd1620a 100644 --- a/github/src/types.rs +++ b/github/src/types.rs @@ -254,7 +254,6 @@ pub struct GitHubApp { /** * The set of permissions for the GitHub app */ - #[serde()] pub permissions: Permissions, #[serde( default, @@ -759,9 +758,7 @@ pub struct HookDelivery { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub repository_id: i64, - #[serde()] pub request: Request, - #[serde()] pub response: Response, #[serde( default, @@ -1217,7 +1214,6 @@ pub struct Installation { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub access_tokens_url: String, - #[serde()] pub account: AccountAnyOf, #[serde( default, @@ -1275,7 +1271,6 @@ pub struct Installation { /** * The permissions granted to the user-to-server access token. */ - #[serde()] pub permissions: AppPermissions, #[serde( default, @@ -2620,7 +2615,6 @@ pub struct App { /// The authorization associated with an OAuth Access. #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct ApplicationGrant { - #[serde()] pub app: App, #[serde( default, @@ -2674,7 +2668,6 @@ pub struct ScopedInstallation { /** * The permissions granted to the user-to-server access token. */ - #[serde()] pub permissions: AppPermissions, #[serde( default, @@ -2704,7 +2697,6 @@ pub struct ScopedInstallation { /// The authorization for an OAuth app, GitHub App, or a Personal Access Token. #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct Authorization { - #[serde()] pub app: App, #[serde( default, @@ -2908,7 +2900,6 @@ pub struct ActionsEnterprisePermissions { /** * The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`. */ - #[serde()] pub enabled_organizations: EnabledRepositories, #[serde( default, @@ -3539,7 +3530,6 @@ pub struct ActionsBillingUsage { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub included_minutes: i64, - #[serde()] pub minutes_used_breakdown: MinutesUsedBreakdown, #[serde( default, @@ -3922,7 +3912,6 @@ pub struct IssueSimple { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -4139,7 +4128,6 @@ pub struct IssueComment { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -4306,7 +4294,6 @@ pub struct Event { /** * Actor */ - #[serde()] pub actor: Actor, #[serde( default, @@ -4325,7 +4312,6 @@ pub struct Event { */ #[serde(default, skip_serializing_if = "Option::is_none")] pub org: Option, - #[serde()] pub payload: Payload, #[serde( default, @@ -4397,12 +4383,10 @@ pub struct Links { /** * Hypermedia Link with Type */ - #[serde()] pub timeline: LinkWithType, /** * Hypermedia Link with Type */ - #[serde()] pub user: LinkWithType, } @@ -4532,7 +4516,6 @@ pub struct BaseGist { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub description: String, - #[serde()] pub files: Files, /** * Base Gist @@ -5026,7 +5009,6 @@ pub struct Gist { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub description: String, - #[serde()] pub files: Files, /** * Gist @@ -5297,7 +5279,6 @@ pub struct GistComment { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -5342,7 +5323,6 @@ pub struct GistComment { /// Gist Commit #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct GistCommit { - #[serde()] pub change_status: Stats, #[serde( default, @@ -5490,7 +5470,6 @@ pub struct Issue { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -5922,7 +5901,6 @@ pub struct MarketplacePurchaseData { pub login: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub marketplace_pending_change: Option, - #[serde()] pub marketplace_purchase: MarketplacePurchase, #[serde( default, @@ -6728,9 +6706,7 @@ pub struct Thread { /** * Minimal Repository */ - #[serde()] pub repository: MinimalRepository, - #[serde()] pub subject: Subject, #[serde( default, @@ -7158,7 +7134,6 @@ pub struct ActionsOrganizationPermissions { /** * The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`. */ - #[serde()] pub enabled_repositories: EnabledRepositories, #[serde( default, @@ -7533,7 +7508,6 @@ pub struct OrgHook { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub active: bool, - #[serde()] pub config: Config, #[serde( default, @@ -7648,7 +7622,6 @@ pub struct InteractionLimits { /** * The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: `existing_users`, `contributors_only`, `collaborators_only`. */ - #[serde()] pub limit: InteractionGroup, #[serde( default, @@ -7716,7 +7689,6 @@ pub struct InteractionLimit { /** * The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: `existing_users`, `contributors_only`, `collaborators_only`. */ - #[serde()] pub limit: InteractionGroup, } @@ -7998,7 +7970,6 @@ pub struct OrgMembership { /** * Organization Simple */ - #[serde()] pub organization: OrganizationSimple, #[serde( default, @@ -8636,7 +8607,6 @@ pub struct FullTeam { /** * Organization Full */ - #[serde()] pub organization: OrganizationFull, #[serde(default, skip_serializing_if = "Option::is_none")] pub parent: Option, @@ -9091,7 +9061,6 @@ pub struct TeamProject { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub owner_url: String, - #[serde()] pub permissions: TeamProjectPermissions, /** * A team's access to a project. @@ -9829,13 +9798,11 @@ pub struct RateLimit { pub struct Resources { #[serde(default, skip_serializing_if = "Option::is_none")] pub code_scanning_upload: Option, - #[serde()] pub core: RateLimit, #[serde(default, skip_serializing_if = "Option::is_none")] pub graphql: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub integration_manifest: Option, - #[serde()] pub search: RateLimit, #[serde(default, skip_serializing_if = "Option::is_none")] pub source_import: Option, @@ -9844,9 +9811,7 @@ pub struct Resources { /// Rate Limit Overview #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct RateLimitOverview { - #[serde()] pub rate: RateLimit, - #[serde()] pub resources: Resources, } @@ -10776,9 +10741,7 @@ pub struct Head { #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct PullRequestMinimal { - #[serde()] pub base: Head, - #[serde()] pub head: Head, #[serde( default, @@ -10914,7 +10877,6 @@ pub struct WorkflowRun { /** * Minimal Repository */ - #[serde()] pub head_repository: MinimalRepository, /** * An invocation of a workflow @@ -10976,7 +10938,6 @@ pub struct WorkflowRun { /** * Minimal Repository */ - #[serde()] pub repository: MinimalRepository, #[serde( default, @@ -11246,7 +11207,6 @@ pub struct PendingDeployment { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub current_user_can_approve: bool, - #[serde()] pub environment: Environment, /** * The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. @@ -11354,7 +11314,6 @@ pub struct Deployment { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub original_environment: String, - #[serde()] pub payload: PayloadOneOf, #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, @@ -11448,7 +11407,6 @@ pub struct Billable { /// Workflow Run Usage #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct WorkflowRunUsage { - #[serde()] pub billable: Billable, /** * Workflow Run Usage @@ -11621,7 +11579,6 @@ pub struct WorkflowUsageBillable { /// Workflow Usage #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct WorkflowUsage { - #[serde()] pub billable: WorkflowUsageBillable, } @@ -12239,7 +12196,6 @@ pub struct Tree { /// Short Branch #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct ShortBranch { - #[serde()] pub commit: Tree, #[serde( default, @@ -12332,7 +12288,6 @@ pub struct CommitData { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub message: String, - #[serde()] pub tree: Tree, #[serde( default, @@ -12447,7 +12402,6 @@ pub struct CommitDataType { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub comments_url: String, - #[serde()] pub commit: CommitData, #[serde(default, skip_serializing_if = "Option::is_none")] pub committer: Option, @@ -12522,7 +12476,6 @@ pub struct BranchWithProtection { /** * Commit */ - #[serde()] pub commit: CommitDataType, #[serde( default, @@ -12544,7 +12497,6 @@ pub struct BranchWithProtection { /** * Branch Protection */ - #[serde()] pub protection: BranchProtection, #[serde( default, @@ -12970,7 +12922,6 @@ pub struct CheckRun { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub node_id: String, - #[serde()] pub output: Output, #[serde( default, @@ -13102,7 +13053,6 @@ pub struct CheckSuiteData { /** * Simple Commit */ - #[serde()] pub head_commit: SimpleCommit, #[serde( default, @@ -13137,7 +13087,6 @@ pub struct CheckSuiteData { /** * Minimal Repository */ - #[serde()] pub repository: MinimalRepository, /** * The phase of the lifecycle that the job is currently in. @@ -13186,12 +13135,10 @@ pub struct Preferences { /// Check suite configuration preferences for a repository. #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct CheckSuitePreference { - #[serde()] pub preferences: Preferences, /** * Minimal Repository */ - #[serde()] pub repository: MinimalRepository, } @@ -13567,7 +13514,6 @@ pub struct CodeScanningAlertItems { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub instances_url: String, - #[serde()] pub most_recent_instance: CodeScanningAlertInstance, #[serde( default, @@ -13575,14 +13521,11 @@ pub struct CodeScanningAlertItems { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub number: i64, - #[serde()] pub rule: CodeScanningAlertRuleSummary, /** * State of a code scanning alert. */ - #[serde()] pub state: CodeScanningAlertState, - #[serde()] pub tool: CodeScanningAnalysisTool, #[serde( default, @@ -13727,7 +13670,6 @@ pub struct CodeScanningAlert { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub instances_url: String, - #[serde()] pub most_recent_instance: CodeScanningAlertInstance, #[serde( default, @@ -13735,14 +13677,11 @@ pub struct CodeScanningAlert { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub number: i64, - #[serde()] pub rule: CodeScanningAlertRule, /** * State of a code scanning alert. */ - #[serde()] pub state: CodeScanningAlertState, - #[serde()] pub tool: CodeScanningAnalysisTool, #[serde( default, @@ -13864,7 +13803,6 @@ pub struct CodeScanningAnalysis { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub sarif_id: String, - #[serde()] pub tool: CodeScanningAnalysisTool, #[serde( default, @@ -14199,7 +14137,6 @@ pub struct RepositoryInvitation { /** * Minimal Repository */ - #[serde()] pub repository: MinimalRepository, #[serde( default, @@ -14215,7 +14152,6 @@ pub struct CommitComment { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -14295,7 +14231,6 @@ pub struct CommitComment { /// Branch Short #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct BranchShort { - #[serde()] pub commit: Tree, #[serde( default, @@ -14454,32 +14389,26 @@ pub struct PullRequestSimpleLinks { /** * Hypermedia Link */ - #[serde()] pub comments: Link, /** * Hypermedia Link */ - #[serde()] pub commits: Link, /** * Hypermedia Link */ - #[serde()] pub html: Link, /** * Hypermedia Link */ - #[serde()] pub issue: Link, /** * Hypermedia Link */ - #[serde()] pub review_comment: Link, /** * Hypermedia Link */ - #[serde()] pub review_comments: Link, /** * Hypermedia Link @@ -14489,7 +14418,6 @@ pub struct PullRequestSimpleLinks { /** * Hypermedia Link */ - #[serde()] pub statuses: Link, } @@ -14515,14 +14443,12 @@ pub struct PullRequestSimple { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, /** * The status of auto merging a pull request. */ #[serde(default, skip_serializing_if = "Option::is_none")] pub auto_merge: Option, - #[serde()] pub base: Base, #[serde( default, @@ -14568,7 +14494,6 @@ pub struct PullRequestSimple { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub draft: bool, - #[serde()] pub head: PullRequestSimpleHead, #[serde( default, @@ -14773,7 +14698,6 @@ pub struct CombinedCommitStatus { /** * Minimal Repository */ - #[serde()] pub repository: MinimalRepository, #[serde( default, @@ -14937,7 +14861,6 @@ pub struct CommunityProfile { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub documentation: String, - #[serde()] pub files: CommunityProfileFiles, #[serde( default, @@ -15077,7 +15000,6 @@ pub struct CommitComparison { /** * Commit */ - #[serde()] pub base_commit: CommitDataType, #[serde( default, @@ -15115,7 +15037,6 @@ pub struct CommitComparison { /** * Commit */ - #[serde()] pub merge_base_commit: CommitDataType, #[serde( default, @@ -15696,7 +15617,6 @@ pub struct FileCommit { /// File Commit #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct FileCommitData { - #[serde()] pub commit: FileCommit, #[serde(default, skip_serializing_if = "Option::is_none")] pub content: Option, @@ -16230,12 +16150,10 @@ pub struct GitCommit { /** * Identifying information for the git-user */ - #[serde()] pub author: Committer, /** * Identifying information for the git-user */ - #[serde()] pub committer: Committer, #[serde( default, @@ -16267,7 +16185,6 @@ pub struct GitCommit { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub sha: String, - #[serde()] pub tree: Tree, #[serde( default, @@ -16275,7 +16192,6 @@ pub struct GitCommit { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub url: String, - #[serde()] pub verification: Verification, } @@ -16311,7 +16227,6 @@ pub struct GitRef { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub node_id: String, - #[serde()] pub object: Object, #[serde( default, @@ -16343,7 +16258,6 @@ pub struct GitTag { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub node_id: String, - #[serde()] pub object: Object, #[serde( default, @@ -16357,7 +16271,6 @@ pub struct GitTag { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub tag: String, - #[serde()] pub tagger: Tagger, #[serde( default, @@ -16534,7 +16447,6 @@ pub struct Hook { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub active: bool, - #[serde()] pub config: HookConfig, #[serde( default, @@ -16563,7 +16475,6 @@ pub struct Hook { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub id: i64, - #[serde()] pub last_response: HookResponse, #[serde( default, @@ -17202,7 +17113,6 @@ pub struct LabeledIssueEvent { /** * Issue Event Label */ - #[serde()] pub label: IssueEventLabel, #[serde( default, @@ -17331,7 +17241,6 @@ pub struct MilestonedIssueEvent { /** * Issue Event Milestone */ - #[serde()] pub milestone: IssueEventMilestone, #[serde( default, @@ -17401,7 +17310,6 @@ pub struct RenamedIssueEvent { */ #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, - #[serde()] pub rename: Rename, #[serde( default, @@ -17581,7 +17489,6 @@ pub struct ReviewDismissedIssueEvent { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub created_at: String, - #[serde()] pub dismissed_review: DismissedReview, #[serde( default, @@ -18018,7 +17925,6 @@ pub struct TimelineCommentEvent { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -18139,7 +18045,6 @@ pub struct TimelineCrossReferencedEvent { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub event: String, - #[serde()] pub source: Source, #[serde( default, @@ -18155,12 +18060,10 @@ pub struct TimelineCommittedEvent { /** * Identifying information for the git-user */ - #[serde()] pub author: Committer, /** * Identifying information for the git-user */ - #[serde()] pub committer: Committer, #[serde( default, @@ -18198,7 +18101,6 @@ pub struct TimelineCommittedEvent { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub sha: String, - #[serde()] pub tree: Tree, #[serde( default, @@ -18206,7 +18108,6 @@ pub struct TimelineCommittedEvent { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub url: String, - #[serde()] pub verification: Verification, } @@ -18215,12 +18116,10 @@ pub struct TimelineReviewedEventLinks { /** * Hypermedia Link */ - #[serde()] pub html: Link, /** * Hypermedia Link */ - #[serde()] pub pull_request: Link, } @@ -18232,7 +18131,6 @@ pub struct TimelineReviewedEvent { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -18315,12 +18213,10 @@ pub struct PullRequestReviewCommentLinks { /** * Hypermedia Link */ - #[serde()] pub html: Link, /** * Hypermedia Link */ - #[serde()] pub pull_request: Link, /** * Hypermedia Link @@ -18367,7 +18263,6 @@ pub struct PullRequestReviewComment { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -18948,7 +18843,6 @@ pub struct Page { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub html_url: String, - #[serde()] pub https_certificate: PagesHttpsCertificate, #[serde( default, @@ -18960,7 +18854,6 @@ pub struct Page { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub public: bool, - #[serde()] pub source: PagesSourceHash, /** * The status of the most recent build of the Page. @@ -19006,7 +18899,6 @@ pub struct PageBuild { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub duration: i64, - #[serde()] pub error: Error, #[serde(default, skip_serializing_if = "Option::is_none")] pub pusher: Option, @@ -19800,7 +19692,6 @@ pub struct PullRequestHeadRepo { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub open_issues_count: i64, - #[serde()] pub owner: User, #[serde(default, skip_serializing_if = "Option::is_none")] pub permissions: Option, @@ -19954,7 +19845,6 @@ pub struct PullRequestHead { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub sha: String, - #[serde()] pub user: User, } @@ -20287,7 +20177,6 @@ pub struct PullRequestBaseRepo { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub open_issues_count: i64, - #[serde()] pub owner: User, #[serde(default, skip_serializing_if = "Option::is_none")] pub permissions: Option, @@ -20444,7 +20333,6 @@ pub struct PullRequestBase { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub sha: String, - #[serde()] pub user: User, } @@ -20476,14 +20364,12 @@ pub struct PullRequestData { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, /** * The status of auto merging a pull request. */ #[serde(default, skip_serializing_if = "Option::is_none")] pub auto_merge: Option, - #[serde()] pub base: PullRequestBase, #[serde( default, @@ -20553,7 +20439,6 @@ pub struct PullRequestData { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub draft: bool, - #[serde()] pub head: PullRequestHead, #[serde( default, @@ -20760,7 +20645,6 @@ pub struct PullRequestReviewData { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -20834,12 +20718,10 @@ pub struct ReviewCommentLinks { /** * Hypermedia Link */ - #[serde()] pub html: Link, /** * Hypermedia Link */ - #[serde()] pub pull_request: Link, /** * Hypermedia Link @@ -20856,7 +20738,6 @@ pub struct ReviewComment { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -21575,7 +21456,6 @@ pub struct RepositorySubscription { /// Tag #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct Tag { - #[serde()] pub commit: Tree, #[serde( default, @@ -22250,9 +22130,7 @@ pub struct ScimUser { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub id: String, - #[serde()] pub meta: ScimUserMeta, - #[serde()] pub name: ScimUserName, /** * SCIM /Users provisioning endpoints @@ -22448,7 +22326,6 @@ pub struct CodeSearchResultItem { /** * Minimal Repository */ - #[serde()] pub repository: MinimalRepository, #[serde( default, @@ -22484,7 +22361,6 @@ pub struct CommitSearchResultItem { /** * Identifying information for the git-user */ - #[serde()] pub author: Committer, #[serde( default, @@ -22500,7 +22376,6 @@ pub struct CommitSearchResultItem { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub message: String, - #[serde()] pub tree: Tree, #[serde( default, @@ -22523,7 +22398,6 @@ pub struct CommitSearchResultItemData { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub comments_url: String, - #[serde()] pub commit: CommitSearchResultItem, #[serde(default, skip_serializing_if = "Option::is_none")] pub committer: Option, @@ -22548,7 +22422,6 @@ pub struct CommitSearchResultItemData { /** * Minimal Repository */ - #[serde()] pub repository: MinimalRepository, #[serde( default, @@ -22599,7 +22472,6 @@ pub struct IssueSearchResultItem { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -24268,7 +24140,6 @@ pub struct MarketplaceAccount { /// User Marketplace Purchase #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct UserMarketplacePurchase { - #[serde()] pub account: MarketplaceAccount, #[serde( default, @@ -24296,7 +24167,6 @@ pub struct UserMarketplacePurchase { /** * Marketplace Listing Plan */ - #[serde()] pub plan: MarketplaceListingPlan, #[serde( default, @@ -25244,7 +25114,6 @@ pub struct EnterpriseAdminSetGithubActionsPermissionsRequest { /** * The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`. */ - #[serde()] pub enabled_organizations: EnabledRepositories, } @@ -25477,7 +25346,6 @@ pub struct GistsCreateRequest { /** * Names and content for the files that make up the gist */ - #[serde()] pub files: FilesAdditionalPropertiesData, #[serde(default, skip_serializing_if = "Option::is_none")] pub public: Option, @@ -25901,7 +25769,6 @@ pub struct ActionsSetGithubPermissionsOrganizationRequest { /** * The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`. */ - #[serde()] pub enabled_repositories: EnabledRepositories, } @@ -26152,7 +26019,6 @@ pub struct OrgsCreateWebhookRequest { /** * Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/orgs#create-hook-config-params). */ - #[serde()] pub config: OrgsCreateWebhookRequestConfig, /** * The list of events for the GitHub app @@ -28559,7 +28425,6 @@ pub struct CodeScanningUpdateAlertRequest { /** * Sets the state of the code scanning alert. Can be one of `open` or `dismissed`. You must provide `dismissed_reason` when you set the state to `dismissed`. */ - #[serde()] pub state: CodeScanningAlertSetState, } @@ -29785,7 +29650,6 @@ pub struct IssuesCreateRequest { pub labels: Vec, #[serde(default, skip_serializing_if = "Option::is_none")] pub milestone: Option, - #[serde()] pub title: TitleOneOf, } @@ -30262,7 +30126,6 @@ pub struct ReposCreatePagesSiteRequest { /** * The source branch and directory used to publish your Pages site. */ - #[serde()] pub source: ReposCreatePagesSiteRequestSource, } @@ -30957,7 +30820,6 @@ pub struct SecretScanningUpdateAlertRequest { /** * Sets the state of the secret scanning alert. Can be either `open` or `resolved`. You must provide `resolution` when you set the state to `resolved`. */ - #[serde()] pub state: SecretScanningAlertState, } @@ -31247,7 +31109,6 @@ pub struct EnterpriseAdminProvisionInviteUserRequest { deserialize_with = "crate::utils::deserialize_null_vector::deserialize" )] pub groups: Vec, - #[serde()] pub name: Name, /** * The list of events for the GitHub app @@ -31323,7 +31184,6 @@ pub struct ScimProvisionInviteUserRequest { deserialize_with = "crate::utils::deserialize_null_vector::deserialize" )] pub groups: Vec, - #[serde()] pub name: ScimUserName, /** * The list of events for the GitHub app From 7ba85076a94f0bc219f9abea16f7eb4389efa9a1 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Tue, 28 Mar 2023 12:10:55 -0500 Subject: [PATCH 04/40] Fix spec and root server --- sendgrid/src/lib.rs | 2 +- specs/sendgrid/sendgrid.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sendgrid/src/lib.rs b/sendgrid/src/lib.rs index 621d19e8..2f36fd2e 100644 --- a/sendgrid/src/lib.rs +++ b/sendgrid/src/lib.rs @@ -164,7 +164,7 @@ pub struct RootDefaultServer {} impl RootDefaultServer { pub fn default_url(&self) -> &str { - "http://api.sendgrid.com/v3" + "https://api.sendgrid.com/v3" } } diff --git a/specs/sendgrid/sendgrid.json b/specs/sendgrid/sendgrid.json index be4880a9..82ade68f 100644 --- a/specs/sendgrid/sendgrid.json +++ b/specs/sendgrid/sendgrid.json @@ -33710,7 +33710,7 @@ }, "servers": [ { - "url": "http://api.sendgrid.com/v3" + "url": "https://api.sendgrid.com/v3" } ], "components": { From 503ad48ab0c41b3b9f455de88e54c4703109c7f8 Mon Sep 17 00:00:00 2001 From: Adam Sunderland Date: Tue, 28 Mar 2023 15:38:40 -0400 Subject: [PATCH 05/40] Fix sendgrid send_plain_text (#65) * Use url() to get correct url * Clean up method --- sendgrid/src/traits.rs | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/sendgrid/src/traits.rs b/sendgrid/src/traits.rs index 6f8c2181..be480bae 100644 --- a/sendgrid/src/traits.rs +++ b/sendgrid/src/traits.rs @@ -31,18 +31,22 @@ impl MailOps for crate::mail_send::MailSend { bccs: &[String], from: &str, ) -> Result<()> { - let mut mail: crate::types::PostMailSendRequest = Default::default(); - mail.subject = subject.to_string(); - mail.from = crate::types::FromEmailObject { - email: from.to_string(), - name: String::new(), + let mut mail = crate::types::PostMailSendRequest { + subject: subject.to_string(), + from: crate::types::FromEmailObject { + email: from.to_string(), + name: String::new(), + }, + content: vec![crate::types::Content { + value: message.to_string(), + type_: "text/plain".to_string(), + }], + ..Default::default() + }; + let mut p = crate::types::Personalizations { + from: Some(mail.from.clone()), + ..Default::default() }; - mail.content = vec![crate::types::Content { - value: message.to_string(), - type_: "text/plain".to_string(), - }]; - let mut p: crate::types::Personalizations = Default::default(); - p.from = Some(mail.from.clone()); for to in tos { p.to.push(crate::types::ReplyTo { email: to.to_string(), @@ -63,11 +67,12 @@ impl MailOps for crate::mail_send::MailSend { } mail.personalizations = vec![p]; + let url = self.client.url("/mail/send", None); let resp = self .client .request_raw( reqwest::Method::POST, - "/mail/send", + &url, crate::Message { body: Some(reqwest::Body::from(serde_json::to_vec(&mail).unwrap())), content_type: None, From f4b615b6b464453acdd892980e5a29e0af454fd2 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Tue, 28 Mar 2023 14:55:50 -0500 Subject: [PATCH 06/40] Add test --- sendgrid/tests/tests.rs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/sendgrid/tests/tests.rs b/sendgrid/tests/tests.rs index 8b137891..96bf29bb 100644 --- a/sendgrid/tests/tests.rs +++ b/sendgrid/tests/tests.rs @@ -1 +1,37 @@ +use rand::RngCore; +use rsa::{pkcs1::EncodeRsaPrivateKey, RsaPrivateKey}; +use std::{mem, time::Duration}; +use wiremock::{ + http::{HeaderName, HeaderValue}, + matchers::{bearer_token, header, method, path, query_param}, + Mock, MockServer, ResponseTemplate, +}; + +use sendgrid_api::{Client, types::GetScopesResponse}; + +#[tokio::test] +async fn test_uses_host_override() { + let server = MockServer::start().await; + let response = ResponseTemplate::new(200) + .set_delay(Duration::from_secs(1)) + .set_body_json(GetScopesResponse { + scopes: vec![] + }); + + Mock::given(method("GET")) + .and(path(format!( + "/scopes" + ))) + .respond_with(response) + .expect(1) + .mount(&server) + .await; + + let mut client = Client::new("token"); + client.with_host_override(server.uri()); + + let _ = client.api_key_permissions().get_scopes().await.unwrap(); + + mem::drop(server) +} From 7949a8b141cdc7be8440a978efe2c7ac2dbf6672 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Tue, 28 Mar 2023 15:31:36 -0500 Subject: [PATCH 07/40] Bump version --- Cargo.lock | 2 +- Makefile | 2 +- sendgrid/Cargo.toml | 2 +- sendgrid/README.md | 2 +- sendgrid/src/lib.rs | 2 +- sendgrid/tests/tests.rs | 15 ++++----------- 6 files changed, 9 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef20a566..3ac8d058 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2208,7 +2208,7 @@ dependencies = [ [[package]] name = "sendgrid-api" -version = "0.4.0" +version = "0.4.1" dependencies = [ "anyhow", "async-recursion", diff --git a/Makefile b/Makefile index 991fbf63..a8271e90 100644 --- a/Makefile +++ b/Makefile @@ -437,7 +437,7 @@ $(SENDGRID_SPEC): $(SENDGRID_SPEC_DIR) $(SENDGRID_SPEC_REMOTE) sendgrid: target/debug/generator $(SENDGRID_SPEC) - ./target/debug/generator -i $(SENDGRID_SPEC) -v 0.4.0 \ + ./target/debug/generator -i $(SENDGRID_SPEC) -v 0.4.1 \ -o sendgrid \ -n sendgrid-api \ --proper-name SendGrid \ diff --git a/sendgrid/Cargo.toml b/sendgrid/Cargo.toml index 7cc13d8c..0e450d19 100644 --- a/sendgrid/Cargo.toml +++ b/sendgrid/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sendgrid-api" description = "A fully generated & opinionated API client for the SendGrid API." -version = "0.4.0" +version = "0.4.1" documentation = "https://docs.rs/sendgrid-api/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/sendgrid" readme = "README.md" diff --git a/sendgrid/README.md b/sendgrid/README.md index 7a5274c8..7b6b44f6 100644 --- a/sendgrid/README.md +++ b/sendgrid/README.md @@ -29,7 +29,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -sendgrid-api = "0.4.0" +sendgrid-api = "0.4.1" ``` ## Basic example diff --git a/sendgrid/src/lib.rs b/sendgrid/src/lib.rs index 2f36fd2e..47b818da 100644 --- a/sendgrid/src/lib.rs +++ b/sendgrid/src/lib.rs @@ -27,7 +27,7 @@ //! //! ```toml //! [dependencies] -//! sendgrid-api = "0.4.0" +//! sendgrid-api = "0.4.1" //! ``` //! //! ## Basic example diff --git a/sendgrid/tests/tests.rs b/sendgrid/tests/tests.rs index 96bf29bb..cb23ff9b 100644 --- a/sendgrid/tests/tests.rs +++ b/sendgrid/tests/tests.rs @@ -1,28 +1,21 @@ -use rand::RngCore; -use rsa::{pkcs1::EncodeRsaPrivateKey, RsaPrivateKey}; use std::{mem, time::Duration}; use wiremock::{ - http::{HeaderName, HeaderValue}, - matchers::{bearer_token, header, method, path, query_param}, + matchers::{method, path}, Mock, MockServer, ResponseTemplate, }; -use sendgrid_api::{Client, types::GetScopesResponse}; +use sendgrid_api::{types::GetScopesResponse, Client}; #[tokio::test] async fn test_uses_host_override() { let server = MockServer::start().await; let response = ResponseTemplate::new(200) .set_delay(Duration::from_secs(1)) - .set_body_json(GetScopesResponse { - scopes: vec![] - }); + .set_body_json(GetScopesResponse { scopes: vec![] }); Mock::given(method("GET")) - .and(path(format!( - "/scopes" - ))) + .and(path("/scopes".to_string())) .respond_with(response) .expect(1) .mount(&server) From 3857d5c766ee1b129ee1ff539625c69c5cd59211 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Tue, 28 Mar 2023 17:09:11 -0500 Subject: [PATCH 08/40] Fix empty serde attributes --- generator/src/types.rs | 29 +++++++-- github/src/types.rs | 140 ----------------------------------------- 2 files changed, 24 insertions(+), 145 deletions(-) diff --git a/generator/src/types.rs b/generator/src/types.rs index ec6f5669..dfbd2642 100644 --- a/generator/src/types.rs +++ b/generator/src/types.rs @@ -175,6 +175,9 @@ pub fn generate_types(ts: &mut TypeSpace, proper_name: &str) -> Result { let te = ts.id_to_entry.get(tid).unwrap(); + // Assume that we are going to output a serde attribute + let mut started_serde_attr = true; + // Render the serde string. if rt == "String" || rt.starts_with("Vec<") @@ -258,7 +261,9 @@ pub fn generate_types(ts: &mut TypeSpace, proper_name: &str) -> Result { a(&format!(r#"skip_serializing_if = "{}::is_noop","#, rt)); } } else { - a(r#"#[serde("#); + // In only this case do we switch to not outputting the start of + // a serde attribute + started_serde_attr = false } if !prop.ends_with('_') { @@ -281,12 +286,26 @@ pub fn generate_types(ts: &mut TypeSpace, proper_name: &str) -> Result { prop = format!("{}_", prop); } - // Close the serde string. + // Before closing, ensure that we have actually opened a serde attribute, + // otherwise print the full tag if *name != prop { - a(&format!(r#"rename = "{}")]"#, name)); + if !started_serde_attr { + a(r#"#[serde("#); + started_serde_attr = true; + } + + a(&format!(r#"rename = "{}""#, name)); } else if rt == "Page" && prop == "page" || rt.ends_with("Page") { - a(r#"default)]"#); - } else { + if !started_serde_attr { + a(r#"#[serde("#); + started_serde_attr = true; + } + + a(r#"default,"#); + } + + // Only output the closing if output has actually started + if started_serde_attr { a(r#")]"#); } diff --git a/github/src/types.rs b/github/src/types.rs index 06ba902d..fdd1620a 100644 --- a/github/src/types.rs +++ b/github/src/types.rs @@ -254,7 +254,6 @@ pub struct GitHubApp { /** * The set of permissions for the GitHub app */ - #[serde()] pub permissions: Permissions, #[serde( default, @@ -759,9 +758,7 @@ pub struct HookDelivery { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub repository_id: i64, - #[serde()] pub request: Request, - #[serde()] pub response: Response, #[serde( default, @@ -1217,7 +1214,6 @@ pub struct Installation { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub access_tokens_url: String, - #[serde()] pub account: AccountAnyOf, #[serde( default, @@ -1275,7 +1271,6 @@ pub struct Installation { /** * The permissions granted to the user-to-server access token. */ - #[serde()] pub permissions: AppPermissions, #[serde( default, @@ -2620,7 +2615,6 @@ pub struct App { /// The authorization associated with an OAuth Access. #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct ApplicationGrant { - #[serde()] pub app: App, #[serde( default, @@ -2674,7 +2668,6 @@ pub struct ScopedInstallation { /** * The permissions granted to the user-to-server access token. */ - #[serde()] pub permissions: AppPermissions, #[serde( default, @@ -2704,7 +2697,6 @@ pub struct ScopedInstallation { /// The authorization for an OAuth app, GitHub App, or a Personal Access Token. #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct Authorization { - #[serde()] pub app: App, #[serde( default, @@ -2908,7 +2900,6 @@ pub struct ActionsEnterprisePermissions { /** * The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`. */ - #[serde()] pub enabled_organizations: EnabledRepositories, #[serde( default, @@ -3539,7 +3530,6 @@ pub struct ActionsBillingUsage { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub included_minutes: i64, - #[serde()] pub minutes_used_breakdown: MinutesUsedBreakdown, #[serde( default, @@ -3922,7 +3912,6 @@ pub struct IssueSimple { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -4139,7 +4128,6 @@ pub struct IssueComment { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -4306,7 +4294,6 @@ pub struct Event { /** * Actor */ - #[serde()] pub actor: Actor, #[serde( default, @@ -4325,7 +4312,6 @@ pub struct Event { */ #[serde(default, skip_serializing_if = "Option::is_none")] pub org: Option, - #[serde()] pub payload: Payload, #[serde( default, @@ -4397,12 +4383,10 @@ pub struct Links { /** * Hypermedia Link with Type */ - #[serde()] pub timeline: LinkWithType, /** * Hypermedia Link with Type */ - #[serde()] pub user: LinkWithType, } @@ -4532,7 +4516,6 @@ pub struct BaseGist { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub description: String, - #[serde()] pub files: Files, /** * Base Gist @@ -5026,7 +5009,6 @@ pub struct Gist { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub description: String, - #[serde()] pub files: Files, /** * Gist @@ -5297,7 +5279,6 @@ pub struct GistComment { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -5342,7 +5323,6 @@ pub struct GistComment { /// Gist Commit #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct GistCommit { - #[serde()] pub change_status: Stats, #[serde( default, @@ -5490,7 +5470,6 @@ pub struct Issue { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -5922,7 +5901,6 @@ pub struct MarketplacePurchaseData { pub login: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub marketplace_pending_change: Option, - #[serde()] pub marketplace_purchase: MarketplacePurchase, #[serde( default, @@ -6728,9 +6706,7 @@ pub struct Thread { /** * Minimal Repository */ - #[serde()] pub repository: MinimalRepository, - #[serde()] pub subject: Subject, #[serde( default, @@ -7158,7 +7134,6 @@ pub struct ActionsOrganizationPermissions { /** * The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`. */ - #[serde()] pub enabled_repositories: EnabledRepositories, #[serde( default, @@ -7533,7 +7508,6 @@ pub struct OrgHook { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub active: bool, - #[serde()] pub config: Config, #[serde( default, @@ -7648,7 +7622,6 @@ pub struct InteractionLimits { /** * The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: `existing_users`, `contributors_only`, `collaborators_only`. */ - #[serde()] pub limit: InteractionGroup, #[serde( default, @@ -7716,7 +7689,6 @@ pub struct InteractionLimit { /** * The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: `existing_users`, `contributors_only`, `collaborators_only`. */ - #[serde()] pub limit: InteractionGroup, } @@ -7998,7 +7970,6 @@ pub struct OrgMembership { /** * Organization Simple */ - #[serde()] pub organization: OrganizationSimple, #[serde( default, @@ -8636,7 +8607,6 @@ pub struct FullTeam { /** * Organization Full */ - #[serde()] pub organization: OrganizationFull, #[serde(default, skip_serializing_if = "Option::is_none")] pub parent: Option, @@ -9091,7 +9061,6 @@ pub struct TeamProject { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub owner_url: String, - #[serde()] pub permissions: TeamProjectPermissions, /** * A team's access to a project. @@ -9829,13 +9798,11 @@ pub struct RateLimit { pub struct Resources { #[serde(default, skip_serializing_if = "Option::is_none")] pub code_scanning_upload: Option, - #[serde()] pub core: RateLimit, #[serde(default, skip_serializing_if = "Option::is_none")] pub graphql: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub integration_manifest: Option, - #[serde()] pub search: RateLimit, #[serde(default, skip_serializing_if = "Option::is_none")] pub source_import: Option, @@ -9844,9 +9811,7 @@ pub struct Resources { /// Rate Limit Overview #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct RateLimitOverview { - #[serde()] pub rate: RateLimit, - #[serde()] pub resources: Resources, } @@ -10776,9 +10741,7 @@ pub struct Head { #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct PullRequestMinimal { - #[serde()] pub base: Head, - #[serde()] pub head: Head, #[serde( default, @@ -10914,7 +10877,6 @@ pub struct WorkflowRun { /** * Minimal Repository */ - #[serde()] pub head_repository: MinimalRepository, /** * An invocation of a workflow @@ -10976,7 +10938,6 @@ pub struct WorkflowRun { /** * Minimal Repository */ - #[serde()] pub repository: MinimalRepository, #[serde( default, @@ -11246,7 +11207,6 @@ pub struct PendingDeployment { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub current_user_can_approve: bool, - #[serde()] pub environment: Environment, /** * The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. @@ -11354,7 +11314,6 @@ pub struct Deployment { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub original_environment: String, - #[serde()] pub payload: PayloadOneOf, #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, @@ -11448,7 +11407,6 @@ pub struct Billable { /// Workflow Run Usage #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct WorkflowRunUsage { - #[serde()] pub billable: Billable, /** * Workflow Run Usage @@ -11621,7 +11579,6 @@ pub struct WorkflowUsageBillable { /// Workflow Usage #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct WorkflowUsage { - #[serde()] pub billable: WorkflowUsageBillable, } @@ -12239,7 +12196,6 @@ pub struct Tree { /// Short Branch #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct ShortBranch { - #[serde()] pub commit: Tree, #[serde( default, @@ -12332,7 +12288,6 @@ pub struct CommitData { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub message: String, - #[serde()] pub tree: Tree, #[serde( default, @@ -12447,7 +12402,6 @@ pub struct CommitDataType { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub comments_url: String, - #[serde()] pub commit: CommitData, #[serde(default, skip_serializing_if = "Option::is_none")] pub committer: Option, @@ -12522,7 +12476,6 @@ pub struct BranchWithProtection { /** * Commit */ - #[serde()] pub commit: CommitDataType, #[serde( default, @@ -12544,7 +12497,6 @@ pub struct BranchWithProtection { /** * Branch Protection */ - #[serde()] pub protection: BranchProtection, #[serde( default, @@ -12970,7 +12922,6 @@ pub struct CheckRun { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub node_id: String, - #[serde()] pub output: Output, #[serde( default, @@ -13102,7 +13053,6 @@ pub struct CheckSuiteData { /** * Simple Commit */ - #[serde()] pub head_commit: SimpleCommit, #[serde( default, @@ -13137,7 +13087,6 @@ pub struct CheckSuiteData { /** * Minimal Repository */ - #[serde()] pub repository: MinimalRepository, /** * The phase of the lifecycle that the job is currently in. @@ -13186,12 +13135,10 @@ pub struct Preferences { /// Check suite configuration preferences for a repository. #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct CheckSuitePreference { - #[serde()] pub preferences: Preferences, /** * Minimal Repository */ - #[serde()] pub repository: MinimalRepository, } @@ -13567,7 +13514,6 @@ pub struct CodeScanningAlertItems { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub instances_url: String, - #[serde()] pub most_recent_instance: CodeScanningAlertInstance, #[serde( default, @@ -13575,14 +13521,11 @@ pub struct CodeScanningAlertItems { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub number: i64, - #[serde()] pub rule: CodeScanningAlertRuleSummary, /** * State of a code scanning alert. */ - #[serde()] pub state: CodeScanningAlertState, - #[serde()] pub tool: CodeScanningAnalysisTool, #[serde( default, @@ -13727,7 +13670,6 @@ pub struct CodeScanningAlert { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub instances_url: String, - #[serde()] pub most_recent_instance: CodeScanningAlertInstance, #[serde( default, @@ -13735,14 +13677,11 @@ pub struct CodeScanningAlert { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub number: i64, - #[serde()] pub rule: CodeScanningAlertRule, /** * State of a code scanning alert. */ - #[serde()] pub state: CodeScanningAlertState, - #[serde()] pub tool: CodeScanningAnalysisTool, #[serde( default, @@ -13864,7 +13803,6 @@ pub struct CodeScanningAnalysis { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub sarif_id: String, - #[serde()] pub tool: CodeScanningAnalysisTool, #[serde( default, @@ -14199,7 +14137,6 @@ pub struct RepositoryInvitation { /** * Minimal Repository */ - #[serde()] pub repository: MinimalRepository, #[serde( default, @@ -14215,7 +14152,6 @@ pub struct CommitComment { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -14295,7 +14231,6 @@ pub struct CommitComment { /// Branch Short #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct BranchShort { - #[serde()] pub commit: Tree, #[serde( default, @@ -14454,32 +14389,26 @@ pub struct PullRequestSimpleLinks { /** * Hypermedia Link */ - #[serde()] pub comments: Link, /** * Hypermedia Link */ - #[serde()] pub commits: Link, /** * Hypermedia Link */ - #[serde()] pub html: Link, /** * Hypermedia Link */ - #[serde()] pub issue: Link, /** * Hypermedia Link */ - #[serde()] pub review_comment: Link, /** * Hypermedia Link */ - #[serde()] pub review_comments: Link, /** * Hypermedia Link @@ -14489,7 +14418,6 @@ pub struct PullRequestSimpleLinks { /** * Hypermedia Link */ - #[serde()] pub statuses: Link, } @@ -14515,14 +14443,12 @@ pub struct PullRequestSimple { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, /** * The status of auto merging a pull request. */ #[serde(default, skip_serializing_if = "Option::is_none")] pub auto_merge: Option, - #[serde()] pub base: Base, #[serde( default, @@ -14568,7 +14494,6 @@ pub struct PullRequestSimple { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub draft: bool, - #[serde()] pub head: PullRequestSimpleHead, #[serde( default, @@ -14773,7 +14698,6 @@ pub struct CombinedCommitStatus { /** * Minimal Repository */ - #[serde()] pub repository: MinimalRepository, #[serde( default, @@ -14937,7 +14861,6 @@ pub struct CommunityProfile { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub documentation: String, - #[serde()] pub files: CommunityProfileFiles, #[serde( default, @@ -15077,7 +15000,6 @@ pub struct CommitComparison { /** * Commit */ - #[serde()] pub base_commit: CommitDataType, #[serde( default, @@ -15115,7 +15037,6 @@ pub struct CommitComparison { /** * Commit */ - #[serde()] pub merge_base_commit: CommitDataType, #[serde( default, @@ -15696,7 +15617,6 @@ pub struct FileCommit { /// File Commit #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct FileCommitData { - #[serde()] pub commit: FileCommit, #[serde(default, skip_serializing_if = "Option::is_none")] pub content: Option, @@ -16230,12 +16150,10 @@ pub struct GitCommit { /** * Identifying information for the git-user */ - #[serde()] pub author: Committer, /** * Identifying information for the git-user */ - #[serde()] pub committer: Committer, #[serde( default, @@ -16267,7 +16185,6 @@ pub struct GitCommit { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub sha: String, - #[serde()] pub tree: Tree, #[serde( default, @@ -16275,7 +16192,6 @@ pub struct GitCommit { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub url: String, - #[serde()] pub verification: Verification, } @@ -16311,7 +16227,6 @@ pub struct GitRef { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub node_id: String, - #[serde()] pub object: Object, #[serde( default, @@ -16343,7 +16258,6 @@ pub struct GitTag { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub node_id: String, - #[serde()] pub object: Object, #[serde( default, @@ -16357,7 +16271,6 @@ pub struct GitTag { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub tag: String, - #[serde()] pub tagger: Tagger, #[serde( default, @@ -16534,7 +16447,6 @@ pub struct Hook { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub active: bool, - #[serde()] pub config: HookConfig, #[serde( default, @@ -16563,7 +16475,6 @@ pub struct Hook { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub id: i64, - #[serde()] pub last_response: HookResponse, #[serde( default, @@ -17202,7 +17113,6 @@ pub struct LabeledIssueEvent { /** * Issue Event Label */ - #[serde()] pub label: IssueEventLabel, #[serde( default, @@ -17331,7 +17241,6 @@ pub struct MilestonedIssueEvent { /** * Issue Event Milestone */ - #[serde()] pub milestone: IssueEventMilestone, #[serde( default, @@ -17401,7 +17310,6 @@ pub struct RenamedIssueEvent { */ #[serde(default, skip_serializing_if = "Option::is_none")] pub performed_via_github_app: Option, - #[serde()] pub rename: Rename, #[serde( default, @@ -17581,7 +17489,6 @@ pub struct ReviewDismissedIssueEvent { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub created_at: String, - #[serde()] pub dismissed_review: DismissedReview, #[serde( default, @@ -18018,7 +17925,6 @@ pub struct TimelineCommentEvent { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -18139,7 +18045,6 @@ pub struct TimelineCrossReferencedEvent { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub event: String, - #[serde()] pub source: Source, #[serde( default, @@ -18155,12 +18060,10 @@ pub struct TimelineCommittedEvent { /** * Identifying information for the git-user */ - #[serde()] pub author: Committer, /** * Identifying information for the git-user */ - #[serde()] pub committer: Committer, #[serde( default, @@ -18198,7 +18101,6 @@ pub struct TimelineCommittedEvent { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub sha: String, - #[serde()] pub tree: Tree, #[serde( default, @@ -18206,7 +18108,6 @@ pub struct TimelineCommittedEvent { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub url: String, - #[serde()] pub verification: Verification, } @@ -18215,12 +18116,10 @@ pub struct TimelineReviewedEventLinks { /** * Hypermedia Link */ - #[serde()] pub html: Link, /** * Hypermedia Link */ - #[serde()] pub pull_request: Link, } @@ -18232,7 +18131,6 @@ pub struct TimelineReviewedEvent { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -18315,12 +18213,10 @@ pub struct PullRequestReviewCommentLinks { /** * Hypermedia Link */ - #[serde()] pub html: Link, /** * Hypermedia Link */ - #[serde()] pub pull_request: Link, /** * Hypermedia Link @@ -18367,7 +18263,6 @@ pub struct PullRequestReviewComment { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -18948,7 +18843,6 @@ pub struct Page { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub html_url: String, - #[serde()] pub https_certificate: PagesHttpsCertificate, #[serde( default, @@ -18960,7 +18854,6 @@ pub struct Page { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub public: bool, - #[serde()] pub source: PagesSourceHash, /** * The status of the most recent build of the Page. @@ -19006,7 +18899,6 @@ pub struct PageBuild { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub duration: i64, - #[serde()] pub error: Error, #[serde(default, skip_serializing_if = "Option::is_none")] pub pusher: Option, @@ -19800,7 +19692,6 @@ pub struct PullRequestHeadRepo { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub open_issues_count: i64, - #[serde()] pub owner: User, #[serde(default, skip_serializing_if = "Option::is_none")] pub permissions: Option, @@ -19954,7 +19845,6 @@ pub struct PullRequestHead { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub sha: String, - #[serde()] pub user: User, } @@ -20287,7 +20177,6 @@ pub struct PullRequestBaseRepo { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub open_issues_count: i64, - #[serde()] pub owner: User, #[serde(default, skip_serializing_if = "Option::is_none")] pub permissions: Option, @@ -20444,7 +20333,6 @@ pub struct PullRequestBase { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub sha: String, - #[serde()] pub user: User, } @@ -20476,14 +20364,12 @@ pub struct PullRequestData { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, /** * The status of auto merging a pull request. */ #[serde(default, skip_serializing_if = "Option::is_none")] pub auto_merge: Option, - #[serde()] pub base: PullRequestBase, #[serde( default, @@ -20553,7 +20439,6 @@ pub struct PullRequestData { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub draft: bool, - #[serde()] pub head: PullRequestHead, #[serde( default, @@ -20760,7 +20645,6 @@ pub struct PullRequestReviewData { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -20834,12 +20718,10 @@ pub struct ReviewCommentLinks { /** * Hypermedia Link */ - #[serde()] pub html: Link, /** * Hypermedia Link */ - #[serde()] pub pull_request: Link, /** * Hypermedia Link @@ -20856,7 +20738,6 @@ pub struct ReviewComment { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -21575,7 +21456,6 @@ pub struct RepositorySubscription { /// Tag #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct Tag { - #[serde()] pub commit: Tree, #[serde( default, @@ -22250,9 +22130,7 @@ pub struct ScimUser { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub id: String, - #[serde()] pub meta: ScimUserMeta, - #[serde()] pub name: ScimUserName, /** * SCIM /Users provisioning endpoints @@ -22448,7 +22326,6 @@ pub struct CodeSearchResultItem { /** * Minimal Repository */ - #[serde()] pub repository: MinimalRepository, #[serde( default, @@ -22484,7 +22361,6 @@ pub struct CommitSearchResultItem { /** * Identifying information for the git-user */ - #[serde()] pub author: Committer, #[serde( default, @@ -22500,7 +22376,6 @@ pub struct CommitSearchResultItem { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub message: String, - #[serde()] pub tree: Tree, #[serde( default, @@ -22523,7 +22398,6 @@ pub struct CommitSearchResultItemData { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub comments_url: String, - #[serde()] pub commit: CommitSearchResultItem, #[serde(default, skip_serializing_if = "Option::is_none")] pub committer: Option, @@ -22548,7 +22422,6 @@ pub struct CommitSearchResultItemData { /** * Minimal Repository */ - #[serde()] pub repository: MinimalRepository, #[serde( default, @@ -22599,7 +22472,6 @@ pub struct IssueSearchResultItem { /** * How the author is associated with the repository. */ - #[serde()] pub author_association: AuthorAssociation, #[serde( default, @@ -24268,7 +24140,6 @@ pub struct MarketplaceAccount { /// User Marketplace Purchase #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct UserMarketplacePurchase { - #[serde()] pub account: MarketplaceAccount, #[serde( default, @@ -24296,7 +24167,6 @@ pub struct UserMarketplacePurchase { /** * Marketplace Listing Plan */ - #[serde()] pub plan: MarketplaceListingPlan, #[serde( default, @@ -25244,7 +25114,6 @@ pub struct EnterpriseAdminSetGithubActionsPermissionsRequest { /** * The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`. */ - #[serde()] pub enabled_organizations: EnabledRepositories, } @@ -25477,7 +25346,6 @@ pub struct GistsCreateRequest { /** * Names and content for the files that make up the gist */ - #[serde()] pub files: FilesAdditionalPropertiesData, #[serde(default, skip_serializing_if = "Option::is_none")] pub public: Option, @@ -25901,7 +25769,6 @@ pub struct ActionsSetGithubPermissionsOrganizationRequest { /** * The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`. */ - #[serde()] pub enabled_repositories: EnabledRepositories, } @@ -26152,7 +26019,6 @@ pub struct OrgsCreateWebhookRequest { /** * Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/orgs#create-hook-config-params). */ - #[serde()] pub config: OrgsCreateWebhookRequestConfig, /** * The list of events for the GitHub app @@ -28559,7 +28425,6 @@ pub struct CodeScanningUpdateAlertRequest { /** * Sets the state of the code scanning alert. Can be one of `open` or `dismissed`. You must provide `dismissed_reason` when you set the state to `dismissed`. */ - #[serde()] pub state: CodeScanningAlertSetState, } @@ -29785,7 +29650,6 @@ pub struct IssuesCreateRequest { pub labels: Vec, #[serde(default, skip_serializing_if = "Option::is_none")] pub milestone: Option, - #[serde()] pub title: TitleOneOf, } @@ -30262,7 +30126,6 @@ pub struct ReposCreatePagesSiteRequest { /** * The source branch and directory used to publish your Pages site. */ - #[serde()] pub source: ReposCreatePagesSiteRequestSource, } @@ -30957,7 +30820,6 @@ pub struct SecretScanningUpdateAlertRequest { /** * Sets the state of the secret scanning alert. Can be either `open` or `resolved`. You must provide `resolution` when you set the state to `resolved`. */ - #[serde()] pub state: SecretScanningAlertState, } @@ -31247,7 +31109,6 @@ pub struct EnterpriseAdminProvisionInviteUserRequest { deserialize_with = "crate::utils::deserialize_null_vector::deserialize" )] pub groups: Vec, - #[serde()] pub name: Name, /** * The list of events for the GitHub app @@ -31323,7 +31184,6 @@ pub struct ScimProvisionInviteUserRequest { deserialize_with = "crate::utils::deserialize_null_vector::deserialize" )] pub groups: Vec, - #[serde()] pub name: ScimUserName, /** * The list of events for the GitHub app From bd0659134f7c9eb45599bb6ac8aeee4de2b4ab74 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Wed, 29 Mar 2023 09:11:00 -0500 Subject: [PATCH 09/40] Fix chrono call --- generator/src/utils.rs | 2 +- sendgrid/src/utils.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generator/src/utils.rs b/generator/src/utils.rs index c6daf8b1..7cc4cc34 100644 --- a/generator/src/utils.rs +++ b/generator/src/utils.rs @@ -82,7 +82,7 @@ pub mod date_time_format { DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0,0,0), + chrono::NaiveTime::from_hms_opt(0,0,0).unwrap(), ), Utc, ) diff --git a/sendgrid/src/utils.rs b/sendgrid/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/sendgrid/src/utils.rs +++ b/sendgrid/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), From 3cd69f6fb6391a900706d7288091e68f30e8a344 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Wed, 29 Mar 2023 10:14:56 -0500 Subject: [PATCH 10/40] Fix deprecation --- generator/src/utils.rs | 2 +- github/src/utils.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generator/src/utils.rs b/generator/src/utils.rs index c6daf8b1..7cc4cc34 100644 --- a/generator/src/utils.rs +++ b/generator/src/utils.rs @@ -82,7 +82,7 @@ pub mod date_time_format { DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0,0,0), + chrono::NaiveTime::from_hms_opt(0,0,0).unwrap(), ), Utc, ) diff --git a/github/src/utils.rs b/github/src/utils.rs index 6b76ec96..b444cd8e 100644 --- a/github/src/utils.rs +++ b/github/src/utils.rs @@ -191,7 +191,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), From 556521c051638653fd368ddf812efd709108f577 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Fri, 31 Mar 2023 09:55:11 -0500 Subject: [PATCH 11/40] Chrono fix --- docusign/src/utils.rs | 2 +- generator/src/utils.rs | 2 +- giphy/src/utils.rs | 2 +- github/src/utils.rs | 2 +- google/admin/src/utils.rs | 2 +- google/calendar/src/utils.rs | 2 +- google/cloud-resource-manager/src/utils.rs | 2 +- google/drive/src/utils.rs | 2 +- google/groups-settings/src/utils.rs | 2 +- google/sheets/src/utils.rs | 2 +- gusto/src/utils.rs | 2 +- mailchimp/src/utils.rs | 2 +- okta/src/utils.rs | 2 +- ramp/src/utils.rs | 2 +- rev.ai/src/traits.rs | 3 ++- rev.ai/src/utils.rs | 2 +- sendgrid/src/utils.rs | 2 +- shipbob/src/utils.rs | 2 +- shopify/src/utils.rs | 2 +- slack/src/utils.rs | 2 +- stripe/src/utils.rs | 2 +- tripactions/src/utils.rs | 2 +- zoom/src/utils.rs | 2 +- 23 files changed, 24 insertions(+), 23 deletions(-) diff --git a/docusign/src/utils.rs b/docusign/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/docusign/src/utils.rs +++ b/docusign/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/generator/src/utils.rs b/generator/src/utils.rs index c6daf8b1..7cc4cc34 100644 --- a/generator/src/utils.rs +++ b/generator/src/utils.rs @@ -82,7 +82,7 @@ pub mod date_time_format { DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0,0,0), + chrono::NaiveTime::from_hms_opt(0,0,0).unwrap(), ), Utc, ) diff --git a/giphy/src/utils.rs b/giphy/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/giphy/src/utils.rs +++ b/giphy/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/github/src/utils.rs b/github/src/utils.rs index 6b76ec96..b444cd8e 100644 --- a/github/src/utils.rs +++ b/github/src/utils.rs @@ -191,7 +191,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/google/admin/src/utils.rs b/google/admin/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/google/admin/src/utils.rs +++ b/google/admin/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/google/calendar/src/utils.rs b/google/calendar/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/google/calendar/src/utils.rs +++ b/google/calendar/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/google/cloud-resource-manager/src/utils.rs b/google/cloud-resource-manager/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/google/cloud-resource-manager/src/utils.rs +++ b/google/cloud-resource-manager/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/google/drive/src/utils.rs b/google/drive/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/google/drive/src/utils.rs +++ b/google/drive/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/google/groups-settings/src/utils.rs b/google/groups-settings/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/google/groups-settings/src/utils.rs +++ b/google/groups-settings/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/google/sheets/src/utils.rs b/google/sheets/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/google/sheets/src/utils.rs +++ b/google/sheets/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/gusto/src/utils.rs b/gusto/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/gusto/src/utils.rs +++ b/gusto/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/mailchimp/src/utils.rs b/mailchimp/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/mailchimp/src/utils.rs +++ b/mailchimp/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/okta/src/utils.rs b/okta/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/okta/src/utils.rs +++ b/okta/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/ramp/src/utils.rs b/ramp/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/ramp/src/utils.rs +++ b/ramp/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/rev.ai/src/traits.rs b/rev.ai/src/traits.rs index eb181c23..38cb41b5 100644 --- a/rev.ai/src/traits.rs +++ b/rev.ai/src/traits.rs @@ -12,6 +12,7 @@ pub trait JobOps { impl JobOps for crate::jobs::Jobs { /// Create a job. async fn post(&self, b: bytes::Bytes) -> Result { + let url = self.client.url("/jobs", None); let form = reqwest::multipart::Form::new() .part( "media", @@ -22,6 +23,6 @@ impl JobOps for crate::jobs::Jobs { ) .text("options", "{}"); - self.client.post_form("/jobs", form).await + self.client.post_form(&url, form).await } } diff --git a/rev.ai/src/utils.rs b/rev.ai/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/rev.ai/src/utils.rs +++ b/rev.ai/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/sendgrid/src/utils.rs b/sendgrid/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/sendgrid/src/utils.rs +++ b/sendgrid/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/shipbob/src/utils.rs b/shipbob/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/shipbob/src/utils.rs +++ b/shipbob/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/shopify/src/utils.rs b/shopify/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/shopify/src/utils.rs +++ b/shopify/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/slack/src/utils.rs b/slack/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/slack/src/utils.rs +++ b/slack/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/stripe/src/utils.rs b/stripe/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/stripe/src/utils.rs +++ b/stripe/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/tripactions/src/utils.rs b/tripactions/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/tripactions/src/utils.rs +++ b/tripactions/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), diff --git a/zoom/src/utils.rs b/zoom/src/utils.rs index 87d66b11..8ec9b604 100644 --- a/zoom/src/utils.rs +++ b/zoom/src/utils.rs @@ -81,7 +81,7 @@ pub mod date_time_format { Ok(d) => Ok(Some(DateTime::::from_utc( chrono::NaiveDateTime::new( d, - chrono::NaiveTime::from_hms(0, 0, 0), + chrono::NaiveTime::from_hms_opt(0, 0, 0).unwrap(), ), Utc, ))), From e5b27a87460fb4734dbc6f44cb1ca89175ab7bcd Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Fri, 31 Mar 2023 10:33:04 -0500 Subject: [PATCH 12/40] Align spec urls with previously used urls --- google/admin/src/lib.rs | 2 +- google/cloud-resource-manager/src/lib.rs | 2 +- google/sheets/src/lib.rs | 2 +- okta/src/lib.rs | 2 +- specs/google/admin/admin.yaml | 2 +- specs/google/cloud-resource-manager/cloud-resource-manager.yaml | 2 +- specs/google/sheets/sheets.yaml | 2 +- specs/okta/okta.json | 2 +- specs/stripe/stripe.json | 2 +- stripe/src/lib.rs | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/google/admin/src/lib.rs b/google/admin/src/lib.rs index 91b3f264..76d0ecdc 100644 --- a/google/admin/src/lib.rs +++ b/google/admin/src/lib.rs @@ -178,7 +178,7 @@ pub struct RootDefaultServer {} impl RootDefaultServer { pub fn default_url(&self) -> &str { - "https://admin.googleapis.com/" + "https://www.googleapis.com" } } diff --git a/google/cloud-resource-manager/src/lib.rs b/google/cloud-resource-manager/src/lib.rs index e79fdea4..ac46d378 100644 --- a/google/cloud-resource-manager/src/lib.rs +++ b/google/cloud-resource-manager/src/lib.rs @@ -160,7 +160,7 @@ pub struct RootDefaultServer {} impl RootDefaultServer { pub fn default_url(&self) -> &str { - "https://cloudresourcemanager.googleapis.com/" + "https://cloudresourcemanager.googleapis.com/v2" } } diff --git a/google/sheets/src/lib.rs b/google/sheets/src/lib.rs index 49c42155..e4507223 100644 --- a/google/sheets/src/lib.rs +++ b/google/sheets/src/lib.rs @@ -160,7 +160,7 @@ pub struct RootDefaultServer {} impl RootDefaultServer { pub fn default_url(&self) -> &str { - "https://sheets.googleapis.com/" + "https://sheets.googleapis.com" } } diff --git a/okta/src/lib.rs b/okta/src/lib.rs index 6a2e1196..f43f4a15 100644 --- a/okta/src/lib.rs +++ b/okta/src/lib.rs @@ -134,7 +134,7 @@ pub struct RootDefaultServer {} impl RootDefaultServer { pub fn default_url(&self) -> &str { - "https://your-subdomain.okta.com" + "https://na4.okta.net" } } diff --git a/specs/google/admin/admin.yaml b/specs/google/admin/admin.yaml index 83c3ed71..d3d7f3e5 100644 --- a/specs/google/admin/admin.yaml +++ b/specs/google/admin/admin.yaml @@ -1,6 +1,6 @@ openapi: 3.0.0 servers: - - url: https://admin.googleapis.com/ + - url: https://www.googleapis.com info: contact: name: Google diff --git a/specs/google/cloud-resource-manager/cloud-resource-manager.yaml b/specs/google/cloud-resource-manager/cloud-resource-manager.yaml index 8717aca7..8130d413 100644 --- a/specs/google/cloud-resource-manager/cloud-resource-manager.yaml +++ b/specs/google/cloud-resource-manager/cloud-resource-manager.yaml @@ -1,6 +1,6 @@ openapi: 3.0.0 servers: - - url: https://cloudresourcemanager.googleapis.com/ + - url: https://cloudresourcemanager.googleapis.com/v2 info: contact: name: Google diff --git a/specs/google/sheets/sheets.yaml b/specs/google/sheets/sheets.yaml index 9aa03722..fc0008d8 100644 --- a/specs/google/sheets/sheets.yaml +++ b/specs/google/sheets/sheets.yaml @@ -1,6 +1,6 @@ openapi: 3.0.0 servers: - - url: https://sheets.googleapis.com/ + - url: https://sheets.googleapis.com info: contact: name: Google diff --git a/specs/okta/okta.json b/specs/okta/okta.json index a860c84d..bc3889ac 100644 --- a/specs/okta/okta.json +++ b/specs/okta/okta.json @@ -11456,7 +11456,7 @@ }, "servers": [ { - "url": "https://your-subdomain.okta.com" + "url": "https://na4.okta.net" } ], "components": { diff --git a/specs/stripe/stripe.json b/specs/stripe/stripe.json index 13d48c36..c2b491ab 100644 --- a/specs/stripe/stripe.json +++ b/specs/stripe/stripe.json @@ -108159,7 +108159,7 @@ ], "servers": [ { - "url": "https://api.stripe.com/" + "url": "https://api.stripe.com/v1" } ] } diff --git a/stripe/src/lib.rs b/stripe/src/lib.rs index b0fc8cbb..464a9408 100644 --- a/stripe/src/lib.rs +++ b/stripe/src/lib.rs @@ -168,7 +168,7 @@ pub struct RootDefaultServer {} impl RootDefaultServer { pub fn default_url(&self) -> &str { - "https://api.stripe.com/" + "https://api.stripe.com/v1" } } From c721b4e8150c7a9549af11f5f3892b0b9f788bb3 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Fri, 31 Mar 2023 10:41:00 -0500 Subject: [PATCH 13/40] Update drive traits to use url method --- google/drive/src/traits.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/google/drive/src/traits.rs b/google/drive/src/traits.rs index 74126fb3..e3e40e40 100644 --- a/google/drive/src/traits.rs +++ b/google/drive/src/traits.rs @@ -270,7 +270,7 @@ impl FileOps for crate::files::Files { .client .request_raw( reqwest::Method::GET, - &format!("/files/{}?supportsAllDrives=true&alt=media", id), + &self.client.url(&format!("/files/{}?supportsAllDrives=true&alt=media", id), None), crate::Message::default(), ) .await?; @@ -325,7 +325,7 @@ impl FileOps for crate::files::Files { let folder: crate::types::File = self .client .post( - "/files?supportsAllDrives=true&includeItemsFromAllDrives=true", + &self.client.url("/files?supportsAllDrives=true&includeItemsFromAllDrives=true", None), crate::Message { body: Some(reqwest::Body::from(serde_json::to_vec(&file)?)), content_type: None, @@ -347,11 +347,11 @@ impl FileOps for crate::files::Files { } query_.push_str(n); } - let url = format!( + let url = self.client.url(&format!( "/files/{}/export?{}", crate::progenitor_support::encode_path(id), query_ - ); + ), None); let resp = self .client .request_raw(reqwest::Method::GET, &url, crate::Message::default()) From 252c8e62fe7e17a675698821fbed20207ff268ff Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Fri, 31 Mar 2023 11:41:39 -0500 Subject: [PATCH 14/40] Fmt --- google/drive/src/traits.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/google/drive/src/traits.rs b/google/drive/src/traits.rs index e3e40e40..9534cb1d 100644 --- a/google/drive/src/traits.rs +++ b/google/drive/src/traits.rs @@ -270,7 +270,10 @@ impl FileOps for crate::files::Files { .client .request_raw( reqwest::Method::GET, - &self.client.url(&format!("/files/{}?supportsAllDrives=true&alt=media", id), None), + &self.client.url( + &format!("/files/{}?supportsAllDrives=true&alt=media", id), + None, + ), crate::Message::default(), ) .await?; @@ -325,7 +328,10 @@ impl FileOps for crate::files::Files { let folder: crate::types::File = self .client .post( - &self.client.url("/files?supportsAllDrives=true&includeItemsFromAllDrives=true", None), + &self.client.url( + "/files?supportsAllDrives=true&includeItemsFromAllDrives=true", + None, + ), crate::Message { body: Some(reqwest::Body::from(serde_json::to_vec(&file)?)), content_type: None, @@ -347,11 +353,14 @@ impl FileOps for crate::files::Files { } query_.push_str(n); } - let url = self.client.url(&format!( - "/files/{}/export?{}", - crate::progenitor_support::encode_path(id), - query_ - ), None); + let url = self.client.url( + &format!( + "/files/{}/export?{}", + crate::progenitor_support::encode_path(id), + query_ + ), + None, + ); let resp = self .client .request_raw(reqwest::Method::GET, &url, crate::Message::default()) From a5649545eac758adc5ee39db55b8d0ce15773a0d Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Fri, 31 Mar 2023 11:42:24 -0500 Subject: [PATCH 15/40] Fix intro docs for client with multiple root servers --- generator/src/main.rs | 11 +++++++++++ generator/src/template.rs | 13 ++++++++++--- gusto/README.md | 8 +++++--- gusto/src/lib.rs | 8 +++++--- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/generator/src/main.rs b/generator/src/main.rs index 71e2e9ba..69feaef6 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -3335,6 +3335,16 @@ rustdoc-args = ["--cfg", "docsrs"] &proper_name, &spec_link, ) + } else if proper_name == "Gusto" { + template::generate_docs_generic_token( + &api, + &to_snake_case(&name), + &version, + &proper_name, + &spec_link, + &add_post_header, + &format!("{}::RootProductionServer", to_snake_case(&name)), + ) } else { template::generate_docs_generic_token( &api, @@ -3343,6 +3353,7 @@ rustdoc-args = ["--cfg", "docsrs"] &proper_name, &spec_link, &add_post_header, + "", ) }; let mut readme = root.clone(); diff --git a/generator/src/template.rs b/generator/src/template.rs index e0aa23d3..79ee7b86 100644 --- a/generator/src/template.rs +++ b/generator/src/template.rs @@ -595,6 +595,7 @@ pub fn generate_docs_generic_token( proper_name: &str, spec_link: &str, add_post_header: &str, + server_args: &str, ) -> String { let info = generate_docs_openapi_info(api, proper_name, spec_link, name); @@ -613,6 +614,9 @@ pub fn generate_docs_generic_token( String::new() }; + let server_args_nl = format!(",\n//! {}", server_args); + let server_args_flat = format!(", {}", server_args); + format!( r#"{} //! @@ -636,7 +640,7 @@ pub fn generate_docs_generic_token( //! String::from("client-secret"), //! String::from("redirect-uri"), //! String::from("token"), -//! String::from("refresh-token"){} +//! String::from("refresh-token"){}{} //! ); //! ``` //! @@ -654,7 +658,7 @@ pub fn generate_docs_generic_token( //! //! let {} = Client::new_from_env( //! String::from("token"), -//! String::from("refresh-token"){} +//! String::from("refresh-token"){}{} //! ); //! ``` //! @@ -667,7 +671,7 @@ pub fn generate_docs_generic_token( //! use {}::Client; //! //! async fn do_call() {{ -//! let mut {} = Client::new_from_env("", ""{}); +//! let mut {} = Client::new_from_env("", ""{}{}); //! //! // Get the URL to request consent from the user. //! // You can optionally pass in scopes. If none are provided, then the @@ -692,15 +696,18 @@ pub fn generate_docs_generic_token( name, proper_name.to_lowercase(), add_post_header_args, + server_args_nl, proper_name.to_uppercase(), proper_name.to_uppercase(), proper_name.to_uppercase(), name, proper_name.to_lowercase(), add_post_header_args, + server_args_nl, name, proper_name.to_lowercase(), add_post_header_var, + server_args_flat, proper_name.to_lowercase(), proper_name.to_lowercase(), proper_name.to_lowercase(), diff --git a/gusto/README.md b/gusto/README.md index 8a84145e..cd865f7c 100644 --- a/gusto/README.md +++ b/gusto/README.md @@ -47,7 +47,8 @@ let gusto = Client::new( String::from("client-secret"), String::from("redirect-uri"), String::from("token"), - String::from("refresh-token") + String::from("refresh-token"), + gusto_api::RootProductionServer ); ``` @@ -65,7 +66,8 @@ use gusto_api::Client; let gusto = Client::new_from_env( String::from("token"), - String::from("refresh-token") + String::from("refresh-token"), + gusto_api::RootProductionServer ); ``` @@ -78,7 +80,7 @@ To start off a fresh client and get a `token` and `refresh_token`, use the follo use gusto_api::Client; async fn do_call() { - let mut gusto = Client::new_from_env("", ""); + let mut gusto = Client::new_from_env("", "", gusto_api::RootProductionServer); // Get the URL to request consent from the user. // You can optionally pass in scopes. If none are provided, then the diff --git a/gusto/src/lib.rs b/gusto/src/lib.rs index ae779f9e..807a6560 100644 --- a/gusto/src/lib.rs +++ b/gusto/src/lib.rs @@ -45,7 +45,8 @@ //! String::from("client-secret"), //! String::from("redirect-uri"), //! String::from("token"), -//! String::from("refresh-token") +//! String::from("refresh-token"), +//! gusto_api::RootProductionServer //! ); //! ``` //! @@ -63,7 +64,8 @@ //! //! let gusto = Client::new_from_env( //! String::from("token"), -//! String::from("refresh-token") +//! String::from("refresh-token"), +//! gusto_api::RootProductionServer //! ); //! ``` //! @@ -76,7 +78,7 @@ //! use gusto_api::Client; //! //! async fn do_call() { -//! let mut gusto = Client::new_from_env("", ""); +//! let mut gusto = Client::new_from_env("", "", gusto_api::RootProductionServer); //! //! // Get the URL to request consent from the user. //! // You can optionally pass in scopes. If none are provided, then the From a2be8c42105c249c2700a8ee4d4efcaddea6a615 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 13 Apr 2023 20:52:47 -0500 Subject: [PATCH 16/40] Fix created param format for GitHub workflow listing --- specs/github/api.github.com.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/specs/github/api.github.com.json b/specs/github/api.github.com.json index 66bc0e69..5ec536de 100644 --- a/specs/github/api.github.com.json +++ b/specs/github/api.github.com.json @@ -95467,8 +95467,7 @@ "in": "query", "required": false, "schema": { - "type": "string", - "format": "date-time" + "type": "string" } }, "run-id": { From 0f98a89a2eb1833fd64b10788acc926e7c4ed25f Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 13 Apr 2023 22:19:51 -0500 Subject: [PATCH 17/40] Rebuild --- generator/src/template.rs | 12 +- github/src/actions.rs | 16 +- gusto/src/types.rs | 4 - mailchimp/src/types.rs | 9 - ramp/src/types.rs | 3 - sendgrid/src/types.rs | 28 --- shipbob/src/types.rs | 8 - slack/src/types.rs | 51 ------ stripe/src/types.rs | 353 -------------------------------------- zoom/src/types.rs | 6 - 10 files changed, 18 insertions(+), 472 deletions(-) diff --git a/generator/src/template.rs b/generator/src/template.rs index 79ee7b86..20af3d98 100644 --- a/generator/src/template.rs +++ b/generator/src/template.rs @@ -614,8 +614,16 @@ pub fn generate_docs_generic_token( String::new() }; - let server_args_nl = format!(",\n//! {}", server_args); - let server_args_flat = format!(", {}", server_args); + let server_args_nl = if !server_args.is_empty() { + format!(",\n//! {}", server_args) + } else { + String::new() + }; + let server_args_flat = if !server_args.is_empty() { + format!(", {}", server_args) + } else { + String::new() + }; format!( r#"{} diff --git a/github/src/actions.rs b/github/src/actions.rs index 431554d2..4c87a533 100644 --- a/github/src/actions.rs +++ b/github/src/actions.rs @@ -2374,7 +2374,7 @@ impl Actions { * * `status: crate::types::WorkflowRunStatus` -- Returns workflow runs with the check run `status` or `conclusion` that you specify. For example, a conclusion can be `success` or a status can be `in_progress`. Only GitHub can set a status of `waiting` or `requested`. For a list of the possible `status` and `conclusion` options, see "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run).". * * `per_page: i64` -- Results per page (max 100). * * `page: i64` -- Page number of the results to fetch. - * * `created: chrono::DateTime` + * * `created: &str` */ pub async fn list_workflow_runs_for_repo( &self, @@ -2386,7 +2386,7 @@ impl Actions { status: crate::types::WorkflowRunStatus, per_page: i64, page: i64, - created: Option>, + created: &str, ) -> Result { let mut query_args: Vec<(String, String)> = Default::default(); if !actor.is_empty() { @@ -2395,8 +2395,8 @@ impl Actions { if !branch.is_empty() { query_args.push(("branch".to_string(), branch.to_string())); } - if let Some(date) = created { - query_args.push(("created".to_string(), date.to_rfc3339())); + if !created.is_empty() { + query_args.push(("created".to_string(), created.to_string())); } if !event.is_empty() { query_args.push(("event".to_string(), event.to_string())); @@ -3604,7 +3604,7 @@ impl Actions { * * `status: crate::types::WorkflowRunStatus` -- Returns workflow runs with the check run `status` or `conclusion` that you specify. For example, a conclusion can be `success` or a status can be `in_progress`. Only GitHub can set a status of `waiting` or `requested`. For a list of the possible `status` and `conclusion` options, see "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run).". * * `per_page: i64` -- Results per page (max 100). * * `page: i64` -- Page number of the results to fetch. - * * `created: chrono::DateTime` + * * `created: &str` */ pub async fn list_workflow_runs( &self, @@ -3617,7 +3617,7 @@ impl Actions { status: crate::types::WorkflowRunStatus, per_page: i64, page: i64, - created: Option>, + created: &str, ) -> Result { let mut query_args: Vec<(String, String)> = Default::default(); if !actor.is_empty() { @@ -3626,8 +3626,8 @@ impl Actions { if !branch.is_empty() { query_args.push(("branch".to_string(), branch.to_string())); } - if let Some(date) = created { - query_args.push(("created".to_string(), date.to_rfc3339())); + if !created.is_empty() { + query_args.push(("created".to_string(), created.to_string())); } if !event.is_empty() { query_args.push(("event".to_string(), event.to_string())); diff --git a/gusto/src/types.rs b/gusto/src/types.rs index e24de649..d3a70edb 100644 --- a/gusto/src/types.rs +++ b/gusto/src/types.rs @@ -5376,12 +5376,10 @@ pub struct PostPartnerManagedCompaniesRequestCompany { /// #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct PostPartnerManagedCompaniesRequest { - #[serde()] pub company: PostPartnerManagedCompaniesRequestCompany, /** * Information for the user who will be the primary payroll administrator for the new company. */ - #[serde()] pub user: User, } @@ -5545,12 +5543,10 @@ pub struct PostProvisionRequestCompany { /// #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct PostProvisionRequest { - #[serde()] pub company: PostProvisionRequestCompany, /** * Information for the user who will be the primary payroll administrator for the new company. */ - #[serde()] pub user: User, } diff --git a/mailchimp/src/types.rs b/mailchimp/src/types.rs index 9c27f53f..6a822b9a 100644 --- a/mailchimp/src/types.rs +++ b/mailchimp/src/types.rs @@ -7472,7 +7472,6 @@ pub struct AutomationWorkflow { /** * List settings for the Automation. */ - #[serde()] pub recipients: Recipients, /** * A summary of an individual Automation workflow's settings and content. @@ -7482,7 +7481,6 @@ pub struct AutomationWorkflow { /** * Trigger settings for the Automation. */ - #[serde()] pub trigger_settings: AutomationTrigger, } @@ -11252,7 +11250,6 @@ pub struct CampaignData { /** * The settings for your campaign, including subject, from name, reply-to address, and more. */ - #[serde()] pub settings: CampaignSettingsData, /** * A summary of an individual campaign's settings and content. @@ -14161,12 +14158,10 @@ pub struct SubscriberList { /** * [Default values for campaigns](https://mailchimp.com/help/edit-your-emails-subject-preview-text-from-name-or-from-email-address/) created for this list. */ - #[serde()] pub campaign_defaults: SubscriberListCampaignDefaults, /** * [Contact information displayed in campaign footers](https://mailchimp.com/help/about-campaign-footers/) to comply with international spam laws. */ - #[serde()] pub contact: SubscriberListContact, /** * Information about a specific list. @@ -15031,12 +15026,10 @@ pub struct SubscriberListData { /** * [Default values for campaigns](https://mailchimp.com/help/edit-your-emails-subject-preview-text-from-name-or-from-email-address/) created for this list. */ - #[serde()] pub campaign_defaults: SubscriberListCampaignDefaults, /** * [Contact information displayed in campaign footers](https://mailchimp.com/help/about-campaign-footers/) to comply with international spam laws. */ - #[serde()] pub contact: SubscriberListContactData, /** * Information about a specific list. @@ -26234,7 +26227,6 @@ pub struct ECommerceCart { /** * Information about a specific customer. For existing customers include only the `id` parameter in the `customer` object body. */ - #[serde()] pub customer: ECommerceCustomer, /** * The name of the folder. @@ -27444,7 +27436,6 @@ pub struct ECommerceOrder { /** * Information about a specific customer. For existing customers include only the `id` parameter in the `customer` object body. */ - #[serde()] pub customer: ECommerceCustomer, /** * Information about a specific order. diff --git a/ramp/src/types.rs b/ramp/src/types.rs index 3aba98a9..58080357 100644 --- a/ramp/src/types.rs +++ b/ramp/src/types.rs @@ -464,7 +464,6 @@ pub struct Data { deserialize_with = "crate::utils::deserialize_null_f64::deserialize" )] pub amount: f64, - #[serde()] pub card_holder: CardHolder, /** * The OAuth2 token header @@ -1075,7 +1074,6 @@ pub struct Business { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub active: bool, - #[serde()] pub billing_address: BillingAddress, /** * The number of results to be returned in each page. The value must be between 2 and 10,000. If not specified, the default will be 1,000. @@ -1705,7 +1703,6 @@ pub struct PostResourcesCardProgramRequest { /** * Specifies the spend restrictions on a Ramp card. */ - #[serde()] pub spending_restrictions: SpendingRestrictions, } diff --git a/sendgrid/src/types.rs b/sendgrid/src/types.rs index e04f3cc6..90c1b627 100644 --- a/sendgrid/src/types.rs +++ b/sendgrid/src/types.rs @@ -441,7 +441,6 @@ pub struct ReverseDns { /** * The DKIM record for messages sent using this authenticated domain. */ - #[serde()] pub a_record: Dkim, /** * The license key provided with your New Relic account. @@ -802,7 +801,6 @@ pub struct Dns { /** * The DNS record generated to point to your link branding subdomain. */ - #[serde()] pub domain_cname: DomainCname, /** * The DNS records generated for this link branding. @@ -824,7 +822,6 @@ pub struct LinkBranding200Response { /** * The DNS records generated for this link branding. */ - #[serde()] pub dns: Dns, /** * The license key provided with your New Relic account. @@ -3925,7 +3922,6 @@ pub struct ContactResponse { /** * The user may choose to create up to 120 custom fields or none at all. This is not a reserved field. */ - #[serde()] pub custom_fields: ContactResponseCustomFields, /** * The license key provided with your New Relic account. @@ -5950,7 +5946,6 @@ pub struct SendersRequestBody { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub country: String, - #[serde()] pub from: From, /** * The license key provided with your New Relic account. @@ -6902,7 +6897,6 @@ pub struct AllSegmentsResponse { /** * Segment status indicates whether the segment's contacts will be updated periodically */ - #[serde()] pub status: SegmentStatusResponse, /** * The license key provided with your New Relic account. @@ -7018,7 +7012,6 @@ pub struct SegmentResponse { /** * Segment status indicates whether the segment's contacts will be updated periodically */ - #[serde()] pub status: SegmentStatusResponse, /** * The license key provided with your New Relic account. @@ -7471,12 +7464,10 @@ pub struct Message { /** * This is the IP of the user who sent the message. */ - #[serde()] pub originating_ip: std::net::Ipv4Addr, /** * This is the IP of the user who sent the message. */ - #[serde()] pub outbound_ip: std::net::Ipv4Addr, /** * Whether or not the outbound IP is dedicated vs shared @@ -7544,22 +7535,18 @@ pub struct DomainAuthenticationDns { /** * The DKIM record for messages sent using this authenticated domain. */ - #[serde()] pub dkim: Dkim, /** * The DKIM record for messages sent using this authenticated domain. */ - #[serde()] pub domain_spf: Dkim, /** * The DKIM record for messages sent using this authenticated domain. */ - #[serde()] pub mail_server: Dkim, /** * The DKIM record for messages sent using this authenticated domain. */ - #[serde()] pub subdomain_spf: Dkim, } @@ -7592,7 +7579,6 @@ pub struct DomainAuthentication { /** * The DNS records for this authenticated domain. */ - #[serde()] pub dns: DomainAuthenticationDns, /** * The license key provided with your New Relic account. @@ -7673,7 +7659,6 @@ pub struct AuthenticationDomainDns { /** * The DKIM record for messages sent using this authenticated domain. */ - #[serde()] pub mail_cname: Dkim, } @@ -7706,7 +7691,6 @@ pub struct AuthenticationDomain { /** * The DNS records used to authenticate the sending domain. */ - #[serde()] pub dns: AuthenticationDomainDns, /** * The license key provided with your New Relic account. @@ -8596,7 +8580,6 @@ pub struct PostMailSendRequest { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub custom_args: String, - #[serde()] pub from: FromEmailObject, #[serde(default, skip_serializing_if = "Option::is_none")] pub headers: Option, @@ -10388,7 +10371,6 @@ pub struct ValidationResults { /** * The DNS record generated for the sending domain used for this branded link. */ - #[serde()] pub domain_cname: PostWhitelabelLinksValidateResponseValidationResultsDomainCname, /** * The individual validation results for each of the DNS records associated with this branded link. @@ -10416,7 +10398,6 @@ pub struct PostWhitelabelLinksValidateResponse { /** * The individual validation results for each of the DNS records associated with this branded link. */ - #[serde()] pub validation_results: ValidationResults, } @@ -10557,7 +10538,6 @@ pub struct PostWhitelabelIpsValidateResponse { /** * The specific results of the validation. */ - #[serde()] pub validation_results: PostWhitelabelIpsValidateResponseValidationResults, } @@ -10690,17 +10670,14 @@ pub struct Checks { /** * Additional checks on the email address. */ - #[serde()] pub additional: Additional, /** * Checks on the domain portion of the email address. */ - #[serde()] pub domain: Domain, /** * Checks on the local part of the email address. */ - #[serde()] pub local_part: LocalPart, } @@ -10709,7 +10686,6 @@ pub struct PostValidationsEmailResponseResult { /** * Granular checks for email address validity. */ - #[serde()] pub checks: Checks, /** * The license key provided with your New Relic account. @@ -10783,7 +10759,6 @@ pub struct PostValidationsEmailResponseResult { #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct PostValidationsEmailResponse { - #[serde()] pub result: PostValidationsEmailResponseResult, } @@ -11367,7 +11342,6 @@ pub struct GetVerifiedSendersDomainsResponseResults { #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct GetVerifiedSendersDomainsResponse { - #[serde()] pub results: GetVerifiedSendersDomainsResponseResults, } @@ -11607,7 +11581,6 @@ pub struct DeleteMcContactsResponse { /** * helper text or docs for troubleshooting */ - #[serde()] pub job_id: Help, } @@ -12209,7 +12182,6 @@ pub struct PostMarketingSendersRequest { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub country: String, - #[serde()] pub from: From, /** * The license key provided with your New Relic account. diff --git a/shipbob/src/types.rs b/shipbob/src/types.rs index 4e601d15..70043d00 100644 --- a/shipbob/src/types.rs +++ b/shipbob/src/types.rs @@ -544,7 +544,6 @@ pub struct OrdersEstimateProductInfoModel { #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct OrdersEstimateFulfillmentRequestModel { - #[serde()] pub address: OrdersEstimationAddress, /** * Products to be included in the order. Each product must include one of reference_id or id @@ -775,7 +774,6 @@ pub struct OrdersRecipientInfo { /** * Address to used when creating a B2B/DropShip order. */ - #[serde()] pub address: OrdersRetailerProgramDataAddress, /** * Name of the channel @@ -2028,7 +2026,6 @@ pub struct OrdersCreateOrderModel { /** * Information about the recipient of an order */ - #[serde()] pub recipient: OrdersRecipientInfo, /** * Name of the channel @@ -3428,7 +3425,6 @@ pub struct ReceivingAddBoxOrderModel { /// Information to create a new receiving order #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct ReceivingCreateOrderModel { - #[serde()] pub box_packaging_type: ReceivingPackingType, /** * Box shipments to be added to this receiving order @@ -3451,9 +3447,7 @@ pub struct ReceivingCreateOrderModel { /** * Model containing information that assigns a receiving order to a fulfillment center */ - #[serde()] pub fulfillment_center: ReceivingAssignOrderFulfillmentCenterModel, - #[serde()] pub package_type: ReceivingPackageType, } @@ -3890,7 +3884,6 @@ pub struct ReturnsCreateReturn { /** * Information about a fulfillment center */ - #[serde()] pub fulfillment_center: ReturnsFulfillmentCenter, /** * Array of inventory items being returned @@ -4068,7 +4061,6 @@ pub struct WebhooksCreateWebhookSubscriptionModel { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub subscription_url: String, - #[serde()] pub topic: WebhooksTopics, } diff --git a/slack/src/types.rs b/slack/src/types.rs index af203208..7c1c2865 100644 --- a/slack/src/types.rs +++ b/slack/src/types.rs @@ -51,7 +51,6 @@ pub struct ObjsBotProfile { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub deleted: bool, - #[serde()] pub icons: Icons, #[serde( default, @@ -265,9 +264,7 @@ pub struct ObjsChannel { deserialize_with = "crate::utils::deserialize_null_f64::deserialize" )] pub priority: f64, - #[serde()] pub purpose: Topic, - #[serde()] pub topic: Topic, #[serde( default, @@ -395,7 +392,6 @@ pub struct Shares { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub is_active: bool, - #[serde()] pub team: ObjsTeam, #[serde( default, @@ -645,7 +641,6 @@ pub struct ObjsConversation { deserialize_with = "crate::utils::deserialize_null_f64::deserialize" )] pub priority: f64, - #[serde()] pub purpose: Topic, #[serde( default, @@ -665,7 +660,6 @@ pub struct ObjsConversation { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub timezone_count: i64, - #[serde()] pub topic: Topic, #[serde( default, @@ -919,7 +913,6 @@ pub struct ConversationMpimObject { deserialize_with = "crate::utils::deserialize_null_f64::deserialize" )] pub priority: f64, - #[serde()] pub purpose: Topic, #[serde( default, @@ -939,7 +932,6 @@ pub struct ConversationMpimObject { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub timezone_count: i64, - #[serde()] pub topic: Topic, #[serde( default, @@ -998,7 +990,6 @@ pub struct ConversationImChannelObjectFromConversationsMethodsShares { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub name: String, - #[serde()] pub team: ObjsTeam, } @@ -2386,7 +2377,6 @@ pub struct ObjsSubteam { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub name: String, - #[serde()] pub prefs: Prefs, #[serde( default, @@ -2564,7 +2554,6 @@ pub struct ObjsTeam { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub has_compliance_export: bool, - #[serde()] pub icon: ObjsIcon, #[serde( default, @@ -2934,7 +2923,6 @@ pub struct ObjsUser { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub presence: String, - #[serde()] pub profile: ObjsUserProfile, /** * user object for non enterprise type @@ -3149,7 +3137,6 @@ pub struct ObjsUserData { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub presence: String, - #[serde()] pub profile: ObjsUserProfile, /** * enterprise user @@ -3331,7 +3318,6 @@ pub struct ObjsUserProfile { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub email: String, - #[serde()] pub fields: FieldsOneOf, #[serde( default, @@ -3752,7 +3738,6 @@ pub struct Im { #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct Team { - #[serde()] pub resources: ObjsResources, #[serde( default, @@ -3764,24 +3749,17 @@ pub struct Team { #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct Info { - #[serde()] pub app_home: Im, - #[serde()] pub channel: Im, - #[serde()] pub group: Im, - #[serde()] pub im: Im, - #[serde()] pub mpim: Im, - #[serde()] pub team: Team, } /// Schema for successful response from apps.permissions.info method #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct AppsPermissionsInfoSchema { - #[serde()] pub info: Info, #[serde( default, @@ -3882,7 +3860,6 @@ pub struct ApiPermissionsScopesListSuccessSchema { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub ok: bool, - #[serde()] pub scopes: Scopes, } @@ -3971,7 +3948,6 @@ pub struct Bot { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub deleted: bool, - #[serde()] pub icons: Icons, #[serde( default, @@ -4002,7 +3978,6 @@ pub struct Bot { /// Schema for successful response from bots.info method #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct BotsInfoSchema { - #[serde()] pub bot: Bot, #[serde( default, @@ -4108,7 +4083,6 @@ pub struct ChatPostMessageSuccessSchema { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub channel: String, - #[serde()] pub message: ObjsMessage, #[serde( default, @@ -4175,7 +4149,6 @@ pub struct ChatScheduleMessageSuccessSchema { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub channel: String, - #[serde()] pub message: Message, #[serde( default, @@ -4238,7 +4211,6 @@ pub struct ChatScheduledMessagesListSchema { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub ok: bool, - #[serde()] pub response_metadata: NewPagingStyle, #[serde( default, @@ -4275,7 +4247,6 @@ pub struct ChatUpdateSuccessSchema { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub channel: String, - #[serde()] pub message: MessageObject, #[serde( default, @@ -4483,7 +4454,6 @@ pub struct ConversationsMembersSuccessSchema { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub ok: bool, - #[serde()] pub response_metadata: NewPagingStyle, } @@ -4740,7 +4710,6 @@ pub struct FilesInfoSchema { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub editor: String, - #[serde()] pub file: ObjsFile, #[serde( default, @@ -4777,14 +4746,12 @@ pub struct FilesListSchema { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub ok: bool, - #[serde()] pub paging: ObjsPaging, } /// Schema for successful response files.upload method #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct FilesUploadSchema { - #[serde()] pub file: ObjsFile, #[serde( default, @@ -5033,7 +5000,6 @@ pub struct RemindersAddSchema { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub ok: bool, - #[serde()] pub reminder: ObjsReminder, } @@ -5101,7 +5067,6 @@ pub struct RtmConnectSchema { pub ok: bool, #[serde(rename = "self")] pub self_: SelfData, - #[serde()] pub team: RtmConnectSchemaTeam, #[serde( default, @@ -5210,7 +5175,6 @@ pub struct TeamAccessLogsSchema { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub ok: bool, - #[serde()] pub paging: ObjsPaging, } @@ -5222,7 +5186,6 @@ pub struct TeamInfoSchema { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub ok: bool, - #[serde()] pub team: ObjsTeam, } @@ -5310,7 +5273,6 @@ pub struct TeamIntegrationLogsSchema { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub ok: bool, - #[serde()] pub paging: ObjsPaging, } @@ -5322,7 +5284,6 @@ pub struct TeamProfileGetSuccessSchema { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub ok: bool, - #[serde()] pub profile: Profile, } @@ -5334,7 +5295,6 @@ pub struct UsergroupsCreateSchema { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub ok: bool, - #[serde()] pub usergroup: ObjsSubteam, } @@ -5467,9 +5427,7 @@ pub struct UsersIdentityResponse { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub ok: bool, - #[serde()] pub team: UsersIdentityResponseTeam, - #[serde()] pub user: SelfData, } @@ -5503,9 +5461,7 @@ pub struct UsersIdentityResponseData { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub ok: bool, - #[serde()] pub team: UsersIdentityResponseTeam, - #[serde()] pub user: User, } @@ -5569,9 +5525,7 @@ pub struct UsersIdentityResponseDataType { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub ok: bool, - #[serde()] pub team: UsersIdentityResponseTeam, - #[serde()] pub user: UsersIdentityResponseUser, } @@ -5652,9 +5606,7 @@ pub struct UsersIdentityResponseDataTypeLinks { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub ok: bool, - #[serde()] pub team: UsersIdentityResponseTeamData, - #[serde()] pub user: SelfData, } @@ -5744,7 +5696,6 @@ pub struct UsersProfileGetSchema { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub ok: bool, - #[serde()] pub profile: ObjsUserProfile, } @@ -5765,7 +5716,6 @@ pub struct UsersProfileSetSchema { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub ok: bool, - #[serde()] pub profile: ObjsUserProfile, #[serde( default, @@ -5841,6 +5791,5 @@ pub struct UsersSetPhotoSchema { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub ok: bool, - #[serde()] pub profile: UsersSetPhotoSchemaProfile, } diff --git a/stripe/src/types.rs b/stripe/src/types.rs index 5dded2b4..9455c75e 100644 --- a/stripe/src/types.rs +++ b/stripe/src/types.rs @@ -133,7 +133,6 @@ pub struct ExternalAccounts { /** * The list contains all external accounts that have been attached to the Stripe account. These may be bank accounts or cards. */ - #[serde()] pub data: Box>, /** * Whether the account can create live charges. @@ -547,12 +546,10 @@ pub struct AccountBrandingSettings { /** * */ - #[serde()] pub icon: Box>, /** * */ - #[serde()] pub logo: Box>, /** * @@ -1262,7 +1259,6 @@ pub struct AccountPayoutSettings { /** * */ - #[serde()] pub schedule: TransferSchedule, /** * @@ -1605,7 +1601,6 @@ pub struct AccountSettings { /** * */ - #[serde()] pub branding: AccountBrandingSettings, /** * @@ -1615,17 +1610,14 @@ pub struct AccountSettings { /** * */ - #[serde()] pub card_payments: AccountCardPaymentsSettings, /** * */ - #[serde()] pub dashboard: AccountDashboardSettings, /** * */ - #[serde()] pub payments: AccountPaymentsSettings, /** * @@ -1913,7 +1905,6 @@ pub struct AlipayAccount { /** * */ - #[serde()] pub customer: Box>, /** * The account's country. @@ -2167,7 +2158,6 @@ pub struct ApiErrors { /** * */ - #[serde()] pub payment_intent: Box>, /** * @@ -2191,7 +2181,6 @@ pub struct ApiErrors { /** * */ - #[serde()] pub source: Box>, /** * The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` @@ -2625,7 +2614,6 @@ pub struct Refunds { /// #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct PlatformFee { - #[serde()] pub account: Box, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -2645,14 +2633,11 @@ pub struct PlatformFee { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub amount_refunded: i64, - #[serde()] pub application: Box, /** * */ - #[serde()] pub balance_transaction: Box>, - #[serde()] pub charge: Box, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -2697,7 +2682,6 @@ pub struct PlatformFee { /** * */ - #[serde()] pub originating_transaction: Box>, /** * Whether the account can create live charges. @@ -2710,7 +2694,6 @@ pub struct PlatformFee { /** * A list of refunds that have been applied to the fee. */ - #[serde()] pub refunds: Refunds, } @@ -3551,7 +3534,6 @@ pub struct BalanceTransaction { * * Related guide: [Balance Transaction Types](https://stripe.com/docs/reports/balance-transaction-types). */ - #[serde()] pub source: Box>, /** * The account's country. @@ -3661,7 +3643,6 @@ pub struct BankAccount { * * Related guide: [Bank Debits and Transfers](https://stripe.com/docs/payments/bank-debits-transfers). */ - #[serde()] pub account: Box>, /** * These bank accounts are payment methods on `Customer` objects. @@ -3759,7 +3740,6 @@ pub struct BankAccount { * * Related guide: [Bank Debits and Transfers](https://stripe.com/docs/payments/bank-debits-transfers). */ - #[serde()] pub customer: Box>, /** * These bank accounts are payment methods on `Customer` objects. @@ -3950,7 +3930,6 @@ pub struct PortalConfiguration { /** * */ - #[serde()] pub business_profile: PortalBusinessProfile, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -3973,7 +3952,6 @@ pub struct PortalConfiguration { /** * */ - #[serde()] pub features: PortalFeatures, /** * The account's country. @@ -4297,7 +4275,6 @@ impl PortalSessionObject { /// Learn more in the [integration guide](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal). #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct PortalSession { - #[serde()] pub configuration: Box, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -4833,7 +4810,6 @@ impl CapabilityStatus { /// Related guide: [Account capabilities](https://stripe.com/docs/connect/account-capabilities). #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct Capability { - #[serde()] pub account: Box, /** * This is an object representing a capability for a Stripe account. @@ -4995,7 +4971,6 @@ pub struct Card { * * Related guide: [Card Payments with Sources](https://stripe.com/docs/sources/cards). */ - #[serde()] pub account: Box>, /** * You can store multiple cards on a customer in order to charge the customer @@ -5155,7 +5130,6 @@ pub struct Card { * * Related guide: [Card Payments with Sources](https://stripe.com/docs/sources/cards). */ - #[serde()] pub customer: Box>, /** * You can store multiple cards on a customer in order to charge the customer @@ -5293,7 +5267,6 @@ pub struct Card { * * Related guide: [Card Payments with Sources](https://stripe.com/docs/sources/cards). */ - #[serde()] pub recipient: Box>, /** * You can store multiple cards on a customer in order to charge the customer @@ -5877,7 +5850,6 @@ pub struct Charge { * * Related guide: [Accept a payment with the Charges API](https://stripe.com/docs/payments/accept-a-payment-charges). */ - #[serde()] pub application: Box>, /** * To charge a credit or a debit card, you create a `Charge` object. You can @@ -5886,7 +5858,6 @@ pub struct Charge { * * Related guide: [Accept a payment with the Charges API](https://stripe.com/docs/payments/accept-a-payment-charges). */ - #[serde()] pub application_fee: Box>, /** * To charge a credit or a debit card, you create a `Charge` object. You can @@ -5908,12 +5879,10 @@ pub struct Charge { * * Related guide: [Accept a payment with the Charges API](https://stripe.com/docs/payments/accept-a-payment-charges). */ - #[serde()] pub balance_transaction: Box>, /** * */ - #[serde()] pub billing_details: BillingDetails, /** * To charge a credit or a debit card, you create a `Charge` object. You can @@ -5961,7 +5930,6 @@ pub struct Charge { * * Related guide: [Accept a payment with the Charges API](https://stripe.com/docs/payments/accept-a-payment-charges). */ - #[serde()] pub customer: Box>, /** * To charge a credit or a debit card, you create a `Charge` object. You can @@ -5991,7 +5959,6 @@ pub struct Charge { * * Related guide: [Accept a payment with the Charges API](https://stripe.com/docs/payments/accept-a-payment-charges). */ - #[serde()] pub failure_balance_transaction: Box>, /** * To charge a credit or a debit card, you create a `Charge` object. You can @@ -6040,7 +6007,6 @@ pub struct Charge { * * Related guide: [Accept a payment with the Charges API](https://stripe.com/docs/payments/accept-a-payment-charges). */ - #[serde()] pub invoice: Box>, /** * Whether the account can create live charges. @@ -6071,7 +6037,6 @@ pub struct Charge { * * Related guide: [Accept a payment with the Charges API](https://stripe.com/docs/payments/accept-a-payment-charges). */ - #[serde()] pub on_behalf_of: Box>, /** * To charge a credit or a debit card, you create a `Charge` object. You can @@ -6080,7 +6045,6 @@ pub struct Charge { * * Related guide: [Accept a payment with the Charges API](https://stripe.com/docs/payments/accept-a-payment-charges). */ - #[serde()] pub order: Box>, /** * Details about whether the payment was accepted, and why. See [understanding declines](https://stripe.com/docs/declines) for details. @@ -6102,7 +6066,6 @@ pub struct Charge { * * Related guide: [Accept a payment with the Charges API](https://stripe.com/docs/payments/accept-a-payment-charges). */ - #[serde()] pub payment_intent: Box>, /** * To charge a credit or a debit card, you create a `Charge` object. You can @@ -6172,7 +6135,6 @@ pub struct Charge { /** * A list of refunds that have been applied to the charge. */ - #[serde()] pub refunds: RefundList, /** * To charge a credit or a debit card, you create a `Charge` object. You can @@ -6181,7 +6143,6 @@ pub struct Charge { * * Related guide: [Accept a payment with the Charges API](https://stripe.com/docs/payments/accept-a-payment-charges). */ - #[serde()] pub review: Box>, /** * Shipping information for the charge. @@ -6195,7 +6156,6 @@ pub struct Charge { * * Related guide: [Accept a payment with the Charges API](https://stripe.com/docs/payments/accept-a-payment-charges). */ - #[serde()] pub source_transfer: Box>, /** * To charge a credit or a debit card, you create a `Charge` object. You can @@ -6235,7 +6195,6 @@ pub struct Charge { * * Related guide: [Accept a payment with the Charges API](https://stripe.com/docs/payments/accept-a-payment-charges). */ - #[serde()] pub transfer: Box>, /** * An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. @@ -6370,7 +6329,6 @@ pub struct ChargeOutcome { /** * */ - #[serde()] pub rule: Box>, /** * @@ -6405,7 +6363,6 @@ pub struct ChargeTransferData { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub amount: i64, - #[serde()] pub destination: Box, } @@ -7191,7 +7148,6 @@ pub struct Session { /** * */ - #[serde()] pub automatic_tax: AutomaticTax, /** * Describes whether Checkout should collect the customer's billing address. @@ -7277,7 +7233,6 @@ pub struct Session { * * Related guide: [Checkout Server Quickstart](https://stripe.com/docs/payments/checkout/api). */ - #[serde()] pub customer: Box>, /** * Configure whether a Checkout Session creates a Customer when the Checkout Session completes. @@ -7408,7 +7363,6 @@ pub struct Session { * * Related guide: [Checkout Server Quickstart](https://stripe.com/docs/payments/checkout/api). */ - #[serde()] pub payment_intent: Box>, /** * A Checkout Session represents your customer's session as they pay for @@ -7426,7 +7380,6 @@ pub struct Session { * * Related guide: [Checkout Server Quickstart](https://stripe.com/docs/payments/checkout/api). */ - #[serde()] pub payment_link: Box>, /** * Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. @@ -7504,7 +7457,6 @@ pub struct Session { * * Related guide: [Checkout Server Quickstart](https://stripe.com/docs/payments/checkout/api). */ - #[serde()] pub setup_intent: Box>, /** * Shipping information for the charge. @@ -7541,7 +7493,6 @@ pub struct Session { * * Related guide: [Checkout Server Quickstart](https://stripe.com/docs/payments/checkout/api). */ - #[serde()] pub shipping_rate: Box>, /** * The status of the Checkout Session, one of `open`, `complete`, or `expired`. @@ -7572,7 +7523,6 @@ pub struct Session { * * Related guide: [Checkout Server Quickstart](https://stripe.com/docs/payments/checkout/api). */ - #[serde()] pub subscription: Box>, /** * The account's country. @@ -8052,7 +8002,6 @@ pub struct ConnectCollectionTransfer { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub currency: String, - #[serde()] pub destination: Box, /** * The account's country. @@ -8186,7 +8135,6 @@ pub struct CountrySpec { /** * */ - #[serde()] pub verification_fields: CountrySpecVerificationFields, } @@ -8219,12 +8167,10 @@ pub struct CountrySpecVerificationFields { /** * */ - #[serde()] pub company: CountrySpecVerificationFieldDetails, /** * */ - #[serde()] pub individual: CountrySpecVerificationFieldDetails, } @@ -8799,14 +8745,12 @@ pub struct CreditNote { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub currency: String, - #[serde()] pub customer: Box, /** * Issue a credit note to adjust an invoice's amount after the invoice is finalized. * * Related guide: [Credit Notes](https://stripe.com/docs/billing/invoices/credit-notes). */ - #[serde()] pub customer_balance_transaction: Box>, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -8835,12 +8779,10 @@ pub struct CreditNote { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub id: String, - #[serde()] pub invoice: Box, /** * Line items that make up the credit note */ - #[serde()] pub lines: Lines, /** * Whether the account can create live charges. @@ -8916,7 +8858,6 @@ pub struct CreditNote { * * Related guide: [Credit Notes](https://stripe.com/docs/billing/invoices/credit-notes). */ - #[serde()] pub refund: Box>, /** * Status of this credit note, one of `issued` or `void`. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). @@ -9241,7 +9182,6 @@ pub struct InvoiceTaxAmount { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub inclusive: bool, - #[serde()] pub tax_rate: Box, } @@ -9484,7 +9424,6 @@ pub struct Sources { /** * Details about each object. */ - #[serde()] pub data: Box>, /** * Whether the account can create live charges. @@ -9719,7 +9658,6 @@ pub struct Customer { * * Related guide: [Save a card during payment](https://stripe.com/docs/payments/save-during-payment). */ - #[serde()] pub default_source: Box>, /** * This object represents a customer of your business. It lets you create recurring charges and track payments that belong to the same customer. @@ -9896,7 +9834,6 @@ pub struct Customer { * * Related guide: [Save a card during payment](https://stripe.com/docs/payments/save-during-payment). */ - #[serde()] pub test_clock: Box>, } @@ -10201,7 +10138,6 @@ pub struct CustomerBalanceTransaction { * * Related guide: [Customer Balance](https://stripe.com/docs/billing/customer/balance) to learn more. */ - #[serde()] pub credit_note: Box>, /** * The account's country. @@ -10212,7 +10148,6 @@ pub struct CustomerBalanceTransaction { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub currency: String, - #[serde()] pub customer: CustomerAnyOfData, /** * Each customer has a [`balance`](https://stripe.com/docs/api/customers/object#customer_object-balance) value, @@ -10254,7 +10189,6 @@ pub struct CustomerBalanceTransaction { * * Related guide: [Customer Balance](https://stripe.com/docs/billing/customer/balance) to learn more. */ - #[serde()] pub invoice: Box>, /** * Whether the account can create live charges. @@ -10772,12 +10706,10 @@ pub struct DeletedDiscount { * might want to apply to a customer. Coupons may be applied to [invoices](https://stripe.com/docs/api#invoices) or * [orders](https://stripe.com/docs/api#create_order_legacy-coupon). Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge). */ - #[serde()] pub coupon: Coupon, /** * */ - #[serde()] pub customer: Box>, /** * Whether the account can create live charges. @@ -10822,7 +10754,6 @@ pub struct DeletedDiscount { /** * */ - #[serde()] pub promotion_code: Box>, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -12005,7 +11936,6 @@ pub struct DiscountData { * might want to apply to a customer. Coupons may be applied to [invoices](https://stripe.com/docs/api#invoices) or * [orders](https://stripe.com/docs/api#create_order_legacy-coupon). Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge). */ - #[serde()] pub coupon: Coupon, /** * A discount represents the actual application of a coupon to a particular @@ -12014,7 +11944,6 @@ pub struct DiscountData { * * Related guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts). */ - #[serde()] pub customer: Box>, /** * A discount represents the actual application of a coupon to a particular @@ -12076,7 +12005,6 @@ pub struct DiscountData { * * Related guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts). */ - #[serde()] pub promotion_code: Box>, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -12178,7 +12106,6 @@ pub struct DiscountsResourceDiscountAmount { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub amount: i64, - #[serde()] pub discount: Box, } @@ -12300,7 +12227,6 @@ pub struct Dispute { deserialize_with = "crate::utils::deserialize_null_vector::deserialize" )] pub balance_transactions: Vec, - #[serde()] pub charge: Box, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -12323,12 +12249,10 @@ pub struct Dispute { /** * */ - #[serde()] pub evidence: DisputeEvidence, /** * */ - #[serde()] pub evidence_details: DisputeEvidenceDetails, /** * The account's country. @@ -12378,7 +12302,6 @@ pub struct Dispute { * * Related guide: [Disputes and Fraud](https://stripe.com/docs/disputes). */ - #[serde()] pub payment_intent: Box>, /** * The account's country. @@ -12420,7 +12343,6 @@ pub struct DisputeEvidence { /** * */ - #[serde()] pub cancellation_policy: Box>, /** * @@ -12443,7 +12365,6 @@ pub struct DisputeEvidence { /** * */ - #[serde()] pub customer_communication: Box>, /** * @@ -12475,12 +12396,10 @@ pub struct DisputeEvidence { /** * */ - #[serde()] pub customer_signature: Box>, /** * */ - #[serde()] pub duplicate_charge_documentation: Box>, /** * @@ -12512,12 +12431,10 @@ pub struct DisputeEvidence { /** * */ - #[serde()] pub receipt: Box>, /** * */ - #[serde()] pub refund_policy: Box>, /** * @@ -12549,7 +12466,6 @@ pub struct DisputeEvidence { /** * */ - #[serde()] pub service_documentation: Box>, /** * @@ -12581,7 +12497,6 @@ pub struct DisputeEvidence { /** * */ - #[serde()] pub shipping_documentation: Box>, /** * @@ -12595,7 +12510,6 @@ pub struct DisputeEvidence { /** * */ - #[serde()] pub uncategorized_file: Box>, /** * @@ -12765,7 +12679,6 @@ pub struct Error { /** * */ - #[serde()] pub error: ApiErrors, } @@ -12921,7 +12834,6 @@ pub struct Event { /** * */ - #[serde()] pub data: NotificationEventData, /** * The account's country. @@ -13153,7 +13065,6 @@ pub struct FeeRefund { * * Related guide: [Refunding Application Fees](https://stripe.com/docs/connect/destination-charges#refunding-app-fee). */ - #[serde()] pub balance_transaction: Box>, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -13173,7 +13084,6 @@ pub struct FeeRefund { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub currency: String, - #[serde()] pub fee: Box, /** * The account's country. @@ -13546,7 +13456,6 @@ pub struct FileLink { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub expires_at: i64, - #[serde()] pub file: Box, /** * The account's country. @@ -14713,7 +14622,6 @@ pub struct GelatoVerificationReport { /** * */ - #[serde()] pub options: GelatoVerificationReportOptions, /** * A VerificationReport is the result of an attempt to collect and verify data from a user. @@ -14967,7 +14875,6 @@ pub struct GelatoVerificationSession { * * Related guide: [The Verification Sessions API](https://stripe.com/docs/identity/verification-sessions) */ - #[serde()] pub last_verification_report: Box>, /** * Whether the account can create live charges. @@ -14997,7 +14904,6 @@ pub struct GelatoVerificationSession { /** * */ - #[serde()] pub options: GelatoVerificationSessionOptions, /** * Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null. @@ -15511,7 +15417,6 @@ pub struct Invoice { /** * The account tax IDs associated with the invoice. Only editable when the invoice is a draft. */ - #[serde()] pub account_tax_ids: Box>, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -15639,7 +15544,6 @@ pub struct Invoice { /** * */ - #[serde()] pub automatic_tax: AutomaticTax, /** * Indicates the reason why the invoice was created. `subscription_cycle` indicates an invoice created by a subscription advancing into a new period. `subscription_create` indicates an invoice created due to creating a subscription. `subscription_update` indicates an invoice created due to updating a subscription. `subscription` is set for all old invoices to indicate either a change to a subscription or a period advancement. `manual` is set for all invoices unrelated to a subscription (for example: created via the invoice editor). The `upcoming` value is reserved for simulated invoices per the upcoming invoice endpoint. `subscription_threshold` indicates an invoice created due to a billing threshold being reached. @@ -15680,7 +15584,6 @@ pub struct Invoice { * * Related guide: [Send Invoices to Customers](https://stripe.com/docs/billing/invoices/sending). */ - #[serde()] pub charge: Box>, /** * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. @@ -15748,7 +15651,6 @@ pub struct Invoice { * * Related guide: [Send Invoices to Customers](https://stripe.com/docs/billing/invoices/sending). */ - #[serde()] pub customer: Box>, /** * A publicly available mailing address for sending support issues to. @@ -15928,7 +15830,6 @@ pub struct Invoice { * * Related guide: [Send Invoices to Customers](https://stripe.com/docs/billing/invoices/sending). */ - #[serde()] pub default_payment_method: Box>, /** * Invoices are statements of amounts owed by a customer, and are either @@ -15964,7 +15865,6 @@ pub struct Invoice { * * Related guide: [Send Invoices to Customers](https://stripe.com/docs/billing/invoices/sending). */ - #[serde()] pub default_source: Box>, /** * The tax rates which apply to the line item. @@ -16023,7 +15923,6 @@ pub struct Invoice { /** * The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. */ - #[serde()] pub discounts: Box>, /** * Invoices are statements of amounts owed by a customer, and are either @@ -16268,12 +16167,10 @@ pub struct Invoice { /** * The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. */ - #[serde()] pub last_finalization_error: Box>, /** * The individual line items that make up the invoice. `lines` is sorted as follows: invoice items in reverse chronological order, followed by the subscription, if any. */ - #[serde()] pub lines: InvoiceLinesList, /** * Whether the account can create live charges. @@ -16442,7 +16339,6 @@ pub struct Invoice { * * Related guide: [Send Invoices to Customers](https://stripe.com/docs/billing/invoices/sending). */ - #[serde()] pub on_behalf_of: Box>, /** * Whether the account can create live charges. @@ -16494,12 +16390,10 @@ pub struct Invoice { * * Related guide: [Send Invoices to Customers](https://stripe.com/docs/billing/invoices/sending). */ - #[serde()] pub payment_intent: Box>, /** * */ - #[serde()] pub payment_settings: InvoicesPaymentSettings, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -16571,7 +16465,6 @@ pub struct Invoice { * * Related guide: [Send Invoices to Customers](https://stripe.com/docs/billing/invoices/sending). */ - #[serde()] pub quote: Box>, /** * Invoices are statements of amounts owed by a customer, and are either @@ -16670,7 +16563,6 @@ pub struct Invoice { /** * */ - #[serde()] pub status_transitions: InvoicesStatusTransitions, /** * Invoices are statements of amounts owed by a customer, and are either @@ -16706,7 +16598,6 @@ pub struct Invoice { * * Related guide: [Send Invoices to Customers](https://stripe.com/docs/billing/invoices/sending). */ - #[serde()] pub subscription: Box>, /** * Invoices are statements of amounts owed by a customer, and are either @@ -16831,7 +16722,6 @@ pub struct Invoice { * * Related guide: [Send Invoices to Customers](https://stripe.com/docs/billing/invoices/sending). */ - #[serde()] pub test_clock: Box>, /** * Invoices are statements of amounts owed by a customer, and are either @@ -17326,7 +17216,6 @@ pub struct InvoiceSettingCustomer { /** * */ - #[serde()] pub default_payment_method: Box>, /** * @@ -17402,7 +17291,6 @@ pub struct InvoiceTransferDataType { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub amount: i64, - #[serde()] pub destination: Box, } @@ -17485,7 +17373,6 @@ pub struct InvoiceItem { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub currency: String, - #[serde()] pub customer: Box, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -17522,7 +17409,6 @@ pub struct InvoiceItem { /** * The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. */ - #[serde()] pub discounts: Box>, /** * The account's country. @@ -17542,7 +17428,6 @@ pub struct InvoiceItem { * * Related guide: [Subscription Invoices](https://stripe.com/docs/billing/invoices/subscription#adding-upcoming-invoice-items). */ - #[serde()] pub invoice: Box>, /** * Whether the account can create live charges. @@ -17575,7 +17460,6 @@ pub struct InvoiceItem { /** * */ - #[serde()] pub period: InvoiceLineItemPeriod, /** * The price of the invoice item. @@ -17608,7 +17492,6 @@ pub struct InvoiceItem { * * Related guide: [Subscription Invoices](https://stripe.com/docs/billing/invoices/subscription#adding-upcoming-invoice-items). */ - #[serde()] pub subscription: Box>, /** * Sometimes you want to add a charge or credit to a customer, but actually @@ -17649,7 +17532,6 @@ pub struct InvoiceItem { * * Related guide: [Subscription Invoices](https://stripe.com/docs/billing/invoices/subscription#adding-upcoming-invoice-items). */ - #[serde()] pub test_clock: Box>, /** * Sometimes you want to add a charge or credit to a customer, but actually @@ -18132,7 +18014,6 @@ pub struct IssuerFraudRecord { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub actionable: bool, - #[serde()] pub charge: Box, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -18412,7 +18293,6 @@ pub struct IssuingAuthorization { /** * You can [create physical or virtual cards](https://stripe.com/docs/issuing/cards) that are issued to cardholders. */ - #[serde()] pub card: IssuingCard, /** * When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization` @@ -18421,7 +18301,6 @@ pub struct IssuingAuthorization { * * Related guide: [Issued Card Authorizations](https://stripe.com/docs/issuing/purchases/authorizations). */ - #[serde()] pub cardholder: Box>, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -18479,7 +18358,6 @@ pub struct IssuingAuthorization { /** * */ - #[serde()] pub merchant_data: IssuingAuthorizationMerchantData, /** * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. @@ -18526,7 +18404,6 @@ pub struct IssuingAuthorization { /** * */ - #[serde()] pub verification_data: IssuingAuthorizationVerificationData, /** * When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization` @@ -18809,7 +18686,6 @@ pub struct IssuingCard { * * Related guide: [How to create a Cardholder](https://stripe.com/docs/issuing/cards#create-cardholder) */ - #[serde()] pub cardholder: IssuingCardholder, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -18909,12 +18785,10 @@ pub struct IssuingCard { /** * You can [create physical or virtual cards](https://stripe.com/docs/issuing/cards) that are issued to cardholders. */ - #[serde()] pub replaced_by: Box>, /** * You can [create physical or virtual cards](https://stripe.com/docs/issuing/cards) that are issued to cardholders. */ - #[serde()] pub replacement_for: Box>, /** * The reason why the previous card needed to be replaced. @@ -18929,7 +18803,6 @@ pub struct IssuingCard { /** * */ - #[serde()] pub spending_controls: IssuingCardAuthorizationControls, /** * Whether authorizations can be approved on this card. @@ -19074,7 +18947,6 @@ pub struct IssuingCardholder { /** * */ - #[serde()] pub billing: IssuingCardholderAddress, /** * Additional information about a `company` cardholder. @@ -19160,7 +19032,6 @@ pub struct IssuingCardholder { /** * */ - #[serde()] pub requirements: IssuingCardholderRequirements, /** * Rules that control spending across this cardholder's cards. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. @@ -19363,7 +19234,6 @@ pub struct IssuingDispute { /** * */ - #[serde()] pub evidence: IssuingDisputeEvidence, /** * The account's country. @@ -19401,7 +19271,6 @@ pub struct IssuingDispute { */ #[serde(default, skip_serializing_if = "IssuingDisputeStatus::is_noop")] pub status: IssuingDisputeStatus, - #[serde()] pub transaction: Box, } @@ -19859,7 +19728,6 @@ pub struct IssuingTransaction { * * Related guide: [Issued Card Transactions](https://stripe.com/docs/issuing/purchases/transactions). */ - #[serde()] pub authorization: Box>, /** * Any use of an [issued card](https://stripe.com/docs/issuing) that results in funds entering or leaving @@ -19868,9 +19736,7 @@ pub struct IssuingTransaction { * * Related guide: [Issued Card Transactions](https://stripe.com/docs/issuing/purchases/transactions). */ - #[serde()] pub balance_transaction: Box>, - #[serde()] pub card: Box, /** * Any use of an [issued card](https://stripe.com/docs/issuing) that results in funds entering or leaving @@ -19879,7 +19745,6 @@ pub struct IssuingTransaction { * * Related guide: [Issued Card Transactions](https://stripe.com/docs/issuing/purchases/transactions). */ - #[serde()] pub cardholder: Box>, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -19906,7 +19771,6 @@ pub struct IssuingTransaction { * * Related guide: [Issued Card Transactions](https://stripe.com/docs/issuing/purchases/transactions). */ - #[serde()] pub dispute: Box>, /** * The account's country. @@ -19946,7 +19810,6 @@ pub struct IssuingTransaction { /** * */ - #[serde()] pub merchant_data: IssuingAuthorizationMerchantData, /** * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. @@ -21576,7 +21439,6 @@ pub struct IssuingCardShippingData { /** * */ - #[serde()] pub address: Address, /** * The delivery company that shipped a card. @@ -21724,12 +21586,10 @@ pub struct IssuingCardWallets { /** * */ - #[serde()] pub apple_pay: IssuingCardApplePay, /** * */ - #[serde()] pub google_pay: IssuingCardApplePay, /** * @@ -21748,7 +21608,6 @@ pub struct IssuingCardholderAddress { /** * */ - #[serde()] pub address: Address, } @@ -21812,12 +21671,10 @@ pub struct IssuingCardholderDocument { /** * */ - #[serde()] pub back: Box>, /** * */ - #[serde()] pub front: Box>, } @@ -22088,7 +21945,6 @@ pub struct IssuingDisputeCanceledEvidence { /** * */ - #[serde()] pub additional_documentation: Box>, /** * @@ -22170,22 +22026,18 @@ pub struct IssuingDisputeDuplicateEvidence { /** * */ - #[serde()] pub additional_documentation: Box>, /** * */ - #[serde()] pub card_statement: Box>, /** * */ - #[serde()] pub cash_receipt: Box>, /** * */ - #[serde()] pub check_image: Box>, /** * @@ -22313,7 +22165,6 @@ pub struct IssuingDisputeFraudulentEvidence { /** * */ - #[serde()] pub additional_documentation: Box>, /** * @@ -22332,7 +22183,6 @@ pub struct IssuingDisputeMerchandiseNotAsDescribedEvidence { /** * */ - #[serde()] pub additional_documentation: Box>, /** * @@ -22383,7 +22233,6 @@ pub struct IssuingDisputeNotReceivedEvidence { /** * */ - #[serde()] pub additional_documentation: Box>, /** * @@ -22425,7 +22274,6 @@ pub struct IssuingDisputeOtherEvidence { /** * */ - #[serde()] pub additional_documentation: Box>, /** * @@ -22458,7 +22306,6 @@ pub struct IssuingDisputeServiceNotAsDescribedEvidence { /** * */ - #[serde()] pub additional_documentation: Box>, /** * @@ -23105,7 +22952,6 @@ pub struct LegalEntityCompanyVerificationData { /** * */ - #[serde()] pub document: LegalEntityCompanyVerificationDocument, } @@ -23115,7 +22961,6 @@ pub struct LegalEntityCompanyVerificationDocument { /** * */ - #[serde()] pub back: Box>, /** * @@ -23138,7 +22983,6 @@ pub struct LegalEntityCompanyVerificationDocument { /** * */ - #[serde()] pub front: Box>, } @@ -23292,7 +23136,6 @@ pub struct LegalEntityPersonVerificationDocument { /** * */ - #[serde()] pub back: Box>, /** * @@ -23315,7 +23158,6 @@ pub struct LegalEntityPersonVerificationDocument { /** * */ - #[serde()] pub front: Box>, } @@ -23474,7 +23316,6 @@ pub struct LineItem { /** * The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. */ - #[serde()] pub discounts: Box>, /** * The account's country. @@ -23519,7 +23360,6 @@ pub struct LineItem { /** * */ - #[serde()] pub period: InvoiceLineItemPeriod, /** * The price of the invoice item. @@ -23614,7 +23454,6 @@ pub struct LineItemsDiscountAmount { * * Related guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts). */ - #[serde()] pub discount: DiscountData, } @@ -23635,7 +23474,6 @@ pub struct LineItemsTaxAmount { * * Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates). */ - #[serde()] pub rate: TaxRate, } @@ -23781,7 +23619,6 @@ pub struct Mandate { /** * */ - #[serde()] pub customer_acceptance: CustomerAcceptance, /** * The account's country. @@ -23810,12 +23647,10 @@ pub struct Mandate { */ #[serde(default, skip_serializing_if = "MandateObject::is_noop")] pub object: MandateObject, - #[serde()] pub payment_method: Box, /** * */ - #[serde()] pub payment_method_details: MandatePaymentMethodDetails, /** * A Mandate is a record of the permission a customer has given you to debit their payment method. @@ -24073,7 +23908,6 @@ pub struct NotificationEventData { /** * When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js. */ - #[serde()] pub object: UseStripeSdk, /** * @@ -24261,7 +24095,6 @@ pub struct Order { * * Related guide: [Tax, Shipping, and Inventory](https://stripe.com/docs/orders-legacy). */ - #[serde()] pub charge: Box>, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -24288,7 +24121,6 @@ pub struct Order { * * Related guide: [Tax, Shipping, and Inventory](https://stripe.com/docs/orders-legacy). */ - #[serde()] pub customer: Box>, /** * Order objects are created to handle end customers' purchases of previously @@ -24566,7 +24398,6 @@ pub struct OrderItem { * * Related guide: [Orders](https://stripe.com/docs/orders/guide). */ - #[serde()] pub parent: Box>, /** * A representation of the constituent items of any given order. Can be used to @@ -24697,7 +24528,6 @@ pub struct OrderReturn { * * Related guide: [Handling Returns](https://stripe.com/docs/orders/guide#handling-returns). */ - #[serde()] pub order: Box>, /** * A return represents the full or partial return of a number of [order items](https://stripe.com/docs/api#order_items). @@ -24705,7 +24535,6 @@ pub struct OrderReturn { * * Related guide: [Handling Returns](https://stripe.com/docs/orders/guide#handling-returns). */ - #[serde()] pub refund: Box>, } @@ -25157,7 +24986,6 @@ pub struct PaymentIntent { * * Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents). */ - #[serde()] pub application: Box>, /** * A PaymentIntent guides you through the process of collecting a payment from your customer. @@ -25282,7 +25110,6 @@ pub struct PaymentIntent { * * Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents). */ - #[serde()] pub customer: Box>, /** * A PaymentIntent guides you through the process of collecting a payment from your customer. @@ -25325,12 +25152,10 @@ pub struct PaymentIntent { * * Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents). */ - #[serde()] pub invoice: Box>, /** * The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. */ - #[serde()] pub last_payment_error: Box>, /** * Whether the account can create live charges. @@ -25382,7 +25207,6 @@ pub struct PaymentIntent { * * Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents). */ - #[serde()] pub on_behalf_of: Box>, /** * A PaymentIntent guides you through the process of collecting a payment from your customer. @@ -25397,7 +25221,6 @@ pub struct PaymentIntent { * * Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents). */ - #[serde()] pub payment_method: Box>, /** * Payment-method-specific configuration for this PaymentIntent. @@ -25450,7 +25273,6 @@ pub struct PaymentIntent { * * Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents). */ - #[serde()] pub review: Box>, /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -25781,7 +25603,6 @@ pub struct PaymentIntentNextActionKonbini { /** * */ - #[serde()] pub stores: PaymentIntentNextActionKonbiniStores, } @@ -27077,92 +26898,74 @@ pub struct PaymentIntentMethodOptionsData { /** * */ - #[serde()] pub acss_debit: Box>, /** * */ - #[serde()] pub afterpay_clearpay: Box>, /** * */ - #[serde()] pub alipay: Box>, /** * */ - #[serde()] pub au_becs_debit: Box>, /** * */ - #[serde()] pub bacs_debit: Box>, /** * */ - #[serde()] pub bancontact: Box>, /** * */ - #[serde()] pub boleto: Box>, /** * */ - #[serde()] pub card: Box>, /** * */ - #[serde()] pub card_present: Box>, /** * */ - #[serde()] pub eps: Box>, /** * */ - #[serde()] pub fpx: Box>, /** * */ - #[serde()] pub giropay: Box>, /** * */ - #[serde()] pub grabpay: Box>, /** * */ - #[serde()] pub ideal: Box>, /** * */ - #[serde()] pub interac_present: Box>, /** * */ - #[serde()] pub klarna: Box>, /** * */ - #[serde()] pub konbini: Box>, /** * */ - #[serde()] pub oxxo: Box>, /** * @@ -27172,27 +26975,22 @@ pub struct PaymentIntentMethodOptionsData { /** * */ - #[serde()] pub paynow: Box>, /** * */ - #[serde()] pub sepa_debit: Box>, /** * */ - #[serde()] pub sofort: Box>, /** * */ - #[serde()] pub us_bank_account: Box>, /** * */ - #[serde()] pub wechat_pay: Box>, } @@ -27674,7 +27472,6 @@ pub struct PaymentLink { /** * */ - #[serde()] pub after_completion: PaymentLinksResourceAfterCompletion, /** * Whether the account can create live charges. @@ -27709,7 +27506,6 @@ pub struct PaymentLink { /** * */ - #[serde()] pub automatic_tax: PortalInvoiceList, /** * Describes whether Checkout should collect the customer's billing address. @@ -27763,7 +27559,6 @@ pub struct PaymentLink { * * Related guide: [Payment Links API](https://stripe.com/docs/payments/payment-links/api) */ - #[serde()] pub on_behalf_of: Box>, /** * The list of payment method types that customers can use. When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). @@ -27777,7 +27572,6 @@ pub struct PaymentLink { /** * */ - #[serde()] pub phone_number_collection: PortalInvoiceList, /** * Configuration for collecting the customer's shipping address. @@ -28661,7 +28455,6 @@ pub struct PaymentLinksResourceTransferData { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub amount: i64, - #[serde()] pub destination: Box, } @@ -28868,7 +28661,6 @@ pub struct PaymentMethod { /** * */ - #[serde()] pub billing_details: BillingDetails, /** * PaymentMethod objects represent your customer's payment instruments. @@ -29425,7 +29217,6 @@ pub struct PaymentMethodCardGenerated { /** * */ - #[serde()] pub setup_attempt: Box>, } @@ -30095,12 +29886,10 @@ pub struct PaymentMethodDetailsBancontact { /** * */ - #[serde()] pub generated_sepa_debit: Box>, /** * */ - #[serde()] pub generated_sepa_debit_mandate: Box>, /** * @@ -31273,12 +31062,10 @@ pub struct PaymentMethodDetailsIdeal { /** * */ - #[serde()] pub generated_sepa_debit: Box>, /** * */ - #[serde()] pub generated_sepa_debit_mandate: Box>, /** * @@ -31980,12 +31767,10 @@ pub struct PaymentMethodDetailsSofort { /** * */ - #[serde()] pub generated_sepa_debit: Box>, /** * */ - #[serde()] pub generated_sepa_debit_mandate: Box>, /** * @@ -33068,7 +32853,6 @@ pub struct PaymentPagesCheckoutSessionShippingOption { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub shipping_amount: i64, - #[serde()] pub shipping_rate: Box, } @@ -33527,7 +33311,6 @@ pub struct Payout { * * Related guide: [Receiving Payouts](https://stripe.com/docs/payouts). */ - #[serde()] pub balance_transaction: Box>, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -33573,7 +33356,6 @@ pub struct Payout { * * Related guide: [Receiving Payouts](https://stripe.com/docs/payouts). */ - #[serde()] pub destination: Box>, /** * A `Payout` object is created when you receive funds from Stripe, or when you @@ -33585,7 +33367,6 @@ pub struct Payout { * * Related guide: [Receiving Payouts](https://stripe.com/docs/payouts). */ - #[serde()] pub failure_balance_transaction: Box>, /** * A `Payout` object is created when you receive funds from Stripe, or when you @@ -33676,7 +33457,6 @@ pub struct Payout { * * Related guide: [Receiving Payouts](https://stripe.com/docs/payouts). */ - #[serde()] pub original_payout: Box>, /** * A `Payout` object is created when you receive funds from Stripe, or when you @@ -33688,7 +33468,6 @@ pub struct Payout { * * Related guide: [Receiving Payouts](https://stripe.com/docs/payouts). */ - #[serde()] pub reversed_by: Box>, /** * The account's country. @@ -34638,7 +34417,6 @@ pub struct PlanData { * * Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](https://stripe.com/docs/products-prices/overview). */ - #[serde()] pub product: Box>, /** * You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. @@ -34925,32 +34703,26 @@ pub struct PortalFeatures { /** * */ - #[serde()] pub customer_update: PortalCustomerUpdate, /** * */ - #[serde()] pub invoice_history: PortalInvoiceList, /** * */ - #[serde()] pub payment_method_update: PortalInvoiceList, /** * */ - #[serde()] pub subscription_cancel: PortalSubscriptionCancel, /** * */ - #[serde()] pub subscription_pause: PortalInvoiceList, /** * */ - #[serde()] pub subscription_update: PortalSubscriptionUpdate, } @@ -35039,7 +34811,6 @@ pub struct PortalSubscriptionCancel { /** * */ - #[serde()] pub cancellation_reason: PortalSubscriptionCancellationReason, /** * Whether the account can create live charges. @@ -35410,7 +35181,6 @@ pub struct PriceData { */ #[serde(default, skip_serializing_if = "DeletedPriceObject::is_noop")] pub object: DeletedPriceObject, - #[serde()] pub product: Box, /** * The recurring components of a price such as `interval` and `usage_type`. @@ -35712,7 +35482,6 @@ pub struct Product { * [accept payments with Checkout](https://stripe.com/docs/payments/accept-a-payment#create-product-prices-upfront), * and more about [Products and Prices](https://stripe.com/docs/products-prices/overview) */ - #[serde()] pub tax_code: Box>, /** * Products describe the specific goods or services you offer to your customers. @@ -35818,7 +35587,6 @@ pub struct PromotionCode { * might want to apply to a customer. Coupons may be applied to [invoices](https://stripe.com/docs/api#invoices) or * [orders](https://stripe.com/docs/api#create_order_legacy-coupon). Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge). */ - #[serde()] pub coupon: Coupon, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -35833,7 +35601,6 @@ pub struct PromotionCode { * A Promotion Code represents a customer-redeemable code for a coupon. It can be used to * create multiple codes for a single coupon. */ - #[serde()] pub customer: Box>, /** * A Promotion Code represents a customer-redeemable code for a coupon. It can be used to @@ -35890,7 +35657,6 @@ pub struct PromotionCode { /** * */ - #[serde()] pub restrictions: PromotionCodesResourceRestrictions, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -36198,7 +35964,6 @@ pub struct Quote { /** * */ - #[serde()] pub automatic_tax: AutomaticTax, /** * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. @@ -36208,7 +35973,6 @@ pub struct Quote { /** * */ - #[serde()] pub computed: QuotesResourceComputed, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -36233,13 +35997,11 @@ pub struct Quote { * A Quote is a way to model prices that you'd like to provide to a customer. * Once accepted, it will automatically create an invoice, subscription or subscription schedule. */ - #[serde()] pub customer: Box>, /** * A Quote is a way to model prices that you'd like to provide to a customer. * Once accepted, it will automatically create an invoice, subscription or subscription schedule. */ - #[serde()] pub default_tax_rates: Box>, /** * A Quote is a way to model prices that you'd like to provide to a customer. @@ -36254,7 +36016,6 @@ pub struct Quote { /** * The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. */ - #[serde()] pub discounts: Box>, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -36303,7 +36064,6 @@ pub struct Quote { * A Quote is a way to model prices that you'd like to provide to a customer. * Once accepted, it will automatically create an invoice, subscription or subscription schedule. */ - #[serde()] pub invoice: Box>, /** * All invoices will be billed using the specified settings. @@ -36352,7 +36112,6 @@ pub struct Quote { * A Quote is a way to model prices that you'd like to provide to a customer. * Once accepted, it will automatically create an invoice, subscription or subscription schedule. */ - #[serde()] pub on_behalf_of: Box>, /** * The status of the quote. @@ -36362,35 +36121,29 @@ pub struct Quote { /** * */ - #[serde()] pub status_transitions: QuotesResourceStatusTransitions, /** * A Quote is a way to model prices that you'd like to provide to a customer. * Once accepted, it will automatically create an invoice, subscription or subscription schedule. */ - #[serde()] pub subscription: Box>, /** * */ - #[serde()] pub subscription_data: QuotesResourceSubscriptionData, /** * A Quote is a way to model prices that you'd like to provide to a customer. * Once accepted, it will automatically create an invoice, subscription or subscription schedule. */ - #[serde()] pub subscription_schedule: Box>, /** * A Quote is a way to model prices that you'd like to provide to a customer. * Once accepted, it will automatically create an invoice, subscription or subscription schedule. */ - #[serde()] pub test_clock: Box>, /** * */ - #[serde()] pub total_details: QuotesResourceTotalDetails, /** * The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices. @@ -36410,7 +36163,6 @@ pub struct QuotesResourceComputed { /** * */ - #[serde()] pub upfront: QuotesResourceUpfront, } @@ -36425,7 +36177,6 @@ pub struct QuotesResourceFromQuote { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub is_revision: bool, - #[serde()] pub quote: Box, } @@ -36467,7 +36218,6 @@ pub struct QuotesResourceRecurring { /** * */ - #[serde()] pub total_details: QuotesResourceTotalDetails, } @@ -36584,7 +36334,6 @@ pub struct QuotesResourceTransferData { deserialize_with = "crate::utils::deserialize_null_f64::deserialize" )] pub amount_percent: f64, - #[serde()] pub destination: Box, } @@ -36617,7 +36366,6 @@ pub struct QuotesResourceUpfront { /** * */ - #[serde()] pub total_details: QuotesResourceTotalDetails, } @@ -36670,7 +36418,6 @@ pub struct RadarEarlyFraudWarning { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub actionable: bool, - #[serde()] pub charge: Box, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -36718,7 +36465,6 @@ pub struct RadarEarlyFraudWarning { * * Related guide: [Early Fraud Warnings](https://stripe.com/docs/disputes/measuring#early-fraud-warnings). */ - #[serde()] pub payment_intent: Box>, } @@ -36863,7 +36609,6 @@ pub struct RadarList { /** * List of items contained within this value list. */ - #[serde()] pub list_items: ListItems, /** * Whether the account can create live charges. @@ -37182,7 +36927,6 @@ pub struct Recipient { * recipients can no longer begin doing so. Please use `Account` objects * instead.\*\* */ - #[serde()] pub default_card: Box>, /** * With `Recipient` objects, you can transfer money from your Stripe account to a @@ -37258,7 +37002,6 @@ pub struct Recipient { * recipients can no longer begin doing so. Please use `Account` objects * instead.\*\* */ - #[serde()] pub migrated_to: Box>, /** * With `Recipient` objects, you can transfer money from your Stripe account to a @@ -37295,7 +37038,6 @@ pub struct Recipient { * recipients can no longer begin doing so. Please use `Account` objects * instead.\*\* */ - #[serde()] pub rolled_back_from: Box>, /** * The account's country. @@ -37500,7 +37242,6 @@ pub struct Refund { * * Related guide: [Refunds](https://stripe.com/docs/refunds). */ - #[serde()] pub balance_transaction: Box>, /** * `Refund` objects allow you to refund a charge that has previously been created @@ -37509,7 +37250,6 @@ pub struct Refund { * * Related guide: [Refunds](https://stripe.com/docs/refunds). */ - #[serde()] pub charge: Box>, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -37549,7 +37289,6 @@ pub struct Refund { * * Related guide: [Refunds](https://stripe.com/docs/refunds). */ - #[serde()] pub failure_balance_transaction: Box>, /** * `Refund` objects allow you to refund a charge that has previously been created @@ -37607,7 +37346,6 @@ pub struct Refund { * * Related guide: [Refunds](https://stripe.com/docs/refunds). */ - #[serde()] pub payment_intent: Box>, /** * Reason for the refund, either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`). @@ -37634,7 +37372,6 @@ pub struct Refund { * * Related guide: [Refunds](https://stripe.com/docs/refunds). */ - #[serde()] pub source_transfer_reversal: Box>, /** * `Refund` objects allow you to refund a charge that has previously been created @@ -37656,7 +37393,6 @@ pub struct Refund { * * Related guide: [Refunds](https://stripe.com/docs/refunds). */ - #[serde()] pub transfer_reversal: Box>, } @@ -37686,7 +37422,6 @@ pub struct RefundNextActionDisplayDetails { /** * */ - #[serde()] pub email_sent: EmailSent, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -37794,7 +37529,6 @@ pub struct ReportingReportRun { /** * */ - #[serde()] pub parameters: FinancialReportingFinanceReportRunParameters, /** * The account's country. @@ -38193,7 +37927,6 @@ pub struct Review { * Learn more about [Radar](/radar) and reviewing payments * [here](https://stripe.com/docs/radar/reviews). */ - #[serde()] pub charge: Box>, /** * The reason the review was closed, or null if it has not yet been closed. One of `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. @@ -38267,7 +38000,6 @@ pub struct Review { * Learn more about [Radar](/radar) and reviewing payments * [here](https://stripe.com/docs/radar/reviews). */ - #[serde()] pub payment_intent: Box>, /** * The account's country. @@ -38456,12 +38188,10 @@ pub struct SepaDebitGeneratedFrom { /** * */ - #[serde()] pub charge: Box>, /** * */ - #[serde()] pub setup_attempt: Box>, } @@ -38512,7 +38242,6 @@ pub struct SetupAttempt { * SetupAttempts to inspect details of a specific attempt at setting up a * payment method using a SetupIntent. */ - #[serde()] pub application: Box>, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -38529,7 +38258,6 @@ pub struct SetupAttempt { * SetupAttempts to inspect details of a specific attempt at setting up a * payment method using a SetupIntent. */ - #[serde()] pub customer: Box>, /** * The account's country. @@ -38559,21 +38287,16 @@ pub struct SetupAttempt { * SetupAttempts to inspect details of a specific attempt at setting up a * payment method using a SetupIntent. */ - #[serde()] pub on_behalf_of: Box>, - #[serde()] pub payment_method: Box, /** * */ - #[serde()] pub payment_method_details: SetupAttemptPaymentMethodDetails, /** * The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. */ - #[serde()] pub setup_error: Box>, - #[serde()] pub setup_intent: Box, /** * The account's country. @@ -38698,12 +38421,10 @@ pub struct SetupAttemptPaymentMethodDetailsBancontact { /** * */ - #[serde()] pub generated_sepa_debit: Box>, /** * */ - #[serde()] pub generated_sepa_debit_mandate: Box>, /** * @@ -38747,7 +38468,6 @@ pub struct SetupAttemptPaymentMethodDetailsCardPresent { /** * */ - #[serde()] pub generated_card: Box>, } @@ -38767,12 +38487,10 @@ pub struct SetupAttemptPaymentMethodDetailsIdeal { /** * */ - #[serde()] pub generated_sepa_debit: Box>, /** * */ - #[serde()] pub generated_sepa_debit_mandate: Box>, /** * @@ -38828,12 +38546,10 @@ pub struct SetupAttemptPaymentMethodDetailsSofort { /** * */ - #[serde()] pub generated_sepa_debit: Box>, /** * */ - #[serde()] pub generated_sepa_debit_mandate: Box>, /** * @@ -39035,7 +38751,6 @@ pub struct SetupIntent { * * Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents). */ - #[serde()] pub application: Box>, /** * Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. @@ -39105,7 +38820,6 @@ pub struct SetupIntent { * * Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents). */ - #[serde()] pub customer: Box>, /** * A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. @@ -39149,7 +38863,6 @@ pub struct SetupIntent { /** * The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. */ - #[serde()] pub last_setup_error: Box>, /** * A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. @@ -39175,7 +38888,6 @@ pub struct SetupIntent { * * Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents). */ - #[serde()] pub latest_attempt: Box>, /** * Whether the account can create live charges. @@ -39209,7 +38921,6 @@ pub struct SetupIntent { * * Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents). */ - #[serde()] pub mandate: Box>, /** * A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. @@ -39275,7 +38986,6 @@ pub struct SetupIntent { * * Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents). */ - #[serde()] pub on_behalf_of: Box>, /** * A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. @@ -39301,7 +39011,6 @@ pub struct SetupIntent { * * Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents). */ - #[serde()] pub payment_method: Box>, /** * Payment-method-specific configuration for this SetupIntent. @@ -39341,7 +39050,6 @@ pub struct SetupIntent { * * Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents). */ - #[serde()] pub single_use_mandate: Box>, /** * [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. @@ -39544,7 +39252,6 @@ pub struct SetupIntentPaymentMethodOptionsData { /** * */ - #[serde()] pub acss_debit: Box>, /** * @@ -39554,12 +39261,10 @@ pub struct SetupIntentPaymentMethodOptionsData { /** * */ - #[serde()] pub sepa_debit: Box>, /** * */ - #[serde()] pub us_bank_account: Box>, } @@ -40004,7 +39709,6 @@ pub struct ShippingRate { * Shipping rates describe the price of shipping presented to your customers and can be * applied to [Checkout Sessions](https://stripe.com/docs/payments/checkout/shipping) to collect shipping costs. */ - #[serde()] pub tax_code: Box>, /** * The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. @@ -40236,7 +39940,6 @@ pub struct Sku { /** * */ - #[serde()] pub inventory: SkuInventory, /** * Whether the account can create live charges. @@ -40274,7 +39977,6 @@ pub struct Sku { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub price: i64, - #[serde()] pub product: Box, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -40971,7 +40673,6 @@ pub struct SourceMandateNotification { * * Related guides: [Sources API](https://stripe.com/docs/sources) and [Sources & Customers](https://stripe.com/docs/sources/customers). */ - #[serde()] pub source: SourceData, /** * The account's country. @@ -43451,7 +43152,6 @@ pub struct Subscription { /** * */ - #[serde()] pub automatic_tax: PortalInvoiceList, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -43529,7 +43229,6 @@ pub struct Subscription { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub current_period_start: i64, - #[serde()] pub customer: Box, /** * Subscriptions allow you to charge a customer on a recurring basis. @@ -43547,14 +43246,12 @@ pub struct Subscription { * * Related guide: [Creating Subscriptions](https://stripe.com/docs/billing/subscriptions/creating). */ - #[serde()] pub default_payment_method: Box>, /** * Subscriptions allow you to charge a customer on a recurring basis. * * Related guide: [Creating Subscriptions](https://stripe.com/docs/billing/subscriptions/creating). */ - #[serde()] pub default_source: Box>, /** * Subscriptions allow you to charge a customer on a recurring basis. @@ -43595,14 +43292,12 @@ pub struct Subscription { /** * List of subscription items, each with an attached price. */ - #[serde()] pub items: Items, /** * Subscriptions allow you to charge a customer on a recurring basis. * * Related guide: [Creating Subscriptions](https://stripe.com/docs/billing/subscriptions/creating). */ - #[serde()] pub latest_invoice: Box>, /** * Whether the account can create live charges. @@ -43657,7 +43352,6 @@ pub struct Subscription { * * Related guide: [Creating Subscriptions](https://stripe.com/docs/billing/subscriptions/creating). */ - #[serde()] pub pending_setup_intent: Box>, /** * If specified, [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid. @@ -43669,7 +43363,6 @@ pub struct Subscription { * * Related guide: [Creating Subscriptions](https://stripe.com/docs/billing/subscriptions/creating). */ - #[serde()] pub schedule: Box>, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -43698,7 +43391,6 @@ pub struct Subscription { * * Related guide: [Creating Subscriptions](https://stripe.com/docs/billing/subscriptions/creating). */ - #[serde()] pub test_clock: Box>, /** * The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. @@ -43803,7 +43495,6 @@ pub struct SubscriptionItem { * * Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/products-prices/overview). */ - #[serde()] pub price: PriceData, /** * Subscription items allow you to create customer subscriptions with more than @@ -44051,12 +43742,10 @@ pub struct SubscriptionSchedule { */ #[serde(default, skip_serializing_if = "Option::is_none")] pub current_phase: Option, - #[serde()] pub customer: Box, /** * */ - #[serde()] pub default_settings: SubscriptionSchedulesResourceDefaultSettings, /** * Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` and `cancel`. @@ -44137,14 +43826,12 @@ pub struct SubscriptionSchedule { * * Related guide: [Subscription Schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules). */ - #[serde()] pub subscription: Box>, /** * A subscription schedule allows you to create and manage the lifecycle of a subscription by predefining expected changes. * * Related guide: [Subscription Schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules). */ - #[serde()] pub test_clock: Box>, } @@ -44216,7 +43903,6 @@ impl std::convert::From for String { /// An Add Invoice Item describes the prices and quantities that will be added as pending invoice items when entering a phase. #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct SubscriptionScheduleAddInvoiceItem { - #[serde()] pub price: Box, /** * An Add Invoice Item describes the prices and quantities that will be added as pending invoice items when entering a phase. @@ -44246,7 +43932,6 @@ pub struct SubscriptionScheduleConfigurationItem { */ #[serde(default, skip_serializing_if = "Option::is_none")] pub billing_thresholds: Option, - #[serde()] pub price: Box, /** * A phase item describes the price and quantity of a phase. @@ -44435,12 +44120,10 @@ pub struct SubscriptionSchedulePhaseConfiguration { /** * A phase describes the plans, coupon, and trialing status of a subscription for a predefined time period. */ - #[serde()] pub coupon: Box>, /** * A phase describes the plans, coupon, and trialing status of a subscription for a predefined time period. */ - #[serde()] pub default_payment_method: Box>, /** * A phase describes the plans, coupon, and trialing status of a subscription for a predefined time period. @@ -44539,7 +44222,6 @@ pub struct SubscriptionSchedulesResourceDefaultSettings { /** * */ - #[serde()] pub default_payment_method: Box>, /** * The invoice settings applicable during this phase. @@ -44565,7 +44247,6 @@ pub struct SubscriptionTransferDataType { deserialize_with = "crate::utils::deserialize_null_f64::deserialize" )] pub amount_percent: f64, - #[serde()] pub destination: Box, } @@ -45347,7 +45028,6 @@ pub struct TerminalLocation { /** * */ - #[serde()] pub address: Address, /** * The account's country. @@ -45559,7 +45239,6 @@ pub struct TerminalReader { * * Related guide: [Connecting to a Reader](https://stripe.com/docs/terminal/payments/connect-reader). */ - #[serde()] pub location: Box>, /** * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. @@ -45673,7 +45352,6 @@ pub struct TerminalReaderResourceLineItem { /// Represents a reader action to process a payment intent #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct TerminalReaderResourceProcessPaymentIntentAction { - #[serde()] pub payment_intent: Box, } @@ -45689,7 +45367,6 @@ pub struct TerminalReaderResourceProcessSetupIntentAction { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub generated_card: String, - #[serde()] pub setup_intent: Box, } @@ -46061,7 +45738,6 @@ pub struct ThreeDSecure { * * Related guide: [Card Payments with Sources](https://stripe.com/docs/sources/cards). */ - #[serde()] pub card: Card, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -46643,7 +46319,6 @@ pub struct Topup { * * Related guide: [Topping Up your Platform Account](https://stripe.com/docs/connect/top-ups). */ - #[serde()] pub balance_transaction: Box>, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -46754,7 +46429,6 @@ pub struct Topup { * * Related guides: [Sources API](https://stripe.com/docs/sources) and [Sources & Customers](https://stripe.com/docs/sources/customers). */ - #[serde()] pub source: SourceData, /** * To top up your Stripe balance, you create a top-up object. You can retrieve @@ -46902,7 +46576,6 @@ pub struct Transfer { * * Related guide: [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/charges-transfers). */ - #[serde()] pub balance_transaction: Box>, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -46952,7 +46625,6 @@ pub struct Transfer { * * Related guide: [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/charges-transfers). */ - #[serde()] pub destination: Box>, /** * A `Transfer` object is created when you move funds between Stripe accounts as @@ -46966,7 +46638,6 @@ pub struct Transfer { * * Related guide: [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/charges-transfers). */ - #[serde()] pub destination_payment: Box>, /** * The account's country. @@ -47002,7 +46673,6 @@ pub struct Transfer { /** * A list of reversals that have been applied to the transfer. */ - #[serde()] pub reversals: Reversals, /** * Whether the account can create live charges. @@ -47024,7 +46694,6 @@ pub struct Transfer { * * Related guide: [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/charges-transfers). */ - #[serde()] pub source_transaction: Box>, /** * A `Transfer` object is created when you move funds between Stripe accounts as @@ -47076,7 +46745,6 @@ pub struct TransferData { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub amount: i64, - #[serde()] pub destination: Box, } @@ -47154,7 +46822,6 @@ pub struct TransferReversal { * * Related guide: [Reversing Transfers](https://stripe.com/docs/connect/charges-transfers#reversing-transfers). */ - #[serde()] pub balance_transaction: Box>, /** * Time at which the account was connected. Measured in seconds since the Unix epoch. @@ -47189,7 +46856,6 @@ pub struct TransferReversal { * * Related guide: [Reversing Transfers](https://stripe.com/docs/connect/charges-transfers#reversing-transfers). */ - #[serde()] pub destination_payment_refund: Box>, /** * The account's country. @@ -47241,9 +46907,7 @@ pub struct TransferReversal { * * Related guide: [Reversing Transfers](https://stripe.com/docs/connect/charges-transfers#reversing-transfers). */ - #[serde()] pub source_refund: Box>, - #[serde()] pub transfer: Box, } @@ -47509,7 +47173,6 @@ pub struct UsageRecordSummary { /** * */ - #[serde()] pub period: Period, /** * The account's country. @@ -48418,7 +48081,6 @@ pub struct CreditNoteLineItemParams { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub quantity: i64, - #[serde()] pub tax_rates: Box>, /** * The type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. When the type is `invoice_line_item` there is an additional `invoice_line_item` property on the resource the value of which is the id of the credited line item on the invoice. @@ -49135,7 +48797,6 @@ impl AddressAnyOf { #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct CustomerShipping { - #[serde()] pub address: OptionalFieldsAddress, /** * The account's country. @@ -49231,7 +48892,6 @@ impl std::convert::From for String { #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct Tax { - #[serde()] pub ip_address: Box>, } @@ -49462,12 +49122,10 @@ pub struct CustomerDetails { /** * Details about the customer you want to invoice or overrides for an existing customer. */ - #[serde()] pub address: Box>, /** * Details about the customer you want to invoice or overrides for an existing customer. */ - #[serde()] pub shipping: Box>, /** * Details about the customer you want to invoice or overrides for an existing customer. @@ -49663,7 +49321,6 @@ pub struct InvoiceItems { deserialize_with = "crate::utils::deserialize_null_boolean::deserialize" )] pub discountable: bool, - #[serde()] pub discounts: Box>, #[serde( default, @@ -49671,7 +49328,6 @@ pub struct InvoiceItems { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub invoiceitem: String, - #[serde()] pub metadata: Box>, #[serde(default, skip_serializing_if = "Option::is_none")] pub period: Option, @@ -49689,7 +49345,6 @@ pub struct InvoiceItems { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub quantity: i64, - #[serde()] pub tax_rates: Box>, #[serde( default, @@ -49917,7 +49572,6 @@ pub struct RecurringPriceData { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub product: String, - #[serde()] pub recurring: RecurringAdhoc, /** * Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. @@ -49943,7 +49597,6 @@ pub struct RecurringPriceData { #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct SubscriptionItems { - #[serde()] pub billing_thresholds: Box>, #[serde( default, @@ -49961,7 +49614,6 @@ pub struct SubscriptionItems { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub id: String, - #[serde()] pub metadata: Box>, #[serde( default, @@ -49977,7 +49629,6 @@ pub struct SubscriptionItems { deserialize_with = "crate::utils::deserialize_null_i64::deserialize" )] pub quantity: i64, - #[serde()] pub tax_rates: Box>, } @@ -50304,22 +49955,18 @@ pub struct OrderTimestampSpecs { /** * Filter orders based on when they were paid, fulfilled, canceled, or returned. */ - #[serde()] pub canceled: Box>, /** * Filter orders based on when they were paid, fulfilled, canceled, or returned. */ - #[serde()] pub fulfilled: Box>, /** * Filter orders based on when they were paid, fulfilled, canceled, or returned. */ - #[serde()] pub paid: Box>, /** * Filter orders based on when they were paid, fulfilled, canceled, or returned. */ - #[serde()] pub returned: Box>, } diff --git a/zoom/src/types.rs b/zoom/src/types.rs index c2c22d99..9179d7a7 100644 --- a/zoom/src/types.rs +++ b/zoom/src/types.rs @@ -426,7 +426,6 @@ pub struct AccountPlans { /** * Account base plan object. */ - #[serde()] pub plan_base: PlanBase, /** * Account Plans object. @@ -11381,7 +11380,6 @@ pub struct SetUpAccountRequest { /** * Specify emergency address for the account. */ - #[serde()] pub emergency_address: EmergencyAddress, /** * User's first name. @@ -14967,7 +14965,6 @@ pub struct AccountPlanAddonCreateRequest { /** * Phone Plan Object */ - #[serde()] pub plan_details: PhonePlan, /** * User's first name. @@ -21070,7 +21067,6 @@ pub struct SendchatbotRequest { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub account_id: String, - #[serde()] pub content: Domains, /** * Enable/disable the option for a sub account to use shared [Virtual Room Connector(s)](https://support.zoom.us/hc/en-us/articles/202134758-Getting-Started-With-Virtual-Room-Connector) that are set up by the master account. Virtual Room Connectors can only be used by On-prem users. @@ -21126,7 +21122,6 @@ pub struct EditChatbotMessageRequest { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub account_id: String, - #[serde()] pub content: Domains, /** * Enable/disable the option for a sub account to use shared [Virtual Room Connector(s)](https://support.zoom.us/hc/en-us/articles/202134758-Getting-Started-With-Virtual-Room-Connector) that are set up by the master account. Virtual Room Connectors can only be used by On-prem users. @@ -22403,7 +22398,6 @@ pub struct Locations { deserialize_with = "crate::utils::deserialize_null_string::deserialize" )] pub elin: String, - #[serde()] pub emergency_address: BatchAddLocationsRequestEmergencyAddress, /** * User's first name. From 498a51fbf26a03146daef28d6398a18ca0967e15 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 13 Apr 2023 22:20:46 -0500 Subject: [PATCH 18/40] Bump h2 --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 3ac8d058..dbcc30d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -925,7 +925,7 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.14" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" dependencies = [ From 52f0c2afd9a87391836e3889e29c1106189d4c85 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 13 Apr 2023 22:22:38 -0500 Subject: [PATCH 19/40] Bump openssl --- Cargo.lock | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dbcc30d0..4f425b2d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1512,15 +1512,16 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.36" +version = "0.10.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9facdb76fec0b73c406f125d44d86fdad818d66fef0531eec9233ca425ff4a" +checksum = "518915b97df115dd36109bfa429a48b8f737bd05508cf9588977b599648926d2" dependencies = [ "bitflags", "cfg-if", "foreign-types", "libc", "once_cell", + "openssl-macros", "openssl-sys", ] @@ -1532,9 +1533,9 @@ checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" [[package]] name = "openssl-sys" -version = "0.9.67" +version = "0.9.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69df2d8dfc6ce3aaf44b40dec6f487d5a886516cf6879c49e98e0710f310a058" +checksum = "666416d899cf077260dac8698d60a60b435a46d57e82acb1be3d0dad87284e5b" dependencies = [ "autocfg", "cc", From 776b94919fa172eb270b3a72a03cdd2dccc342b0 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 13 Apr 2023 22:23:06 -0500 Subject: [PATCH 20/40] Fix h2 ck --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 4f425b2d..b2257673 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -927,7 +927,7 @@ dependencies = [ name = "h2" version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" +checksum = "66b91535aa35fea1523ad1b86cb6b53c28e0ae566ba4a460f4457e936cad7c6f" dependencies = [ "bytes", "fnv", From f9800b1407d00e281d08fa7a2c3dbbf8ba3c80c2 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 13 Apr 2023 22:25:54 -0500 Subject: [PATCH 21/40] Add openssl-macros --- Cargo.lock | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index b2257673..7402394d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1525,6 +1525,17 @@ dependencies = [ "openssl-sys", ] +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "openssl-probe" version = "0.1.4" From 6d602e3d292f07cb17d89f87656f0560afee2587 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 4 May 2023 15:55:42 -0500 Subject: [PATCH 22/40] Comment and derive cleanup --- docusign/src/account_signatures.rs | 42 +- docusign/src/custom_tabs.rs | 22 +- .../src/envelope_document_html_definitions.rs | 24 +- docusign/src/envelope_recipient_tabs.rs | 26 +- docusign/src/favorite_templates.rs | 20 +- docusign/src/reports.rs | 20 +- generator/src/functions.rs | 48 +- generator/src/main.rs | 12 +- generator/src/types.rs | 6 +- giphy/src/types.rs | 13 +- github/src/lib.rs | 10 +- github/src/types.rs | 1298 +++---- github/src/utils.rs | 9 +- google/admin/src/types.rs | 228 +- google/calendar/src/types.rs | 48 +- google/cloud-resource-manager/src/types.rs | 72 +- google/drive/src/types.rs | 24 +- google/groups-settings/src/types.rs | 12 +- google/sheets/src/types.rs | 692 ++-- gusto/src/federal_tax_details_beta.rs | 32 +- gusto/src/types.rs | 237 +- mailchimp/src/types.rs | 2110 ++++------- okta/src/types.rs | 776 +--- ramp/src/types.rs | 60 +- rev.ai/src/types.rs | 81 +- sendgrid/src/types.rs | 447 +-- shipbob/src/types.rs | 268 +- shopify/src/billing.rs | 160 +- shopify/src/customers.rs | 12 +- shopify/src/discounts.rs | 204 +- shopify/src/inventory.rs | 180 +- shopify/src/online_store.rs | 84 +- shopify/src/orders.rs | 908 ++--- shopify/src/plus.rs | 144 +- shopify/src/products.rs | 72 +- shopify/src/sales_channels.rs | 24 +- shopify/src/shipping_and_fulfillment.rs | 214 +- shopify/src/shopify_payments.rs | 44 +- shopify/src/store_properties.rs | 324 +- slack/src/types.rs | 48 +- stripe/src/types.rs | 3262 ++++++----------- tripactions/src/types.rs | 40 +- zoom/src/types.rs | 1705 ++++----- 43 files changed, 5053 insertions(+), 9009 deletions(-) diff --git a/docusign/src/account_signatures.rs b/docusign/src/account_signatures.rs index c6953875..5dd56cea 100644 --- a/docusign/src/account_signatures.rs +++ b/docusign/src/account_signatures.rs @@ -63,17 +63,17 @@ impl AccountSignatures { .await } /** - * Updates an account signature. + * Updates an account signature. . - * - * This function performs a `PUT` to the `/v2.1/accounts/{accountId}/signatures` endpoint. - * - * - * - * **Parameters:** - * - * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. - */ + * + * This function performs a `PUT` to the `/v2.1/accounts/{accountId}/signatures` endpoint. + * + * + * + * **Parameters:** + * + * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. + */ pub async fn put_signature( &self, account_id: &str, @@ -97,18 +97,18 @@ impl AccountSignatures { .await } /** - * Adds or updates one or more account signatures. + * Adds or updates one or more account signatures. This request may include images in multi-part format. - * - * This function performs a `POST` to the `/v2.1/accounts/{accountId}/signatures` endpoint. - * - * - * - * **Parameters:** - * - * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. - * * `decode_only: &str` -- The brand that envelope recipients see when a brand is not explicitly set. - */ + * + * This function performs a `POST` to the `/v2.1/accounts/{accountId}/signatures` endpoint. + * + * + * + * **Parameters:** + * + * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. + * * `decode_only: &str` -- The brand that envelope recipients see when a brand is not explicitly set. + */ pub async fn post( &self, account_id: &str, diff --git a/docusign/src/custom_tabs.rs b/docusign/src/custom_tabs.rs index f0a6255b..5dd2023a 100644 --- a/docusign/src/custom_tabs.rs +++ b/docusign/src/custom_tabs.rs @@ -123,19 +123,19 @@ impl CustomTabs { .await } /** - * Updates custom tab information. + * Updates custom tab information. . - * - * This function performs a `PUT` to the `/v2.1/accounts/{accountId}/tab_definitions/{customTabId}` endpoint. - * - * Updates the information in a custom tab for the specified account. - * - * **Parameters:** - * - * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. - * * `custom_tab_id: &str` -- The DocuSign-generated custom tab id for the custom tab to be applied. This can only be used when adding new tabs for a recipient. When used, the new tab inherits all the custom tab properties. - */ + * + * This function performs a `PUT` to the `/v2.1/accounts/{accountId}/tab_definitions/{customTabId}` endpoint. + * + * Updates the information in a custom tab for the specified account. + * + * **Parameters:** + * + * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. + * * `custom_tab_id: &str` -- The DocuSign-generated custom tab id for the custom tab to be applied. This can only be used when adding new tabs for a recipient. When used, the new tab inherits all the custom tab properties. + */ pub async fn tab_put_custom( &self, account_id: &str, diff --git a/docusign/src/envelope_document_html_definitions.rs b/docusign/src/envelope_document_html_definitions.rs index 39febf6c..1fe30b46 100644 --- a/docusign/src/envelope_document_html_definitions.rs +++ b/docusign/src/envelope_document_html_definitions.rs @@ -13,19 +13,19 @@ impl EnvelopeDocumentHtmlDefinitions { } /** - * Gets the Original HTML Definition used to + * Gets the Original HTML Definition used to generate the Responsive HTML for a given document. - * - * This function performs a `GET` to the `/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/html_definitions` endpoint. - * - * - * - * **Parameters:** - * - * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. - * * `document_id: &str` -- The `documentId` is set by the API client. It is an integer that falls between `1` and 2,147,483,647. The value is encoded as a string without commas. The values `1`, `2`, `3`, and so on are typically used to identify the first few documents in an envelope. Tab definitions include a `documentId` property that specifies the document on which to place the tab. - * * `envelope_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. - */ + * + * This function performs a `GET` to the `/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/html_definitions` endpoint. + * + * + * + * **Parameters:** + * + * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. + * * `document_id: &str` -- The `documentId` is set by the API client. It is an integer that falls between `1` and 2,147,483,647. The value is encoded as a string without commas. The values `1`, `2`, `3`, and so on are typically used to identify the first few documents in an envelope. Tab definitions include a `documentId` property that specifies the document on which to place the tab. + * * `envelope_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. + */ pub async fn responsive_html_get_envelope_document_definition( &self, account_id: &str, diff --git a/docusign/src/envelope_recipient_tabs.rs b/docusign/src/envelope_recipient_tabs.rs index bc837a82..6396c538 100644 --- a/docusign/src/envelope_recipient_tabs.rs +++ b/docusign/src/envelope_recipient_tabs.rs @@ -73,21 +73,21 @@ impl EnvelopeRecipientTabs { .await } /** - * Updates the tabs for a recipient. + * Updates the tabs for a recipient. . - * - * This function performs a `PUT` to the `/v2.1/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/tabs` endpoint. - * - * Updates one or more tabs for a recipient in a draft envelope. - * **Note**: The Update method can be used if the envelope is not yet complete. To update an existing tab, the request body must include the `tabId`. - * - * **Parameters:** - * - * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. - * * `envelope_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. - * * `recipient_id: &str` -- A local reference that senders use to map recipients to other objects, such as specific document tabs. Within an envelope, each `recipientId` must be unique, but there is no uniqueness requirement across envelopes. For example, many envelopes assign the first recipient a `recipientId` of `1`. - */ + * + * This function performs a `PUT` to the `/v2.1/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/tabs` endpoint. + * + * Updates one or more tabs for a recipient in a draft envelope. + * **Note**: The Update method can be used if the envelope is not yet complete. To update an existing tab, the request body must include the `tabId`. + * + * **Parameters:** + * + * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. + * * `envelope_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. + * * `recipient_id: &str` -- A local reference that senders use to map recipients to other objects, such as specific document tabs. Within an envelope, each `recipientId` must be unique, but there is no uniqueness requirement across envelopes. For example, many envelopes assign the first recipient a `recipientId` of `1`. + */ pub async fn recipients_put_recipient_tabs( &self, account_id: &str, diff --git a/docusign/src/favorite_templates.rs b/docusign/src/favorite_templates.rs index fb481d10..67dfeb2f 100644 --- a/docusign/src/favorite_templates.rs +++ b/docusign/src/favorite_templates.rs @@ -42,17 +42,17 @@ impl FavoriteTemplates { .await } /** - * Sets a template as a favorite. + * Sets a template as a favorite. . - * - * This function performs a `PUT` to the `/v2.1/accounts/{accountId}/favorite_templates` endpoint. - * - * - * - * **Parameters:** - * - * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. - */ + * + * This function performs a `PUT` to the `/v2.1/accounts/{accountId}/favorite_templates` endpoint. + * + * + * + * **Parameters:** + * + * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. + */ pub async fn put_template( &self, account_id: &str, diff --git a/docusign/src/reports.rs b/docusign/src/reports.rs index 9567ce14..fd7a403c 100644 --- a/docusign/src/reports.rs +++ b/docusign/src/reports.rs @@ -13,17 +13,17 @@ impl Reports { } /** - * Gets the descriptors for all of + * Gets the descriptors for all of an account's active reports (for listings). - * - * This function performs a `GET` to the `/v2.1/accounts/{accountId}/reports` endpoint. - * - * - * - * **Parameters:** - * - * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. - */ + * + * This function performs a `GET` to the `/v2.1/accounts/{accountId}/reports` endpoint. + * + * + * + * **Parameters:** + * + * * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set. + */ pub async fn product_get_list( &self, account_id: &str, diff --git a/generator/src/functions.rs b/generator/src/functions.rs index 0295c112..04384878 100644 --- a/generator/src/functions.rs +++ b/generator/src/functions.rs @@ -1158,25 +1158,25 @@ fn get_fn_docs( a("/**"); if let Some(summary) = &o.summary { - a(&format!("* {}.", summary.trim_end_matches('.'))); - a("*"); + a(&format!(" * {}.", summary.trim_end_matches('.'))); + a(" *"); } a(&format!( - "* This function performs a `{}` to the `{}` endpoint.", + " * This function performs a `{}` to the `{}` endpoint.", m, p )); if let Some(description) = &o.description { - a("*"); - a(&format!("* {}", description.replace('\n', "\n* "))); + a(" *"); + a(&format!(" * {}", description.replace('\n', "\n * "))); } if let Some(external_docs) = &o.external_docs { - a("*"); - a(&format!("* FROM: <{}>", external_docs.url)); + a(" *"); + a(&format!(" * FROM: <{}>", external_docs.url)); } if !o.parameters.is_empty() { - a("*"); - a("* **Parameters:**"); - a("*"); + a(" *"); + a(" * **Parameters:**"); + a(" *"); } // Iterate over the function parameters and add any data those had as well. for par in o.parameters.iter() { @@ -1200,7 +1200,7 @@ fn get_fn_docs( let mut docs = ts.render_docs(&pid); if let Some(d) = ¶meter_data.description { if !d.is_empty() && d.len() > docs.len() { - docs = format!(" -- {}.", d.trim_end_matches('.').replace('\n', "\n* ")); + docs = format!(" -- {}.", d.trim_end_matches('.').replace('\n', "\n * ")); } else if !docs.is_empty() { docs = format!( " -- {}.", @@ -1224,12 +1224,12 @@ fn get_fn_docs( || nam == "const" || nam == "use" { - a(&format!("* * `{}_: {}`{}", nam, typ, docs)); + a(&format!(" * * `{}_: {}`{}", nam, typ, docs)); } else { - a(&format!("* * `{}: {}`{}", nam, typ, docs)); + a(&format!(" * * `{}: {}`{}", nam, typ, docs)); } } - a("*/"); + a(" */"); Ok(out.trim().to_string()) } @@ -1244,27 +1244,27 @@ fn get_fn_docs_all(o: &openapiv3::Operation, m: &str, p: &str, fn_name: &str) -> a("/**"); if let Some(summary) = &o.summary { - a(&format!("* {}.", summary.trim_end_matches('.'))); - a("*"); + a(&format!(" * {}.", summary.trim_end_matches('.'))); + a(" *"); } a(&format!( - "* This function performs a `{}` to the `{}` endpoint.", + " * This function performs a `{}` to the `{}` endpoint.", m, p )); - a("*"); + a(" *"); a(&format!( - "* As opposed to `{}`, this function returns all the pages of the request at once.", + " * As opposed to `{}`, this function returns all the pages of the request at once.", fn_name )); if let Some(description) = &o.description { - a("*"); - a(&format!("* {}", description.replace('\n', "\n* "))); + a(" *"); + a(&format!(" * {}", description.replace('\n', "\n * "))); } if let Some(external_docs) = &o.external_docs { - a("*"); - a(&format!("* FROM: <{}>", external_docs.url)); + a(" *"); + a(&format!(" * FROM: <{}>", external_docs.url)); } - a("*/"); + a(" */"); Ok(out.trim().to_string()) } diff --git a/generator/src/main.rs b/generator/src/main.rs index 69feaef6..2c18b585 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -875,13 +875,13 @@ impl TypeSpace { if let Some(s) = schema { if let Some(description) = &s.description { a(&format!( - "* {}", - description.replace('*', "\\*").replace('\n', "\n* ") + " * {}", + description.replace('*', "\\*").replace('\n', "\n * ") )); } if let Some(external_docs) = &s.external_docs { - a("*"); - a(&format!("* FROM: <{}>", external_docs.url)); + a(" *"); + a(&format!(" * FROM: <{}>", external_docs.url)); } } @@ -2175,8 +2175,8 @@ fn render_param( if !description.is_empty() { a("/**"); - a(&format!("* {}", description.replace('\n', "\n* "))); - a("*/"); + a(&format!(" * {}", description.replace('\n', "\n * "))); + a(" */"); } a("#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]"); diff --git a/generator/src/types.rs b/generator/src/types.rs index dfbd2642..664d806c 100644 --- a/generator/src/types.rs +++ b/generator/src/types.rs @@ -170,7 +170,7 @@ pub fn generate_types(ts: &mut TypeSpace, proper_name: &str) -> Result { if !p.is_empty() && p != desc { a("/**"); a(&p); - a("*/"); + a(" */"); } let te = ts.id_to_entry.get(tid).unwrap(); @@ -405,7 +405,7 @@ fn do_one_of_type(ts: &mut TypeSpace, omap: &[crate::TypeId], sn: String) -> Str if !p.is_empty() && p != description { a("/**"); a(&p); - a("*/"); + a(" */"); } a(&format!("{}({}),", fn_name, name)); @@ -571,7 +571,7 @@ fn do_all_of_type(ts: &mut TypeSpace, omap: &[crate::TypeId], sn: String) -> Str if !p.is_empty() && p != description { a("/**"); a(&p); - a("*/"); + a(" */"); } a("#[serde(flatten)]"); diff --git a/giphy/src/types.rs b/giphy/src/types.rs index bacaf8ef..d5e26c0b 100644 --- a/giphy/src/types.rs +++ b/giphy/src/types.rs @@ -124,11 +124,12 @@ pub struct Images { } /** -* Type of the gif. By default, this is almost always gif -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Type of the gif. By default, this is almost always gif + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Type { #[serde(rename = "gif")] + #[default] Gif, #[serde(other)] FallthroughString, @@ -144,12 +145,6 @@ impl std::fmt::Display for Type { } } -impl Default for Type { - fn default() -> Type { - Type::Gif - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct Gif { /** diff --git a/github/src/lib.rs b/github/src/lib.rs index ba48a623..4ec5e504 100644 --- a/github/src/lib.rs +++ b/github/src/lib.rs @@ -415,7 +415,7 @@ impl Client { ) => creds, ( crate::auth::AuthenticationConstraint::JWT, - Some(&crate::auth::Credentials::InstallationToken(ref apptoken)), + Some(crate::auth::Credentials::InstallationToken(apptoken)), ) => Some(apptoken.jwt()), (crate::auth::AuthenticationConstraint::JWT, _) => { log::info!( @@ -434,7 +434,7 @@ impl Client { let parsed_url = uri.parse::(); match self.credentials(authentication) { - Some(&crate::auth::Credentials::Client(ref id, ref secret)) => parsed_url + Some(crate::auth::Credentials::Client(id, secret)) => parsed_url .map(|mut u| { u.query_pairs_mut() .append_pair("client_id", id) @@ -442,15 +442,15 @@ impl Client { (u, None) }) .map_err(Error::from), - Some(&crate::auth::Credentials::Token(ref token)) => { + Some(crate::auth::Credentials::Token(token)) => { let auth = format!("token {}", token); parsed_url.map(|u| (u, Some(auth))).map_err(Error::from) } - Some(&crate::auth::Credentials::JWT(ref jwt)) => { + Some(crate::auth::Credentials::JWT(jwt)) => { let auth = format!("Bearer {}", jwt.token()); parsed_url.map(|u| (u, Some(auth))).map_err(Error::from) } - Some(&crate::auth::Credentials::InstallationToken(ref apptoken)) => { + Some(crate::auth::Credentials::InstallationToken(apptoken)) => { let token = if let Some(token) = apptoken.token().await { token } else { diff --git a/github/src/types.rs b/github/src/types.rs index fdd1620a..8d96b9a5 100644 --- a/github/src/types.rs +++ b/github/src/types.rs @@ -840,15 +840,16 @@ pub struct Enterprise { } /** -* The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. Can be one of: `read` or `write`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. Can be one of: `read` or `write`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Pages { #[serde(rename = "read")] Read, #[serde(rename = "write")] Write, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -866,11 +867,6 @@ impl std::fmt::Display for Pages { } } -impl Default for Pages { - fn default() -> Pages { - Pages::Noop - } -} impl Pages { pub fn is_noop(&self) -> bool { matches!(self, Pages::Noop) @@ -878,9 +874,9 @@ impl Pages { } /** -* The level of permission to grant the access token to manage repository projects, columns, and cards. Can be one of: `read`, `write`, or `admin`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The level of permission to grant the access token to manage repository projects, columns, and cards. Can be one of: `read`, `write`, or `admin`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RepositoryProjects { #[serde(rename = "admin")] Admin, @@ -889,6 +885,7 @@ pub enum RepositoryProjects { #[serde(rename = "write")] Write, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -907,11 +904,6 @@ impl std::fmt::Display for RepositoryProjects { } } -impl Default for RepositoryProjects { - fn default() -> RepositoryProjects { - RepositoryProjects::Noop - } -} impl RepositoryProjects { pub fn is_noop(&self) -> bool { matches!(self, RepositoryProjects::Noop) @@ -919,13 +911,14 @@ impl RepositoryProjects { } /** -* The level of permission to grant the access token for viewing an organization's plan. Can be one of: `read`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The level of permission to grant the access token for viewing an organization's plan. Can be one of: `read`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OrganizationPlan { #[serde(rename = "read")] Read, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -942,11 +935,6 @@ impl std::fmt::Display for OrganizationPlan { } } -impl Default for OrganizationPlan { - fn default() -> OrganizationPlan { - OrganizationPlan::Noop - } -} impl OrganizationPlan { pub fn is_noop(&self) -> bool { matches!(self, OrganizationPlan::Noop) @@ -954,13 +942,14 @@ impl OrganizationPlan { } /** -* The level of permission to grant the access token to update GitHub Actions workflow files. Can be one of: `write`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The level of permission to grant the access token to update GitHub Actions workflow files. Can be one of: `write`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Workflows { #[serde(rename = "write")] Write, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -977,11 +966,6 @@ impl std::fmt::Display for Workflows { } } -impl Default for Workflows { - fn default() -> Workflows { - Workflows::Noop - } -} impl Workflows { pub fn is_noop(&self) -> bool { matches!(self, Workflows::Noop) @@ -1168,15 +1152,16 @@ pub struct AccountAnyOf { } /** -* Describe whether all repositories have been selected or there's a selection involved -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Describe whether all repositories have been selected or there's a selection involved + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RepositorySelection { #[serde(rename = "all")] All, #[serde(rename = "selected")] Selected, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1194,11 +1179,6 @@ impl std::fmt::Display for RepositorySelection { } } -impl Default for RepositorySelection { - fn default() -> RepositorySelection { - RepositorySelection::Noop - } -} impl RepositorySelection { pub fn is_noop(&self) -> bool { matches!(self, RepositorySelection::Noop) @@ -2809,9 +2789,9 @@ pub struct CodeOfConduct { } /** -* The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EnabledRepositories { #[serde(rename = "all")] All, @@ -2820,6 +2800,7 @@ pub enum EnabledRepositories { #[serde(rename = "selected")] Selected, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2838,11 +2819,6 @@ impl std::fmt::Display for EnabledRepositories { } } -impl Default for EnabledRepositories { - fn default() -> EnabledRepositories { - EnabledRepositories::Noop - } -} impl EnabledRepositories { pub fn is_noop(&self) -> bool { matches!(self, EnabledRepositories::Noop) @@ -2850,9 +2826,9 @@ impl EnabledRepositories { } /** -* The permissions policy that controls the actions that are allowed to run. Can be one of: `all`, `local_only`, or `selected`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The permissions policy that controls the actions that are allowed to run. Can be one of: `all`, `local_only`, or `selected`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AllowedActions { #[serde(rename = "all")] All, @@ -2861,6 +2837,7 @@ pub enum AllowedActions { #[serde(rename = "selected")] Selected, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2879,11 +2856,6 @@ impl std::fmt::Display for AllowedActions { } } -impl Default for AllowedActions { - fn default() -> AllowedActions { - AllowedActions::Noop - } -} impl AllowedActions { pub fn is_noop(&self) -> bool { matches!(self, AllowedActions::Noop) @@ -3060,15 +3032,16 @@ pub struct RunnerGroupsEnterprise { } /** -* The type of label. Read-only labels are applied automatically when the runner is configured. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of label. Read-only labels are applied automatically when the runner is configured. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Type { #[serde(rename = "custom")] Custom, #[serde(rename = "read-only")] ReadOnly, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3086,11 +3059,6 @@ impl std::fmt::Display for Type { } } -impl Default for Type { - fn default() -> Type { - Type::Noop - } -} impl Type { pub fn is_noop(&self) -> bool { matches!(self, Type::Noop) @@ -3677,13 +3645,14 @@ pub struct Label { } /** -* The state of the milestone. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The state of the milestone. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum State { #[serde(rename = "closed")] Closed, #[serde(rename = "open")] + #[default] Open, #[serde(other)] FallthroughString, @@ -3700,12 +3669,6 @@ impl std::fmt::Display for State { } } -impl Default for State { - fn default() -> State { - State::Open - } -} - /// A collection of related issues and pull requests. #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct Milestone { @@ -3803,9 +3766,9 @@ pub struct Milestone { } /** -* How the author is associated with the repository. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * How the author is associated with the repository. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AuthorAssociation { #[serde(rename = "COLLABORATOR")] Collaborator, @@ -3824,6 +3787,7 @@ pub enum AuthorAssociation { #[serde(rename = "OWNER")] Owner, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3847,11 +3811,6 @@ impl std::fmt::Display for AuthorAssociation { } } -impl Default for AuthorAssociation { - fn default() -> AuthorAssociation { - AuthorAssociation::Noop - } -} impl AuthorAssociation { pub fn is_noop(&self) -> bool { matches!(self, AuthorAssociation::Noop) @@ -7204,9 +7163,9 @@ pub struct RunnerGroupsOrg { } /** -* Visibility of a secret -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Visibility of a secret + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Visibility { #[serde(rename = "all")] All, @@ -7215,6 +7174,7 @@ pub enum Visibility { #[serde(rename = "selected")] Selected, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7233,11 +7193,6 @@ impl std::fmt::Display for Visibility { } } -impl Default for Visibility { - fn default() -> Visibility { - Visibility::Noop - } -} impl Visibility { pub fn is_noop(&self) -> bool { matches!(self, Visibility::Noop) @@ -7570,9 +7525,9 @@ pub struct OrgHook { } /** -* The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: `existing_users`, `contributors_only`, `collaborators_only`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: `existing_users`, `contributors_only`, `collaborators_only`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum InteractionGroup { #[serde(rename = "collaborators_only")] CollaboratorsOnly, @@ -7581,6 +7536,7 @@ pub enum InteractionGroup { #[serde(rename = "existing_users")] ExistingUsers, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7599,11 +7555,6 @@ impl std::fmt::Display for InteractionGroup { } } -impl Default for InteractionGroup { - fn default() -> InteractionGroup { - InteractionGroup::Noop - } -} impl InteractionGroup { pub fn is_noop(&self) -> bool { matches!(self, InteractionGroup::Noop) @@ -7632,9 +7583,9 @@ pub struct InteractionLimits { } /** -* The duration of the interaction restriction. Can be one of: `one_day`, `three_days`, `one_week`, `one_month`, `six_months`. Default: `one_day`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The duration of the interaction restriction. Can be one of: `one_day`, `three_days`, `one_week`, `one_month`, `six_months`. Default: `one_day`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum InteractionExpiry { #[serde(rename = "one_day")] OneDay, @@ -7647,6 +7598,7 @@ pub enum InteractionExpiry { #[serde(rename = "three_days")] ThreeDays, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7667,11 +7619,6 @@ impl std::fmt::Display for InteractionExpiry { } } -impl Default for InteractionExpiry { - fn default() -> InteractionExpiry { - InteractionExpiry::Noop - } -} impl InteractionExpiry { pub fn is_noop(&self) -> bool { matches!(self, InteractionExpiry::Noop) @@ -7877,15 +7824,16 @@ pub struct Team { } /** -* The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OrgMembershipState { #[serde(rename = "active")] Active, #[serde(rename = "pending")] Pending, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7903,11 +7851,6 @@ impl std::fmt::Display for OrgMembershipState { } } -impl Default for OrgMembershipState { - fn default() -> OrgMembershipState { - OrgMembershipState::Noop - } -} impl OrgMembershipState { pub fn is_noop(&self) -> bool { matches!(self, OrgMembershipState::Noop) @@ -7915,9 +7858,9 @@ impl OrgMembershipState { } /** -* The user's membership type in the organization. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The user's membership type in the organization. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Role { #[serde(rename = "admin")] Admin, @@ -7926,6 +7869,7 @@ pub enum Role { #[serde(rename = "member")] Member, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7944,11 +7888,6 @@ impl std::fmt::Display for Role { } } -impl Default for Role { - fn default() -> Role { - Role::Noop - } -} impl Role { pub fn is_noop(&self) -> bool { matches!(self, Role::Noop) @@ -8082,7 +8021,7 @@ pub struct Migration { pub url: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PackageType { #[serde(rename = "container")] Container, @@ -8097,6 +8036,7 @@ pub enum PackageType { #[serde(rename = "rubygems")] Rubygems, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8118,24 +8058,20 @@ impl std::fmt::Display for PackageType { } } -impl Default for PackageType { - fn default() -> PackageType { - PackageType::Noop - } -} impl PackageType { pub fn is_noop(&self) -> bool { matches!(self, PackageType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PackageVisibility { #[serde(rename = "private")] Private, #[serde(rename = "public")] Public, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8153,11 +8089,6 @@ impl std::fmt::Display for PackageVisibility { } } -impl Default for PackageVisibility { - fn default() -> PackageVisibility { - PackageVisibility::Noop - } -} impl PackageVisibility { pub fn is_noop(&self) -> bool { matches!(self, PackageVisibility::Noop) @@ -8326,9 +8257,9 @@ pub struct PackageVersion { } /** -* The baseline permission that all organization members have on this project. Only present if owner is an organization. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The baseline permission that all organization members have on this project. Only present if owner is an organization. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OrganizationPermission { #[serde(rename = "admin")] Admin, @@ -8339,6 +8270,7 @@ pub enum OrganizationPermission { #[serde(rename = "write")] Write, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8358,11 +8290,6 @@ impl std::fmt::Display for OrganizationPermission { } } -impl Default for OrganizationPermission { - fn default() -> OrganizationPermission { - OrganizationPermission::Noop - } -} impl OrganizationPermission { pub fn is_noop(&self) -> bool { matches!(self, OrganizationPermission::Noop) @@ -8510,15 +8437,16 @@ pub struct GroupMapping { } /** -* The level of privacy this team should have -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The level of privacy this team should have + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Privacy { #[serde(rename = "closed")] Closed, #[serde(rename = "secret")] Secret, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8536,11 +8464,6 @@ impl std::fmt::Display for Privacy { } } -impl Default for Privacy { - fn default() -> Privacy { - Privacy::Noop - } -} impl Privacy { pub fn is_noop(&self) -> bool { matches!(self, Privacy::Noop) @@ -8838,9 +8761,9 @@ pub struct TeamDiscussionComment { } /** -* The reaction to use -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The reaction to use + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Content { #[serde(rename = "+1")] PlusOne, @@ -8859,6 +8782,7 @@ pub enum Content { #[serde(rename = "rocket")] Rocket, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8882,11 +8806,6 @@ impl std::fmt::Display for Content { } } -impl Default for Content { - fn default() -> Content { - Content::Noop - } -} impl Content { pub fn is_noop(&self) -> bool { matches!(self, Content::Noop) @@ -8924,13 +8843,14 @@ pub struct Reaction { } /** -* The role of the user in the team. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The role of the user in the team. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TeamMembershipRole { #[serde(rename = "maintainer")] Maintainer, #[serde(rename = "member")] + #[default] Member, #[serde(other)] FallthroughString, @@ -8947,12 +8867,6 @@ impl std::fmt::Display for TeamMembershipRole { } } -impl Default for TeamMembershipRole { - fn default() -> TeamMembershipRole { - TeamMembershipRole::Member - } -} - /// Team Membership #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct TeamMembership { @@ -9863,13 +9777,14 @@ pub struct FullRepositoryPermissions { pub push: bool, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Status { #[serde(rename = "disabled")] Disabled, #[serde(rename = "enabled")] Enabled, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9887,11 +9802,6 @@ impl std::fmt::Display for Status { } } -impl Default for Status { - fn default() -> Status { - Status::Noop - } -} impl Status { pub fn is_noop(&self) -> bool { matches!(self, Status::Noop) @@ -10530,9 +10440,9 @@ pub struct Artifact { } /** -* The phase of the lifecycle that the job is currently in. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The phase of the lifecycle that the job is currently in. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum JobStatus { #[serde(rename = "completed")] Completed, @@ -10541,6 +10451,7 @@ pub enum JobStatus { #[serde(rename = "queued")] Queued, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10559,11 +10470,6 @@ impl std::fmt::Display for JobStatus { } } -impl Default for JobStatus { - fn default() -> JobStatus { - JobStatus::Noop - } -} impl JobStatus { pub fn is_noop(&self) -> bool { matches!(self, JobStatus::Noop) @@ -11030,15 +10936,16 @@ pub struct Environments { } /** -* Whether deployment to the environment(s) was approved or rejected -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether deployment to the environment(s) was approved or rejected + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EnvironmentApprovalState { #[serde(rename = "approved")] Approved, #[serde(rename = "rejected")] Rejected, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11056,11 +10963,6 @@ impl std::fmt::Display for EnvironmentApprovalState { } } -impl Default for EnvironmentApprovalState { - fn default() -> EnvironmentApprovalState { - EnvironmentApprovalState::Noop - } -} impl EnvironmentApprovalState { pub fn is_noop(&self) -> bool { matches!(self, EnvironmentApprovalState::Noop) @@ -11098,15 +11000,16 @@ pub struct EnvironmentApproval { } /** -* The type of reviewer. Must be one of: `User` or `Team` -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of reviewer. Must be one of: `User` or `Team` + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeploymentReviewerType { #[serde(rename = "Team")] Team, #[serde(rename = "User")] User, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11124,11 +11027,6 @@ impl std::fmt::Display for DeploymentReviewerType { } } -impl Default for DeploymentReviewerType { - fn default() -> DeploymentReviewerType { - DeploymentReviewerType::Noop - } -} impl DeploymentReviewerType { pub fn is_noop(&self) -> bool { matches!(self, DeploymentReviewerType::Noop) @@ -11442,7 +11340,7 @@ pub struct ActionsSecret { pub updated_at: Option>, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum WorkflowState { #[serde(rename = "active")] Active, @@ -11455,6 +11353,7 @@ pub enum WorkflowState { #[serde(rename = "disabled_manually")] DisabledManually, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11475,11 +11374,6 @@ impl std::fmt::Display for WorkflowState { } } -impl Default for WorkflowState { - fn default() -> WorkflowState { - WorkflowState::Noop - } -} impl WorkflowState { pub fn is_noop(&self) -> bool { matches!(self, WorkflowState::Noop) @@ -12766,7 +12660,7 @@ pub struct DeploymentSimple { pub url: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Conclusion { #[serde(rename = "action_required")] ActionRequired, @@ -12783,6 +12677,7 @@ pub enum Conclusion { #[serde(rename = "timed_out")] TimedOut, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -12805,11 +12700,6 @@ impl std::fmt::Display for Conclusion { } } -impl Default for Conclusion { - fn default() -> Conclusion { - Conclusion::Noop - } -} impl Conclusion { pub fn is_noop(&self) -> bool { matches!(self, Conclusion::Noop) @@ -13143,9 +13033,9 @@ pub struct CheckSuitePreference { } /** -* State of a code scanning alert. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * State of a code scanning alert. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CodeScanningAlertState { #[serde(rename = "closed")] Closed, @@ -13156,6 +13046,7 @@ pub enum CodeScanningAlertState { #[serde(rename = "open")] Open, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13175,11 +13066,6 @@ impl std::fmt::Display for CodeScanningAlertState { } } -impl Default for CodeScanningAlertState { - fn default() -> CodeScanningAlertState { - CodeScanningAlertState::Noop - } -} impl CodeScanningAlertState { pub fn is_noop(&self) -> bool { matches!(self, CodeScanningAlertState::Noop) @@ -13187,9 +13073,9 @@ impl CodeScanningAlertState { } /** -* **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: `false positive`, `won't fix`, and `used in tests`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: `false positive`, `won't fix`, and `used in tests`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CodeScanningAlertDismissedReason { #[serde(rename = "false positive")] FalsePositive, @@ -13198,6 +13084,7 @@ pub enum CodeScanningAlertDismissedReason { #[serde(rename = "won't fix")] WonTFix, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13216,11 +13103,6 @@ impl std::fmt::Display for CodeScanningAlertDismissedReason { } } -impl Default for CodeScanningAlertDismissedReason { - fn default() -> CodeScanningAlertDismissedReason { - CodeScanningAlertDismissedReason::Noop - } -} impl CodeScanningAlertDismissedReason { pub fn is_noop(&self) -> bool { matches!(self, CodeScanningAlertDismissedReason::Noop) @@ -13228,9 +13110,9 @@ impl CodeScanningAlertDismissedReason { } /** -* The severity of the alert. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The severity of the alert. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Severity { #[serde(rename = "error")] Error, @@ -13241,6 +13123,7 @@ pub enum Severity { #[serde(rename = "warning")] Warning, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13260,11 +13143,6 @@ impl std::fmt::Display for Severity { } } -impl Default for Severity { - fn default() -> Severity { - Severity::Noop - } -} impl Severity { pub fn is_noop(&self) -> bool { matches!(self, Severity::Noop) @@ -13368,9 +13246,9 @@ pub struct CodeScanningAlertLocation { } /** -* A classification of the file. For example to identify it as generated. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * A classification of the file. For example to identify it as generated. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CodeScanningAlertClassification { #[serde(rename = "generated")] Generated, @@ -13381,6 +13259,7 @@ pub enum CodeScanningAlertClassification { #[serde(rename = "test")] Test, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13400,11 +13279,6 @@ impl std::fmt::Display for CodeScanningAlertClassification { } } -impl Default for CodeScanningAlertClassification { - fn default() -> CodeScanningAlertClassification { - CodeScanningAlertClassification::Noop - } -} impl CodeScanningAlertClassification { pub fn is_noop(&self) -> bool { matches!(self, CodeScanningAlertClassification::Noop) @@ -13536,9 +13410,9 @@ pub struct CodeScanningAlertItems { } /** -* The security severity of the alert. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The security severity of the alert. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SecuritySeverityLevel { #[serde(rename = "critical")] Critical, @@ -13549,6 +13423,7 @@ pub enum SecuritySeverityLevel { #[serde(rename = "medium")] Medium, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13568,11 +13443,6 @@ impl std::fmt::Display for SecuritySeverityLevel { } } -impl Default for SecuritySeverityLevel { - fn default() -> SecuritySeverityLevel { - SecuritySeverityLevel::Noop - } -} impl SecuritySeverityLevel { pub fn is_noop(&self) -> bool { matches!(self, SecuritySeverityLevel::Noop) @@ -13692,15 +13562,16 @@ pub struct CodeScanningAlert { } /** -* Sets the state of the code scanning alert. Can be one of `open` or `dismissed`. You must provide `dismissed_reason` when you set the state to `dismissed`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Sets the state of the code scanning alert. Can be one of `open` or `dismissed`. You must provide `dismissed_reason` when you set the state to `dismissed`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CodeScanningAlertSetState { #[serde(rename = "dismissed")] Dismissed, #[serde(rename = "open")] Open, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13718,11 +13589,6 @@ impl std::fmt::Display for CodeScanningAlertSetState { } } -impl Default for CodeScanningAlertSetState { - fn default() -> CodeScanningAlertSetState { - CodeScanningAlertSetState::Noop - } -} impl CodeScanningAlertSetState { pub fn is_noop(&self) -> bool { matches!(self, CodeScanningAlertSetState::Noop) @@ -13858,15 +13724,16 @@ pub struct CodeScanningSarifsReceipt { } /** -* `pending` files have not yet been processed, while `complete` means all results in the SARIF have been stored. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * `pending` files have not yet been processed, while `complete` means all results in the SARIF have been stored. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ProcessingStatus { #[serde(rename = "complete")] Complete, #[serde(rename = "pending")] Pending, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13884,11 +13751,6 @@ impl std::fmt::Display for ProcessingStatus { } } -impl Default for ProcessingStatus { - fn default() -> ProcessingStatus { - ProcessingStatus::Noop - } -} impl ProcessingStatus { pub fn is_noop(&self) -> bool { matches!(self, ProcessingStatus::Noop) @@ -14041,9 +13903,9 @@ pub struct Collaborator { } /** -* The permission associated with the invitation. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The permission associated with the invitation. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RepositoryInvitationPermissions { #[serde(rename = "admin")] Admin, @@ -14056,6 +13918,7 @@ pub enum RepositoryInvitationPermissions { #[serde(rename = "write")] Write, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14076,11 +13939,6 @@ impl std::fmt::Display for RepositoryInvitationPermissions { } } -impl Default for RepositoryInvitationPermissions { - fn default() -> RepositoryInvitationPermissions { - RepositoryInvitationPermissions::Noop - } -} impl RepositoryInvitationPermissions { pub fn is_noop(&self) -> bool { matches!(self, RepositoryInvitationPermissions::Noop) @@ -14257,9 +14115,9 @@ pub struct Link { } /** -* The merge method to use. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The merge method to use. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MergeMethod { #[serde(rename = "merge")] Merge, @@ -14268,6 +14126,7 @@ pub enum MergeMethod { #[serde(rename = "squash")] Squash, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14286,11 +14145,6 @@ impl std::fmt::Display for MergeMethod { } } -impl Default for MergeMethod { - fn default() -> MergeMethod { - MergeMethod::Noop - } -} impl MergeMethod { pub fn is_noop(&self) -> bool { matches!(self, MergeMethod::Noop) @@ -14947,7 +14801,7 @@ pub struct DiffEntry { pub status: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CommitComparisonStatus { #[serde(rename = "ahead")] Ahead, @@ -14958,6 +14812,7 @@ pub enum CommitComparisonStatus { #[serde(rename = "identical")] Identical, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14977,11 +14832,6 @@ impl std::fmt::Display for CommitComparisonStatus { } } -impl Default for CommitComparisonStatus { - fn default() -> CommitComparisonStatus { - CommitComparisonStatus::Noop - } -} impl CommitComparisonStatus { pub fn is_noop(&self) -> bool { matches!(self, CommitComparisonStatus::Noop) @@ -15760,9 +15610,9 @@ pub struct Contributor { } /** -* The state of the status. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The state of the status. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeploymentStatusState { #[serde(rename = "error")] Error, @@ -15779,6 +15629,7 @@ pub enum DeploymentStatusState { #[serde(rename = "success")] Success, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -15801,11 +15652,6 @@ impl std::fmt::Display for DeploymentStatusState { } } -impl Default for DeploymentStatusState { - fn default() -> DeploymentStatusState { - DeploymentStatusState::Noop - } -} impl DeploymentStatusState { pub fn is_noop(&self) -> bool { matches!(self, DeploymentStatusState::Noop) @@ -16515,7 +16361,7 @@ pub struct Hook { pub url: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ImportStatus { #[serde(rename = "auth")] Auth, @@ -16550,6 +16396,7 @@ pub enum ImportStatus { #[serde(rename = "waiting_to_push")] WaitingToPush, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -16581,11 +16428,6 @@ impl std::fmt::Display for ImportStatus { } } -impl Default for ImportStatus { - fn default() -> ImportStatus { - ImportStatus::Noop - } -} impl ImportStatus { pub fn is_noop(&self) -> bool { matches!(self, ImportStatus::Noop) @@ -18226,13 +18068,14 @@ pub struct PullRequestReviewCommentLinks { } /** -* The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Side { #[serde(rename = "LEFT")] Left, #[serde(rename = "RIGHT")] + #[default] Right, #[serde(other)] FallthroughString, @@ -18249,12 +18092,6 @@ impl std::fmt::Display for Side { } } -impl Default for Side { - fn default() -> Side { - Side::Right - } -} - /// Pull Request Review Comments are comments on a portion of the Pull Request's diff. #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct PullRequestReviewComment { @@ -18690,7 +18527,7 @@ pub struct PagesSourceHash { pub path: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PagesHttpsCertificateState { #[serde(rename = "approved")] Approved, @@ -18717,6 +18554,7 @@ pub enum PagesHttpsCertificateState { #[serde(rename = "uploaded")] Uploaded, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18744,11 +18582,6 @@ impl std::fmt::Display for PagesHttpsCertificateState { } } -impl Default for PagesHttpsCertificateState { - fn default() -> PagesHttpsCertificateState { - PagesHttpsCertificateState::Noop - } -} impl PagesHttpsCertificateState { pub fn is_noop(&self) -> bool { matches!(self, PagesHttpsCertificateState::Noop) @@ -18783,9 +18616,9 @@ pub struct PagesHttpsCertificate { } /** -* The status of the most recent build of the Page. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the most recent build of the Page. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PageStatus { #[serde(rename = "building")] Building, @@ -18794,6 +18627,7 @@ pub enum PageStatus { #[serde(rename = "errored")] Errored, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18812,11 +18646,6 @@ impl std::fmt::Display for PageStatus { } } -impl Default for PageStatus { - fn default() -> PageStatus { - PageStatus::Noop - } -} impl PageStatus { pub fn is_noop(&self) -> bool { matches!(self, PageStatus::Noop) @@ -20906,15 +20735,16 @@ pub struct ReviewComment { } /** -* State of the release asset. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * State of the release asset. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReleaseAssetState { #[serde(rename = "open")] Open, #[serde(rename = "uploaded")] Uploaded, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -20932,11 +20762,6 @@ impl std::fmt::Display for ReleaseAssetState { } } -impl Default for ReleaseAssetState { - fn default() -> ReleaseAssetState { - ReleaseAssetState::Noop - } -} impl ReleaseAssetState { pub fn is_noop(&self) -> bool { matches!(self, ReleaseAssetState::Noop) @@ -21164,15 +20989,16 @@ pub struct Release { } /** -* Sets the state of the secret scanning alert. Can be either `open` or `resolved`. You must provide `resolution` when you set the state to `resolved`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Sets the state of the secret scanning alert. Can be either `open` or `resolved`. You must provide `resolution` when you set the state to `resolved`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SecretScanningAlertState { #[serde(rename = "open")] Open, #[serde(rename = "resolved")] Resolved, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -21190,11 +21016,6 @@ impl std::fmt::Display for SecretScanningAlertState { } } -impl Default for SecretScanningAlertState { - fn default() -> SecretScanningAlertState { - SecretScanningAlertState::Noop - } -} impl SecretScanningAlertState { pub fn is_noop(&self) -> bool { matches!(self, SecretScanningAlertState::Noop) @@ -21202,9 +21023,9 @@ impl SecretScanningAlertState { } /** -* **Required when the `state` is `resolved`.** The reason for resolving the alert. Can be one of `false_positive`, `wont_fix`, `revoked`, or `used_in_tests`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * **Required when the `state` is `resolved`.** The reason for resolving the alert. Can be one of `false_positive`, `wont_fix`, `revoked`, or `used_in_tests`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SecretScanningAlertResolution { #[serde(rename = "false_positive")] FalsePositive, @@ -21215,6 +21036,7 @@ pub enum SecretScanningAlertResolution { #[serde(rename = "wont_fix")] WontFix, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -21234,11 +21056,6 @@ impl std::fmt::Display for SecretScanningAlertResolution { } } -impl Default for SecretScanningAlertResolution { - fn default() -> SecretScanningAlertResolution { - SecretScanningAlertResolution::Noop - } -} impl SecretScanningAlertResolution { pub fn is_noop(&self) -> bool { matches!(self, SecretScanningAlertResolution::Noop) @@ -21966,7 +21783,7 @@ pub struct ScimUserMeta { pub resource_type: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Op { #[serde(rename = "add")] Add, @@ -21975,6 +21792,7 @@ pub enum Op { #[serde(rename = "replace")] Replace, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -21993,11 +21811,6 @@ impl std::fmt::Display for Op { } } -impl Default for Op { - fn default() -> Op { - Op::Noop - } -} impl Op { pub fn is_noop(&self) -> bool { matches!(self, Op::Noop) @@ -24243,15 +24056,15 @@ pub struct KeySimple { } /** -* The event types to include: -* -* - `web` - returns web (non-Git) events -* - `git` - returns Git events -* - `all` - returns both web and Git events -* -* The default is `web`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The event types to include: + * + * - `web` - returns web (non-Git) events + * - `git` - returns Git events + * - `all` - returns both web and Git events + * + * The default is `web`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Include { #[serde(rename = "all")] All, @@ -24260,6 +24073,7 @@ pub enum Include { #[serde(rename = "web")] Web, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -24278,11 +24092,6 @@ impl std::fmt::Display for Include { } } -impl Default for Include { - fn default() -> Include { - Include::Noop - } -} impl Include { pub fn is_noop(&self) -> bool { matches!(self, Include::Noop) @@ -24290,17 +24099,18 @@ impl Include { } /** -* The order of audit log events. To list newest events first, specify `desc`. To list oldest events first, specify `asc`. -* -* The default is `desc`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The order of audit log events. To list newest events first, specify `desc`. To list oldest events first, specify `asc`. + * + * The default is `desc`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Order { #[serde(rename = "asc")] Asc, #[serde(rename = "desc")] Desc, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -24318,11 +24128,6 @@ impl std::fmt::Display for Order { } } -impl Default for Order { - fn default() -> Order { - Order::Noop - } -} impl Order { pub fn is_noop(&self) -> bool { matches!(self, Order::Noop) @@ -24330,11 +24135,12 @@ impl Order { } /** -* One of `created` (when the repository was starred) or `updated` (when it was last pushed to). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * One of `created` (when the repository was starred) or `updated` (when it was last pushed to). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Sort { #[serde(rename = "created")] + #[default] Created, #[serde(rename = "updated")] Updated, @@ -24353,16 +24159,10 @@ impl std::fmt::Display for Sort { } } -impl Default for Sort { - fn default() -> Sort { - Sort::Created - } -} - /** -* Returns workflow runs with the check run `status` or `conclusion` that you specify. For example, a conclusion can be `success` or a status can be `in_progress`. Only GitHub can set a status of `waiting` or `requested`. For a list of the possible `status` and `conclusion` options, see "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Returns workflow runs with the check run `status` or `conclusion` that you specify. For example, a conclusion can be `success` or a status can be `in_progress`. Only GitHub can set a status of `waiting` or `requested`. For a list of the possible `status` and `conclusion` options, see "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum WorkflowRunStatus { #[serde(rename = "action_required")] ActionRequired, @@ -24391,6 +24191,7 @@ pub enum WorkflowRunStatus { #[serde(rename = "waiting")] Waiting, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -24419,11 +24220,6 @@ impl std::fmt::Display for WorkflowRunStatus { } } -impl Default for WorkflowRunStatus { - fn default() -> WorkflowRunStatus { - WorkflowRunStatus::Noop - } -} impl WorkflowRunStatus { pub fn is_noop(&self) -> bool { matches!(self, WorkflowRunStatus::Noop) @@ -24485,11 +24281,12 @@ impl std::convert::From for String { } /** -* Must be one of: `day`, `week`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Must be one of: `day`, `week`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Per { #[serde(rename = "day")] + #[default] Day, #[serde(rename = "week")] Week, @@ -24508,12 +24305,6 @@ impl std::fmt::Display for Per { } } -impl Default for Per { - fn default() -> Per { - Per::Day - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct PullsMergeResponse { #[serde( @@ -25266,9 +25057,10 @@ pub struct FilesAdditionalPropertiesData { pub content: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Public { #[serde(rename = "false")] + #[default] False, #[serde(rename = "true")] True, @@ -25287,12 +25079,6 @@ impl std::fmt::Display for Public { } } -impl Default for Public { - fn default() -> Public { - Public::False - } -} - /// All of the following types: /// /// - `bool` @@ -25413,18 +25199,19 @@ pub struct AppsListInstallationReposResponse { } /** -* Indicates which sorts of issues to return. Can be one of: -* \* `assigned`: Issues assigned to you -* \* `created`: Issues created by you -* \* `mentioned`: Issues mentioning you -* \* `subscribed`: Issues you're subscribed to updates for -* \* `all` or `repos`: All issues the authenticated user can see, regardless of participation or creation -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Indicates which sorts of issues to return. Can be one of: + * \* `assigned`: Issues assigned to you + * \* `created`: Issues created by you + * \* `mentioned`: Issues mentioning you + * \* `subscribed`: Issues you're subscribed to updates for + * \* `all` or `repos`: All issues the authenticated user can see, regardless of participation or creation + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Filter { #[serde(rename = "all")] All, #[serde(rename = "assigned")] + #[default] Assigned, #[serde(rename = "created")] Created, @@ -25453,22 +25240,17 @@ impl std::fmt::Display for Filter { } } -impl Default for Filter { - fn default() -> Filter { - Filter::Assigned - } -} - /** -* Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuesListState { #[serde(rename = "all")] All, #[serde(rename = "closed")] Closed, #[serde(rename = "open")] + #[default] Open, #[serde(other)] FallthroughString, @@ -25486,20 +25268,15 @@ impl std::fmt::Display for IssuesListState { } } -impl Default for IssuesListState { - fn default() -> IssuesListState { - IssuesListState::Open - } -} - /** -* What to sort results by. Can be either `created`, `updated`, `comments`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * What to sort results by. Can be either `created`, `updated`, `comments`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuesListSort { #[serde(rename = "comments")] Comments, #[serde(rename = "created")] + #[default] Created, #[serde(rename = "updated")] Updated, @@ -25519,20 +25296,15 @@ impl std::fmt::Display for IssuesListSort { } } -impl Default for IssuesListSort { - fn default() -> IssuesListSort { - IssuesListSort::Created - } -} - /** -* The rendering mode. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The rendering mode. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Mode { #[serde(rename = "gfm")] Gfm, #[serde(rename = "markdown")] + #[default] Markdown, #[serde(other)] FallthroughString, @@ -25549,12 +25321,6 @@ impl std::fmt::Display for Mode { } } -impl Default for Mode { - fn default() -> Mode { - Mode::Markdown - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct MarkdownRenderRequest { #[serde( @@ -25595,13 +25361,13 @@ pub struct ActivitySetThreadSubscriptionRequest { } /** -* Specifies which types of repositories non-admin organization members can create. Can be one of: -* \* `all` - all organization members can create public and private repositories. -* \* `private` - members can create private repositories. This option is only available to repositories that are part of an organization on GitHub Enterprise Cloud. -* \* `none` - only admin members can create repositories. -* **Note:** This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Specifies which types of repositories non-admin organization members can create. Can be one of: + * \* `all` - all organization members can create public and private repositories. + * \* `private` - members can create private repositories. This option is only available to repositories that are part of an organization on GitHub Enterprise Cloud. + * \* `none` - only admin members can create repositories. + * **Note:** This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MembersAllowedRepositoryCreationType { #[serde(rename = "all")] All, @@ -25610,6 +25376,7 @@ pub enum MembersAllowedRepositoryCreationType { #[serde(rename = "private")] Private, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -25628,11 +25395,6 @@ impl std::fmt::Display for MembersAllowedRepositoryCreationType { } } -impl Default for MembersAllowedRepositoryCreationType { - fn default() -> MembersAllowedRepositoryCreationType { - MembersAllowedRepositoryCreationType::Noop - } -} impl MembersAllowedRepositoryCreationType { pub fn is_noop(&self) -> bool { matches!(self, MembersAllowedRepositoryCreationType::Noop) @@ -26124,18 +25886,19 @@ pub struct InteractionsGetRestrictionsResponseAnyOf { } /** -* Specify role for new member. Can be one of: -* \* `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. -* \* `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. -* \* `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Specify role for new member. Can be one of: + * \* `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. + * \* `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. + * \* `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OrgsCreateInvitationRequestRole { #[serde(rename = "admin")] Admin, #[serde(rename = "billing_manager")] BillingManager, #[serde(rename = "direct_member")] + #[default] DirectMember, #[serde(other)] FallthroughString, @@ -26153,12 +25916,6 @@ impl std::fmt::Display for OrgsCreateInvitationRequestRole { } } -impl Default for OrgsCreateInvitationRequestRole { - fn default() -> OrgsCreateInvitationRequestRole { - OrgsCreateInvitationRequestRole::DirectMember - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct OrgsCreateInvitationRequest { #[serde( @@ -26193,15 +25950,16 @@ pub struct OrgsCreateInvitationRequest { } /** -* Filter members returned in the list. Can be one of: -* \* `2fa_disabled` - Members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. Available for organization owners. -* \* `all` - All members the authenticated user can see. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Filter members returned in the list. Can be one of: + * \* `2fa_disabled` - Members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. Available for organization owners. + * \* `all` - All members the authenticated user can see. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OrgsListMembersFilter { #[serde(rename = "2fa_disabled")] TwoFaDisabled, #[serde(rename = "all")] + #[default] All, #[serde(other)] FallthroughString, @@ -26218,23 +25976,18 @@ impl std::fmt::Display for OrgsListMembersFilter { } } -impl Default for OrgsListMembersFilter { - fn default() -> OrgsListMembersFilter { - OrgsListMembersFilter::All - } -} - /** -* Filter members returned by their role. Can be one of: -* \* `all` - All members of the organization, regardless of role. -* \* `admin` - Organization owners. -* \* `member` - Non-owner organization members. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Filter members returned by their role. Can be one of: + * \* `all` - All members of the organization, regardless of role. + * \* `admin` - Organization owners. + * \* `member` - Non-owner organization members. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OrgsListMembersRole { #[serde(rename = "admin")] Admin, #[serde(rename = "all")] + #[default] All, #[serde(rename = "member")] Member, @@ -26254,22 +26007,17 @@ impl std::fmt::Display for OrgsListMembersRole { } } -impl Default for OrgsListMembersRole { - fn default() -> OrgsListMembersRole { - OrgsListMembersRole::All - } -} - /** -* The role to give the user in the organization. Can be one of: -* \* `admin` - The user will become an owner of the organization. -* \* `member` - The user will become a non-owner member of the organization. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The role to give the user in the organization. Can be one of: + * \* `admin` - The user will become an owner of the organization. + * \* `member` - The user will become a non-owner member of the organization. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OrgsSetMembershipUserRequestRole { #[serde(rename = "admin")] Admin, #[serde(rename = "member")] + #[default] Member, #[serde(other)] FallthroughString, @@ -26286,12 +26034,6 @@ impl std::fmt::Display for OrgsSetMembershipUserRequestRole { } } -impl Default for OrgsSetMembershipUserRequestRole { - fn default() -> OrgsSetMembershipUserRequestRole { - OrgsSetMembershipUserRequestRole::Member - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct OrgsSetMembershipUserRequest { /** @@ -26304,13 +26046,14 @@ pub struct OrgsSetMembershipUserRequest { } /** -* Allowed values that can be passed to the exclude param. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Allowed values that can be passed to the exclude param. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Exclude { #[serde(rename = "repositories")] Repositories, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -26327,11 +26070,6 @@ impl std::fmt::Display for Exclude { } } -impl Default for Exclude { - fn default() -> Exclude { - Exclude::Noop - } -} impl Exclude { pub fn is_noop(&self) -> bool { matches!(self, Exclude::Noop) @@ -26365,11 +26103,12 @@ pub struct MigrationsStartRequest { } /** -* The state of the package, either active or deleted. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The state of the package, either active or deleted. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PackagesGetAllPackageVersionsOwnedByOrgState { #[serde(rename = "active")] + #[default] Active, #[serde(rename = "deleted")] Deleted, @@ -26388,12 +26127,6 @@ impl std::fmt::Display for PackagesGetAllPackageVersionsOwnedByOrgState { } } -impl Default for PackagesGetAllPackageVersionsOwnedByOrgState { - fn default() -> PackagesGetAllPackageVersionsOwnedByOrgState { - PackagesGetAllPackageVersionsOwnedByOrgState::Active - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct ProjectsCreateRequest { #[serde( @@ -26411,9 +26144,9 @@ pub struct ProjectsCreateRequest { } /** -* Specifies the types of repositories you want returned. Can be one of `all`, `public`, `private`, `forks`, `sources`, `member`, `internal`. Note: For GitHub AE, can be one of `all`, `private`, `forks`, `sources`, `member`, `internal`. Default: `all`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `type` can also be `internal`. However, the `internal` value is not yet supported when a GitHub App calls this API with an installation access token. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Specifies the types of repositories you want returned. Can be one of `all`, `public`, `private`, `forks`, `sources`, `member`, `internal`. Note: For GitHub AE, can be one of `all`, `private`, `forks`, `sources`, `member`, `internal`. Default: `all`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `type` can also be `internal`. However, the `internal` value is not yet supported when a GitHub App calls this API with an installation access token. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReposListOrgType { #[serde(rename = "all")] All, @@ -26430,6 +26163,7 @@ pub enum ReposListOrgType { #[serde(rename = "sources")] Sources, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -26452,11 +26186,6 @@ impl std::fmt::Display for ReposListOrgType { } } -impl Default for ReposListOrgType { - fn default() -> ReposListOrgType { - ReposListOrgType::Noop - } -} impl ReposListOrgType { pub fn is_noop(&self) -> bool { matches!(self, ReposListOrgType::Noop) @@ -26464,11 +26193,12 @@ impl ReposListOrgType { } /** -* Can be one of `created`, `updated`, `pushed`, `full_name`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Can be one of `created`, `updated`, `pushed`, `full_name`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReposListOrgSort { #[serde(rename = "created")] + #[default] Created, #[serde(rename = "full_name")] FullName, @@ -26493,17 +26223,11 @@ impl std::fmt::Display for ReposListOrgSort { } } -impl Default for ReposListOrgSort { - fn default() -> ReposListOrgSort { - ReposListOrgSort::Created - } -} - /** -* Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `visibility` can also be `internal`. Note: For GitHub Enterprise Server and GitHub AE, this endpoint will only list repositories available to all users on the enterprise. For more information, see "[Creating an internal repository](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-repository-visibility#about-internal-repositories)" in the GitHub Help documentation. -* The `visibility` parameter overrides the `private` parameter when you use both parameters with the `nebula-preview` preview header. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `visibility` can also be `internal`. Note: For GitHub Enterprise Server and GitHub AE, this endpoint will only list repositories available to all users on the enterprise. For more information, see "[Creating an internal repository](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-repository-visibility#about-internal-repositories)" in the GitHub Help documentation. + * The `visibility` parameter overrides the `private` parameter when you use both parameters with the `nebula-preview` preview header. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReposCreateInOrgRequestVisibility { #[serde(rename = "internal")] Internal, @@ -26514,6 +26238,7 @@ pub enum ReposCreateInOrgRequestVisibility { #[serde(rename = "visibility")] Visibility, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -26533,11 +26258,6 @@ impl std::fmt::Display for ReposCreateInOrgRequestVisibility { } } -impl Default for ReposCreateInOrgRequestVisibility { - fn default() -> ReposCreateInOrgRequestVisibility { - ReposCreateInOrgRequestVisibility::Noop - } -} impl ReposCreateInOrgRequestVisibility { pub fn is_noop(&self) -> bool { matches!(self, ReposCreateInOrgRequestVisibility::Noop) @@ -26613,16 +26333,17 @@ pub struct ReposCreateInOrgRequest { } /** -* **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: -* \* `pull` - team members can pull, but not push to or administer newly-added repositories. -* \* `push` - team members can pull and push, but not administer newly-added repositories. -* \* `admin` - team members can pull, push and administer newly-added repositories. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: + * \* `pull` - team members can pull, but not push to or administer newly-added repositories. + * \* `push` - team members can pull and push, but not administer newly-added repositories. + * \* `admin` - team members can pull, push and administer newly-added repositories. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Permission { #[serde(rename = "admin")] Admin, #[serde(rename = "pull")] + #[default] Pull, #[serde(rename = "push")] Push, @@ -26642,12 +26363,6 @@ impl std::fmt::Display for Permission { } } -impl Default for Permission { - fn default() -> Permission { - Permission::Pull - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct TeamsCreateRequest { #[serde( @@ -26780,14 +26495,15 @@ pub struct ReactionsCreateIssueRequest { } /** -* Filters members returned by their role in the team. Can be one of: -* \* `member` - normal members of the team. -* \* `maintainer` - team maintainers. -* \* `all` - all members of the team. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Filters members returned by their role in the team. Can be one of: + * \* `member` - normal members of the team. + * \* `maintainer` - team maintainers. + * \* `all` - all members of the team. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TeamsListMembersInOrgRole { #[serde(rename = "all")] + #[default] All, #[serde(rename = "maintainer")] Maintainer, @@ -26809,12 +26525,6 @@ impl std::fmt::Display for TeamsListMembersInOrgRole { } } -impl Default for TeamsListMembersInOrgRole { - fn default() -> TeamsListMembersInOrgRole { - TeamsListMembersInOrgRole::All - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct TeamsAddUpdateMembershipUserInOrgRequest { /** @@ -26831,16 +26541,16 @@ pub struct ProjectsAddCollaboratorRequest { } /** -* The permission to grant the team on this repository. Can be one of: -* \* `pull` - team members can pull, but not push to or administer this repository. -* \* `push` - team members can pull and push, but not administer this repository. -* \* `admin` - team members can pull, push and administer this repository. -* \* `maintain` - team members can manage the repository without access to sensitive or destructive actions. Recommended for project managers. Only applies to repositories owned by organizations. -* \* `triage` - team members can proactively manage issues and pull requests without write access. Recommended for contributors who triage a repository. Only applies to repositories owned by organizations. -* -* If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The permission to grant the team on this repository. Can be one of: + * \* `pull` - team members can pull, but not push to or administer this repository. + * \* `push` - team members can pull and push, but not administer this repository. + * \* `admin` - team members can pull, push and administer this repository. + * \* `maintain` - team members can manage the repository without access to sensitive or destructive actions. Recommended for project managers. Only applies to repositories owned by organizations. + * \* `triage` - team members can proactively manage issues and pull requests without write access. Recommended for contributors who triage a repository. Only applies to repositories owned by organizations. + * + * If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TeamsAddUpdateRepoPermissionsInOrgRequestPermission { #[serde(rename = "admin")] Admin, @@ -26853,6 +26563,7 @@ pub enum TeamsAddUpdateRepoPermissionsInOrgRequestPermission { #[serde(rename = "triage")] Triage, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -26873,11 +26584,6 @@ impl std::fmt::Display for TeamsAddUpdateRepoPermissionsInOrgRequestPermission { } } -impl Default for TeamsAddUpdateRepoPermissionsInOrgRequestPermission { - fn default() -> TeamsAddUpdateRepoPermissionsInOrgRequestPermission { - TeamsAddUpdateRepoPermissionsInOrgRequestPermission::Noop - } -} impl TeamsAddUpdateRepoPermissionsInOrgRequestPermission { pub fn is_noop(&self) -> bool { matches!( @@ -27096,15 +26802,16 @@ pub struct ProjectsUpdateColumnRequest { } /** -* Filters the project cards that are returned by the card's state. Can be one of `all`,`archived`, or `not_archived`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Filters the project cards that are returned by the card's state. Can be one of `all`,`archived`, or `not_archived`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ArchivedState { #[serde(rename = "all")] All, #[serde(rename = "archived")] Archived, #[serde(rename = "not_archived")] + #[default] NotArchived, #[serde(other)] FallthroughString, @@ -27122,12 +26829,6 @@ impl std::fmt::Display for ArchivedState { } } -impl Default for ArchivedState { - fn default() -> ArchivedState { - ArchivedState::NotArchived - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct ProjectsCreateCardRequest { #[serde( @@ -27224,14 +26925,15 @@ pub struct ProjectsUpdateRequest { } /** -* Filters the collaborators by their affiliation. Can be one of: -* \* `outside`: Outside collaborators of a project that are not a member of the project's organization. -* \* `direct`: Collaborators with permissions to a project, regardless of organization membership status. -* \* `all`: All collaborators the authenticated user can see. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Filters the collaborators by their affiliation. Can be one of: + * \* `outside`: Outside collaborators of a project that are not a member of the project's organization. + * \* `direct`: Collaborators with permissions to a project, regardless of organization membership status. + * \* `all`: All collaborators the authenticated user can see. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Affiliation { #[serde(rename = "all")] + #[default] All, #[serde(rename = "direct")] Direct, @@ -27253,12 +26955,6 @@ impl std::fmt::Display for Affiliation { } } -impl Default for Affiliation { - fn default() -> Affiliation { - Affiliation::All - } -} - /// Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct ReposUpdateRequestSecurityAnalysisAdvanced { @@ -27390,15 +27086,16 @@ pub struct ActionsListWorkflowRunsResponse { } /** -* Filters jobs by their `completed_at` timestamp. Can be one of: -* \* `latest`: Returns jobs from the most recent execution of the workflow run. -* \* `all`: Returns all jobs for a workflow run, including from old executions of the workflow run. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Filters jobs by their `completed_at` timestamp. Can be one of: + * \* `latest`: Returns jobs from the most recent execution of the workflow run. + * \* `all`: Returns all jobs for a workflow run, including from old executions of the workflow run. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ActionsListJobsWorkflowRunFilter { #[serde(rename = "all")] All, #[serde(rename = "latest")] + #[default] Latest, #[serde(other)] FallthroughString, @@ -27415,12 +27112,6 @@ impl std::fmt::Display for ActionsListJobsWorkflowRunFilter { } } -impl Default for ActionsListJobsWorkflowRunFilter { - fn default() -> ActionsListJobsWorkflowRunFilter { - ActionsListJobsWorkflowRunFilter::Latest - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct ActionsListJobsWorkflowRunResponse { #[serde( @@ -27985,10 +27676,10 @@ pub struct ReposRenameBranchRequest { } /** -* **Required if you provide `completed_at` or a `status` of `completed`**. The final conclusion of the check. Can be one of `action_required`, `cancelled`, `failure`, `neutral`, `success`, `skipped`, `stale`, or `timed_out`. When the conclusion is `action_required`, additional details should be provided on the site specified by `details_url`. -* **Note:** Providing `conclusion` will automatically set the `status` parameter to `completed`. You cannot change a check run conclusion to `stale`, only GitHub can set this. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * **Required if you provide `completed_at` or a `status` of `completed`**. The final conclusion of the check. Can be one of `action_required`, `cancelled`, `failure`, `neutral`, `success`, `skipped`, `stale`, or `timed_out`. When the conclusion is `action_required`, additional details should be provided on the site specified by `details_url`. + * **Note:** Providing `conclusion` will automatically set the `status` parameter to `completed`. You cannot change a check run conclusion to `stale`, only GitHub can set this. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ChecksCreateRequestConclusion { #[serde(rename = "action_required")] ActionRequired, @@ -28007,6 +27698,7 @@ pub enum ChecksCreateRequestConclusion { #[serde(rename = "timed_out")] TimedOut, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -28030,11 +27722,6 @@ impl std::fmt::Display for ChecksCreateRequestConclusion { } } -impl Default for ChecksCreateRequestConclusion { - fn default() -> ChecksCreateRequestConclusion { - ChecksCreateRequestConclusion::Noop - } -} impl ChecksCreateRequestConclusion { pub fn is_noop(&self) -> bool { matches!(self, ChecksCreateRequestConclusion::Noop) @@ -28042,9 +27729,9 @@ impl ChecksCreateRequestConclusion { } /** -* The level of the annotation. Can be one of `notice`, `warning`, or `failure`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The level of the annotation. Can be one of `notice`, `warning`, or `failure`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AnnotationLevel { #[serde(rename = "failure")] Failure, @@ -28053,6 +27740,7 @@ pub enum AnnotationLevel { #[serde(rename = "warning")] Warning, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -28071,11 +27759,6 @@ impl std::fmt::Display for AnnotationLevel { } } -impl Default for AnnotationLevel { - fn default() -> AnnotationLevel { - AnnotationLevel::Noop - } -} impl AnnotationLevel { pub fn is_noop(&self) -> bool { matches!(self, AnnotationLevel::Noop) @@ -28709,9 +28392,9 @@ pub struct ReposCreateDeploymentRequest { } /** -* Name for the target deployment environment, which can be changed when setting a deploy status. For example, `production`, `staging`, or `qa`. **Note:** This parameter requires you to use the [`application/vnd.github.flash-preview+json`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Name for the target deployment environment, which can be changed when setting a deploy status. For example, `production`, `staging`, or `qa`. **Note:** This parameter requires you to use the [`application/vnd.github.flash-preview+json`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReposCreateDeploymentStatusRequestEnvironment { #[serde(rename = "production")] Production, @@ -28720,6 +28403,7 @@ pub enum ReposCreateDeploymentStatusRequestEnvironment { #[serde(rename = "staging")] Staging, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -28738,11 +28422,6 @@ impl std::fmt::Display for ReposCreateDeploymentStatusRequestEnvironment { } } -impl Default for ReposCreateDeploymentStatusRequestEnvironment { - fn default() -> ReposCreateDeploymentStatusRequestEnvironment { - ReposCreateDeploymentStatusRequestEnvironment::Noop - } -} impl ReposCreateDeploymentStatusRequestEnvironment { pub fn is_noop(&self) -> bool { matches!(self, ReposCreateDeploymentStatusRequestEnvironment::Noop) @@ -28857,11 +28536,12 @@ pub struct ReposCreateUpdateEnvironmentRequest { } /** -* The sort order. Can be either `newest`, `oldest`, or `stargazers`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The sort order. Can be either `newest`, `oldest`, or `stargazers`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReposListForksSort { #[serde(rename = "newest")] + #[default] Newest, #[serde(rename = "oldest")] Oldest, @@ -28886,12 +28566,6 @@ impl std::fmt::Display for ReposListForksSort { } } -impl Default for ReposListForksSort { - fn default() -> ReposListForksSort { - ReposListForksSort::Newest - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct ReposCreateForkRequest { #[serde( @@ -29047,9 +28721,9 @@ pub struct GitUpdateRefRequest { } /** -* The type of the object we're tagging. Normally this is a `commit` but it can also be a `tree` or a `blob`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of the object we're tagging. Normally this is a `commit` but it can also be a `tree` or a `blob`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GitCreateTagRequestType { #[serde(rename = "blob")] Blob, @@ -29058,6 +28732,7 @@ pub enum GitCreateTagRequestType { #[serde(rename = "tree")] Tree, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -29076,11 +28751,6 @@ impl std::fmt::Display for GitCreateTagRequestType { } } -impl Default for GitCreateTagRequestType { - fn default() -> GitCreateTagRequestType { - GitCreateTagRequestType::Noop - } -} impl GitCreateTagRequestType { pub fn is_noop(&self) -> bool { matches!(self, GitCreateTagRequestType::Noop) @@ -29150,9 +28820,9 @@ pub struct GitCreateTagRequest { } /** -* The file mode; one of `100644` for file (blob), `100755` for executable (blob), `040000` for subdirectory (tree), `160000` for submodule (commit), or `120000` for a blob that specifies the path of a symlink. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The file mode; one of `100644` for file (blob), `100755` for executable (blob), `040000` for subdirectory (tree), `160000` for submodule (commit), or `120000` for a blob that specifies the path of a symlink. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GitCreateTreeRequestMode { #[serde(rename = "040000")] SubdirectoryTree, @@ -29165,6 +28835,7 @@ pub enum GitCreateTreeRequestMode { #[serde(rename = "160000")] SubmoduleCommit, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -29185,11 +28856,6 @@ impl std::fmt::Display for GitCreateTreeRequestMode { } } -impl Default for GitCreateTreeRequestMode { - fn default() -> GitCreateTreeRequestMode { - GitCreateTreeRequestMode::Noop - } -} impl GitCreateTreeRequestMode { pub fn is_noop(&self) -> bool { matches!(self, GitCreateTreeRequestMode::Noop) @@ -29386,9 +29052,9 @@ pub struct ReposUpdateWebhookRequest { } /** -* The originating VCS type. Can be one of `subversion`, `git`, `mercurial`, or `tfvc`. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The originating VCS type. Can be one of `subversion`, `git`, `mercurial`, or `tfvc`. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Vcs { #[serde(rename = "git")] Git, @@ -29399,6 +29065,7 @@ pub enum Vcs { #[serde(rename = "tfvc")] Tfvc, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -29418,11 +29085,6 @@ impl std::fmt::Display for Vcs { } } -impl Default for Vcs { - fn default() -> Vcs { - Vcs::Noop - } -} impl Vcs { pub fn is_noop(&self) -> bool { matches!(self, Vcs::Noop) @@ -29491,15 +29153,16 @@ pub struct MigrationsUpdateImportRequest { } /** -* Can be one of `opt_in` (large files will be stored using Git LFS) or `opt_out` (large files will be removed during the import). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Can be one of `opt_in` (large files will be stored using Git LFS) or `opt_out` (large files will be removed during the import). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UseLfs { #[serde(rename = "opt_in")] OptIn, #[serde(rename = "opt_out")] OptOut, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -29517,11 +29180,6 @@ impl std::fmt::Display for UseLfs { } } -impl Default for UseLfs { - fn default() -> UseLfs { - UseLfs::Noop - } -} impl UseLfs { pub fn is_noop(&self) -> bool { matches!(self, UseLfs::Noop) @@ -29854,13 +29512,13 @@ pub struct IssuesSetLabelsRequestAnyOf { } /** -* The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: -* \* `off-topic` -* \* `too heated` -* \* `resolved` -* \* `spam` -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: + * \* `off-topic` + * \* `too heated` + * \* `resolved` + * \* `spam` + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LockReason { #[serde(rename = "off-topic")] OffTopic, @@ -29871,6 +29529,7 @@ pub enum LockReason { #[serde(rename = "too heated")] TooHeated, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -29890,11 +29549,6 @@ impl std::fmt::Display for LockReason { } } -impl Default for LockReason { - fn default() -> LockReason { - LockReason::Noop - } -} impl LockReason { pub fn is_noop(&self) -> bool { matches!(self, LockReason::Noop) @@ -29992,13 +29646,14 @@ pub struct ReposMergeRequest { } /** -* What to sort results by. Either `due_on` or `completeness`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * What to sort results by. Either `due_on` or `completeness`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuesListMilestonesSort { #[serde(rename = "completeness")] Completeness, #[serde(rename = "due_on")] + #[default] DueOn, #[serde(other)] FallthroughString, @@ -30015,12 +29670,6 @@ impl std::fmt::Display for IssuesListMilestonesSort { } } -impl Default for IssuesListMilestonesSort { - fn default() -> IssuesListMilestonesSort { - IssuesListMilestonesSort::DueOn - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct IssuesCreateMilestoneRequest { #[serde( @@ -30075,11 +29724,12 @@ pub struct PullsUpdateBranchResponse { } /** -* The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`. Default: `/` -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`. Default: `/` + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Path { #[serde(rename = "/")] + #[default] Root, #[serde(rename = "/docs")] Docs, @@ -30098,12 +29748,6 @@ impl std::fmt::Display for Path { } } -impl Default for Path { - fn default() -> Path { - Path::Root - } -} - /// The source branch and directory used to publish your Pages site. #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct ReposCreatePagesSiteRequestSource { @@ -30130,9 +29774,9 @@ pub struct ReposCreatePagesSiteRequest { } /** -* Update the source for the repository. Must include the branch name, and may optionally specify the subdirectory `/docs`. Possible values are `"gh-pages"`, `"master"`, and `"master /docs"`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Update the source for the repository. Must include the branch name, and may optionally specify the subdirectory `/docs`. Possible values are `"gh-pages"`, `"master"`, and `"master /docs"`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SourceData { #[serde(rename = "gh-pages")] GhPages, @@ -30141,6 +29785,7 @@ pub enum SourceData { #[serde(rename = "master /docs")] MasterDocs, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -30159,11 +29804,6 @@ impl std::fmt::Display for SourceData { } } -impl Default for SourceData { - fn default() -> SourceData { - SourceData::Noop - } -} impl SourceData { pub fn is_noop(&self) -> bool { matches!(self, SourceData::Noop) @@ -30222,11 +29862,12 @@ pub struct ReposUpdateInformationAboutPagesSiteRequest { } /** -* What to sort results by. Can be either `created`, `updated`, `popularity` (comment count) or `long-running` (age, filtering by pulls updated in the last month). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * What to sort results by. Can be either `created`, `updated`, `popularity` (comment count) or `long-running` (age, filtering by pulls updated in the last month). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PullsListSort { #[serde(rename = "created")] + #[default] Created, #[serde(rename = "long-running")] LongRunning, @@ -30251,12 +29892,6 @@ impl std::fmt::Display for PullsListSort { } } -impl Default for PullsListSort { - fn default() -> PullsListSort { - PullsListSort::Created - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct PullsCreateRequest { #[serde( @@ -30295,7 +29930,7 @@ pub struct PullsCreateRequest { pub title: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PullsListReviewCommentsRepoSort { #[serde(rename = "created")] Created, @@ -30304,6 +29939,7 @@ pub enum PullsListReviewCommentsRepoSort { #[serde(rename = "updated")] Updated, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -30322,11 +29958,6 @@ impl std::fmt::Display for PullsListReviewCommentsRepoSort { } } -impl Default for PullsListReviewCommentsRepoSort { - fn default() -> PullsListReviewCommentsRepoSort { - PullsListReviewCommentsRepoSort::Noop - } -} impl PullsListReviewCommentsRepoSort { pub fn is_noop(&self) -> bool { matches!(self, PullsListReviewCommentsRepoSort::Noop) @@ -30363,9 +29994,9 @@ pub struct PullsUpdateRequest { } /** -* **Required when using multi-line comments**. To create multi-line comments, you must use the `comfort-fade` preview header. The `start_side` is the starting side of the diff that the comment applies to. Can be `LEFT` or `RIGHT`. To learn more about multi-line comments, see "[Commenting on a pull request](https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. See `side` in this table for additional context. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * **Required when using multi-line comments**. To create multi-line comments, you must use the `comfort-fade` preview header. The `start_side` is the starting side of the diff that the comment applies to. Can be `LEFT` or `RIGHT`. To learn more about multi-line comments, see "[Commenting on a pull request](https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. See `side` in this table for additional context. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PullsCreateReviewCommentRequestStartSide { #[serde(rename = "LEFT")] Left, @@ -30374,6 +30005,7 @@ pub enum PullsCreateReviewCommentRequestStartSide { #[serde(rename = "side")] Side, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -30392,11 +30024,6 @@ impl std::fmt::Display for PullsCreateReviewCommentRequestStartSide { } } -impl Default for PullsCreateReviewCommentRequestStartSide { - fn default() -> PullsCreateReviewCommentRequestStartSide { - PullsCreateReviewCommentRequestStartSide::Noop - } -} impl PullsCreateReviewCommentRequestStartSide { pub fn is_noop(&self) -> bool { matches!(self, PullsCreateReviewCommentRequestStartSide::Noop) @@ -30528,9 +30155,9 @@ pub struct PullsRemoveRequestedReviewersRequest { } /** -* The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. By leaving this blank, you set the review action state to `PENDING`, which means you will need to [submit the pull request review](https://docs.github.com/rest/reference/pulls#submit-a-review-for-a-pull-request) when you are ready. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. By leaving this blank, you set the review action state to `PENDING`, which means you will need to [submit the pull request review](https://docs.github.com/rest/reference/pulls#submit-a-review-for-a-pull-request) when you are ready. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PullsCreateReviewRequestEvent { #[serde(rename = "APPROVE")] Approve, @@ -30539,6 +30166,7 @@ pub enum PullsCreateReviewRequestEvent { #[serde(rename = "REQUEST_CHANGES")] RequestChanges, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -30557,11 +30185,6 @@ impl std::fmt::Display for PullsCreateReviewRequestEvent { } } -impl Default for PullsCreateReviewRequestEvent { - fn default() -> PullsCreateReviewRequestEvent { - PullsCreateReviewRequestEvent::Noop - } -} impl PullsCreateReviewRequestEvent { pub fn is_noop(&self) -> bool { matches!(self, PullsCreateReviewRequestEvent::Noop) @@ -30749,9 +30372,9 @@ pub struct ReposUpdateReleaseAssetRequest { } /** -* The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the release. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the release. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReactionsCreateReleaseRequestContent { #[serde(rename = "+1")] PlusOne, @@ -30766,6 +30389,7 @@ pub enum ReactionsCreateReleaseRequestContent { #[serde(rename = "rocket")] Rocket, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -30787,11 +30411,6 @@ impl std::fmt::Display for ReactionsCreateReleaseRequestContent { } } -impl Default for ReactionsCreateReleaseRequestContent { - fn default() -> ReactionsCreateReleaseRequestContent { - ReactionsCreateReleaseRequestContent::Noop - } -} impl ReactionsCreateReleaseRequestContent { pub fn is_noop(&self) -> bool { matches!(self, ReactionsCreateReleaseRequestContent::Noop) @@ -30837,9 +30456,9 @@ pub struct ActivityListStargazersRepoResponseAnyOf { } /** -* The state of the status. Can be one of `error`, `failure`, `pending`, or `success`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The state of the status. Can be one of `error`, `failure`, `pending`, or `success`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReposCreateCommitStatusRequestState { #[serde(rename = "error")] Error, @@ -30850,6 +30469,7 @@ pub enum ReposCreateCommitStatusRequestState { #[serde(rename = "success")] Success, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -30869,11 +30489,6 @@ impl std::fmt::Display for ReposCreateCommitStatusRequestState { } } -impl Default for ReposCreateCommitStatusRequestState { - fn default() -> ReposCreateCommitStatusRequestState { - ReposCreateCommitStatusRequestState::Noop - } -} impl ReposCreateCommitStatusRequestState { pub fn is_noop(&self) -> bool { matches!(self, ReposCreateCommitStatusRequestState::Noop) @@ -30989,7 +30604,7 @@ pub struct EnterpriseAdminProvisionInviteGroupRequest { pub schemas: Vec, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EnterpriseAdminUpdateAttributeGroupRequestOperationsOp { #[serde(rename = "Add")] Add, @@ -30998,6 +30613,7 @@ pub enum EnterpriseAdminUpdateAttributeGroupRequestOperationsOp { #[serde(rename = "Replace")] Replace, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -31016,11 +30632,6 @@ impl std::fmt::Display for EnterpriseAdminUpdateAttributeGroupRequestOperationsO } } -impl Default for EnterpriseAdminUpdateAttributeGroupRequestOperationsOp { - fn default() -> EnterpriseAdminUpdateAttributeGroupRequestOperationsOp { - EnterpriseAdminUpdateAttributeGroupRequestOperationsOp::Noop - } -} impl EnterpriseAdminUpdateAttributeGroupRequestOperationsOp { pub fn is_noop(&self) -> bool { matches!( @@ -31349,13 +30960,14 @@ pub struct ScimUpdateAttributeUserRequest { } /** -* Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SearchCodeSort { #[serde(rename = "indexed")] Indexed, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -31372,11 +30984,6 @@ impl std::fmt::Display for SearchCodeSort { } } -impl Default for SearchCodeSort { - fn default() -> SearchCodeSort { - SearchCodeSort::Noop - } -} impl SearchCodeSort { pub fn is_noop(&self) -> bool { matches!(self, SearchCodeSort::Noop) @@ -31405,15 +31012,16 @@ pub struct SearchCodeResponse { } /** -* Sorts the results of your query by `author-date` or `committer-date`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Sorts the results of your query by `author-date` or `committer-date`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SearchCommitsSort { #[serde(rename = "author-date")] AuthorDate, #[serde(rename = "committer-date")] CommitterDate, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -31431,11 +31039,6 @@ impl std::fmt::Display for SearchCommitsSort { } } -impl Default for SearchCommitsSort { - fn default() -> SearchCommitsSort { - SearchCommitsSort::Noop - } -} impl SearchCommitsSort { pub fn is_noop(&self) -> bool { matches!(self, SearchCommitsSort::Noop) @@ -31464,9 +31067,9 @@ pub struct SearchCommitsResponse { } /** -* Sorts the results of your query by the number of `comments`, `reactions`, `reactions-+1`, `reactions--1`, `reactions-smile`, `reactions-thinking_face`, `reactions-heart`, `reactions-tada`, or `interactions`. You can also sort results by how recently the items were `created` or `updated`, Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Sorts the results of your query by the number of `comments`, `reactions`, `reactions-+1`, `reactions--1`, `reactions-smile`, `reactions-thinking_face`, `reactions-heart`, `reactions-tada`, or `interactions`. You can also sort results by how recently the items were `created` or `updated`, Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SearchIssuesPullRequestsSort { #[serde(rename = "comments")] Comments, @@ -31491,6 +31094,7 @@ pub enum SearchIssuesPullRequestsSort { #[serde(rename = "updated")] Updated, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -31517,11 +31121,6 @@ impl std::fmt::Display for SearchIssuesPullRequestsSort { } } -impl Default for SearchIssuesPullRequestsSort { - fn default() -> SearchIssuesPullRequestsSort { - SearchIssuesPullRequestsSort::Noop - } -} impl SearchIssuesPullRequestsSort { pub fn is_noop(&self) -> bool { matches!(self, SearchIssuesPullRequestsSort::Noop) @@ -31571,9 +31170,9 @@ pub struct SearchLabelsResponse { } /** -* Sorts the results of your query by number of `stars`, `forks`, or `help-wanted-issues` or how recently the items were `updated`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Sorts the results of your query by number of `stars`, `forks`, or `help-wanted-issues` or how recently the items were `updated`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SearchReposSort { #[serde(rename = "forks")] Forks, @@ -31584,6 +31183,7 @@ pub enum SearchReposSort { #[serde(rename = "updated")] Updated, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -31603,11 +31203,6 @@ impl std::fmt::Display for SearchReposSort { } } -impl Default for SearchReposSort { - fn default() -> SearchReposSort { - SearchReposSort::Noop - } -} impl SearchReposSort { pub fn is_noop(&self) -> bool { matches!(self, SearchReposSort::Noop) @@ -31657,9 +31252,9 @@ pub struct SearchTopicsResponse { } /** -* Sorts the results of your query by number of `followers` or `repositories`, or when the person `joined` GitHub. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Sorts the results of your query by number of `followers` or `repositories`, or when the person `joined` GitHub. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SearchUsersSort { #[serde(rename = "followers")] Followers, @@ -31668,6 +31263,7 @@ pub enum SearchUsersSort { #[serde(rename = "repositories")] Repositories, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -31686,11 +31282,6 @@ impl std::fmt::Display for SearchUsersSort { } } -impl Default for SearchUsersSort { - fn default() -> SearchUsersSort { - SearchUsersSort::Noop - } -} impl SearchUsersSort { pub fn is_noop(&self) -> bool { matches!(self, SearchUsersSort::Noop) @@ -31998,13 +31589,14 @@ pub struct UsersCreatePublicSshKeyAuthenticatedRequest { } /** -* The state that the membership should be in. Only `"active"` will be accepted. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The state that the membership should be in. Only `"active"` will be accepted. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OrgsUpdateMembershipRequestState { #[serde(rename = "active")] Active, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -32021,11 +31613,6 @@ impl std::fmt::Display for OrgsUpdateMembershipRequestState { } } -impl Default for OrgsUpdateMembershipRequestState { - fn default() -> OrgsUpdateMembershipRequestState { - OrgsUpdateMembershipRequestState::Noop - } -} impl OrgsUpdateMembershipRequestState { pub fn is_noop(&self) -> bool { matches!(self, OrgsUpdateMembershipRequestState::Noop) @@ -32045,11 +31632,12 @@ pub struct OrgsUpdateMembershipRequest { } /** -* Can be one of `all`, `public`, or `private`. Note: For GitHub AE, can be one of `all`, `internal`, or `private`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Can be one of `all`, `public`, or `private`. Note: For GitHub AE, can be one of `all`, `internal`, or `private`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReposListVisibility { #[serde(rename = "all")] + #[default] All, #[serde(rename = "private")] Private, @@ -32071,20 +31659,15 @@ impl std::fmt::Display for ReposListVisibility { } } -impl Default for ReposListVisibility { - fn default() -> ReposListVisibility { - ReposListVisibility::All - } -} - /** -* Can be one of `all`, `owner`, `public`, `private`, `member`. Note: For GitHub AE, can be one of `all`, `owner`, `internal`, `private`, `member`. Default: `all` -* -* Will cause a `422` error if used in the same request as **visibility** or **affiliation**. Will cause a `422` error if used in the same request as **visibility** or **affiliation**. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Can be one of `all`, `owner`, `public`, `private`, `member`. Note: For GitHub AE, can be one of `all`, `owner`, `internal`, `private`, `member`. Default: `all` + * + * Will cause a `422` error if used in the same request as **visibility** or **affiliation**. Will cause a `422` error if used in the same request as **visibility** or **affiliation**. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReposListType { #[serde(rename = "all")] + #[default] All, #[serde(rename = "member")] Member, @@ -32112,12 +31695,6 @@ impl std::fmt::Display for ReposListType { } } -impl Default for ReposListType { - fn default() -> ReposListType { - ReposListType::All - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct ReposCreateRequest { #[serde(default, skip_serializing_if = "Option::is_none")] @@ -32183,9 +31760,9 @@ pub struct ReposCreateRequest { } /** -* Identifies which additional information you'd like to receive about the person's hovercard. Can be `organization`, `repository`, `issue`, `pull_request`. **Required** when using `subject_id`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Identifies which additional information you'd like to receive about the person's hovercard. Can be `organization`, `repository`, `issue`, `pull_request`. **Required** when using `subject_id`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SubjectType { #[serde(rename = "issue")] Issue, @@ -32196,6 +31773,7 @@ pub enum SubjectType { #[serde(rename = "repository")] Repository, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -32215,11 +31793,6 @@ impl std::fmt::Display for SubjectType { } } -impl Default for SubjectType { - fn default() -> SubjectType { - SubjectType::Noop - } -} impl SubjectType { pub fn is_noop(&self) -> bool { matches!(self, SubjectType::Noop) @@ -32227,15 +31800,16 @@ impl SubjectType { } /** -* Can be one of `all`, `owner`, `member`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Can be one of `all`, `owner`, `member`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReposListUserType { #[serde(rename = "all")] All, #[serde(rename = "member")] Member, #[serde(rename = "owner")] + #[default] Owner, #[serde(other)] FallthroughString, @@ -32253,12 +31827,6 @@ impl std::fmt::Display for ReposListUserType { } } -impl Default for ReposListUserType { - fn default() -> ReposListUserType { - ReposListUserType::Owner - } -} - /// All of the following types are flattened into one object: /// /// - `Vec` diff --git a/github/src/utils.rs b/github/src/utils.rs index b444cd8e..0efcaa1b 100644 --- a/github/src/utils.rs +++ b/github/src/utils.rs @@ -48,20 +48,15 @@ pub fn get_header_values( /// GitHub defined Media types /// See [this doc](https://developer.github.com/v3/media/) for more for more information -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Default)] pub enum MediaType { /// Return json (the default) + #[default] Json, /// Return json in preview form Preview(&'static str), } -impl Default for MediaType { - fn default() -> MediaType { - MediaType::Json - } -} - impl std::fmt::Display for MediaType { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { diff --git a/google/admin/src/types.rs b/google/admin/src/types.rs index a5847be1..b4db1428 100644 --- a/google/admin/src/types.rs +++ b/google/admin/src/types.rs @@ -183,9 +183,9 @@ pub struct Asps { } /** -* Message severity -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Message severity + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Severity { #[serde(rename = "SEVERITY_ERROR")] SeverityError, @@ -196,6 +196,7 @@ pub enum Severity { #[serde(rename = "SEVERITY_WARNING")] SeverityWarning, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -215,11 +216,6 @@ impl std::fmt::Display for Severity { } } -impl Default for Severity { - fn default() -> Severity { - Severity::Noop - } -} impl Severity { pub fn is_noop(&self) -> bool { matches!(self, Severity::Noop) @@ -1695,9 +1691,9 @@ pub struct CustomerPostalAddress { } /** -* Indicates the command state. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Indicates the command state. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum State { #[serde(rename = "ACKED_BY_CLIENT")] AckedByClient, @@ -1714,6 +1710,7 @@ pub enum State { #[serde(rename = "STATE_UNSPECIFIED")] StateUnspecified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1736,11 +1733,6 @@ impl std::fmt::Display for State { } } -impl Default for State { - fn default() -> State { - State::Noop - } -} impl State { pub fn is_noop(&self) -> bool { matches!(self, State::Noop) @@ -1748,9 +1740,9 @@ impl State { } /** -* The type of the command. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of the command. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Type { #[serde(rename = "COMMAND_TYPE_UNSPECIFIED")] CommandTypeUnspecified, @@ -1765,6 +1757,7 @@ pub enum Type { #[serde(rename = "WIPE_USERS")] WipeUsers, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1786,11 +1779,6 @@ impl std::fmt::Display for Type { } } -impl Default for Type { - fn default() -> Type { - Type::Noop - } -} impl Type { pub fn is_noop(&self) -> bool { matches!(self, Type::Noop) @@ -1861,9 +1849,9 @@ pub struct DirectoryChromeosdevicesCommand { } /** -* The result of the command. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The result of the command. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Result { #[serde(rename = "COMMAND_RESULT_TYPE_UNSPECIFIED")] CommandResultTypeUnspecified, @@ -1874,6 +1862,7 @@ pub enum Result { #[serde(rename = "SUCCESS")] Success, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1893,11 +1882,6 @@ impl std::fmt::Display for Result { } } -impl Default for Result { - fn default() -> Result { - Result::Noop - } -} impl Result { pub fn is_noop(&self) -> bool { matches!(self, Result::Noop) @@ -2136,9 +2120,9 @@ pub struct Domains2 { pub struct Empty {} /** -* Canonical code for why the update failed to apply. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Canonical code for why the update failed to apply. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ErrorCode { #[serde(rename = "ABORTED")] Aborted, @@ -2175,6 +2159,7 @@ pub enum ErrorCode { #[serde(rename = "UNKNOWN")] Unknown, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2207,11 +2192,6 @@ impl std::fmt::Display for ErrorCode { } } -impl Default for ErrorCode { - fn default() -> ErrorCode { - ErrorCode::Noop - } -} impl ErrorCode { pub fn is_noop(&self) -> bool { matches!(self, ErrorCode::Noop) @@ -5468,15 +5448,16 @@ pub struct VerificationCodes { } /** -* V1 error format. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * V1 error format. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Xgafv { #[serde(rename = "1")] One, #[serde(rename = "2")] Two, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5494,11 +5475,6 @@ impl std::fmt::Display for Xgafv { } } -impl Default for Xgafv { - fn default() -> Xgafv { - Xgafv::Noop - } -} impl Xgafv { pub fn is_noop(&self) -> bool { matches!(self, Xgafv::Noop) @@ -5506,9 +5482,9 @@ impl Xgafv { } /** -* Data format for response. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Data format for response. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Alt { #[serde(rename = "json")] Json, @@ -5517,6 +5493,7 @@ pub enum Alt { #[serde(rename = "proto")] Proto, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5535,11 +5512,6 @@ impl std::fmt::Display for Alt { } } -impl Default for Alt { - fn default() -> Alt { - Alt::Noop - } -} impl Alt { pub fn is_noop(&self) -> bool { matches!(self, Alt::Noop) @@ -5547,9 +5519,9 @@ impl Alt { } /** -* Device property to use for sorting results. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Device property to use for sorting results. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OrderBy { #[serde(rename = "annotatedLocation")] AnnotatedLocation, @@ -5566,6 +5538,7 @@ pub enum OrderBy { #[serde(rename = "supportEndDate")] SupportEndDate, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5588,11 +5561,6 @@ impl std::fmt::Display for OrderBy { } } -impl Default for OrderBy { - fn default() -> OrderBy { - OrderBy::Noop - } -} impl OrderBy { pub fn is_noop(&self) -> bool { matches!(self, OrderBy::Noop) @@ -5600,15 +5568,16 @@ impl OrderBy { } /** -* Restrict information returned to a set of selected fields. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Restrict information returned to a set of selected fields. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Projection { #[serde(rename = "BASIC")] Basic, #[serde(rename = "FULL")] Full, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5626,11 +5595,6 @@ impl std::fmt::Display for Projection { } } -impl Default for Projection { - fn default() -> Projection { - Projection::Noop - } -} impl Projection { pub fn is_noop(&self) -> bool { matches!(self, Projection::Noop) @@ -5638,15 +5602,16 @@ impl Projection { } /** -* Whether to return results in ascending or descending order. Must be used with the `orderBy` parameter. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether to return results in ascending or descending order. Must be used with the `orderBy` parameter. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SortOrder { #[serde(rename = "ASCENDING")] Ascending, #[serde(rename = "DESCENDING")] Descending, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5664,11 +5629,6 @@ impl std::fmt::Display for SortOrder { } } -impl Default for SortOrder { - fn default() -> SortOrder { - SortOrder::Noop - } -} impl SortOrder { pub fn is_noop(&self) -> bool { matches!(self, SortOrder::Noop) @@ -5676,9 +5636,9 @@ impl SortOrder { } /** -* Device property to use for sorting results. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Device property to use for sorting results. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DirectoryMobiledevicesListOrderBy { #[serde(rename = "deviceId")] DeviceId, @@ -5697,6 +5657,7 @@ pub enum DirectoryMobiledevicesListOrderBy { #[serde(rename = "type")] Type, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5720,11 +5681,6 @@ impl std::fmt::Display for DirectoryMobiledevicesListOrderBy { } } -impl Default for DirectoryMobiledevicesListOrderBy { - fn default() -> DirectoryMobiledevicesListOrderBy { - DirectoryMobiledevicesListOrderBy::Noop - } -} impl DirectoryMobiledevicesListOrderBy { pub fn is_noop(&self) -> bool { matches!(self, DirectoryMobiledevicesListOrderBy::Noop) @@ -5732,15 +5688,16 @@ impl DirectoryMobiledevicesListOrderBy { } /** -* Whether to return all sub-organizations or just immediate children. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether to return all sub-organizations or just immediate children. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DirectoryOrgunitsListType { #[serde(rename = "all")] All, #[serde(rename = "children")] Children, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5758,11 +5715,6 @@ impl std::fmt::Display for DirectoryOrgunitsListType { } } -impl Default for DirectoryOrgunitsListType { - fn default() -> DirectoryOrgunitsListType { - DirectoryOrgunitsListType::Noop - } -} impl DirectoryOrgunitsListType { pub fn is_noop(&self) -> bool { matches!(self, DirectoryOrgunitsListType::Noop) @@ -5770,9 +5722,9 @@ impl DirectoryOrgunitsListType { } /** -* Source from which Building.coordinates are derived. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Source from which Building.coordinates are derived. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CoordinatesSource { #[serde(rename = "CLIENT_SPECIFIED")] ClientSpecified, @@ -5781,6 +5733,7 @@ pub enum CoordinatesSource { #[serde(rename = "SOURCE_UNSPECIFIED")] SourceUnspecified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5799,11 +5752,6 @@ impl std::fmt::Display for CoordinatesSource { } } -impl Default for CoordinatesSource { - fn default() -> CoordinatesSource { - CoordinatesSource::Noop - } -} impl CoordinatesSource { pub fn is_noop(&self) -> bool { matches!(self, CoordinatesSource::Noop) @@ -5811,13 +5759,14 @@ impl CoordinatesSource { } /** -* Column to use for sorting results -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Column to use for sorting results + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DirectoryGroupsListOrderBy { #[serde(rename = "email")] Email, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5834,11 +5783,6 @@ impl std::fmt::Display for DirectoryGroupsListOrderBy { } } -impl Default for DirectoryGroupsListOrderBy { - fn default() -> DirectoryGroupsListOrderBy { - DirectoryGroupsListOrderBy::Noop - } -} impl DirectoryGroupsListOrderBy { pub fn is_noop(&self) -> bool { matches!(self, DirectoryGroupsListOrderBy::Noop) @@ -5846,9 +5790,9 @@ impl DirectoryGroupsListOrderBy { } /** -* Event on which subscription is intended (if subscribing) -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Event on which subscription is intended (if subscribing) + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Event { #[serde(rename = "add")] Add, @@ -5861,6 +5805,7 @@ pub enum Event { #[serde(rename = "update")] Update, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5881,11 +5826,6 @@ impl std::fmt::Display for Event { } } -impl Default for Event { - fn default() -> Event { - Event::Noop - } -} impl Event { pub fn is_noop(&self) -> bool { matches!(self, Event::Noop) @@ -5893,9 +5833,9 @@ impl Event { } /** -* Property to use for sorting results. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Property to use for sorting results. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DirectoryUsersListOrderBy { #[serde(rename = "email")] Email, @@ -5904,6 +5844,7 @@ pub enum DirectoryUsersListOrderBy { #[serde(rename = "givenName")] GivenName, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5922,11 +5863,6 @@ impl std::fmt::Display for DirectoryUsersListOrderBy { } } -impl Default for DirectoryUsersListOrderBy { - fn default() -> DirectoryUsersListOrderBy { - DirectoryUsersListOrderBy::Noop - } -} impl DirectoryUsersListOrderBy { pub fn is_noop(&self) -> bool { matches!(self, DirectoryUsersListOrderBy::Noop) @@ -5934,9 +5870,9 @@ impl DirectoryUsersListOrderBy { } /** -* What subset of fields to fetch for this user. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * What subset of fields to fetch for this user. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DirectoryUsersListProjection { #[serde(rename = "basic")] Basic, @@ -5945,6 +5881,7 @@ pub enum DirectoryUsersListProjection { #[serde(rename = "full")] Full, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5963,11 +5900,6 @@ impl std::fmt::Display for DirectoryUsersListProjection { } } -impl Default for DirectoryUsersListProjection { - fn default() -> DirectoryUsersListProjection { - DirectoryUsersListProjection::Noop - } -} impl DirectoryUsersListProjection { pub fn is_noop(&self) -> bool { matches!(self, DirectoryUsersListProjection::Noop) @@ -5975,15 +5907,16 @@ impl DirectoryUsersListProjection { } /** -* Whether to fetch the administrator-only or domain-wide public view of the user. For more information, see [Retrieve a user as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether to fetch the administrator-only or domain-wide public view of the user. For more information, see [Retrieve a user as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ViewType { #[serde(rename = "admin_view")] AdminView, #[serde(rename = "domain_public")] DomainPublic, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6001,11 +5934,6 @@ impl std::fmt::Display for ViewType { } } -impl Default for ViewType { - fn default() -> ViewType { - ViewType::Noop - } -} impl ViewType { pub fn is_noop(&self) -> bool { matches!(self, ViewType::Noop) @@ -6013,15 +5941,16 @@ impl ViewType { } /** -* Events to watch for. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Events to watch for. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DirectoryUsersAliasesListEvent { #[serde(rename = "add")] Add, #[serde(rename = "delete")] Delete, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6039,11 +5968,6 @@ impl std::fmt::Display for DirectoryUsersAliasesListEvent { } } -impl Default for DirectoryUsersAliasesListEvent { - fn default() -> DirectoryUsersAliasesListEvent { - DirectoryUsersAliasesListEvent::Noop - } -} impl DirectoryUsersAliasesListEvent { pub fn is_noop(&self) -> bool { matches!(self, DirectoryUsersAliasesListEvent::Noop) diff --git a/google/calendar/src/types.rs b/google/calendar/src/types.rs index 430cb368..b5912c5b 100644 --- a/google/calendar/src/types.rs +++ b/google/calendar/src/types.rs @@ -2060,13 +2060,14 @@ pub struct TimePeriod { } /** -* Data format for the response. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Data format for the response. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Alt { #[serde(rename = "json")] Json, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2083,11 +2084,6 @@ impl std::fmt::Display for Alt { } } -impl Default for Alt { - fn default() -> Alt { - Alt::Noop - } -} impl Alt { pub fn is_noop(&self) -> bool { matches!(self, Alt::Noop) @@ -2095,15 +2091,16 @@ impl Alt { } /** -* The order of the events returned in the result. Optional. The default is an unspecified, stable order. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The order of the events returned in the result. Optional. The default is an unspecified, stable order. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OrderBy { #[serde(rename = "startTime")] StartTime, #[serde(rename = "updated")] Updated, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2121,11 +2118,6 @@ impl std::fmt::Display for OrderBy { } } -impl Default for OrderBy { - fn default() -> OrderBy { - OrderBy::Noop - } -} impl OrderBy { pub fn is_noop(&self) -> bool { matches!(self, OrderBy::Noop) @@ -2133,9 +2125,9 @@ impl OrderBy { } /** -* Whether to send notifications about the creation of the new event. Note that some emails might still be sent. The default is false. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether to send notifications about the creation of the new event. Note that some emails might still be sent. The default is false. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SendUpdates { #[serde(rename = "all")] All, @@ -2144,6 +2136,7 @@ pub enum SendUpdates { #[serde(rename = "none")] None, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2162,11 +2155,6 @@ impl std::fmt::Display for SendUpdates { } } -impl Default for SendUpdates { - fn default() -> SendUpdates { - SendUpdates::Noop - } -} impl SendUpdates { pub fn is_noop(&self) -> bool { matches!(self, SendUpdates::Noop) @@ -2174,9 +2162,9 @@ impl SendUpdates { } /** -* The minimum access role for the user in the returned entries. Optional. The default is no restriction. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The minimum access role for the user in the returned entries. Optional. The default is no restriction. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MinAccessRole { #[serde(rename = "freeBusyReader")] FreeBusyReader, @@ -2187,6 +2175,7 @@ pub enum MinAccessRole { #[serde(rename = "writer")] Writer, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2206,11 +2195,6 @@ impl std::fmt::Display for MinAccessRole { } } -impl Default for MinAccessRole { - fn default() -> MinAccessRole { - MinAccessRole::Noop - } -} impl MinAccessRole { pub fn is_noop(&self) -> bool { matches!(self, MinAccessRole::Noop) diff --git a/google/cloud-resource-manager/src/types.rs b/google/cloud-resource-manager/src/types.rs index 990a7fdb..c81bef65 100644 --- a/google/cloud-resource-manager/src/types.rs +++ b/google/cloud-resource-manager/src/types.rs @@ -27,9 +27,9 @@ pub struct AuditConfig { } /** -* The log type that this config enables. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The log type that this config enables. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LogType { #[serde(rename = "ADMIN_READ")] AdminRead, @@ -40,6 +40,7 @@ pub enum LogType { #[serde(rename = "LOG_TYPE_UNSPECIFIED")] LogTypeUnspecified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -59,11 +60,6 @@ impl std::fmt::Display for LogType { } } -impl Default for LogType { - fn default() -> LogType { - LogType::Noop - } -} impl LogType { pub fn is_noop(&self) -> bool { matches!(self, LogType::Noop) @@ -119,9 +115,9 @@ pub struct Binding { } /** -* The type of this operation. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of this operation. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OperationType { #[serde(rename = "CREATE")] Create, @@ -130,6 +126,7 @@ pub enum OperationType { #[serde(rename = "OPERATION_TYPE_UNSPECIFIED")] OperationTypeUnspecified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -148,11 +145,6 @@ impl std::fmt::Display for OperationType { } } -impl Default for OperationType { - fn default() -> OperationType { - OperationType::Noop - } -} impl OperationType { pub fn is_noop(&self) -> bool { matches!(self, OperationType::Noop) @@ -304,9 +296,9 @@ pub struct Expr { } /** -* Output only. The lifecycle state of the folder. Updates to the lifecycle_state must be performed via DeleteFolder and UndeleteFolder. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Output only. The lifecycle state of the folder. Updates to the lifecycle_state must be performed via DeleteFolder and UndeleteFolder. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LifecycleState { #[serde(rename = "ACTIVE")] Active, @@ -315,6 +307,7 @@ pub enum LifecycleState { #[serde(rename = "LIFECYCLE_STATE_UNSPECIFIED")] LifecycleStateUnspecified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -333,11 +326,6 @@ impl std::fmt::Display for LifecycleState { } } -impl Default for LifecycleState { - fn default() -> LifecycleState { - LifecycleState::Noop - } -} impl LifecycleState { pub fn is_noop(&self) -> bool { matches!(self, LifecycleState::Noop) @@ -397,9 +385,9 @@ pub struct Folder { } /** -* The type of operation error experienced. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of operation error experienced. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ErrorMessageId { #[serde(rename = "ACTIVE_FOLDER_HEIGHT_VIOLATION")] ActiveFolderHeightViolation, @@ -422,6 +410,7 @@ pub enum ErrorMessageId { #[serde(rename = "RESOURCE_DELETED_VIOLATION")] ResourceDeletedViolation, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -449,11 +438,6 @@ impl std::fmt::Display for ErrorMessageId { } } -impl Default for ErrorMessageId { - fn default() -> ErrorMessageId { - ErrorMessageId::Noop - } -} impl ErrorMessageId { pub fn is_noop(&self) -> bool { matches!(self, ErrorMessageId::Noop) @@ -787,15 +771,16 @@ pub struct TestIamPermissionsResponse { } /** -* V1 error format. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * V1 error format. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Xgafv { #[serde(rename = "1")] One, #[serde(rename = "2")] Two, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -813,11 +798,6 @@ impl std::fmt::Display for Xgafv { } } -impl Default for Xgafv { - fn default() -> Xgafv { - Xgafv::Noop - } -} impl Xgafv { pub fn is_noop(&self) -> bool { matches!(self, Xgafv::Noop) @@ -825,9 +805,9 @@ impl Xgafv { } /** -* Data format for response. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Data format for response. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Alt { #[serde(rename = "json")] Json, @@ -836,6 +816,7 @@ pub enum Alt { #[serde(rename = "proto")] Proto, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -854,11 +835,6 @@ impl std::fmt::Display for Alt { } } -impl Default for Alt { - fn default() -> Alt { - Alt::Noop - } -} impl Alt { pub fn is_noop(&self) -> bool { matches!(self, Alt::Noop) diff --git a/google/drive/src/types.rs b/google/drive/src/types.rs index 6c4954a6..22f7bcbb 100644 --- a/google/drive/src/types.rs +++ b/google/drive/src/types.rs @@ -3254,13 +3254,14 @@ pub struct User { } /** -* Data format for the response. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Data format for the response. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Alt { #[serde(rename = "json")] Json, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3277,11 +3278,6 @@ impl std::fmt::Display for Alt { } } -impl Default for Alt { - fn default() -> Alt { - Alt::Noop - } -} impl Alt { pub fn is_noop(&self) -> bool { matches!(self, Alt::Noop) @@ -3289,15 +3285,16 @@ impl Alt { } /** -* The source of files to list. Deprecated: use 'corpora' instead. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The source of files to list. Deprecated: use 'corpora' instead. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Corpus { #[serde(rename = "domain")] Domain, #[serde(rename = "user")] User, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3315,11 +3312,6 @@ impl std::fmt::Display for Corpus { } } -impl Default for Corpus { - fn default() -> Corpus { - Corpus::Noop - } -} impl Corpus { pub fn is_noop(&self) -> bool { matches!(self, Corpus::Noop) diff --git a/google/groups-settings/src/types.rs b/google/groups-settings/src/types.rs index 00c20326..3c9a8505 100644 --- a/google/groups-settings/src/types.rs +++ b/google/groups-settings/src/types.rs @@ -623,15 +623,16 @@ pub struct Groups { } /** -* Data format for the response. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Data format for the response. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Alt { #[serde(rename = "atom")] Atom, #[serde(rename = "json")] Json, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -649,11 +650,6 @@ impl std::fmt::Display for Alt { } } -impl Default for Alt { - fn default() -> Alt { - Alt::Noop - } -} impl Alt { pub fn is_noop(&self) -> bool { matches!(self, Alt::Noop) diff --git a/google/sheets/src/types.rs b/google/sheets/src/types.rs index b42ff1ad..d001d948 100644 --- a/google/sheets/src/types.rs +++ b/google/sheets/src/types.rs @@ -281,9 +281,9 @@ pub struct AppendCellsRequest { } /** -* Whether rows or columns should be appended. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether rows or columns should be appended. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Dimension { #[serde(rename = "COLUMNS")] Columns, @@ -292,6 +292,7 @@ pub enum Dimension { #[serde(rename = "ROWS")] Rows, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -310,11 +311,6 @@ impl std::fmt::Display for Dimension { } } -impl Default for Dimension { - fn default() -> Dimension { - Dimension::Noop - } -} impl Dimension { pub fn is_noop(&self) -> bool { matches!(self, Dimension::Noop) @@ -543,9 +539,9 @@ pub struct BandingProperties { } /** -* The comparison type of key value with baseline value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The comparison type of key value with baseline value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ComparisonType { #[serde(rename = "ABSOLUTE_DIFFERENCE")] AbsoluteDifference, @@ -554,6 +550,7 @@ pub enum ComparisonType { #[serde(rename = "PERCENTAGE_DIFFERENCE")] PercentageDifference, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -572,11 +569,6 @@ impl std::fmt::Display for ComparisonType { } } -impl Default for ComparisonType { - fn default() -> ComparisonType { - ComparisonType::Noop - } -} impl ComparisonType { pub fn is_noop(&self) -> bool { matches!(self, ComparisonType::Noop) @@ -657,9 +649,9 @@ pub struct BaselineValueFormat { } /** -* The position of this axis. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The position of this axis. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Position { #[serde(rename = "BASIC_CHART_AXIS_POSITION_UNSPECIFIED")] BasicChartAxisPositionUnspecified, @@ -670,6 +662,7 @@ pub enum Position { #[serde(rename = "RIGHT_AXIS")] RightAxis, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -689,11 +682,6 @@ impl std::fmt::Display for Position { } } -impl Default for Position { - fn default() -> Position { - Position::Noop - } -} impl Position { pub fn is_noop(&self) -> bool { matches!(self, Position::Noop) @@ -761,9 +749,9 @@ pub struct BasicChartDomain { } /** -* The type of this series. Valid only if the chartType is COMBO. Different types will change the way the series is visualized. Only LINE, AREA, and COLUMN are supported. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of this series. Valid only if the chartType is COMBO. Different types will change the way the series is visualized. Only LINE, AREA, and COLUMN are supported. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Type { #[serde(rename = "AREA")] Area, @@ -782,6 +770,7 @@ pub enum Type { #[serde(rename = "STEPPED_AREA")] SteppedArea, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -805,11 +794,6 @@ impl std::fmt::Display for Type { } } -impl Default for Type { - fn default() -> Type { - Type::Noop - } -} impl Type { pub fn is_noop(&self) -> bool { matches!(self, Type::Noop) @@ -884,9 +868,9 @@ pub struct BasicChartSeries { } /** -* The behavior of tooltips and data highlighting when hovering on data and chart area. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The behavior of tooltips and data highlighting when hovering on data and chart area. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CompareMode { #[serde(rename = "BASIC_CHART_COMPARE_MODE_UNSPECIFIED")] BasicChartCompareModeUnspecified, @@ -895,6 +879,7 @@ pub enum CompareMode { #[serde(rename = "DATUM")] Datum, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -913,11 +898,6 @@ impl std::fmt::Display for CompareMode { } } -impl Default for CompareMode { - fn default() -> CompareMode { - CompareMode::Noop - } -} impl CompareMode { pub fn is_noop(&self) -> bool { matches!(self, CompareMode::Noop) @@ -925,9 +905,9 @@ impl CompareMode { } /** -* The position of the chart legend. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The position of the chart legend. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LegendPosition { #[serde(rename = "BASIC_CHART_LEGEND_POSITION_UNSPECIFIED")] BasicChartLegendPositionUnspecified, @@ -942,6 +922,7 @@ pub enum LegendPosition { #[serde(rename = "TOP_LEGEND")] TopLegend, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -965,11 +946,6 @@ impl std::fmt::Display for LegendPosition { } } -impl Default for LegendPosition { - fn default() -> LegendPosition { - LegendPosition::Noop - } -} impl LegendPosition { pub fn is_noop(&self) -> bool { matches!(self, LegendPosition::Noop) @@ -977,9 +953,9 @@ impl LegendPosition { } /** -* The stacked type for charts that support vertical stacking. Applies to Area, Bar, Column, Combo, and Stepped Area charts. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The stacked type for charts that support vertical stacking. Applies to Area, Bar, Column, Combo, and Stepped Area charts. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum StackedType { #[serde(rename = "BASIC_CHART_STACKED_TYPE_UNSPECIFIED")] BasicChartStackedTypeUnspecified, @@ -990,6 +966,7 @@ pub enum StackedType { #[serde(rename = "STACKED")] Stacked, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1009,11 +986,6 @@ impl std::fmt::Display for StackedType { } } -impl Default for StackedType { - fn default() -> StackedType { - StackedType::Noop - } -} impl StackedType { pub fn is_noop(&self) -> bool { matches!(self, StackedType::Noop) @@ -1282,15 +1254,16 @@ pub struct BatchClearValuesResponse { } /** -* How dates, times, and durations should be represented in the output. This is ignored if value_render_option is FORMATTED_VALUE. The default dateTime render option is SERIAL_NUMBER. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * How dates, times, and durations should be represented in the output. This is ignored if value_render_option is FORMATTED_VALUE. The default dateTime render option is SERIAL_NUMBER. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DateTimeRenderOption { #[serde(rename = "FORMATTED_STRING")] FormattedString, #[serde(rename = "SERIAL_NUMBER")] SerialNumber, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1308,11 +1281,6 @@ impl std::fmt::Display for DateTimeRenderOption { } } -impl Default for DateTimeRenderOption { - fn default() -> DateTimeRenderOption { - DateTimeRenderOption::Noop - } -} impl DateTimeRenderOption { pub fn is_noop(&self) -> bool { matches!(self, DateTimeRenderOption::Noop) @@ -1320,9 +1288,9 @@ impl DateTimeRenderOption { } /** -* How values should be represented in the output. The default render option is FORMATTED_VALUE. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * How values should be represented in the output. The default render option is FORMATTED_VALUE. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ValueRenderOption { #[serde(rename = "FORMATTED_VALUE")] FormattedValue, @@ -1331,6 +1299,7 @@ pub enum ValueRenderOption { #[serde(rename = "UNFORMATTED_VALUE")] UnformattedValue, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1349,11 +1318,6 @@ impl std::fmt::Display for ValueRenderOption { } } -impl Default for ValueRenderOption { - fn default() -> ValueRenderOption { - ValueRenderOption::Noop - } -} impl ValueRenderOption { pub fn is_noop(&self) -> bool { matches!(self, ValueRenderOption::Noop) @@ -1528,9 +1492,9 @@ pub struct BatchUpdateSpreadsheetResponse { } /** -* How the input data should be interpreted. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * How the input data should be interpreted. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ValueInputOption { #[serde(rename = "INPUT_VALUE_OPTION_UNSPECIFIED")] InputValueOptionUnspecified, @@ -1539,6 +1503,7 @@ pub enum ValueInputOption { #[serde(rename = "USER_ENTERED")] UserEntered, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1557,11 +1522,6 @@ impl std::fmt::Display for ValueInputOption { } } -impl Default for ValueInputOption { - fn default() -> ValueInputOption { - ValueInputOption::Noop - } -} impl ValueInputOption { pub fn is_noop(&self) -> bool { matches!(self, ValueInputOption::Noop) @@ -1872,9 +1832,9 @@ pub struct BigQueryTableSpec { } /** -* The type of condition. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of condition. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BooleanConditionType { #[serde(rename = "BLANK")] Blank, @@ -1941,6 +1901,7 @@ pub enum BooleanConditionType { #[serde(rename = "TEXT_STARTS_WITH")] TextStartsWith, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1988,11 +1949,6 @@ impl std::fmt::Display for BooleanConditionType { } } -impl Default for BooleanConditionType { - fn default() -> BooleanConditionType { - BooleanConditionType::Noop - } -} impl BooleanConditionType { pub fn is_noop(&self) -> bool { matches!(self, BooleanConditionType::Noop) @@ -2034,9 +1990,9 @@ pub struct BooleanRule { } /** -* The style of the border. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The style of the border. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Style { #[serde(rename = "DASHED")] Dashed, @@ -2055,6 +2011,7 @@ pub enum Style { #[serde(rename = "STYLE_UNSPECIFIED")] StyleUnspecified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2078,11 +2035,6 @@ impl std::fmt::Display for Style { } } -impl Default for Style { - fn default() -> Style { - Style::Noop - } -} impl Style { pub fn is_noop(&self) -> bool { matches!(self, Style::Noop) @@ -2148,9 +2100,9 @@ pub struct Borders { } /** -* Where the legend of the chart should be drawn. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Where the legend of the chart should be drawn. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BubbleChartSpecLegendPosition { #[serde(rename = "BOTTOM_LEGEND")] BottomLegend, @@ -2167,6 +2119,7 @@ pub enum BubbleChartSpecLegendPosition { #[serde(rename = "TOP_LEGEND")] TopLegend, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2191,11 +2144,6 @@ impl std::fmt::Display for BubbleChartSpecLegendPosition { } } -impl Default for BubbleChartSpecLegendPosition { - fn default() -> BubbleChartSpecLegendPosition { - BubbleChartSpecLegendPosition::Noop - } -} impl BubbleChartSpecLegendPosition { pub fn is_noop(&self) -> bool { matches!(self, BubbleChartSpecLegendPosition::Noop) @@ -2506,9 +2454,9 @@ pub struct CellData { } /** -* The horizontal alignment of the value in the cell. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The horizontal alignment of the value in the cell. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum HorizontalAlignment { #[serde(rename = "CENTER")] Center, @@ -2519,6 +2467,7 @@ pub enum HorizontalAlignment { #[serde(rename = "RIGHT")] Right, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2538,11 +2487,6 @@ impl std::fmt::Display for HorizontalAlignment { } } -impl Default for HorizontalAlignment { - fn default() -> HorizontalAlignment { - HorizontalAlignment::Noop - } -} impl HorizontalAlignment { pub fn is_noop(&self) -> bool { matches!(self, HorizontalAlignment::Noop) @@ -2550,9 +2494,9 @@ impl HorizontalAlignment { } /** -* How a hyperlink, if it exists, should be displayed in the cell. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * How a hyperlink, if it exists, should be displayed in the cell. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum HyperlinkDisplayType { #[serde(rename = "HYPERLINK_DISPLAY_TYPE_UNSPECIFIED")] HyperlinkDisplayTypeUnspecified, @@ -2561,6 +2505,7 @@ pub enum HyperlinkDisplayType { #[serde(rename = "PLAIN_TEXT")] PlainText, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2581,11 +2526,6 @@ impl std::fmt::Display for HyperlinkDisplayType { } } -impl Default for HyperlinkDisplayType { - fn default() -> HyperlinkDisplayType { - HyperlinkDisplayType::Noop - } -} impl HyperlinkDisplayType { pub fn is_noop(&self) -> bool { matches!(self, HyperlinkDisplayType::Noop) @@ -2593,9 +2533,9 @@ impl HyperlinkDisplayType { } /** -* The direction of the text in the cell. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The direction of the text in the cell. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TextDirection { #[serde(rename = "LEFT_TO_RIGHT")] LeftToRight, @@ -2604,6 +2544,7 @@ pub enum TextDirection { #[serde(rename = "TEXT_DIRECTION_UNSPECIFIED")] TextDirectionUnspecified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2622,11 +2563,6 @@ impl std::fmt::Display for TextDirection { } } -impl Default for TextDirection { - fn default() -> TextDirection { - TextDirection::Noop - } -} impl TextDirection { pub fn is_noop(&self) -> bool { matches!(self, TextDirection::Noop) @@ -2634,9 +2570,9 @@ impl TextDirection { } /** -* The vertical alignment of the value in the cell. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The vertical alignment of the value in the cell. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum VerticalAlignment { #[serde(rename = "BOTTOM")] Bottom, @@ -2647,6 +2583,7 @@ pub enum VerticalAlignment { #[serde(rename = "VERTICAL_ALIGN_UNSPECIFIED")] VerticalAlignUnspecified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2666,11 +2603,6 @@ impl std::fmt::Display for VerticalAlignment { } } -impl Default for VerticalAlignment { - fn default() -> VerticalAlignment { - VerticalAlignment::Noop - } -} impl VerticalAlignment { pub fn is_noop(&self) -> bool { matches!(self, VerticalAlignment::Noop) @@ -2678,9 +2610,9 @@ impl VerticalAlignment { } /** -* The wrap strategy for the value in the cell. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The wrap strategy for the value in the cell. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum WrapStrategy { #[serde(rename = "CLIP")] Clip, @@ -2693,6 +2625,7 @@ pub enum WrapStrategy { #[serde(rename = "WRAP_STRATEGY_UNSPECIFIED")] WrapStrategyUnspecified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2713,11 +2646,6 @@ impl std::fmt::Display for WrapStrategy { } } -impl Default for WrapStrategy { - fn default() -> WrapStrategy { - WrapStrategy::Noop - } -} impl WrapStrategy { pub fn is_noop(&self) -> bool { matches!(self, WrapStrategy::Noop) @@ -2830,9 +2758,9 @@ pub struct CellFormat { } /** -* The view window's mode. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The view window's mode. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ViewWindowMode { #[serde(rename = "DEFAULT_VIEW_WINDOW_MODE")] DefaultViewWindowMode, @@ -2843,6 +2771,7 @@ pub enum ViewWindowMode { #[serde(rename = "VIEW_WINDOW_MODE_UNSUPPORTED")] ViewWindowModeUnsupported, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2862,11 +2791,6 @@ impl std::fmt::Display for ViewWindowMode { } } -impl Default for ViewWindowMode { - fn default() -> ViewWindowMode { - ViewWindowMode::Noop - } -} impl ViewWindowMode { pub fn is_noop(&self) -> bool { matches!(self, ViewWindowMode::Noop) @@ -2931,9 +2855,9 @@ pub struct ChartCustomNumberFormatOptions { } /** -* The aggregation type for the series of a data source chart. Only supported for data source charts. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The aggregation type for the series of a data source chart. Only supported for data source charts. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AggregateType { #[serde(rename = "AVERAGE")] Average, @@ -2950,6 +2874,7 @@ pub enum AggregateType { #[serde(rename = "SUM")] Sum, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2972,11 +2897,6 @@ impl std::fmt::Display for AggregateType { } } -impl Default for AggregateType { - fn default() -> AggregateType { - AggregateType::Noop - } -} impl AggregateType { pub fn is_noop(&self) -> bool { matches!(self, AggregateType::Noop) @@ -3021,9 +2941,9 @@ pub struct ChartData { } /** -* The type of date-time grouping to apply. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of date-time grouping to apply. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ChartDateTimeRuleType { #[serde(rename = "CHART_DATE_TIME_RULE_TYPE_UNSPECIFIED")] ChartDateTimeRuleTypeUnspecified, @@ -3058,6 +2978,7 @@ pub enum ChartDateTimeRuleType { #[serde(rename = "YEAR_QUARTER")] YearQuarter, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3091,11 +3012,6 @@ impl std::fmt::Display for ChartDateTimeRuleType { } } -impl Default for ChartDateTimeRuleType { - fn default() -> ChartDateTimeRuleType { - ChartDateTimeRuleType::Noop - } -} impl ChartDateTimeRuleType { pub fn is_noop(&self) -> bool { matches!(self, ChartDateTimeRuleType::Noop) @@ -3185,9 +3101,9 @@ pub struct ChartSourceRange { } /** -* Determines how the charts will use hidden rows or columns. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Determines how the charts will use hidden rows or columns. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum HiddenDimensionStrategy { #[serde(rename = "CHART_HIDDEN_DIMENSION_STRATEGY_UNSPECIFIED")] ChartHiddenDimensionStrategyUnspecified, @@ -3200,6 +3116,7 @@ pub enum HiddenDimensionStrategy { #[serde(rename = "SKIP_HIDDEN_ROWS_AND_COLUMNS")] SkipHiddenRowsAndColumns, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3222,11 +3139,6 @@ impl std::fmt::Display for HiddenDimensionStrategy { } } -impl Default for HiddenDimensionStrategy { - fn default() -> HiddenDimensionStrategy { - HiddenDimensionStrategy::Noop - } -} impl HiddenDimensionStrategy { pub fn is_noop(&self) -> bool { matches!(self, HiddenDimensionStrategy::Noop) @@ -3535,9 +3447,9 @@ pub struct Color { } /** -* The type of the spreadsheet theme color. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of the spreadsheet theme color. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ColorType { #[serde(rename = "ACCENT1")] Accent1, @@ -3560,6 +3472,7 @@ pub enum ColorType { #[serde(rename = "THEME_COLOR_TYPE_UNSPECIFIED")] ThemeColorTypeUnspecified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3585,11 +3498,6 @@ impl std::fmt::Display for ColorType { } } -impl Default for ColorType { - fn default() -> ColorType { - ColorType::Noop - } -} impl ColorType { pub fn is_noop(&self) -> bool { matches!(self, ColorType::Noop) @@ -3616,9 +3524,9 @@ pub struct ColorStyle { } /** -* A relative date (based on the current date). Valid only if the type is DATE_BEFORE, DATE_AFTER, DATE_ON_OR_BEFORE or DATE_ON_OR_AFTER. Relative dates are not supported in data validation. They are supported only in conditional formatting and conditional filters. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * A relative date (based on the current date). Valid only if the type is DATE_BEFORE, DATE_AFTER, DATE_ON_OR_BEFORE or DATE_ON_OR_AFTER. Relative dates are not supported in data validation. They are supported only in conditional formatting and conditional filters. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RelativeDate { #[serde(rename = "PAST_MONTH")] PastMonth, @@ -3635,6 +3543,7 @@ pub enum RelativeDate { #[serde(rename = "YESTERDAY")] Yesterday, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3657,11 +3566,6 @@ impl std::fmt::Display for RelativeDate { } } -impl Default for RelativeDate { - fn default() -> RelativeDate { - RelativeDate::Noop - } -} impl RelativeDate { pub fn is_noop(&self) -> bool { matches!(self, RelativeDate::Noop) @@ -3725,15 +3629,16 @@ pub struct ConditionalFormatRule { } /** -* How that data should be oriented when pasting. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * How that data should be oriented when pasting. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PasteOrientation { #[serde(rename = "NORMAL")] Normal, #[serde(rename = "TRANSPOSE")] Transpose, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3751,11 +3656,6 @@ impl std::fmt::Display for PasteOrientation { } } -impl Default for PasteOrientation { - fn default() -> PasteOrientation { - PasteOrientation::Noop - } -} impl PasteOrientation { pub fn is_noop(&self) -> bool { matches!(self, PasteOrientation::Noop) @@ -3763,9 +3663,9 @@ impl PasteOrientation { } /** -* What kind of data to paste. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * What kind of data to paste. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PasteType { #[serde(rename = "PASTE_CONDITIONAL_FORMATTING")] PasteConditionalFormatting, @@ -3782,6 +3682,7 @@ pub enum PasteType { #[serde(rename = "PASTE_VALUES")] PasteValues, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3804,11 +3705,6 @@ impl std::fmt::Display for PasteType { } } -impl Default for PasteType { - fn default() -> PasteType { - PasteType::Noop - } -} impl PasteType { pub fn is_noop(&self) -> bool { matches!(self, PasteType::Noop) @@ -3908,9 +3804,9 @@ pub struct CutPasteRequest { } /** -* The error code. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The error code. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ErrorCode { #[serde(rename = "CONCURRENT_QUERY")] ConcurrentQuery, @@ -3949,6 +3845,7 @@ pub enum ErrorCode { #[serde(rename = "UNSUPPORTED_DATA_TYPE")] UnsupportedDataType, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3982,11 +3879,6 @@ impl std::fmt::Display for ErrorCode { } } -impl Default for ErrorCode { - fn default() -> ErrorCode { - ErrorCode::Noop - } -} impl ErrorCode { pub fn is_noop(&self) -> bool { matches!(self, ErrorCode::Noop) @@ -3994,9 +3886,9 @@ impl ErrorCode { } /** -* The state of the data execution. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The state of the data execution. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum State { #[serde(rename = "DATA_EXECUTION_STATE_UNSPECIFIED")] DataExecutionStateUnspecified, @@ -4009,6 +3901,7 @@ pub enum State { #[serde(rename = "SUCCEEDED")] Succeeded, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4029,11 +3922,6 @@ impl std::fmt::Display for State { } } -impl Default for State { - fn default() -> State { - State::Noop - } -} impl State { pub fn is_noop(&self) -> bool { matches!(self, State::Noop) @@ -4137,9 +4025,9 @@ pub struct DataFilterValueRange { } /** -* The placement of the data label relative to the labeled data. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The placement of the data label relative to the labeled data. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Placement { #[serde(rename = "ABOVE")] Above, @@ -4160,6 +4048,7 @@ pub enum Placement { #[serde(rename = "RIGHT")] Right, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4184,11 +4073,6 @@ impl std::fmt::Display for Placement { } } -impl Default for Placement { - fn default() -> Placement { - Placement::Noop - } -} impl Placement { pub fn is_noop(&self) -> bool { matches!(self, Placement::Noop) @@ -4196,9 +4080,9 @@ impl Placement { } /** -* The type of the data label. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of the data label. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DataLabelType { #[serde(rename = "CUSTOM")] Custom, @@ -4209,6 +4093,7 @@ pub enum DataLabelType { #[serde(rename = "NONE")] None, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4228,11 +4113,6 @@ impl std::fmt::Display for DataLabelType { } } -impl Default for DataLabelType { - fn default() -> DataLabelType { - DataLabelType::Noop - } -} impl DataLabelType { pub fn is_noop(&self) -> bool { matches!(self, DataLabelType::Noop) @@ -4519,15 +4399,16 @@ pub struct DataSourceRefreshMonthlySchedule { } /** -* The scope of the refresh. Must be ALL_DATA_SOURCES. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The scope of the refresh. Must be ALL_DATA_SOURCES. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RefreshScope { #[serde(rename = "ALL_DATA_SOURCES")] AllDataSources, #[serde(rename = "DATA_SOURCE_REFRESH_SCOPE_UNSPECIFIED")] DataSourceRefreshScopeUnspecified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4547,11 +4428,6 @@ impl std::fmt::Display for RefreshScope { } } -impl Default for RefreshScope { - fn default() -> RefreshScope { - RefreshScope::Noop - } -} impl RefreshScope { pub fn is_noop(&self) -> bool { matches!(self, RefreshScope::Noop) @@ -4612,7 +4488,7 @@ pub struct DataSourceRefreshSchedule { pub weekly_schedule: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DaysOfWeek { #[serde(rename = "DAY_OF_WEEK_UNSPECIFIED")] DayOfWeekUnspecified, @@ -4631,6 +4507,7 @@ pub enum DaysOfWeek { #[serde(rename = "WEDNESDAY")] Wednesday, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4654,11 +4531,6 @@ impl std::fmt::Display for DaysOfWeek { } } -impl Default for DaysOfWeek { - fn default() -> DaysOfWeek { - DaysOfWeek::Noop - } -} impl DaysOfWeek { pub fn is_noop(&self) -> bool { matches!(self, DaysOfWeek::Noop) @@ -4763,9 +4635,9 @@ pub struct DataSourceSpec { } /** -* The type to select columns for the data source table. Defaults to SELECTED. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type to select columns for the data source table. Defaults to SELECTED. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ColumnSelectionType { #[serde(rename = "DATA_SOURCE_TABLE_COLUMN_SELECTION_TYPE_UNSPECIFIED")] DataSourceTableColumnSelectionTypeUnspecified, @@ -4774,6 +4646,7 @@ pub enum ColumnSelectionType { #[serde(rename = "SYNC_ALL")] SyncAll, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4794,11 +4667,6 @@ impl std::fmt::Display for ColumnSelectionType { } } -impl Default for ColumnSelectionType { - fn default() -> ColumnSelectionType { - ColumnSelectionType::Noop - } -} impl ColumnSelectionType { pub fn is_noop(&self) -> bool { matches!(self, ColumnSelectionType::Noop) @@ -4915,9 +4783,9 @@ pub struct DataValidationRule { } /** -* The type of date-time grouping to apply. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of date-time grouping to apply. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DateTimeRuleType { #[serde(rename = "DATE_TIME_RULE_TYPE_UNSPECIFIED")] DateTimeRuleTypeUnspecified, @@ -4952,6 +4820,7 @@ pub enum DateTimeRuleType { #[serde(rename = "YEAR_QUARTER")] YearQuarter, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4983,11 +4852,6 @@ impl std::fmt::Display for DateTimeRuleType { } } -impl Default for DateTimeRuleType { - fn default() -> DateTimeRuleType { - DateTimeRuleType::Noop - } -} impl DateTimeRuleType { pub fn is_noop(&self) -> bool { matches!(self, DateTimeRuleType::Noop) @@ -5262,9 +5126,9 @@ pub struct DeleteSheetRequest { } /** -* The metadata visibility. Developer metadata must always have a visibility specified. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The metadata visibility. Developer metadata must always have a visibility specified. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Visibility { #[serde(rename = "DEVELOPER_METADATA_VISIBILITY_UNSPECIFIED")] DeveloperMetadataVisibilityUnspecified, @@ -5273,6 +5137,7 @@ pub enum Visibility { #[serde(rename = "PROJECT")] Project, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5293,11 +5158,6 @@ impl std::fmt::Display for Visibility { } } -impl Default for Visibility { - fn default() -> Visibility { - Visibility::Noop - } -} impl Visibility { pub fn is_noop(&self) -> bool { matches!(self, Visibility::Noop) @@ -5350,9 +5210,9 @@ pub struct DeveloperMetadata { } /** -* The type of location this object represents. This field is read-only. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of location this object represents. This field is read-only. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LocationType { #[serde(rename = "COLUMN")] Column, @@ -5365,6 +5225,7 @@ pub enum LocationType { #[serde(rename = "SPREADSHEET")] Spreadsheet, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5387,11 +5248,6 @@ impl std::fmt::Display for LocationType { } } -impl Default for LocationType { - fn default() -> LocationType { - LocationType::Noop - } -} impl LocationType { pub fn is_noop(&self) -> bool { matches!(self, LocationType::Noop) @@ -5440,9 +5296,9 @@ pub struct DeveloperMetadataLocation { } /** -* Determines how this lookup matches the location. If this field is specified as EXACT, only developer metadata associated on the exact location specified is matched. If this field is specified to INTERSECTING, developer metadata associated on intersecting locations is also matched. If left unspecified, this field assumes a default value of INTERSECTING. If this field is specified, a metadataLocation must also be specified. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Determines how this lookup matches the location. If this field is specified as EXACT, only developer metadata associated on the exact location specified is matched. If this field is specified to INTERSECTING, developer metadata associated on intersecting locations is also matched. If left unspecified, this field assumes a default value of INTERSECTING. If this field is specified, a metadataLocation must also be specified. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LocationMatchingStrategy { #[serde(rename = "DEVELOPER_METADATA_LOCATION_MATCHING_STRATEGY_UNSPECIFIED")] DeveloperMetadataLocationMatchingStrategyUnspecified, @@ -5451,6 +5307,7 @@ pub enum LocationMatchingStrategy { #[serde(rename = "INTERSECTING_LOCATION")] IntersectingLocation, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5471,11 +5328,6 @@ impl std::fmt::Display for LocationMatchingStrategy { } } -impl Default for LocationMatchingStrategy { - fn default() -> LocationMatchingStrategy { - LocationMatchingStrategy::Noop - } -} impl LocationMatchingStrategy { pub fn is_noop(&self) -> bool { matches!(self, LocationMatchingStrategy::Noop) @@ -5863,9 +5715,9 @@ pub struct EmbeddedObjectPosition { } /** -* The type of error. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of error. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ErrorValueType { #[serde(rename = "DIVIDE_BY_ZERO")] DivideByZero, @@ -5888,6 +5740,7 @@ pub enum ErrorValueType { #[serde(rename = "VALUE")] Value, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5913,11 +5766,6 @@ impl std::fmt::Display for ErrorValueType { } } -impl Default for ErrorValueType { - fn default() -> ErrorValueType { - ErrorValueType::Noop - } -} impl ErrorValueType { pub fn is_noop(&self) -> bool { matches!(self, ErrorValueType::Noop) @@ -6541,9 +6389,9 @@ pub struct GridRange { } /** -* The position of the chart legend. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The position of the chart legend. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum HistogramChartSpecLegendPosition { #[serde(rename = "BOTTOM_LEGEND")] BottomLegend, @@ -6560,6 +6408,7 @@ pub enum HistogramChartSpecLegendPosition { #[serde(rename = "TOP_LEGEND")] TopLegend, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6584,11 +6433,6 @@ impl std::fmt::Display for HistogramChartSpecLegendPosition { } } -impl Default for HistogramChartSpecLegendPosition { - fn default() -> HistogramChartSpecLegendPosition { - HistogramChartSpecLegendPosition::Noop - } -} impl HistogramChartSpecLegendPosition { pub fn is_noop(&self) -> bool { matches!(self, HistogramChartSpecLegendPosition::Noop) @@ -6742,9 +6586,9 @@ pub struct InsertRangeRequest { } /** -* How the value should be interpreted. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * How the value should be interpreted. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum InterpolationPointType { #[serde(rename = "INTERPOLATION_POINT_TYPE_UNSPECIFIED")] InterpolationPointTypeUnspecified, @@ -6759,6 +6603,7 @@ pub enum InterpolationPointType { #[serde(rename = "PERCENTILE")] Percentile, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6782,11 +6627,6 @@ impl std::fmt::Display for InterpolationPointType { } } -impl Default for InterpolationPointType { - fn default() -> InterpolationPointType { - InterpolationPointType::Noop - } -} impl InterpolationPointType { pub fn is_noop(&self) -> bool { matches!(self, InterpolationPointType::Noop) @@ -6896,9 +6736,9 @@ pub struct KeyValueFormat { } /** -* The dash type of the line. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The dash type of the line. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LineStyleType { #[serde(rename = "CUSTOM")] Custom, @@ -6919,6 +6759,7 @@ pub enum LineStyleType { #[serde(rename = "SOLID")] Solid, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6943,11 +6784,6 @@ impl std::fmt::Display for LineStyleType { } } -impl Default for LineStyleType { - fn default() -> LineStyleType { - LineStyleType::Noop - } -} impl LineStyleType { pub fn is_noop(&self) -> bool { matches!(self, LineStyleType::Noop) @@ -7069,9 +6905,9 @@ pub struct MatchedValueRange { } /** -* How the cells should be merged. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * How the cells should be merged. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MergeType { #[serde(rename = "MERGE_ALL")] MergeAll, @@ -7080,6 +6916,7 @@ pub enum MergeType { #[serde(rename = "MERGE_ROWS")] MergeRows, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7098,11 +6935,6 @@ impl std::fmt::Display for MergeType { } } -impl Default for MergeType { - fn default() -> MergeType { - MergeType::Noop - } -} impl MergeType { pub fn is_noop(&self) -> bool { matches!(self, MergeType::Noop) @@ -7174,9 +7006,9 @@ pub struct NamedRange { } /** -* The type of the number format. When writing, this field must be set. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of the number format. When writing, this field must be set. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum NumberFormatType { #[serde(rename = "CURRENCY")] Currency, @@ -7197,6 +7029,7 @@ pub enum NumberFormatType { #[serde(rename = "TIME")] Time, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7221,11 +7054,6 @@ impl std::fmt::Display for NumberFormatType { } } -impl Default for NumberFormatType { - fn default() -> NumberFormatType { - NumberFormatType::Noop - } -} impl NumberFormatType { pub fn is_noop(&self) -> bool { matches!(self, NumberFormatType::Noop) @@ -7252,9 +7080,9 @@ pub struct NumberFormat { } /** -* The size of the org chart nodes. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The size of the org chart nodes. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum NodeSize { #[serde(rename = "LARGE")] Large, @@ -7265,6 +7093,7 @@ pub enum NodeSize { #[serde(rename = "SMALL")] Small, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7284,11 +7113,6 @@ impl std::fmt::Display for NodeSize { } } -impl Default for NodeSize { - fn default() -> NodeSize { - NodeSize::Noop - } -} impl NodeSize { pub fn is_noop(&self) -> bool { matches!(self, NodeSize::Noop) @@ -7490,9 +7314,9 @@ pub struct PasteDataRequest { } /** -* Where the legend of the pie chart should be drawn. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Where the legend of the pie chart should be drawn. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PieChartSpecLegendPosition { #[serde(rename = "BOTTOM_LEGEND")] BottomLegend, @@ -7509,6 +7333,7 @@ pub enum PieChartSpecLegendPosition { #[serde(rename = "TOP_LEGEND")] TopLegend, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7533,11 +7358,6 @@ impl std::fmt::Display for PieChartSpecLegendPosition { } } -impl Default for PieChartSpecLegendPosition { - fn default() -> PieChartSpecLegendPosition { - PieChartSpecLegendPosition::Noop - } -} impl PieChartSpecLegendPosition { pub fn is_noop(&self) -> bool { matches!(self, PieChartSpecLegendPosition::Noop) @@ -7650,9 +7470,9 @@ pub struct PivotFilterSpec { } /** -* The order the values in this group should be sorted. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The order the values in this group should be sorted. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SortOrder { #[serde(rename = "ASCENDING")] Ascending, @@ -7661,6 +7481,7 @@ pub enum SortOrder { #[serde(rename = "SORT_ORDER_UNSPECIFIED")] SortOrderUnspecified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7679,11 +7500,6 @@ impl std::fmt::Display for SortOrder { } } -impl Default for SortOrder { - fn default() -> SortOrder { - SortOrder::Noop - } -} impl SortOrder { pub fn is_noop(&self) -> bool { matches!(self, SortOrder::Noop) @@ -7879,15 +7695,16 @@ pub struct PivotGroupValueMetadata { } /** -* Whether values should be listed horizontally (as columns) or vertically (as rows). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether values should be listed horizontally (as columns) or vertically (as rows). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ValueLayout { #[serde(rename = "HORIZONTAL")] Horizontal, #[serde(rename = "VERTICAL")] Vertical, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7905,11 +7722,6 @@ impl std::fmt::Display for ValueLayout { } } -impl Default for ValueLayout { - fn default() -> ValueLayout { - ValueLayout::Noop - } -} impl ValueLayout { pub fn is_noop(&self) -> bool { matches!(self, ValueLayout::Noop) @@ -7997,9 +7809,9 @@ pub struct PivotTable { } /** -* If specified, indicates that pivot values should be displayed as the result of a calculation with another pivot value. For example, if calculated_display_type is specified as PERCENT_OF_GRAND_TOTAL, all the pivot values are displayed as the percentage of the grand total. In the Sheets editor, this is referred to as "Show As" in the value section of a pivot table. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * If specified, indicates that pivot values should be displayed as the result of a calculation with another pivot value. For example, if calculated_display_type is specified as PERCENT_OF_GRAND_TOTAL, all the pivot values are displayed as the percentage of the grand total. In the Sheets editor, this is referred to as "Show As" in the value section of a pivot table. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CalculatedDisplayType { #[serde(rename = "PERCENT_OF_COLUMN_TOTAL")] PercentOfColumnTotal, @@ -8010,6 +7822,7 @@ pub enum CalculatedDisplayType { #[serde(rename = "PIVOT_VALUE_CALCULATED_DISPLAY_TYPE_UNSPECIFIED")] PivotValueCalculatedDisplayTypeUnspecified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8031,11 +7844,6 @@ impl std::fmt::Display for CalculatedDisplayType { } } -impl Default for CalculatedDisplayType { - fn default() -> CalculatedDisplayType { - CalculatedDisplayType::Noop - } -} impl CalculatedDisplayType { pub fn is_noop(&self) -> bool { matches!(self, CalculatedDisplayType::Noop) @@ -8043,9 +7851,9 @@ impl CalculatedDisplayType { } /** -* A function to summarize the value. If formula is set, the only supported values are SUM and CUSTOM. If sourceColumnOffset is set, then `CUSTOM` is not supported. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * A function to summarize the value. If formula is set, the only supported values are SUM and CUSTOM. If sourceColumnOffset is set, then `CUSTOM` is not supported. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SummarizeFunction { #[serde(rename = "AVERAGE")] Average, @@ -8078,6 +7886,7 @@ pub enum SummarizeFunction { #[serde(rename = "VARP")] Varp, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8110,11 +7919,6 @@ impl std::fmt::Display for SummarizeFunction { } } -impl Default for SummarizeFunction { - fn default() -> SummarizeFunction { - SummarizeFunction::Noop - } -} impl SummarizeFunction { pub fn is_noop(&self) -> bool { matches!(self, SummarizeFunction::Noop) @@ -8182,9 +7986,9 @@ pub struct PivotValue { } /** -* The point shape. If empty or unspecified, a default shape is used. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The point shape. If empty or unspecified, a default shape is used. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Shape { #[serde(rename = "CIRCLE")] Circle, @@ -8205,6 +8009,7 @@ pub enum Shape { #[serde(rename = "X_MARK")] XMark, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8229,11 +8034,6 @@ impl std::fmt::Display for Shape { } } -impl Default for Shape { - fn default() -> Shape { - Shape::Noop - } -} impl Shape { pub fn is_noop(&self) -> bool { matches!(self, Shape::Noop) @@ -9201,9 +9001,9 @@ pub struct RowData { } /** -* The number format source used in the scorecard chart. This field is optional. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The number format source used in the scorecard chart. This field is optional. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum NumberFormatSource { #[serde(rename = "CHART_NUMBER_FORMAT_SOURCE_UNDEFINED")] ChartNumberFormatSourceUndefined, @@ -9212,6 +9012,7 @@ pub enum NumberFormatSource { #[serde(rename = "FROM_DATA")] FromData, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9232,11 +9033,6 @@ impl std::fmt::Display for NumberFormatSource { } } -impl Default for NumberFormatSource { - fn default() -> NumberFormatSource { - NumberFormatSource::Noop - } -} impl NumberFormatSource { pub fn is_noop(&self) -> bool { matches!(self, NumberFormatSource::Noop) @@ -9502,9 +9298,9 @@ pub struct Sheet { } /** -* The type of sheet. Defaults to GRID. This field cannot be changed once set. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of sheet. Defaults to GRID. This field cannot be changed once set. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SheetType { #[serde(rename = "DATA_SOURCE")] DataSource, @@ -9515,6 +9311,7 @@ pub enum SheetType { #[serde(rename = "SHEET_TYPE_UNSPECIFIED")] SheetTypeUnspecified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9534,11 +9331,6 @@ impl std::fmt::Display for SheetType { } } -impl Default for SheetType { - fn default() -> SheetType { - SheetType::Noop - } -} impl SheetType { pub fn is_noop(&self) -> bool { matches!(self, SheetType::Noop) @@ -9930,9 +9722,9 @@ pub struct Spreadsheet { } /** -* The amount of time to wait before volatile functions are recalculated. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The amount of time to wait before volatile functions are recalculated. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AutoRecalc { #[serde(rename = "HOUR")] Hour, @@ -9943,6 +9735,7 @@ pub enum AutoRecalc { #[serde(rename = "RECALCULATION_INTERVAL_UNSPECIFIED")] RecalculationIntervalUnspecified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9962,11 +9755,6 @@ impl std::fmt::Display for AutoRecalc { } } -impl Default for AutoRecalc { - fn default() -> AutoRecalc { - AutoRecalc::Noop - } -} impl AutoRecalc { pub fn is_noop(&self) -> bool { matches!(self, AutoRecalc::Noop) @@ -10204,9 +9992,9 @@ pub struct TextRotation { } /** -* The delimiter type to use. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The delimiter type to use. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DelimiterType { #[serde(rename = "AUTODETECT")] Autodetect, @@ -10223,6 +10011,7 @@ pub enum DelimiterType { #[serde(rename = "SPACE")] Space, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10245,11 +10034,6 @@ impl std::fmt::Display for DelimiterType { } } -impl Default for DelimiterType { - fn default() -> DelimiterType { - DelimiterType::Noop - } -} impl DelimiterType { pub fn is_noop(&self) -> bool { matches!(self, DelimiterType::Noop) @@ -11417,9 +11201,9 @@ pub struct WaterfallChartSeries { } /** -* The stacked type. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The stacked type. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum WaterfallChartSpecStackedType { #[serde(rename = "SEQUENTIAL")] Sequential, @@ -11428,6 +11212,7 @@ pub enum WaterfallChartSpecStackedType { #[serde(rename = "WATERFALL_STACKED_TYPE_UNSPECIFIED")] WaterfallStackedTypeUnspecified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11448,11 +11233,6 @@ impl std::fmt::Display for WaterfallChartSpecStackedType { } } -impl Default for WaterfallChartSpecStackedType { - fn default() -> WaterfallChartSpecStackedType { - WaterfallChartSpecStackedType::Noop - } -} impl WaterfallChartSpecStackedType { pub fn is_noop(&self) -> bool { matches!(self, WaterfallChartSpecStackedType::Noop) @@ -11524,15 +11304,16 @@ pub struct WaterfallChartSpec { } /** -* V1 error format. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * V1 error format. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Xgafv { #[serde(rename = "1")] One, #[serde(rename = "2")] Two, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11550,11 +11331,6 @@ impl std::fmt::Display for Xgafv { } } -impl Default for Xgafv { - fn default() -> Xgafv { - Xgafv::Noop - } -} impl Xgafv { pub fn is_noop(&self) -> bool { matches!(self, Xgafv::Noop) @@ -11562,9 +11338,9 @@ impl Xgafv { } /** -* Data format for response. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Data format for response. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Alt { #[serde(rename = "json")] Json, @@ -11573,6 +11349,7 @@ pub enum Alt { #[serde(rename = "proto")] Proto, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11591,11 +11368,6 @@ impl std::fmt::Display for Alt { } } -impl Default for Alt { - fn default() -> Alt { - Alt::Noop - } -} impl Alt { pub fn is_noop(&self) -> bool { matches!(self, Alt::Noop) @@ -11603,15 +11375,16 @@ impl Alt { } /** -* How the input data should be inserted. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * How the input data should be inserted. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum InsertDataOption { #[serde(rename = "INSERT_ROWS")] InsertRows, #[serde(rename = "OVERWRITE")] Overwrite, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11629,11 +11402,6 @@ impl std::fmt::Display for InsertDataOption { } } -impl Default for InsertDataOption { - fn default() -> InsertDataOption { - InsertDataOption::Noop - } -} impl InsertDataOption { pub fn is_noop(&self) -> bool { matches!(self, InsertDataOption::Noop) diff --git a/gusto/src/federal_tax_details_beta.rs b/gusto/src/federal_tax_details_beta.rs index 95b4c068..cc8f7de3 100644 --- a/gusto/src/federal_tax_details_beta.rs +++ b/gusto/src/federal_tax_details_beta.rs @@ -18,25 +18,25 @@ impl FederalTaxDetailsBeta { } /** -* Get Federal Tax Details. -* -* This function performs a `GET` to the `/v1/companies/{company_id_or_uuid}/federal_tax_details` endpoint. -* -* This endpoint is in beta and intended for **[Gusto Embedded Payroll](https://gusto.com/embedded-payroll)** customers. Please [apply for early access](https://gusto-embedded-payroll.typeform.com/to/iomAQIj3?utm_source=docs) if you’d like to learn more and use it for production. Note, this endpoint will require you to enter a different agreement with Gusto. -* -* Fetches attributes relevant for a company's federal taxes. -*/pub async fn get_company_or_federal_tax_details(&self,company_id_or_uuid: &str,) -> Result {let url = self.client.url( + * Get Federal Tax Details. + * + * This function performs a `GET` to the `/v1/companies/{company_id_or_uuid}/federal_tax_details` endpoint. + * + * This endpoint is in beta and intended for **[Gusto Embedded Payroll](https://gusto.com/embedded-payroll)** customers. Please [apply for early access](https://gusto-embedded-payroll.typeform.com/to/iomAQIj3?utm_source=docs) if you’d like to learn more and use it for production. Note, this endpoint will require you to enter a different agreement with Gusto. + * + * Fetches attributes relevant for a company's federal taxes. + */pub async fn get_company_or_federal_tax_details(&self,company_id_or_uuid: &str,) -> Result {let url = self.client.url( &format!("/v1/companies/{}/federal_tax_details", crate::progenitor_support::encode_path(&company_id_or_uuid.to_string()),), None); self.client.get(&url, crate::Message { body: None, content_type: None } ).await}/** -* Update Federal Tax Details. -* -* This function performs a `PUT` to the `/v1/companies/{company_id_or_uuid}/federal_tax_details` endpoint. -* -* This endpoint is in beta and intended for **[Gusto Embedded Payroll](https://gusto.com/embedded-payroll)** customers. Please [apply for early access](https://gusto-embedded-payroll.typeform.com/to/iomAQIj3?utm_source=docs) if you’d like to learn more and use it for production. Note, this endpoint will require you to enter a different agreement with Gusto. -* -* Updates attributes relevant for a company's federal taxes. This information is required is to onboard a company for use with Gusto Embedded Payroll. -*/pub async fn put_company_or_federal_tax_details(&self,company_id_or_uuid: &str,body: &crate::types::PutCompanyFederalTaxDetailsRequest) -> Result {let url = self.client.url( + * Update Federal Tax Details. + * + * This function performs a `PUT` to the `/v1/companies/{company_id_or_uuid}/federal_tax_details` endpoint. + * + * This endpoint is in beta and intended for **[Gusto Embedded Payroll](https://gusto.com/embedded-payroll)** customers. Please [apply for early access](https://gusto-embedded-payroll.typeform.com/to/iomAQIj3?utm_source=docs) if you’d like to learn more and use it for production. Note, this endpoint will require you to enter a different agreement with Gusto. + * + * Updates attributes relevant for a company's federal taxes. This information is required is to onboard a company for use with Gusto Embedded Payroll. + */pub async fn put_company_or_federal_tax_details(&self,company_id_or_uuid: &str,body: &crate::types::PutCompanyFederalTaxDetailsRequest) -> Result {let url = self.client.url( &format!("/v1/companies/{}/federal_tax_details", crate::progenitor_support::encode_path(&company_id_or_uuid.to_string()),), None); self.client.put(&url, crate::Message { body: Some(reqwest::Body::from(serde_json::to_vec(body)?)), content_type: Some("application/json".to_string()) } ).await} diff --git a/gusto/src/types.rs b/gusto/src/types.rs index d3a70edb..9c38700d 100644 --- a/gusto/src/types.rs +++ b/gusto/src/types.rs @@ -589,9 +589,9 @@ pub struct Termination { } /** -* The unit accompanying the compensation rate. If the employee is an owner, rate should be 'Paycheck'. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The unit accompanying the compensation rate. If the employee is an owner, rate should be 'Paycheck'. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentUnit { #[serde(rename = "Hour")] Hour, @@ -604,6 +604,7 @@ pub enum PaymentUnit { #[serde(rename = "Year")] Year, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -624,11 +625,6 @@ impl std::fmt::Display for PaymentUnit { } } -impl Default for PaymentUnit { - fn default() -> PaymentUnit { - PaymentUnit::Noop - } -} impl PaymentUnit { pub fn is_noop(&self) -> bool { matches!(self, PaymentUnit::Noop) @@ -636,9 +632,9 @@ impl PaymentUnit { } /** -* The FLSA status for this compensation. Salaried ('Exempt') employees are paid a fixed salary every pay period. Salaried with overtime ('Salaried Nonexempt') employees are paid a fixed salary every pay period, and receive overtime pay when applicable. Hourly ('Nonexempt') employees are paid for the hours they work, and receive overtime pay when applicable. Owners ('Owner') are employees that own at least twenty percent of the company. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The FLSA status for this compensation. Salaried ('Exempt') employees are paid a fixed salary every pay period. Salaried with overtime ('Salaried Nonexempt') employees are paid a fixed salary every pay period, and receive overtime pay when applicable. Hourly ('Nonexempt') employees are paid for the hours they work, and receive overtime pay when applicable. Owners ('Owner') are employees that own at least twenty percent of the company. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FlsaStatus { #[serde(rename = "Exempt")] Exempt, @@ -649,6 +645,7 @@ pub enum FlsaStatus { #[serde(rename = "Salaried Nonexempt")] SalariedNonexempt, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -668,11 +665,6 @@ impl std::fmt::Display for FlsaStatus { } } -impl Default for FlsaStatus { - fn default() -> FlsaStatus { - FlsaStatus::Noop - } -} impl FlsaStatus { pub fn is_noop(&self) -> bool { matches!(self, FlsaStatus::Noop) @@ -949,9 +941,9 @@ pub struct Admin { } /** -* The tax payer type of the company. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The tax payer type of the company. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EntityType { #[serde(rename = "Association")] Association, @@ -978,6 +970,7 @@ pub enum EntityType { #[serde(rename = "Trusteeship")] Trusteeship, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1005,11 +998,6 @@ impl std::fmt::Display for EntityType { } } -impl Default for EntityType { - fn default() -> EntityType { - EntityType::Noop - } -} impl EntityType { pub fn is_noop(&self) -> bool { matches!(self, EntityType::Noop) @@ -1017,9 +1005,9 @@ impl EntityType { } /** -* The Gusto product tier of the company. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The Gusto product tier of the company. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Tier { #[serde(rename = "basic")] Basic, @@ -1032,6 +1020,7 @@ pub enum Tier { #[serde(rename = "core")] Core, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1052,11 +1041,6 @@ impl std::fmt::Display for Tier { } } -impl Default for Tier { - fn default() -> Tier { - Tier::Noop - } -} impl Tier { pub fn is_noop(&self) -> bool { matches!(self, Tier::Noop) @@ -1064,9 +1048,9 @@ impl Tier { } /** -* The status of the company in Gusto. "Approved" companies may run payroll with Gusto. "Not Approved" companies may not yet run payroll with Gusto. In order to run payroll, the company may need to complete onboarding or contact support. "Suspended" companies may not run payroll with Gusto. In order to unsuspend their account, the company must contact support. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the company in Gusto. "Approved" companies may run payroll with Gusto. "Not Approved" companies may not yet run payroll with Gusto. In order to run payroll, the company may need to complete onboarding or contact support. "Suspended" companies may not run payroll with Gusto. In order to unsuspend their account, the company must contact support. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CompanyStatus { #[serde(rename = "Approved")] Approved, @@ -1075,6 +1059,7 @@ pub enum CompanyStatus { #[serde(rename = "Suspended")] Suspended, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1093,11 +1078,6 @@ impl std::fmt::Display for CompanyStatus { } } -impl Default for CompanyStatus { - fn default() -> CompanyStatus { - CompanyStatus::Noop - } -} impl CompanyStatus { pub fn is_noop(&self) -> bool { matches!(self, CompanyStatus::Noop) @@ -1396,15 +1376,16 @@ pub struct Company { } /** -* The contractor's wage type, either "Fixed" or "Hourly". -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The contractor's wage type, either "Fixed" or "Hourly". + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum WageType { #[serde(rename = "Fixed")] Fixed, #[serde(rename = "Hourly")] Hourly, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1422,11 +1403,6 @@ impl std::fmt::Display for WageType { } } -impl Default for WageType { - fn default() -> WageType { - WageType::Noop - } -} impl WageType { pub fn is_noop(&self) -> bool { matches!(self, WageType::Noop) @@ -1434,15 +1410,16 @@ impl WageType { } /** -* The contractor's type, either "Individual" or "Business". -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The contractor's type, either "Individual" or "Business". + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Type { #[serde(rename = "Business")] Business, #[serde(rename = "Individual")] Individual, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1460,11 +1437,6 @@ impl std::fmt::Display for Type { } } -impl Default for Type { - fn default() -> Type { - Type::Noop - } -} impl Type { pub fn is_noop(&self) -> bool { matches!(self, Type::Noop) @@ -1649,9 +1621,9 @@ pub struct Contractor { } /** -* The payment method. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The payment method. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentMethod { #[serde(rename = "Check")] Check, @@ -1662,6 +1634,7 @@ pub enum PaymentMethod { #[serde(rename = "Historical Payment")] HistoricalPayment, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1681,11 +1654,6 @@ impl std::fmt::Display for PaymentMethod { } } -impl Default for PaymentMethod { - fn default() -> PaymentMethod { - PaymentMethod::Noop - } -} impl PaymentMethod { pub fn is_noop(&self) -> bool { matches!(self, PaymentMethod::Noop) @@ -1872,9 +1840,9 @@ pub struct ContractorPaymentSummary { } /** -* The status of the time off request. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the time off request. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Status { #[serde(rename = "approved")] Approved, @@ -1883,6 +1851,7 @@ pub enum Status { #[serde(rename = "pending")] Pending, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1901,11 +1870,6 @@ impl std::fmt::Display for Status { } } -impl Default for Status { - fn default() -> Status { - Status::Noop - } -} impl Status { pub fn is_noop(&self) -> bool { matches!(self, Status::Noop) @@ -1913,15 +1877,16 @@ impl Status { } /** -* The type of time off request. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of time off request. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RequestType { #[serde(rename = "sick")] Sick, #[serde(rename = "vacation")] Vacation, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1939,11 +1904,6 @@ impl std::fmt::Display for RequestType { } } -impl Default for RequestType { - fn default() -> RequestType { - RequestType::Noop - } -} impl RequestType { pub fn is_noop(&self) -> bool { matches!(self, RequestType::Noop) @@ -2161,7 +2121,7 @@ pub struct CurrentUser { pub roles: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Frequency { #[serde(rename = "Every other week")] EveryOtherWeek, @@ -2172,6 +2132,7 @@ pub enum Frequency { #[serde(rename = "Twice per month")] TwicePerMonth, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2191,11 +2152,6 @@ impl std::fmt::Display for Frequency { } } -impl Default for Frequency { - fn default() -> Frequency { - Frequency::Noop - } -} impl Frequency { pub fn is_noop(&self) -> bool { matches!(self, Frequency::Noop) @@ -2272,15 +2228,16 @@ pub struct PaySchedule { } /** -* Bank account type -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Bank account type + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AccountType { #[serde(rename = "Checking")] Checking, #[serde(rename = "Savings")] Savings, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2298,11 +2255,6 @@ impl std::fmt::Display for AccountType { } } -impl Default for AccountType { - fn default() -> AccountType { - AccountType::Noop - } -} impl AccountType { pub fn is_noop(&self) -> bool { matches!(self, AccountType::Noop) @@ -2310,13 +2262,13 @@ impl AccountType { } /** -* The verification status of the bank account. -* -* 'awaiting_deposits' means the bank account is just created and money is being transferred. -* 'ready_for_verification' means the micro-deposits are completed and the verification process can begin by using the verify endpoint. -* 'verified' means the bank account is verified. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The verification status of the bank account. + * + * 'awaiting_deposits' means the bank account is just created and money is being transferred. + * 'ready_for_verification' means the micro-deposits are completed and the verification process can begin by using the verify endpoint. + * 'verified' means the bank account is verified. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum VerificationStatus { #[serde(rename = "awaiting_deposits")] AwaitingDeposits, @@ -2325,6 +2277,7 @@ pub enum VerificationStatus { #[serde(rename = "verified")] Verified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2343,11 +2296,6 @@ impl std::fmt::Display for VerificationStatus { } } -impl Default for VerificationStatus { - fn default() -> VerificationStatus { - VerificationStatus::Noop - } -} impl VerificationStatus { pub fn is_noop(&self) -> bool { matches!(self, VerificationStatus::Noop) @@ -2592,15 +2540,16 @@ pub struct EarningType { } /** -* Whether the employee deduction reduces taxable income or not. Only valid for Group Term Life benefits. Note: when the value is not "unset", coverage amount and coverage salary multiplier are ignored. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether the employee deduction reduces taxable income or not. Only valid for Group Term Life benefits. Note: when the value is not "unset", coverage amount and coverage salary multiplier are ignored. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeductionReducesTaxableIncome { #[serde(rename = "does_not_reduce_taxable_income")] DoesNotReduceTaxableIncome, #[serde(rename = "reduces_taxable_income")] ReducesTaxableIncome, #[serde(rename = "unset")] + #[default] Unset, #[serde(other)] FallthroughString, @@ -2620,12 +2569,6 @@ impl std::fmt::Display for DeductionReducesTaxableIncome { } } -impl Default for DeductionReducesTaxableIncome { - fn default() -> DeductionReducesTaxableIncome { - DeductionReducesTaxableIncome::Unset - } -} - /// The representation of an employee benefit. #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct EmployeeBenefit { @@ -3068,15 +3011,16 @@ pub struct Totals { } /** -* The employee's compensation payment method. This value is only available for processed payrolls. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The employee's compensation payment method. This value is only available for processed payrolls. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PayrollEmployeeCompensationsPaymentMethod { #[serde(rename = "Check")] Check, #[serde(rename = "Direct Deposit")] DirectDeposit, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3094,11 +3038,6 @@ impl std::fmt::Display for PayrollEmployeeCompensationsPaymentMethod { } } -impl Default for PayrollEmployeeCompensationsPaymentMethod { - fn default() -> PayrollEmployeeCompensationsPaymentMethod { - PayrollEmployeeCompensationsPaymentMethod::Noop - } -} impl PayrollEmployeeCompensationsPaymentMethod { pub fn is_noop(&self) -> bool { matches!(self, PayrollEmployeeCompensationsPaymentMethod::Noop) @@ -3468,7 +3407,7 @@ pub struct PayrollData { pub version: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CustomFieldType { #[serde(rename = "currency")] Currency, @@ -3481,6 +3420,7 @@ pub enum CustomFieldType { #[serde(rename = "text")] Text, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3501,11 +3441,6 @@ impl std::fmt::Display for CustomFieldType { } } -impl Default for CustomFieldType { - fn default() -> CustomFieldType { - CustomFieldType::Noop - } -} impl CustomFieldType { pub fn is_noop(&self) -> bool { matches!(self, CustomFieldType::Noop) @@ -3616,7 +3551,7 @@ pub struct CompanyCustomField { pub type_: CustomFieldType, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GustoPersonType { #[serde(rename = "Candidate")] Candidate, @@ -3625,6 +3560,7 @@ pub enum GustoPersonType { #[serde(rename = "Employee")] Employee, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3643,11 +3579,6 @@ impl std::fmt::Display for GustoPersonType { } } -impl Default for GustoPersonType { - fn default() -> GustoPersonType { - GustoPersonType::Noop - } -} impl GustoPersonType { pub fn is_noop(&self) -> bool { matches!(self, GustoPersonType::Noop) @@ -3870,11 +3801,12 @@ pub struct EarningTypeListResponse { pub default: Vec, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Include { #[serde(rename = "custom_fields")] CustomFields, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3891,11 +3823,6 @@ impl std::fmt::Display for Include { } } -impl Default for Include { - fn default() -> Include { - Include::Noop - } -} impl Include { pub fn is_noop(&self) -> bool { matches!(self, Include::Noop) @@ -5065,7 +4992,7 @@ pub struct PutEmployeeBenefitRequest { pub version: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetCompanyPayrollsInclude { #[serde(rename = "benefits")] Benefits, @@ -5074,6 +5001,7 @@ pub enum GetCompanyPayrollsInclude { #[serde(rename = "taxes")] Taxes, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5092,24 +5020,20 @@ impl std::fmt::Display for GetCompanyPayrollsInclude { } } -impl Default for GetCompanyPayrollsInclude { - fn default() -> GetCompanyPayrollsInclude { - GetCompanyPayrollsInclude::Noop - } -} impl GetCompanyPayrollsInclude { pub fn is_noop(&self) -> bool { matches!(self, GetCompanyPayrollsInclude::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OffCycleReason { #[serde(rename = "Bonus")] Bonus, #[serde(rename = "Correction")] Correction, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5127,11 +5051,6 @@ impl std::fmt::Display for OffCycleReason { } } -impl Default for OffCycleReason { - fn default() -> OffCycleReason { - OffCycleReason::Noop - } -} impl OffCycleReason { pub fn is_noop(&self) -> bool { matches!(self, OffCycleReason::Noop) @@ -5588,15 +5507,16 @@ pub struct GetCompanyCustomFieldsResponse { } /** -* Must be "Employee" if send_offer is set to true. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Must be "Employee" if send_offer is set to true. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OnboardingPersonType { #[serde(rename = "Contractor")] Contractor, #[serde(rename = "Employee")] Employee, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5614,11 +5534,6 @@ impl std::fmt::Display for OnboardingPersonType { } } -impl Default for OnboardingPersonType { - fn default() -> OnboardingPersonType { - OnboardingPersonType::Noop - } -} impl OnboardingPersonType { pub fn is_noop(&self) -> bool { matches!(self, OnboardingPersonType::Noop) diff --git a/mailchimp/src/types.rs b/mailchimp/src/types.rs index 6a822b9a..6fd5689b 100644 --- a/mailchimp/src/types.rs +++ b/mailchimp/src/types.rs @@ -86,9 +86,9 @@ pub struct Interest { } /** -* Determines how this category’s interests appear on signup forms. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Determines how this category’s interests appear on signup forms. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Type { #[serde(rename = "checkboxes")] Checkboxes, @@ -99,6 +99,7 @@ pub enum Type { #[serde(rename = "radio")] Radio, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -118,11 +119,6 @@ impl std::fmt::Display for Type { } } -impl Default for Type { - fn default() -> Type { - Type::Noop - } -} impl Type { pub fn is_noop(&self) -> bool { matches!(self, Type::Noop) @@ -364,9 +360,9 @@ pub struct ECommerceProductVariant { } /** -* The type of pricing plan the account is on. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of pricing plan the account is on. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PricingPlanType { #[serde(rename = "forever_free")] ForeverFree, @@ -375,6 +371,7 @@ pub enum PricingPlanType { #[serde(rename = "pay_as_you_go")] PayAsYouGo, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -393,11 +390,6 @@ impl std::fmt::Display for PricingPlanType { } } -impl Default for PricingPlanType { - fn default() -> PricingPlanType { - PricingPlanType::Noop - } -} impl PricingPlanType { pub fn is_noop(&self) -> bool { matches!(self, PricingPlanType::Noop) @@ -507,9 +499,9 @@ pub struct IndustryStats { } /** -* The HTTP method that should be used when accessing the URL defined in 'href'. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The HTTP method that should be used when accessing the URL defined in 'href'. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Method { #[serde(rename = "DELETE")] Delete, @@ -526,6 +518,7 @@ pub enum Method { #[serde(rename = "PUT")] Put, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -548,11 +541,6 @@ impl std::fmt::Display for Method { } } -impl Default for Method { - fn default() -> Method { - Method::Noop - } -} impl Method { pub fn is_noop(&self) -> bool { matches!(self, Method::Noop) @@ -780,9 +768,9 @@ pub struct ApiRoot { } /** -* The type of activity -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of activity + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetActivityFeedChimpChatterResponseType { #[serde(rename = "campaigns:facebook-likes")] CampaignsFacebookLikes, @@ -797,6 +785,7 @@ pub enum GetActivityFeedChimpChatterResponseType { #[serde(rename = "lists:unsubscribes")] ListsUnsubscribes, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -822,11 +811,6 @@ impl std::fmt::Display for GetActivityFeedChimpChatterResponseType { } } -impl Default for GetActivityFeedChimpChatterResponseType { - fn default() -> GetActivityFeedChimpChatterResponseType { - GetActivityFeedChimpChatterResponseType::Noop - } -} impl GetActivityFeedChimpChatterResponseType { pub fn is_noop(&self) -> bool { matches!(self, GetActivityFeedChimpChatterResponseType::Noop) @@ -1015,9 +999,9 @@ pub struct GetAuthorizedAppsResponse { } /** -* Restrict the results to automations with the specified status. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Restrict the results to automations with the specified status. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Status { #[serde(rename = "paused")] Paused, @@ -1026,6 +1010,7 @@ pub enum Status { #[serde(rename = "sending")] Sending, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1044,11 +1029,6 @@ impl std::fmt::Display for Status { } } -impl Default for Status { - fn default() -> Status { - Status::Noop - } -} impl Status { pub fn is_noop(&self) -> bool { matches!(self, Status::Noop) @@ -1056,15 +1036,16 @@ impl Status { } /** -* Segment match type. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment match type. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Match { #[serde(rename = "all")] All, #[serde(rename = "any")] Any, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1082,22 +1063,18 @@ impl std::fmt::Display for Match { } } -impl Default for Match { - fn default() -> Match { - Match::Noop - } -} impl Match { pub fn is_noop(&self) -> bool { matches!(self, Match::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ConditionType { #[serde(rename = "Aim")] Aim, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1114,11 +1091,6 @@ impl std::fmt::Display for ConditionType { } } -impl Default for ConditionType { - fn default() -> ConditionType { - ConditionType::Noop - } -} impl ConditionType { pub fn is_noop(&self) -> bool { matches!(self, ConditionType::Noop) @@ -1126,13 +1098,14 @@ impl ConditionType { } /** -* Segment by interaction with a specific campaign. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by interaction with a specific campaign. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Field { #[serde(rename = "aim")] Aim, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1149,11 +1122,6 @@ impl std::fmt::Display for Field { } } -impl Default for Field { - fn default() -> Field { - Field::Noop - } -} impl Field { pub fn is_noop(&self) -> bool { matches!(self, Field::Noop) @@ -1161,9 +1129,9 @@ impl Field { } /** -* The status of the member with regard to their campaign interaction. One of the following: opened, clicked, was sent, didn't open, didn't click, or was not sent. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the member with regard to their campaign interaction. One of the following: opened, clicked, was sent, didn't open, didn't click, or was not sent. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Op { #[serde(rename = "click")] Click, @@ -1178,6 +1146,7 @@ pub enum Op { #[serde(rename = "sent")] Sent, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1199,11 +1168,6 @@ impl std::fmt::Display for Op { } } -impl Default for Op { - fn default() -> Op { - Op::Noop - } -} impl Op { pub fn is_noop(&self) -> bool { matches!(self, Op::Noop) @@ -1239,11 +1203,12 @@ pub struct Conditions { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AutomationSegmentConditionType { #[serde(rename = "Automation")] Automation, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1260,11 +1225,6 @@ impl std::fmt::Display for AutomationSegmentConditionType { } } -impl Default for AutomationSegmentConditionType { - fn default() -> AutomationSegmentConditionType { - AutomationSegmentConditionType::Noop - } -} impl AutomationSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, AutomationSegmentConditionType::Noop) @@ -1272,13 +1232,14 @@ impl AutomationSegmentConditionType { } /** -* Segment by interaction with an Automation workflow. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by interaction with an Automation workflow. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SegmentField { #[serde(rename = "automation")] Automation, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1295,11 +1256,6 @@ impl std::fmt::Display for SegmentField { } } -impl Default for SegmentField { - fn default() -> SegmentField { - SegmentField::Noop - } -} impl SegmentField { pub fn is_noop(&self) -> bool { matches!(self, SegmentField::Noop) @@ -1307,9 +1263,9 @@ impl SegmentField { } /** -* The status of the member with regard to the automation workflow. One of the following: has started the workflow, has completed the workflow, has not started the workflow, or has not completed the workflow. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the member with regard to the automation workflow. One of the following: has started the workflow, has completed the workflow, has not started the workflow, or has not completed the workflow. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SegmentOperator { #[serde(rename = "completed")] Completed, @@ -1320,6 +1276,7 @@ pub enum SegmentOperator { #[serde(rename = "started")] Started, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1339,11 +1296,6 @@ impl std::fmt::Display for SegmentOperator { } } -impl Default for SegmentOperator { - fn default() -> SegmentOperator { - SegmentOperator::Noop - } -} impl SegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, SegmentOperator::Noop) @@ -1379,11 +1331,12 @@ pub struct AutomationSegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PollActivitySegmentConditionType { #[serde(rename = "CampaignPoll")] CampaignPoll, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1400,11 +1353,6 @@ impl std::fmt::Display for PollActivitySegmentConditionType { } } -impl Default for PollActivitySegmentConditionType { - fn default() -> PollActivitySegmentConditionType { - PollActivitySegmentConditionType::Noop - } -} impl PollActivitySegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, PollActivitySegmentConditionType::Noop) @@ -1412,13 +1360,14 @@ impl PollActivitySegmentConditionType { } /** -* Segment by poll activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by poll activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PollActivitySegmentField { #[serde(rename = "poll")] Poll, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1435,11 +1384,6 @@ impl std::fmt::Display for PollActivitySegmentField { } } -impl Default for PollActivitySegmentField { - fn default() -> PollActivitySegmentField { - PollActivitySegmentField::Noop - } -} impl PollActivitySegmentField { pub fn is_noop(&self) -> bool { matches!(self, PollActivitySegmentField::Noop) @@ -1447,15 +1391,16 @@ impl PollActivitySegmentField { } /** -* Members have/have not interacted with a specific poll in a Mailchimp email. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Members have/have not interacted with a specific poll in a Mailchimp email. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PollActivitySegmentOperator { #[serde(rename = "member")] Member, #[serde(rename = "notmember")] Notmember, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1473,11 +1418,6 @@ impl std::fmt::Display for PollActivitySegmentOperator { } } -impl Default for PollActivitySegmentOperator { - fn default() -> PollActivitySegmentOperator { - PollActivitySegmentOperator::Noop - } -} impl PollActivitySegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, PollActivitySegmentOperator::Noop) @@ -1513,11 +1453,12 @@ pub struct PollActivitySegment { pub value: f64, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ConversationSegmentConditionType { #[serde(rename = "Conversation")] Conversation, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1534,11 +1475,6 @@ impl std::fmt::Display for ConversationSegmentConditionType { } } -impl Default for ConversationSegmentConditionType { - fn default() -> ConversationSegmentConditionType { - ConversationSegmentConditionType::Noop - } -} impl ConversationSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, ConversationSegmentConditionType::Noop) @@ -1546,13 +1482,14 @@ impl ConversationSegmentConditionType { } /** -* Segment by interaction with a campaign via Conversations. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by interaction with a campaign via Conversations. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ConversationSegmentField { #[serde(rename = "conversation")] Conversation, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1569,11 +1506,6 @@ impl std::fmt::Display for ConversationSegmentField { } } -impl Default for ConversationSegmentField { - fn default() -> ConversationSegmentField { - ConversationSegmentField::Noop - } -} impl ConversationSegmentField { pub fn is_noop(&self) -> bool { matches!(self, ConversationSegmentField::Noop) @@ -1609,11 +1541,12 @@ pub struct ConversationSegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DateSegmentConditionType { #[serde(rename = "Date")] Date, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1630,11 +1563,6 @@ impl std::fmt::Display for DateSegmentConditionType { } } -impl Default for DateSegmentConditionType { - fn default() -> DateSegmentConditionType { - DateSegmentConditionType::Noop - } -} impl DateSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, DateSegmentConditionType::Noop) @@ -1642,9 +1570,9 @@ impl DateSegmentConditionType { } /** -* The type of date field to segment on: The opt-in time for a signup, the date the subscriber was last updated, or the date of their last ecomm purchase. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of date field to segment on: The opt-in time for a signup, the date the subscriber was last updated, or the date of their last ecomm purchase. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DateSegmentField { #[serde(rename = "ecomm_date")] EcommDate, @@ -1653,6 +1581,7 @@ pub enum DateSegmentField { #[serde(rename = "timestamp_opt")] TimestampOpt, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1671,11 +1600,6 @@ impl std::fmt::Display for DateSegmentField { } } -impl Default for DateSegmentField { - fn default() -> DateSegmentField { - DateSegmentField::Noop - } -} impl DateSegmentField { pub fn is_noop(&self) -> bool { matches!(self, DateSegmentField::Noop) @@ -1683,9 +1607,9 @@ impl DateSegmentField { } /** -* When the event took place: Before, after, is a specific date, is not a specific date, is blank, or is not blank. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * When the event took place: Before, after, is a specific date, is not a specific date, is blank, or is not blank. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DateSegmentOperator { #[serde(rename = "blank")] Blank, @@ -1704,6 +1628,7 @@ pub enum DateSegmentOperator { #[serde(rename = "within")] Within, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1727,11 +1652,6 @@ impl std::fmt::Display for DateSegmentOperator { } } -impl Default for DateSegmentOperator { - fn default() -> DateSegmentOperator { - DateSegmentOperator::Noop - } -} impl DateSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, DateSegmentOperator::Noop) @@ -1776,11 +1696,12 @@ pub struct DateSegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EmailClientSegmentConditionType { #[serde(rename = "EmailClient")] EmailClient, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1797,11 +1718,6 @@ impl std::fmt::Display for EmailClientSegmentConditionType { } } -impl Default for EmailClientSegmentConditionType { - fn default() -> EmailClientSegmentConditionType { - EmailClientSegmentConditionType::Noop - } -} impl EmailClientSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, EmailClientSegmentConditionType::Noop) @@ -1809,13 +1725,14 @@ impl EmailClientSegmentConditionType { } /** -* Segment by use of a particular email client. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by use of a particular email client. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EmailClientSegmentField { #[serde(rename = "email_client")] EmailClient, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1832,11 +1749,6 @@ impl std::fmt::Display for EmailClientSegmentField { } } -impl Default for EmailClientSegmentField { - fn default() -> EmailClientSegmentField { - EmailClientSegmentField::Noop - } -} impl EmailClientSegmentField { pub fn is_noop(&self) -> bool { matches!(self, EmailClientSegmentField::Noop) @@ -1844,15 +1756,16 @@ impl EmailClientSegmentField { } /** -* The operation to determine whether we select clients that match the value, or clients that do not match the value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The operation to determine whether we select clients that match the value, or clients that do not match the value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EmailClientSegmentOperator { #[serde(rename = "client_is")] ClientIs, #[serde(rename = "client_not")] ClientNot, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1870,11 +1783,6 @@ impl std::fmt::Display for EmailClientSegmentOperator { } } -impl Default for EmailClientSegmentOperator { - fn default() -> EmailClientSegmentOperator { - EmailClientSegmentOperator::Noop - } -} impl EmailClientSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, EmailClientSegmentOperator::Noop) @@ -1910,11 +1818,12 @@ pub struct EmailClientSegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LanguageSegmentConditionType { #[serde(rename = "Language")] Language, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1931,11 +1840,6 @@ impl std::fmt::Display for LanguageSegmentConditionType { } } -impl Default for LanguageSegmentConditionType { - fn default() -> LanguageSegmentConditionType { - LanguageSegmentConditionType::Noop - } -} impl LanguageSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, LanguageSegmentConditionType::Noop) @@ -1943,13 +1847,14 @@ impl LanguageSegmentConditionType { } /** -* Segmenting based off of a subscriber's language. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segmenting based off of a subscriber's language. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LanguageSegmentField { #[serde(rename = "language")] Language, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1966,11 +1871,6 @@ impl std::fmt::Display for LanguageSegmentField { } } -impl Default for LanguageSegmentField { - fn default() -> LanguageSegmentField { - LanguageSegmentField::Noop - } -} impl LanguageSegmentField { pub fn is_noop(&self) -> bool { matches!(self, LanguageSegmentField::Noop) @@ -1978,15 +1878,16 @@ impl LanguageSegmentField { } /** -* Whether the member's language is or is not set to a specific language. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether the member's language is or is not set to a specific language. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LanguageSegmentOperator { #[serde(rename = "is")] Is, #[serde(rename = "not")] Not, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2004,11 +1905,6 @@ impl std::fmt::Display for LanguageSegmentOperator { } } -impl Default for LanguageSegmentOperator { - fn default() -> LanguageSegmentOperator { - LanguageSegmentOperator::Noop - } -} impl LanguageSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, LanguageSegmentOperator::Noop) @@ -2044,11 +1940,12 @@ pub struct LanguageSegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MemberRatingSegmentConditionType { #[serde(rename = "MemberRating")] MemberRating, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2065,11 +1962,6 @@ impl std::fmt::Display for MemberRatingSegmentConditionType { } } -impl Default for MemberRatingSegmentConditionType { - fn default() -> MemberRatingSegmentConditionType { - MemberRatingSegmentConditionType::Noop - } -} impl MemberRatingSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, MemberRatingSegmentConditionType::Noop) @@ -2077,13 +1969,14 @@ impl MemberRatingSegmentConditionType { } /** -* Segment by member rating. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by member rating. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MemberRatingSegmentField { #[serde(rename = "rating")] Rating, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2100,11 +1993,6 @@ impl std::fmt::Display for MemberRatingSegmentField { } } -impl Default for MemberRatingSegmentField { - fn default() -> MemberRatingSegmentField { - MemberRatingSegmentField::Noop - } -} impl MemberRatingSegmentField { pub fn is_noop(&self) -> bool { matches!(self, MemberRatingSegmentField::Noop) @@ -2112,9 +2000,9 @@ impl MemberRatingSegmentField { } /** -* Members who have have a rating that is/not exactly a given number or members who have a rating greater/less than a given number. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Members who have have a rating that is/not exactly a given number or members who have a rating greater/less than a given number. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MemberRatingSegmentOperator { #[serde(rename = "greater")] Greater, @@ -2125,6 +2013,7 @@ pub enum MemberRatingSegmentOperator { #[serde(rename = "not")] Not, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2144,11 +2033,6 @@ impl std::fmt::Display for MemberRatingSegmentOperator { } } -impl Default for MemberRatingSegmentOperator { - fn default() -> MemberRatingSegmentOperator { - MemberRatingSegmentOperator::Noop - } -} impl MemberRatingSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, MemberRatingSegmentOperator::Noop) @@ -2184,11 +2068,12 @@ pub struct MemberRatingSegment { pub value: f64, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SignupSourceSegmentType { #[serde(rename = "SignupSource")] SignupSource, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2205,22 +2090,18 @@ impl std::fmt::Display for SignupSourceSegmentType { } } -impl Default for SignupSourceSegmentType { - fn default() -> SignupSourceSegmentType { - SignupSourceSegmentType::Noop - } -} impl SignupSourceSegmentType { pub fn is_noop(&self) -> bool { matches!(self, SignupSourceSegmentType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SignupSourceSegmentField { #[serde(rename = "source")] Source, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2237,11 +2118,6 @@ impl std::fmt::Display for SignupSourceSegmentField { } } -impl Default for SignupSourceSegmentField { - fn default() -> SignupSourceSegmentField { - SignupSourceSegmentField::Noop - } -} impl SignupSourceSegmentField { pub fn is_noop(&self) -> bool { matches!(self, SignupSourceSegmentField::Noop) @@ -2249,15 +2125,16 @@ impl SignupSourceSegmentField { } /** -* Whether the member's signup source was/was not a particular value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether the member's signup source was/was not a particular value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SignupSourceSegmentOperator { #[serde(rename = "source_is")] SourceIs, #[serde(rename = "source_not")] SourceNot, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2275,11 +2152,6 @@ impl std::fmt::Display for SignupSourceSegmentOperator { } } -impl Default for SignupSourceSegmentOperator { - fn default() -> SignupSourceSegmentOperator { - SignupSourceSegmentOperator::Noop - } -} impl SignupSourceSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, SignupSourceSegmentOperator::Noop) @@ -2309,11 +2181,12 @@ pub struct SignupSourceSegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SurveyMonkeySegmentConditionType { #[serde(rename = "SurveyMonkey")] SurveyMonkey, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2330,11 +2203,6 @@ impl std::fmt::Display for SurveyMonkeySegmentConditionType { } } -impl Default for SurveyMonkeySegmentConditionType { - fn default() -> SurveyMonkeySegmentConditionType { - SurveyMonkeySegmentConditionType::Noop - } -} impl SurveyMonkeySegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, SurveyMonkeySegmentConditionType::Noop) @@ -2342,13 +2210,14 @@ impl SurveyMonkeySegmentConditionType { } /** -* Segment by interaction with a SurveyMonkey survey. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by interaction with a SurveyMonkey survey. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SurveyMonkeySegmentField { #[serde(rename = "survey_monkey")] SurveyMonkey, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2365,11 +2234,6 @@ impl std::fmt::Display for SurveyMonkeySegmentField { } } -impl Default for SurveyMonkeySegmentField { - fn default() -> SurveyMonkeySegmentField { - SurveyMonkeySegmentField::Noop - } -} impl SurveyMonkeySegmentField { pub fn is_noop(&self) -> bool { matches!(self, SurveyMonkeySegmentField::Noop) @@ -2405,11 +2269,12 @@ pub struct SurveyMonkeySegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum VipSegmentConditionType { #[serde(rename = "VIP")] Vip, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2426,11 +2291,6 @@ impl std::fmt::Display for VipSegmentConditionType { } } -impl Default for VipSegmentConditionType { - fn default() -> VipSegmentConditionType { - VipSegmentConditionType::Noop - } -} impl VipSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, VipSegmentConditionType::Noop) @@ -2438,13 +2298,14 @@ impl VipSegmentConditionType { } /** -* Segment by VIP status. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by VIP status. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum VipSegmentField { #[serde(rename = "gmonkey")] Gmonkey, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2461,11 +2322,6 @@ impl std::fmt::Display for VipSegmentField { } } -impl Default for VipSegmentField { - fn default() -> VipSegmentField { - VipSegmentField::Noop - } -} impl VipSegmentField { pub fn is_noop(&self) -> bool { matches!(self, VipSegmentField::Noop) @@ -2492,11 +2348,12 @@ pub struct VipSegment { pub op: PollActivitySegmentOperator, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum InterestsSegmentConditionType { #[serde(rename = "Interests")] Interests, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2513,11 +2370,6 @@ impl std::fmt::Display for InterestsSegmentConditionType { } } -impl Default for InterestsSegmentConditionType { - fn default() -> InterestsSegmentConditionType { - InterestsSegmentConditionType::Noop - } -} impl InterestsSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, InterestsSegmentConditionType::Noop) @@ -2525,9 +2377,9 @@ impl InterestsSegmentConditionType { } /** -* Whether the member is a part of one, all, or none of the groups. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether the member is a part of one, all, or none of the groups. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum InterestsSegmentOperator { #[serde(rename = "interestcontains")] Interestcontains, @@ -2536,6 +2388,7 @@ pub enum InterestsSegmentOperator { #[serde(rename = "interestnotcontains")] Interestnotcontains, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2554,11 +2407,6 @@ impl std::fmt::Display for InterestsSegmentOperator { } } -impl Default for InterestsSegmentOperator { - fn default() -> InterestsSegmentOperator { - InterestsSegmentOperator::Noop - } -} impl InterestsSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, InterestsSegmentOperator::Noop) @@ -2598,11 +2446,12 @@ pub struct InterestsSegment { pub value: Vec, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EcommerceCategorySegmentConditionType { #[serde(rename = "EcommCategory")] EcommCategory, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2619,11 +2468,6 @@ impl std::fmt::Display for EcommerceCategorySegmentConditionType { } } -impl Default for EcommerceCategorySegmentConditionType { - fn default() -> EcommerceCategorySegmentConditionType { - EcommerceCategorySegmentConditionType::Noop - } -} impl EcommerceCategorySegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, EcommerceCategorySegmentConditionType::Noop) @@ -2631,15 +2475,16 @@ impl EcommerceCategorySegmentConditionType { } /** -* Segment by purchases in specific items or categories. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by purchases in specific items or categories. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EcommerceCategorySegmentField { #[serde(rename = "ecomm_cat")] EcommCat, #[serde(rename = "ecomm_prod")] EcommProd, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2657,11 +2502,6 @@ impl std::fmt::Display for EcommerceCategorySegmentField { } } -impl Default for EcommerceCategorySegmentField { - fn default() -> EcommerceCategorySegmentField { - EcommerceCategorySegmentField::Noop - } -} impl EcommerceCategorySegmentField { pub fn is_noop(&self) -> bool { matches!(self, EcommerceCategorySegmentField::Noop) @@ -2669,9 +2509,9 @@ impl EcommerceCategorySegmentField { } /** -* A member who has purchased from a category/specific item that is/is not a specific name, where the category/item name contains/doesn't contain a specific phrase or string, or a category/item name that starts/ends with a string. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * A member who has purchased from a category/specific item that is/is not a specific name, where the category/item name contains/doesn't contain a specific phrase or string, or a category/item name that starts/ends with a string. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EcommerceCategorySegmentOperator { #[serde(rename = "contains")] Contains, @@ -2686,6 +2526,7 @@ pub enum EcommerceCategorySegmentOperator { #[serde(rename = "starts")] Starts, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2707,11 +2548,6 @@ impl std::fmt::Display for EcommerceCategorySegmentOperator { } } -impl Default for EcommerceCategorySegmentOperator { - fn default() -> EcommerceCategorySegmentOperator { - EcommerceCategorySegmentOperator::Noop - } -} impl EcommerceCategorySegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, EcommerceCategorySegmentOperator::Noop) @@ -2747,11 +2583,12 @@ pub struct EcommerceCategorySegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EcommerceNumberSegmentConditionType { #[serde(rename = "EcommNumber")] EcommNumber, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2768,11 +2605,6 @@ impl std::fmt::Display for EcommerceNumberSegmentConditionType { } } -impl Default for EcommerceNumberSegmentConditionType { - fn default() -> EcommerceNumberSegmentConditionType { - EcommerceNumberSegmentConditionType::Noop - } -} impl EcommerceNumberSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, EcommerceNumberSegmentConditionType::Noop) @@ -2780,9 +2612,9 @@ impl EcommerceNumberSegmentConditionType { } /** -* Segment by average spent total, number of orders, total number of products purchased, or average number of products per order. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by average spent total, number of orders, total number of products purchased, or average number of products per order. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EcommerceNumberSegmentField { #[serde(rename = "ecomm_avg_ord")] EcommAvgOrd, @@ -2793,6 +2625,7 @@ pub enum EcommerceNumberSegmentField { #[serde(rename = "ecomm_spent_avg")] EcommSpentAvg, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2812,11 +2645,6 @@ impl std::fmt::Display for EcommerceNumberSegmentField { } } -impl Default for EcommerceNumberSegmentField { - fn default() -> EcommerceNumberSegmentField { - EcommerceNumberSegmentField::Noop - } -} impl EcommerceNumberSegmentField { pub fn is_noop(&self) -> bool { matches!(self, EcommerceNumberSegmentField::Noop) @@ -2852,11 +2680,12 @@ pub struct EcommerceNumberSegment { pub value: f64, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EcommercePurchasedSegmentConditionType { #[serde(rename = "EcommPurchased")] EcommPurchased, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2873,11 +2702,6 @@ impl std::fmt::Display for EcommercePurchasedSegmentConditionType { } } -impl Default for EcommercePurchasedSegmentConditionType { - fn default() -> EcommercePurchasedSegmentConditionType { - EcommercePurchasedSegmentConditionType::Noop - } -} impl EcommercePurchasedSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, EcommercePurchasedSegmentConditionType::Noop) @@ -2885,13 +2709,14 @@ impl EcommercePurchasedSegmentConditionType { } /** -* Segment by whether someone has purchased anything. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by whether someone has purchased anything. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EcommercePurchasedSegmentField { #[serde(rename = "ecomm_purchased")] EcommPurchased, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2908,11 +2733,6 @@ impl std::fmt::Display for EcommercePurchasedSegmentField { } } -impl Default for EcommercePurchasedSegmentField { - fn default() -> EcommercePurchasedSegmentField { - EcommercePurchasedSegmentField::Noop - } -} impl EcommercePurchasedSegmentField { pub fn is_noop(&self) -> bool { matches!(self, EcommercePurchasedSegmentField::Noop) @@ -2939,11 +2759,12 @@ pub struct EcommercePurchasedSegment { pub op: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EcommerceSpentSegmentConditionType { #[serde(rename = "EcommSpent")] EcommSpent, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2960,11 +2781,6 @@ impl std::fmt::Display for EcommerceSpentSegmentConditionType { } } -impl Default for EcommerceSpentSegmentConditionType { - fn default() -> EcommerceSpentSegmentConditionType { - EcommerceSpentSegmentConditionType::Noop - } -} impl EcommerceSpentSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, EcommerceSpentSegmentConditionType::Noop) @@ -2972,15 +2788,16 @@ impl EcommerceSpentSegmentConditionType { } /** -* Segment by amount spent on a single order or across all orders. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by amount spent on a single order or across all orders. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EcommerceSpentSegmentField { #[serde(rename = "ecomm_spent_all")] EcommSpentAll, #[serde(rename = "ecomm_spent_one")] EcommSpentOne, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2998,11 +2815,6 @@ impl std::fmt::Display for EcommerceSpentSegmentField { } } -impl Default for EcommerceSpentSegmentField { - fn default() -> EcommerceSpentSegmentField { - EcommerceSpentSegmentField::Noop - } -} impl EcommerceSpentSegmentField { pub fn is_noop(&self) -> bool { matches!(self, EcommerceSpentSegmentField::Noop) @@ -3010,15 +2822,16 @@ impl EcommerceSpentSegmentField { } /** -* Members who have spent 'more' or 'less' than then specified value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Members who have spent 'more' or 'less' than then specified value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EcommerceSpentSegmentOperator { #[serde(rename = "greater")] Greater, #[serde(rename = "less")] Less, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3036,11 +2849,6 @@ impl std::fmt::Display for EcommerceSpentSegmentOperator { } } -impl Default for EcommerceSpentSegmentOperator { - fn default() -> EcommerceSpentSegmentOperator { - EcommerceSpentSegmentOperator::Noop - } -} impl EcommerceSpentSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, EcommerceSpentSegmentOperator::Noop) @@ -3076,11 +2884,12 @@ pub struct EcommerceSpentSegment { pub value: i64, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EcommercePurchasedStoreSegmentConditionType { #[serde(rename = "EcommStore")] EcommStore, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3097,11 +2906,6 @@ impl std::fmt::Display for EcommercePurchasedStoreSegmentConditionType { } } -impl Default for EcommercePurchasedStoreSegmentConditionType { - fn default() -> EcommercePurchasedStoreSegmentConditionType { - EcommercePurchasedStoreSegmentConditionType::Noop - } -} impl EcommercePurchasedStoreSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, EcommercePurchasedStoreSegmentConditionType::Noop) @@ -3109,13 +2913,14 @@ impl EcommercePurchasedStoreSegmentConditionType { } /** -* Segment by purchases from a specific store. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by purchases from a specific store. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EcommercePurchasedStoreSegmentField { #[serde(rename = "ecomm_store")] EcommStore, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3132,11 +2937,6 @@ impl std::fmt::Display for EcommercePurchasedStoreSegmentField { } } -impl Default for EcommercePurchasedStoreSegmentField { - fn default() -> EcommercePurchasedStoreSegmentField { - EcommercePurchasedStoreSegmentField::Noop - } -} impl EcommercePurchasedStoreSegmentField { pub fn is_noop(&self) -> bool { matches!(self, EcommercePurchasedStoreSegmentField::Noop) @@ -3172,11 +2972,12 @@ pub struct EcommercePurchasedStoreSegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GoalActivitySegmentConditionType { #[serde(rename = "GoalActivity")] GoalActivity, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3193,11 +2994,6 @@ impl std::fmt::Display for GoalActivitySegmentConditionType { } } -impl Default for GoalActivitySegmentConditionType { - fn default() -> GoalActivitySegmentConditionType { - GoalActivitySegmentConditionType::Noop - } -} impl GoalActivitySegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, GoalActivitySegmentConditionType::Noop) @@ -3205,13 +3001,14 @@ impl GoalActivitySegmentConditionType { } /** -* Segment by Goal activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by Goal activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GoalActivitySegmentField { #[serde(rename = "goal")] Goal, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3228,11 +3025,6 @@ impl std::fmt::Display for GoalActivitySegmentField { } } -impl Default for GoalActivitySegmentField { - fn default() -> GoalActivitySegmentField { - GoalActivitySegmentField::Noop - } -} impl GoalActivitySegmentField { pub fn is_noop(&self) -> bool { matches!(self, GoalActivitySegmentField::Noop) @@ -3240,9 +3032,9 @@ impl GoalActivitySegmentField { } /** -* Whether the website URL is/not exactly, contains/doesn't contain, starts with/ends with a string. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether the website URL is/not exactly, contains/doesn't contain, starts with/ends with a string. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GoalActivitySegmentOperator { #[serde(rename = "contains")] Contains, @@ -3257,6 +3049,7 @@ pub enum GoalActivitySegmentOperator { #[serde(rename = "starts")] Starts, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3278,11 +3071,6 @@ impl std::fmt::Display for GoalActivitySegmentOperator { } } -impl Default for GoalActivitySegmentOperator { - fn default() -> GoalActivitySegmentOperator { - GoalActivitySegmentOperator::Noop - } -} impl GoalActivitySegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, GoalActivitySegmentOperator::Noop) @@ -3318,11 +3106,12 @@ pub struct GoalActivitySegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GoalTimestampSegmentConditionType { #[serde(rename = "GoalTimestamp")] GoalTimestamp, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3339,11 +3128,6 @@ impl std::fmt::Display for GoalTimestampSegmentConditionType { } } -impl Default for GoalTimestampSegmentConditionType { - fn default() -> GoalTimestampSegmentConditionType { - GoalTimestampSegmentConditionType::Noop - } -} impl GoalTimestampSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, GoalTimestampSegmentConditionType::Noop) @@ -3351,13 +3135,14 @@ impl GoalTimestampSegmentConditionType { } /** -* Segment by most recent interaction with a website. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by most recent interaction with a website. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GoalTimestampSegmentField { #[serde(rename = "goal_last_visited")] GoalLastVisited, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3374,11 +3159,6 @@ impl std::fmt::Display for GoalTimestampSegmentField { } } -impl Default for GoalTimestampSegmentField { - fn default() -> GoalTimestampSegmentField { - GoalTimestampSegmentField::Noop - } -} impl GoalTimestampSegmentField { pub fn is_noop(&self) -> bool { matches!(self, GoalTimestampSegmentField::Noop) @@ -3386,9 +3166,9 @@ impl GoalTimestampSegmentField { } /** -* Whether the website activity happened after, before, or at a given timestamp. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether the website activity happened after, before, or at a given timestamp. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GoalTimestampSegmentOperator { #[serde(rename = "greater")] Greater, @@ -3397,6 +3177,7 @@ pub enum GoalTimestampSegmentOperator { #[serde(rename = "less")] Less, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3415,11 +3196,6 @@ impl std::fmt::Display for GoalTimestampSegmentOperator { } } -impl Default for GoalTimestampSegmentOperator { - fn default() -> GoalTimestampSegmentOperator { - GoalTimestampSegmentOperator::Noop - } -} impl GoalTimestampSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, GoalTimestampSegmentOperator::Noop) @@ -3455,11 +3231,12 @@ pub struct GoalTimestampSegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SimilarSubscribersSegmentMemberConditionType { #[serde(rename = "FuzzySegment")] FuzzySegment, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3476,11 +3253,6 @@ impl std::fmt::Display for SimilarSubscribersSegmentMemberConditionType { } } -impl Default for SimilarSubscribersSegmentMemberConditionType { - fn default() -> SimilarSubscribersSegmentMemberConditionType { - SimilarSubscribersSegmentMemberConditionType::Noop - } -} impl SimilarSubscribersSegmentMemberConditionType { pub fn is_noop(&self) -> bool { matches!(self, SimilarSubscribersSegmentMemberConditionType::Noop) @@ -3488,13 +3260,14 @@ impl SimilarSubscribersSegmentMemberConditionType { } /** -* Segment by similar subscribers. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by similar subscribers. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SimilarSubscribersSegmentMemberField { #[serde(rename = "fuzzy_segment")] FuzzySegment, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3511,11 +3284,6 @@ impl std::fmt::Display for SimilarSubscribersSegmentMemberField { } } -impl Default for SimilarSubscribersSegmentMemberField { - fn default() -> SimilarSubscribersSegmentMemberField { - SimilarSubscribersSegmentMemberField::Noop - } -} impl SimilarSubscribersSegmentMemberField { pub fn is_noop(&self) -> bool { matches!(self, SimilarSubscribersSegmentMemberField::Noop) @@ -3523,15 +3291,16 @@ impl SimilarSubscribersSegmentMemberField { } /** -* Members who are/are not apart of a 'similar subscribers' segment. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Members who are/are not apart of a 'similar subscribers' segment. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SimilarSubscribersSegmentMemberOperator { #[serde(rename = "fuzzy_is")] FuzzyIs, #[serde(rename = "fuzzy_not")] FuzzyNot, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3549,11 +3318,6 @@ impl std::fmt::Display for SimilarSubscribersSegmentMemberOperator { } } -impl Default for SimilarSubscribersSegmentMemberOperator { - fn default() -> SimilarSubscribersSegmentMemberOperator { - SimilarSubscribersSegmentMemberOperator::Noop - } -} impl SimilarSubscribersSegmentMemberOperator { pub fn is_noop(&self) -> bool { matches!(self, SimilarSubscribersSegmentMemberOperator::Noop) @@ -3595,11 +3359,12 @@ pub struct SimilarSubscribersSegmentMember { pub value: f64, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum StaticSegmentMemberConditionType { #[serde(rename = "StaticSegment")] StaticSegment, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3616,11 +3381,6 @@ impl std::fmt::Display for StaticSegmentMemberConditionType { } } -impl Default for StaticSegmentMemberConditionType { - fn default() -> StaticSegmentMemberConditionType { - StaticSegmentMemberConditionType::Noop - } -} impl StaticSegmentMemberConditionType { pub fn is_noop(&self) -> bool { matches!(self, StaticSegmentMemberConditionType::Noop) @@ -3628,13 +3388,14 @@ impl StaticSegmentMemberConditionType { } /** -* Segment by a given static segment. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by a given static segment. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum StaticSegmentMemberField { #[serde(rename = "static_segment")] StaticSegment, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3651,11 +3412,6 @@ impl std::fmt::Display for StaticSegmentMemberField { } } -impl Default for StaticSegmentMemberField { - fn default() -> StaticSegmentMemberField { - StaticSegmentMemberField::Noop - } -} impl StaticSegmentMemberField { pub fn is_noop(&self) -> bool { matches!(self, StaticSegmentMemberField::Noop) @@ -3663,15 +3419,16 @@ impl StaticSegmentMemberField { } /** -* Members who are/are not apart of a static segment. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Members who are/are not apart of a static segment. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum StaticSegmentMemberOperator { #[serde(rename = "static_is")] StaticIs, #[serde(rename = "static_not")] StaticNot, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3689,11 +3446,6 @@ impl std::fmt::Display for StaticSegmentMemberOperator { } } -impl Default for StaticSegmentMemberOperator { - fn default() -> StaticSegmentMemberOperator { - StaticSegmentMemberOperator::Noop - } -} impl StaticSegmentMemberOperator { pub fn is_noop(&self) -> bool { matches!(self, StaticSegmentMemberOperator::Noop) @@ -3729,11 +3481,12 @@ pub struct StaticSegmentMember { pub value: f64, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LocationBasedSegmentConditionType { #[serde(rename = "IPGeoCountryState")] IpGeoCountryState, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3750,11 +3503,6 @@ impl std::fmt::Display for LocationBasedSegmentConditionType { } } -impl Default for LocationBasedSegmentConditionType { - fn default() -> LocationBasedSegmentConditionType { - LocationBasedSegmentConditionType::Noop - } -} impl LocationBasedSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, LocationBasedSegmentConditionType::Noop) @@ -3762,13 +3510,14 @@ impl LocationBasedSegmentConditionType { } /** -* Segmenting subscribers who are within a specific location. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segmenting subscribers who are within a specific location. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LocationBasedSegmentField { #[serde(rename = "ipgeo")] Ipgeo, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3785,11 +3534,6 @@ impl std::fmt::Display for LocationBasedSegmentField { } } -impl Default for LocationBasedSegmentField { - fn default() -> LocationBasedSegmentField { - LocationBasedSegmentField::Noop - } -} impl LocationBasedSegmentField { pub fn is_noop(&self) -> bool { matches!(self, LocationBasedSegmentField::Noop) @@ -3797,9 +3541,9 @@ impl LocationBasedSegmentField { } /** -* Segment members who are within a specific country or US state. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment members who are within a specific country or US state. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LocationBasedSegmentOperator { #[serde(rename = "ipgeocountry")] Ipgeocountry, @@ -3810,6 +3554,7 @@ pub enum LocationBasedSegmentOperator { #[serde(rename = "ipgeostate")] Ipgeostate, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3829,11 +3574,6 @@ impl std::fmt::Display for LocationBasedSegmentOperator { } } -impl Default for LocationBasedSegmentOperator { - fn default() -> LocationBasedSegmentOperator { - LocationBasedSegmentOperator::Noop - } -} impl LocationBasedSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, LocationBasedSegmentOperator::Noop) @@ -3869,11 +3609,12 @@ pub struct LocationBasedSegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GeolocationSegmentConditionType { #[serde(rename = "IPGeoIn")] IpGeoIn, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3890,11 +3631,6 @@ impl std::fmt::Display for GeolocationSegmentConditionType { } } -impl Default for GeolocationSegmentConditionType { - fn default() -> GeolocationSegmentConditionType { - GeolocationSegmentConditionType::Noop - } -} impl GeolocationSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, GeolocationSegmentConditionType::Noop) @@ -3902,15 +3638,16 @@ impl GeolocationSegmentConditionType { } /** -* Segment members who are within a specific geographic region. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment members who are within a specific geographic region. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GeolocationSegmentOperator { #[serde(rename = "ipgeoin")] Ipgeoin, #[serde(rename = "ipgeonotin")] Ipgeonotin, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3928,11 +3665,6 @@ impl std::fmt::Display for GeolocationSegmentOperator { } } -impl Default for GeolocationSegmentOperator { - fn default() -> GeolocationSegmentOperator { - GeolocationSegmentOperator::Noop - } -} impl GeolocationSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, GeolocationSegmentOperator::Noop) @@ -3995,11 +3727,12 @@ pub struct GeolocationSegment { pub value: i64, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UsZipCodeSegmentConditionType { #[serde(rename = "IPGeoInZip")] IpGeoInZip, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4016,11 +3749,6 @@ impl std::fmt::Display for UsZipCodeSegmentConditionType { } } -impl Default for UsZipCodeSegmentConditionType { - fn default() -> UsZipCodeSegmentConditionType { - UsZipCodeSegmentConditionType::Noop - } -} impl UsZipCodeSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, UsZipCodeSegmentConditionType::Noop) @@ -4028,13 +3756,14 @@ impl UsZipCodeSegmentConditionType { } /** -* Segment members who are within a specific US zip code. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment members who are within a specific US zip code. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UsZipCodeSegmentOperator { #[serde(rename = "ipgeoinzip")] Ipgeoinzip, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4051,11 +3780,6 @@ impl std::fmt::Display for UsZipCodeSegmentOperator { } } -impl Default for UsZipCodeSegmentOperator { - fn default() -> UsZipCodeSegmentOperator { - UsZipCodeSegmentOperator::Noop - } -} impl UsZipCodeSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, UsZipCodeSegmentOperator::Noop) @@ -4100,11 +3824,12 @@ pub struct UsZipCodeSegment { pub value: i64, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UnknownLocationBasedSegmentConditionType { #[serde(rename = "IPGeoUnknown")] IpGeoUnknown, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4121,11 +3846,6 @@ impl std::fmt::Display for UnknownLocationBasedSegmentConditionType { } } -impl Default for UnknownLocationBasedSegmentConditionType { - fn default() -> UnknownLocationBasedSegmentConditionType { - UnknownLocationBasedSegmentConditionType::Noop - } -} impl UnknownLocationBasedSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, UnknownLocationBasedSegmentConditionType::Noop) @@ -4133,13 +3853,14 @@ impl UnknownLocationBasedSegmentConditionType { } /** -* Segment members for which location information is unknown. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment members for which location information is unknown. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UnknownLocationBasedSegmentOperator { #[serde(rename = "ipgeounknown")] Ipgeounknown, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4156,11 +3877,6 @@ impl std::fmt::Display for UnknownLocationBasedSegmentOperator { } } -impl Default for UnknownLocationBasedSegmentOperator { - fn default() -> UnknownLocationBasedSegmentOperator { - UnknownLocationBasedSegmentOperator::Noop - } -} impl UnknownLocationBasedSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, UnknownLocationBasedSegmentOperator::Noop) @@ -4190,11 +3906,12 @@ pub struct UnknownLocationBasedSegment { pub op: UnknownLocationBasedSegmentOperator, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ZipCodeLocationBasedSegmentConditionType { #[serde(rename = "IPGeoZip")] IpGeoZip, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4211,11 +3928,6 @@ impl std::fmt::Display for ZipCodeLocationBasedSegmentConditionType { } } -impl Default for ZipCodeLocationBasedSegmentConditionType { - fn default() -> ZipCodeLocationBasedSegmentConditionType { - ZipCodeLocationBasedSegmentConditionType::Noop - } -} impl ZipCodeLocationBasedSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, ZipCodeLocationBasedSegmentConditionType::Noop) @@ -4223,15 +3935,16 @@ impl ZipCodeLocationBasedSegmentConditionType { } /** -* Segment members who are/are not within a specific US zip code. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment members who are/are not within a specific US zip code. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ZipCodeLocationBasedSegmentOperator { #[serde(rename = "ipgeoiszip")] Ipgeoiszip, #[serde(rename = "ipgeonotzip")] Ipgeonotzip, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4249,11 +3962,6 @@ impl std::fmt::Display for ZipCodeLocationBasedSegmentOperator { } } -impl Default for ZipCodeLocationBasedSegmentOperator { - fn default() -> ZipCodeLocationBasedSegmentOperator { - ZipCodeLocationBasedSegmentOperator::Noop - } -} impl ZipCodeLocationBasedSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, ZipCodeLocationBasedSegmentOperator::Noop) @@ -4292,11 +4000,12 @@ pub struct ZipCodeLocationBasedSegment { pub value: i64, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SocialProfilesAgeSegmentConditionType { #[serde(rename = "SocialAge")] SocialAge, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4313,11 +4022,6 @@ impl std::fmt::Display for SocialProfilesAgeSegmentConditionType { } } -impl Default for SocialProfilesAgeSegmentConditionType { - fn default() -> SocialProfilesAgeSegmentConditionType { - SocialProfilesAgeSegmentConditionType::Noop - } -} impl SocialProfilesAgeSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, SocialProfilesAgeSegmentConditionType::Noop) @@ -4325,13 +4029,14 @@ impl SocialProfilesAgeSegmentConditionType { } /** -* Segment by age ranges in Social Profiles data. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by age ranges in Social Profiles data. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SocialProfilesAgeSegmentField { #[serde(rename = "social_age")] SocialAge, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4348,11 +4053,6 @@ impl std::fmt::Display for SocialProfilesAgeSegmentField { } } -impl Default for SocialProfilesAgeSegmentField { - fn default() -> SocialProfilesAgeSegmentField { - SocialProfilesAgeSegmentField::Noop - } -} impl SocialProfilesAgeSegmentField { pub fn is_noop(&self) -> bool { matches!(self, SocialProfilesAgeSegmentField::Noop) @@ -4360,9 +4060,9 @@ impl SocialProfilesAgeSegmentField { } /** -* The age range to segment. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The age range to segment. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Value { #[serde(rename = "18-24")] OneThousandEightHundredAndTwentyFour, @@ -4373,6 +4073,7 @@ pub enum Value { #[serde(rename = "55+")] FiftyFive, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4392,11 +4093,6 @@ impl std::fmt::Display for Value { } } -impl Default for Value { - fn default() -> Value { - Value::Noop - } -} impl Value { pub fn is_noop(&self) -> bool { matches!(self, Value::Noop) @@ -4431,11 +4127,12 @@ pub struct SocialProfilesAgeSegment { pub value: Value, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SocialProfilesGenderSegmentConditionType { #[serde(rename = "SocialGender")] SocialGender, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4452,11 +4149,6 @@ impl std::fmt::Display for SocialProfilesGenderSegmentConditionType { } } -impl Default for SocialProfilesGenderSegmentConditionType { - fn default() -> SocialProfilesGenderSegmentConditionType { - SocialProfilesGenderSegmentConditionType::Noop - } -} impl SocialProfilesGenderSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, SocialProfilesGenderSegmentConditionType::Noop) @@ -4464,13 +4156,14 @@ impl SocialProfilesGenderSegmentConditionType { } /** -* Segment by listed gender in Social Profiles data. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by listed gender in Social Profiles data. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SocialProfilesGenderSegmentField { #[serde(rename = "social_gender")] SocialGender, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4487,11 +4180,6 @@ impl std::fmt::Display for SocialProfilesGenderSegmentField { } } -impl Default for SocialProfilesGenderSegmentField { - fn default() -> SocialProfilesGenderSegmentField { - SocialProfilesGenderSegmentField::Noop - } -} impl SocialProfilesGenderSegmentField { pub fn is_noop(&self) -> bool { matches!(self, SocialProfilesGenderSegmentField::Noop) @@ -4499,15 +4187,16 @@ impl SocialProfilesGenderSegmentField { } /** -* The Social Profiles gender to segment. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The Social Profiles gender to segment. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SocialProfilesGenderSegmentOperator { #[serde(rename = "female")] Female, #[serde(rename = "male")] Male, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4525,11 +4214,6 @@ impl std::fmt::Display for SocialProfilesGenderSegmentOperator { } } -impl Default for SocialProfilesGenderSegmentOperator { - fn default() -> SocialProfilesGenderSegmentOperator { - SocialProfilesGenderSegmentOperator::Noop - } -} impl SocialProfilesGenderSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, SocialProfilesGenderSegmentOperator::Noop) @@ -4567,11 +4251,12 @@ pub struct SocialProfilesGenderSegment { pub value: SocialProfilesGenderSegmentOperator, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SocialProfilesInfluenceSegmentConditionType { #[serde(rename = "SocialInfluence")] SocialInfluence, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4588,11 +4273,6 @@ impl std::fmt::Display for SocialProfilesInfluenceSegmentConditionType { } } -impl Default for SocialProfilesInfluenceSegmentConditionType { - fn default() -> SocialProfilesInfluenceSegmentConditionType { - SocialProfilesInfluenceSegmentConditionType::Noop - } -} impl SocialProfilesInfluenceSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, SocialProfilesInfluenceSegmentConditionType::Noop) @@ -4600,13 +4280,14 @@ impl SocialProfilesInfluenceSegmentConditionType { } /** -* Segment by influence rating in Social Profiles data. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by influence rating in Social Profiles data. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SocialProfilesInfluenceSegmentField { #[serde(rename = "social_influence")] SocialInfluence, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4623,11 +4304,6 @@ impl std::fmt::Display for SocialProfilesInfluenceSegmentField { } } -impl Default for SocialProfilesInfluenceSegmentField { - fn default() -> SocialProfilesInfluenceSegmentField { - SocialProfilesInfluenceSegmentField::Noop - } -} impl SocialProfilesInfluenceSegmentField { pub fn is_noop(&self) -> bool { matches!(self, SocialProfilesInfluenceSegmentField::Noop) @@ -4666,11 +4342,12 @@ pub struct SocialProfilesInfluenceSegment { pub value: f64, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SocialProfilesNetworkSegmentConditionType { #[serde(rename = "SocialNetworkMember")] SocialNetworkMember, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4687,11 +4364,6 @@ impl std::fmt::Display for SocialProfilesNetworkSegmentConditionType { } } -impl Default for SocialProfilesNetworkSegmentConditionType { - fn default() -> SocialProfilesNetworkSegmentConditionType { - SocialProfilesNetworkSegmentConditionType::Noop - } -} impl SocialProfilesNetworkSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, SocialProfilesNetworkSegmentConditionType::Noop) @@ -4699,13 +4371,14 @@ impl SocialProfilesNetworkSegmentConditionType { } /** -* Segment by social network in Social Profiles data. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by social network in Social Profiles data. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SocialProfilesNetworkSegmentField { #[serde(rename = "social_network")] SocialNetwork, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4722,11 +4395,6 @@ impl std::fmt::Display for SocialProfilesNetworkSegmentField { } } -impl Default for SocialProfilesNetworkSegmentField { - fn default() -> SocialProfilesNetworkSegmentField { - SocialProfilesNetworkSegmentField::Noop - } -} impl SocialProfilesNetworkSegmentField { pub fn is_noop(&self) -> bool { matches!(self, SocialProfilesNetworkSegmentField::Noop) @@ -4734,9 +4402,9 @@ impl SocialProfilesNetworkSegmentField { } /** -* The social network to segment against. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The social network to segment against. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SocialProfilesNetworkSegmentOperator { #[serde(rename = "facebook")] Facebook, @@ -4761,6 +4429,7 @@ pub enum SocialProfilesNetworkSegmentOperator { #[serde(rename = "youtube")] Youtube, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4787,11 +4456,6 @@ impl std::fmt::Display for SocialProfilesNetworkSegmentOperator { } } -impl Default for SocialProfilesNetworkSegmentOperator { - fn default() -> SocialProfilesNetworkSegmentOperator { - SocialProfilesNetworkSegmentOperator::Noop - } -} impl SocialProfilesNetworkSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, SocialProfilesNetworkSegmentOperator::Noop) @@ -4829,11 +4493,12 @@ pub struct SocialProfilesNetworkSegment { pub value: SocialProfilesNetworkSegmentOperator, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SocialProfilesNetworkFollowSegmentConditionType { #[serde(rename = "SocialNetworkFollow")] SocialNetworkFollow, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4852,11 +4517,6 @@ impl std::fmt::Display for SocialProfilesNetworkFollowSegmentConditionType { } } -impl Default for SocialProfilesNetworkFollowSegmentConditionType { - fn default() -> SocialProfilesNetworkFollowSegmentConditionType { - SocialProfilesNetworkFollowSegmentConditionType::Noop - } -} impl SocialProfilesNetworkFollowSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, SocialProfilesNetworkFollowSegmentConditionType::Noop) @@ -4864,15 +4524,16 @@ impl SocialProfilesNetworkFollowSegmentConditionType { } /** -* Members who are/not following a linked account on a given social network. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Members who are/not following a linked account on a given social network. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SocialProfilesNetworkFollowSegmentOperator { #[serde(rename = "follow")] Follow, #[serde(rename = "notfollow")] Notfollow, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4890,11 +4551,6 @@ impl std::fmt::Display for SocialProfilesNetworkFollowSegmentOperator { } } -impl Default for SocialProfilesNetworkFollowSegmentOperator { - fn default() -> SocialProfilesNetworkFollowSegmentOperator { - SocialProfilesNetworkFollowSegmentOperator::Noop - } -} impl SocialProfilesNetworkFollowSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, SocialProfilesNetworkFollowSegmentOperator::Noop) @@ -4902,13 +4558,14 @@ impl SocialProfilesNetworkFollowSegmentOperator { } /** -* The social network to segment against. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The social network to segment against. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SocialProfilesNetworkFollowSegmentOperatorData { #[serde(rename = "twitter_follow")] TwitterFollow, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4925,11 +4582,6 @@ impl std::fmt::Display for SocialProfilesNetworkFollowSegmentOperatorData { } } -impl Default for SocialProfilesNetworkFollowSegmentOperatorData { - fn default() -> SocialProfilesNetworkFollowSegmentOperatorData { - SocialProfilesNetworkFollowSegmentOperatorData::Noop - } -} impl SocialProfilesNetworkFollowSegmentOperatorData { pub fn is_noop(&self) -> bool { matches!(self, SocialProfilesNetworkFollowSegmentOperatorData::Noop) @@ -4970,11 +4622,12 @@ pub struct SocialProfilesNetworkFollowSegment { pub value: SocialProfilesNetworkFollowSegmentOperatorData, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AddressMergeFieldSegmentConditionType { #[serde(rename = "AddressMerge")] AddressMerge, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4991,11 +4644,6 @@ impl std::fmt::Display for AddressMergeFieldSegmentConditionType { } } -impl Default for AddressMergeFieldSegmentConditionType { - fn default() -> AddressMergeFieldSegmentConditionType { - AddressMergeFieldSegmentConditionType::Noop - } -} impl AddressMergeFieldSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, AddressMergeFieldSegmentConditionType::Noop) @@ -5003,9 +4651,9 @@ impl AddressMergeFieldSegmentConditionType { } /** -* Whether the member's address merge field contains/does not contain a value or is/is not blank. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether the member's address merge field contains/does not contain a value or is/is not blank. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AddressMergeFieldSegmentOperator { #[serde(rename = "blank")] Blank, @@ -5016,6 +4664,7 @@ pub enum AddressMergeFieldSegmentOperator { #[serde(rename = "notcontain")] Notcontain, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5035,11 +4684,6 @@ impl std::fmt::Display for AddressMergeFieldSegmentOperator { } } -impl Default for AddressMergeFieldSegmentOperator { - fn default() -> AddressMergeFieldSegmentOperator { - AddressMergeFieldSegmentOperator::Noop - } -} impl AddressMergeFieldSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, AddressMergeFieldSegmentOperator::Noop) @@ -5082,11 +4726,12 @@ pub struct AddressMergeFieldSegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AddressZipMergeFieldSegmentConditionType { #[serde(rename = "ZipMerge")] ZipMerge, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5103,11 +4748,6 @@ impl std::fmt::Display for AddressZipMergeFieldSegmentConditionType { } } -impl Default for AddressZipMergeFieldSegmentConditionType { - fn default() -> AddressZipMergeFieldSegmentConditionType { - AddressZipMergeFieldSegmentConditionType::Noop - } -} impl AddressZipMergeFieldSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, AddressZipMergeFieldSegmentConditionType::Noop) @@ -5115,13 +4755,14 @@ impl AddressZipMergeFieldSegmentConditionType { } /** -* Whether the member's address merge field is within a given distance from a city or zip. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether the member's address merge field is within a given distance from a city or zip. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AddressZipMergeFieldSegmentOperator { #[serde(rename = "geoin")] Geoin, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5138,11 +4779,6 @@ impl std::fmt::Display for AddressZipMergeFieldSegmentOperator { } } -impl Default for AddressZipMergeFieldSegmentOperator { - fn default() -> AddressZipMergeFieldSegmentOperator { - AddressZipMergeFieldSegmentOperator::Noop - } -} impl AddressZipMergeFieldSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, AddressZipMergeFieldSegmentOperator::Noop) @@ -5194,11 +4830,12 @@ pub struct AddressZipMergeFieldSegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BirthdayMergeFieldSegmentConditionType { #[serde(rename = "BirthdayMerge")] BirthdayMerge, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5215,11 +4852,6 @@ impl std::fmt::Display for BirthdayMergeFieldSegmentConditionType { } } -impl Default for BirthdayMergeFieldSegmentConditionType { - fn default() -> BirthdayMergeFieldSegmentConditionType { - BirthdayMergeFieldSegmentConditionType::Noop - } -} impl BirthdayMergeFieldSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, BirthdayMergeFieldSegmentConditionType::Noop) @@ -5227,9 +4859,9 @@ impl BirthdayMergeFieldSegmentConditionType { } /** -* Whether the member's birthday merge information is/is not a certain date or is/is not blank. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether the member's birthday merge information is/is not a certain date or is/is not blank. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BirthdayMergeFieldSegmentOperator { #[serde(rename = "blank")] Blank, @@ -5240,6 +4872,7 @@ pub enum BirthdayMergeFieldSegmentOperator { #[serde(rename = "not")] Not, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5259,11 +4892,6 @@ impl std::fmt::Display for BirthdayMergeFieldSegmentOperator { } } -impl Default for BirthdayMergeFieldSegmentOperator { - fn default() -> BirthdayMergeFieldSegmentOperator { - BirthdayMergeFieldSegmentOperator::Noop - } -} impl BirthdayMergeFieldSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, BirthdayMergeFieldSegmentOperator::Noop) @@ -5306,11 +4934,12 @@ pub struct BirthdayMergeFieldSegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DateMergeFieldSegmentConditionType { #[serde(rename = "DateMerge")] DateMerge, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5327,11 +4956,6 @@ impl std::fmt::Display for DateMergeFieldSegmentConditionType { } } -impl Default for DateMergeFieldSegmentConditionType { - fn default() -> DateMergeFieldSegmentConditionType { - DateMergeFieldSegmentConditionType::Noop - } -} impl DateMergeFieldSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, DateMergeFieldSegmentConditionType::Noop) @@ -5339,9 +4963,9 @@ impl DateMergeFieldSegmentConditionType { } /** -* Whether the member's merge information is/is not, is greater/less than a value or is/is not blank. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether the member's merge information is/is not, is greater/less than a value or is/is not blank. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DateMergeFieldSegmentOperator { #[serde(rename = "blank")] Blank, @@ -5356,6 +4980,7 @@ pub enum DateMergeFieldSegmentOperator { #[serde(rename = "not")] Not, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5377,11 +5002,6 @@ impl std::fmt::Display for DateMergeFieldSegmentOperator { } } -impl Default for DateMergeFieldSegmentOperator { - fn default() -> DateMergeFieldSegmentOperator { - DateMergeFieldSegmentOperator::Noop - } -} impl DateMergeFieldSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, DateMergeFieldSegmentOperator::Noop) @@ -5424,11 +5044,12 @@ pub struct DateMergeFieldSegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DropdownRadioMergeFieldSegmentConditionType { #[serde(rename = "SelectMerge")] SelectMerge, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5445,11 +5066,6 @@ impl std::fmt::Display for DropdownRadioMergeFieldSegmentConditionType { } } -impl Default for DropdownRadioMergeFieldSegmentConditionType { - fn default() -> DropdownRadioMergeFieldSegmentConditionType { - DropdownRadioMergeFieldSegmentConditionType::Noop - } -} impl DropdownRadioMergeFieldSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, DropdownRadioMergeFieldSegmentConditionType::Noop) @@ -5457,9 +5073,9 @@ impl DropdownRadioMergeFieldSegmentConditionType { } /** -* Whether the member's merge information is/is not a value or is/is not blank. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether the member's merge information is/is not a value or is/is not blank. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DropdownRadioMergeFieldSegmentOperator { #[serde(rename = "blank")] Blank, @@ -5474,6 +5090,7 @@ pub enum DropdownRadioMergeFieldSegmentOperator { #[serde(rename = "notcontain")] Notcontain, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5495,11 +5112,6 @@ impl std::fmt::Display for DropdownRadioMergeFieldSegmentOperator { } } -impl Default for DropdownRadioMergeFieldSegmentOperator { - fn default() -> DropdownRadioMergeFieldSegmentOperator { - DropdownRadioMergeFieldSegmentOperator::Noop - } -} impl DropdownRadioMergeFieldSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, DropdownRadioMergeFieldSegmentOperator::Noop) @@ -5542,11 +5154,12 @@ pub struct DropdownRadioMergeFieldSegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TextNumberMergeFieldSegmentConditionType { #[serde(rename = "TextMerge")] TextMerge, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5563,11 +5176,6 @@ impl std::fmt::Display for TextNumberMergeFieldSegmentConditionType { } } -impl Default for TextNumberMergeFieldSegmentConditionType { - fn default() -> TextNumberMergeFieldSegmentConditionType { - TextNumberMergeFieldSegmentConditionType::Noop - } -} impl TextNumberMergeFieldSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, TextNumberMergeFieldSegmentConditionType::Noop) @@ -5575,9 +5183,9 @@ impl TextNumberMergeFieldSegmentConditionType { } /** -* Whether the member's merge information is/is not, contains/does not contain, starts/ends with, or is greater/less than a value -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether the member's merge information is/is not, contains/does not contain, starts/ends with, or is greater/less than a value + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TextNumberMergeFieldSegmentOperator { #[serde(rename = "blank")] Blank, @@ -5600,6 +5208,7 @@ pub enum TextNumberMergeFieldSegmentOperator { #[serde(rename = "starts")] Starts, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5625,11 +5234,6 @@ impl std::fmt::Display for TextNumberMergeFieldSegmentOperator { } } -impl Default for TextNumberMergeFieldSegmentOperator { - fn default() -> TextNumberMergeFieldSegmentOperator { - TextNumberMergeFieldSegmentOperator::Noop - } -} impl TextNumberMergeFieldSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, TextNumberMergeFieldSegmentOperator::Noop) @@ -5672,11 +5276,12 @@ pub struct TextNumberMergeFieldSegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EmailSegmentConditionType { #[serde(rename = "EmailAddress")] EmailAddress, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5693,11 +5298,6 @@ impl std::fmt::Display for EmailSegmentConditionType { } } -impl Default for EmailSegmentConditionType { - fn default() -> EmailSegmentConditionType { - EmailSegmentConditionType::Noop - } -} impl EmailSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, EmailSegmentConditionType::Noop) @@ -5705,15 +5305,16 @@ impl EmailSegmentConditionType { } /** -* Segmenting based off of a subscriber's email address. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segmenting based off of a subscriber's email address. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EmailSegmentField { #[serde(rename = "EMAIL")] Email, #[serde(rename = "merge0")] Merge0, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5731,11 +5332,6 @@ impl std::fmt::Display for EmailSegmentField { } } -impl Default for EmailSegmentField { - fn default() -> EmailSegmentField { - EmailSegmentField::Noop - } -} impl EmailSegmentField { pub fn is_noop(&self) -> bool { matches!(self, EmailSegmentField::Noop) @@ -5743,9 +5339,9 @@ impl EmailSegmentField { } /** -* Whether the email address is/not exactly, contains/doesn't contain, starts/ends with a string. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether the email address is/not exactly, contains/doesn't contain, starts/ends with a string. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EmailSegmentOperator { #[serde(rename = "contains")] Contains, @@ -5764,6 +5360,7 @@ pub enum EmailSegmentOperator { #[serde(rename = "starts")] Starts, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5787,11 +5384,6 @@ impl std::fmt::Display for EmailSegmentOperator { } } -impl Default for EmailSegmentOperator { - fn default() -> EmailSegmentOperator { - EmailSegmentOperator::Noop - } -} impl EmailSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, EmailSegmentOperator::Noop) @@ -5827,11 +5419,12 @@ pub struct EmailSegment { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PredictedGenderSegmentConditionType { #[serde(rename = "PredictedGender")] PredictedGender, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5848,11 +5441,6 @@ impl std::fmt::Display for PredictedGenderSegmentConditionType { } } -impl Default for PredictedGenderSegmentConditionType { - fn default() -> PredictedGenderSegmentConditionType { - PredictedGenderSegmentConditionType::Noop - } -} impl PredictedGenderSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, PredictedGenderSegmentConditionType::Noop) @@ -5860,13 +5448,14 @@ impl PredictedGenderSegmentConditionType { } /** -* Segment by predicted gender. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by predicted gender. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PredictedGenderSegmentField { #[serde(rename = "predicted_gender")] PredictedGender, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5883,11 +5472,6 @@ impl std::fmt::Display for PredictedGenderSegmentField { } } -impl Default for PredictedGenderSegmentField { - fn default() -> PredictedGenderSegmentField { - PredictedGenderSegmentField::Noop - } -} impl PredictedGenderSegmentField { pub fn is_noop(&self) -> bool { matches!(self, PredictedGenderSegmentField::Noop) @@ -5922,11 +5506,12 @@ pub struct PredictedGenderSegment { pub value: SocialProfilesGenderSegmentOperator, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PredictedAgeSegmentConditionType { #[serde(rename = "PredictedAge")] PredictedAge, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5942,12 +5527,7 @@ impl std::fmt::Display for PredictedAgeSegmentConditionType { .fmt(f) } } - -impl Default for PredictedAgeSegmentConditionType { - fn default() -> PredictedAgeSegmentConditionType { - PredictedAgeSegmentConditionType::Noop - } -} + impl PredictedAgeSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, PredictedAgeSegmentConditionType::Noop) @@ -5955,13 +5535,14 @@ impl PredictedAgeSegmentConditionType { } /** -* Segment by predicted age. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by predicted age. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PredictedAgeSegmentField { #[serde(rename = "predicted_age_range")] PredictedAgeRange, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5978,11 +5559,6 @@ impl std::fmt::Display for PredictedAgeSegmentField { } } -impl Default for PredictedAgeSegmentField { - fn default() -> PredictedAgeSegmentField { - PredictedAgeSegmentField::Noop - } -} impl PredictedAgeSegmentField { pub fn is_noop(&self) -> bool { matches!(self, PredictedAgeSegmentField::Noop) @@ -5990,13 +5566,14 @@ impl PredictedAgeSegmentField { } /** -* Members who are/not the exact criteria listed. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Members who are/not the exact criteria listed. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PredictedAgeSegmentOperator { #[serde(rename = "is")] Is, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6013,11 +5590,6 @@ impl std::fmt::Display for PredictedAgeSegmentOperator { } } -impl Default for PredictedAgeSegmentOperator { - fn default() -> PredictedAgeSegmentOperator { - PredictedAgeSegmentOperator::Noop - } -} impl PredictedAgeSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, PredictedAgeSegmentOperator::Noop) @@ -6025,9 +5597,9 @@ impl PredictedAgeSegmentOperator { } /** -* The predicted age to segment. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The predicted age to segment. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PredictedAgeSegmentOperatorData { #[serde(rename = "18-24")] OneThousandEightHundredAndTwentyFour, @@ -6042,6 +5614,7 @@ pub enum PredictedAgeSegmentOperatorData { #[serde(rename = "65+")] SixtyFive, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6063,11 +5636,6 @@ impl std::fmt::Display for PredictedAgeSegmentOperatorData { } } -impl Default for PredictedAgeSegmentOperatorData { - fn default() -> PredictedAgeSegmentOperatorData { - PredictedAgeSegmentOperatorData::Noop - } -} impl PredictedAgeSegmentOperatorData { pub fn is_noop(&self) -> bool { matches!(self, PredictedAgeSegmentOperatorData::Noop) @@ -6102,11 +5670,12 @@ pub struct PredictedAgeSegment { pub value: PredictedAgeSegmentOperatorData, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum NewSubscribersPrebuiltSegmentConditionType { #[serde(rename = "NewSubscribers")] NewSubscribers, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6123,11 +5692,6 @@ impl std::fmt::Display for NewSubscribersPrebuiltSegmentConditionType { } } -impl Default for NewSubscribersPrebuiltSegmentConditionType { - fn default() -> NewSubscribersPrebuiltSegmentConditionType { - NewSubscribersPrebuiltSegmentConditionType::Noop - } -} impl NewSubscribersPrebuiltSegmentConditionType { pub fn is_noop(&self) -> bool { matches!(self, NewSubscribersPrebuiltSegmentConditionType::Noop) @@ -6135,13 +5699,14 @@ impl NewSubscribersPrebuiltSegmentConditionType { } /** -* Segment by when people subscribed. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Segment by when people subscribed. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum NewSubscribersPrebuiltSegmentField { #[serde(rename = "timestamp_opt")] TimestampOpt, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6158,11 +5723,6 @@ impl std::fmt::Display for NewSubscribersPrebuiltSegmentField { } } -impl Default for NewSubscribersPrebuiltSegmentField { - fn default() -> NewSubscribersPrebuiltSegmentField { - NewSubscribersPrebuiltSegmentField::Noop - } -} impl NewSubscribersPrebuiltSegmentField { pub fn is_noop(&self) -> bool { matches!(self, NewSubscribersPrebuiltSegmentField::Noop) @@ -6170,13 +5730,14 @@ impl NewSubscribersPrebuiltSegmentField { } /** -* Whe the event took place, namely within a time frame. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whe the event took place, namely within a time frame. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum NewSubscribersPrebuiltSegmentOperator { #[serde(rename = "date_within")] DateWithin, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6193,11 +5754,6 @@ impl std::fmt::Display for NewSubscribersPrebuiltSegmentOperator { } } -impl Default for NewSubscribersPrebuiltSegmentOperator { - fn default() -> NewSubscribersPrebuiltSegmentOperator { - NewSubscribersPrebuiltSegmentOperator::Noop - } -} impl NewSubscribersPrebuiltSegmentOperator { pub fn is_noop(&self) -> bool { matches!(self, NewSubscribersPrebuiltSegmentOperator::Noop) @@ -6994,9 +6550,9 @@ pub struct Tracking { } /** -* The type of Automation workflow. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of Automation workflow. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum WorkflowType { #[serde(rename = "abandonedBrowse")] AbandonedBrowse, @@ -7033,6 +6589,7 @@ pub enum WorkflowType { #[serde(rename = "welcomeSeries")] WelcomeSeries, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7065,18 +6622,13 @@ impl std::fmt::Display for WorkflowType { } } -impl Default for WorkflowType { - fn default() -> WorkflowType { - WorkflowType::Noop - } -} impl WorkflowType { pub fn is_noop(&self) -> bool { matches!(self, WorkflowType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Days { #[serde(rename = "friday")] Friday, @@ -7093,6 +6645,7 @@ pub enum Days { #[serde(rename = "wednesday")] Wednesday, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7115,11 +6668,6 @@ impl std::fmt::Display for Days { } } -impl Default for Days { - fn default() -> Days { - Days::Noop - } -} impl Days { pub fn is_noop(&self) -> bool { matches!(self, Days::Noop) @@ -7127,9 +6675,9 @@ impl Days { } /** -* When to send the Automation email. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * When to send the Automation email. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EmailSendTimeSettings { #[serde(rename = "send_asap")] SendAsap, @@ -7138,6 +6686,7 @@ pub enum EmailSendTimeSettings { #[serde(rename = "send_between")] SendBetween, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7156,11 +6705,6 @@ impl std::fmt::Display for EmailSendTimeSettings { } } -impl Default for EmailSendTimeSettings { - fn default() -> EmailSendTimeSettings { - EmailSendTimeSettings::Noop - } -} impl EmailSendTimeSettings { pub fn is_noop(&self) -> bool { matches!(self, EmailSendTimeSettings::Noop) @@ -7485,9 +7029,9 @@ pub struct AutomationWorkflow { } /** -* The type of delay for an Automation email. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of delay for an Automation email. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DelayType { #[serde(rename = "day")] Day, @@ -7498,6 +7042,7 @@ pub enum DelayType { #[serde(rename = "week")] Week, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7517,11 +7062,6 @@ impl std::fmt::Display for DelayType { } } -impl Default for DelayType { - fn default() -> DelayType { - DelayType::Noop - } -} impl DelayType { pub fn is_noop(&self) -> bool { matches!(self, DelayType::Noop) @@ -7529,15 +7069,16 @@ impl DelayType { } /** -* Whether the delay settings describe before or after the delay action of an Automation email. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether the delay settings describe before or after the delay action of an Automation email. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Direction { #[serde(rename = "after")] After, #[serde(rename = "before")] Before, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7555,11 +7096,6 @@ impl std::fmt::Display for Direction { } } -impl Default for Direction { - fn default() -> Direction { - Direction::Noop - } -} impl Direction { pub fn is_noop(&self) -> bool { matches!(self, Direction::Noop) @@ -7567,9 +7103,9 @@ impl Direction { } /** -* The action that triggers the delay of an Automation email. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The action that triggers the delay of an Automation email. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Action { #[serde(rename = "annual")] Annual, @@ -7638,6 +7174,7 @@ pub enum Action { #[serde(rename = "tag_add")] TagAdd, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7686,11 +7223,6 @@ impl std::fmt::Display for Action { } } -impl Default for Action { - fn default() -> Action { - Action::Noop - } -} impl Action { pub fn is_noop(&self) -> bool { matches!(self, Action::Noop) @@ -8361,13 +7893,14 @@ pub struct UpdateInformationAboutASpecificWorkflowEmailCampaignSettings { } /** -* Whether the delay settings describe before or after the delay action of an automation email. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether the delay settings describe before or after the delay action of an automation email. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DelayDirection { #[serde(rename = "after")] After, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8384,11 +7917,6 @@ impl std::fmt::Display for DelayDirection { } } -impl Default for DelayDirection { - fn default() -> DelayDirection { - DelayDirection::Noop - } -} impl DelayDirection { pub fn is_noop(&self) -> bool { matches!(self, DelayDirection::Noop) @@ -8396,9 +7924,9 @@ impl DelayDirection { } /** -* The action that triggers the delay of an automation emails. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The action that triggers the delay of an automation emails. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DelayAction { #[serde(rename = "ecomm_abandoned_browse")] EcommAbandonedBrowse, @@ -8407,6 +7935,7 @@ pub enum DelayAction { #[serde(rename = "signup")] Signup, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8425,11 +7954,6 @@ impl std::fmt::Display for DelayAction { } } -impl Default for DelayAction { - fn default() -> DelayAction { - DelayAction::Noop - } -} impl DelayAction { pub fn is_noop(&self) -> bool { matches!(self, DelayAction::Noop) @@ -8771,9 +8295,9 @@ pub struct RemovedSubscribers { } /** -* The status of the batch call. [Learn more](https://mailchimp.com/developer/marketing/guides/run-async-requests-batch-endpoint/#check-the-status-of-a-batch-operation) about the batch operation status. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the batch call. [Learn more](https://mailchimp.com/developer/marketing/guides/run-async-requests-batch-endpoint/#check-the-status-of-a-batch-operation) about the batch operation status. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BatchOperationsStatus { #[serde(rename = "finalizing")] Finalizing, @@ -8786,6 +8310,7 @@ pub enum BatchOperationsStatus { #[serde(rename = "started")] Started, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8806,11 +8331,6 @@ impl std::fmt::Display for BatchOperationsStatus { } } -impl Default for BatchOperationsStatus { - fn default() -> BatchOperationsStatus { - BatchOperationsStatus::Noop - } -} impl BatchOperationsStatus { pub fn is_noop(&self) -> bool { matches!(self, BatchOperationsStatus::Noop) @@ -8934,9 +8454,9 @@ pub struct BatchOperations { } /** -* The HTTP method to use for the operation. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The HTTP method to use for the operation. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum HttpMethod { #[serde(rename = "DELETE")] Delete, @@ -8949,6 +8469,7 @@ pub enum HttpMethod { #[serde(rename = "PUT")] Put, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8969,11 +8490,6 @@ impl std::fmt::Display for HttpMethod { } } -impl Default for HttpMethod { - fn default() -> HttpMethod { - HttpMethod::Noop - } -} impl HttpMethod { pub fn is_noop(&self) -> bool { matches!(self, HttpMethod::Noop) @@ -9260,9 +8776,9 @@ pub struct CampaignFolders { } /** -* There are four types of [campaigns](https://mailchimp.com/help/getting-started-with-campaigns/) you can create in Mailchimp. A/B Split campaigns have been deprecated and variate campaigns should be used instead. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * There are four types of [campaigns](https://mailchimp.com/help/getting-started-with-campaigns/) you can create in Mailchimp. A/B Split campaigns have been deprecated and variate campaigns should be used instead. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CampaignType { #[serde(rename = "absplit")] Absplit, @@ -9275,6 +8791,7 @@ pub enum CampaignType { #[serde(rename = "variate")] Variate, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9295,11 +8812,6 @@ impl std::fmt::Display for CampaignType { } } -impl Default for CampaignType { - fn default() -> CampaignType { - CampaignType::Noop - } -} impl CampaignType { pub fn is_noop(&self) -> bool { matches!(self, CampaignType::Noop) @@ -9307,9 +8819,9 @@ impl CampaignType { } /** -* The status of the campaign. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the campaign. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetCampaignsStatus { #[serde(rename = "paused")] Paused, @@ -9322,6 +8834,7 @@ pub enum GetCampaignsStatus { #[serde(rename = "sent")] Sent, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9342,11 +8855,6 @@ impl std::fmt::Display for GetCampaignsStatus { } } -impl Default for GetCampaignsStatus { - fn default() -> GetCampaignsStatus { - GetCampaignsStatus::Noop - } -} impl GetCampaignsStatus { pub fn is_noop(&self) -> bool { matches!(self, GetCampaignsStatus::Noop) @@ -9354,15 +8862,16 @@ impl GetCampaignsStatus { } /** -* Returns files sorted by the specified field. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Returns files sorted by the specified field. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SortField { #[serde(rename = "create_time")] CreateTime, #[serde(rename = "send_time")] SendTime, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9380,11 +8889,6 @@ impl std::fmt::Display for SortField { } } -impl Default for SortField { - fn default() -> SortField { - SortField::Noop - } -} impl SortField { pub fn is_noop(&self) -> bool { matches!(self, SortField::Noop) @@ -9392,15 +8896,16 @@ impl SortField { } /** -* Determines the order direction for sorted results. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Determines the order direction for sorted results. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SortDir { #[serde(rename = "ASC")] Asc, #[serde(rename = "DESC")] Desc, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9418,11 +8923,6 @@ impl std::fmt::Display for SortDir { } } -impl Default for SortDir { - fn default() -> SortDir { - SortDir::Noop - } -} impl SortDir { pub fn is_noop(&self) -> bool { matches!(self, SortDir::Noop) @@ -9430,9 +8930,9 @@ impl SortDir { } /** -* The current status of the campaign. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The current status of the campaign. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CampaignStatus { #[serde(rename = "archived")] Archived, @@ -9451,6 +8951,7 @@ pub enum CampaignStatus { #[serde(rename = "sent")] Sent, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9474,11 +8975,6 @@ impl std::fmt::Display for CampaignStatus { } } -impl Default for CampaignStatus { - fn default() -> CampaignStatus { - CampaignStatus::Noop - } -} impl CampaignStatus { pub fn is_noop(&self) -> bool { matches!(self, CampaignStatus::Noop) @@ -9486,9 +8982,9 @@ impl CampaignStatus { } /** -* How the campaign's content is put together. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * How the campaign's content is put together. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ContentType { #[serde(rename = "html")] Html, @@ -9499,6 +8995,7 @@ pub enum ContentType { #[serde(rename = "url")] Url, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9518,11 +9015,6 @@ impl std::fmt::Display for ContentType { } } -impl Default for ContentType { - fn default() -> ContentType { - ContentType::Noop - } -} impl ContentType { pub fn is_noop(&self) -> bool { matches!(self, ContentType::Noop) @@ -9680,9 +9172,9 @@ pub struct GetCampaignsResponseCampaignSettings { } /** -* The combination that performs the best. This may be determined automatically by click rate, open rate, or total revenue -- or you may choose manually based on the reporting data you find the most valuable. For Multivariate Campaigns testing send_time, winner_criteria is ignored. For Multivariate Campaigns with 'manual' as the winner_criteria, the winner must be chosen in the Mailchimp web application. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The combination that performs the best. This may be determined automatically by click rate, open rate, or total revenue -- or you may choose manually based on the reporting data you find the most valuable. For Multivariate Campaigns testing send_time, winner_criteria is ignored. For Multivariate Campaigns with 'manual' as the winner_criteria, the winner must be chosen in the Mailchimp web application. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum WinnerCriteria { #[serde(rename = "clicks")] Clicks, @@ -9693,6 +9185,7 @@ pub enum WinnerCriteria { #[serde(rename = "total_revenue")] TotalRevenue, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9712,11 +9205,6 @@ impl std::fmt::Display for WinnerCriteria { } } -impl Default for WinnerCriteria { - fn default() -> WinnerCriteria { - WinnerCriteria::Noop - } -} impl WinnerCriteria { pub fn is_noop(&self) -> bool { matches!(self, WinnerCriteria::Noop) @@ -9891,9 +9379,9 @@ pub struct ABTestOptions { } /** -* The frequency of the RSS Campaign. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The frequency of the RSS Campaign. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Frequency { #[serde(rename = "daily")] Daily, @@ -9902,6 +9390,7 @@ pub enum Frequency { #[serde(rename = "weekly")] Weekly, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9920,11 +9409,6 @@ impl std::fmt::Display for Frequency { } } -impl Default for Frequency { - fn default() -> Frequency { - Frequency::Noop - } -} impl Frequency { pub fn is_noop(&self) -> bool { matches!(self, Frequency::Noop) @@ -10067,9 +9551,9 @@ pub struct RssOpts { } /** -* The type of AB split to run. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of AB split to run. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SplitTest { #[serde(rename = "from_name")] FromName, @@ -10078,6 +9562,7 @@ pub enum SplitTest { #[serde(rename = "subject")] Subject, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10096,11 +9581,6 @@ impl std::fmt::Display for SplitTest { } } -impl Default for SplitTest { - fn default() -> SplitTest { - SplitTest::Noop - } -} impl SplitTest { pub fn is_noop(&self) -> bool { matches!(self, SplitTest::Noop) @@ -10108,9 +9588,9 @@ impl SplitTest { } /** -* How we should evaluate a winner. Based on 'opens', 'clicks', or 'manual'. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * How we should evaluate a winner. Based on 'opens', 'clicks', or 'manual'. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PickWinner { #[serde(rename = "clicks")] Clicks, @@ -10119,6 +9599,7 @@ pub enum PickWinner { #[serde(rename = "opens")] Opens, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10137,11 +9618,6 @@ impl std::fmt::Display for PickWinner { } } -impl Default for PickWinner { - fn default() -> PickWinner { - PickWinner::Noop - } -} impl PickWinner { pub fn is_noop(&self) -> bool { matches!(self, PickWinner::Noop) @@ -10149,15 +9625,16 @@ impl PickWinner { } /** -* How unit of time for measuring the winner ('hours' or 'days'). This cannot be changed after a campaign is sent. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * How unit of time for measuring the winner ('hours' or 'days'). This cannot be changed after a campaign is sent. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum WaitTime { #[serde(rename = "days")] Days, #[serde(rename = "hours")] Hours, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10175,11 +9652,6 @@ impl std::fmt::Display for WaitTime { } } -impl Default for WaitTime { - fn default() -> WaitTime { - WaitTime::Noop - } -} impl WaitTime { pub fn is_noop(&self) -> bool { matches!(self, WaitTime::Noop) @@ -10402,9 +9874,9 @@ pub struct GetCampaignsResponseCampaignReportSummary { } /** -* The current state of a campaign delivery. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The current state of a campaign delivery. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CampaignDeliveryStatus { #[serde(rename = "canceled")] Canceled, @@ -10415,6 +9887,7 @@ pub enum CampaignDeliveryStatus { #[serde(rename = "delivering")] Delivering, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10434,11 +9907,6 @@ impl std::fmt::Display for CampaignDeliveryStatus { } } -impl Default for CampaignDeliveryStatus { - fn default() -> CampaignDeliveryStatus { - CampaignDeliveryStatus::Noop - } -} impl CampaignDeliveryStatus { pub fn is_noop(&self) -> bool { matches!(self, CampaignDeliveryStatus::Noop) @@ -10963,15 +10431,16 @@ pub struct RssOptions { } /** -* How the campaign's content is put together. The old drag and drop editor uses 'template' while the new editor uses 'multichannel'. Defaults to template. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * How the campaign's content is put together. The old drag and drop editor uses 'template' while the new editor uses 'multichannel'. Defaults to template. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CreatedCampaignContentType { #[serde(rename = "multichannel")] Multichannel, #[serde(rename = "template")] Template, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10989,11 +10458,6 @@ impl std::fmt::Display for CreatedCampaignContentType { } } -impl Default for CreatedCampaignContentType { - fn default() -> CreatedCampaignContentType { - CreatedCampaignContentType::Noop - } -} impl CreatedCampaignContentType { pub fn is_noop(&self) -> bool { matches!(self, CreatedCampaignContentType::Noop) @@ -11737,15 +11201,16 @@ pub struct PostCampaignsActionsScheduleRequest { } /** -* Choose the type of test email to send. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Choose the type of test email to send. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SendType { #[serde(rename = "html")] Html, #[serde(rename = "plaintext")] Plaintext, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11763,11 +11228,6 @@ impl std::fmt::Display for SendType { } } -impl Default for SendType { - fn default() -> SendType { - SendType::Noop - } -} impl SendType { pub fn is_noop(&self) -> bool { matches!(self, SendType::Noop) @@ -11894,9 +11354,9 @@ pub struct Template { } /** -* The type of encoded file. Defaults to zip. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of encoded file. Defaults to zip. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ArchiveType { #[serde(rename = "tar")] Tar, @@ -11911,6 +11371,7 @@ pub enum ArchiveType { #[serde(rename = "zip")] Zip, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11932,11 +11393,6 @@ impl std::fmt::Display for ArchiveType { } } -impl Default for ArchiveType { - fn default() -> ArchiveType { - ArchiveType::Noop - } -} impl ArchiveType { pub fn is_noop(&self) -> bool { matches!(self, ArchiveType::Noop) @@ -12083,9 +11539,9 @@ pub struct CampaignContentData { } /** -* The source of the feedback. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The source of the feedback. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Source { #[serde(rename = "android")] Android, @@ -12100,6 +11556,7 @@ pub enum Source { #[serde(rename = "web")] Web, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -12121,11 +11578,6 @@ impl std::fmt::Display for Source { } } -impl Default for Source { - fn default() -> Source { - Source::Noop - } -} impl Source { pub fn is_noop(&self) -> bool { matches!(self, Source::Noop) @@ -12437,9 +11889,9 @@ pub struct CampaignFeedbackDataType { } /** -* The item type. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The item type. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SendChecklistItemsType { #[serde(rename = "error")] Error, @@ -12448,6 +11900,7 @@ pub enum SendChecklistItemsType { #[serde(rename = "warning")] Warning, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -12466,11 +11919,6 @@ impl std::fmt::Display for SendChecklistItemsType { } } -impl Default for SendChecklistItemsType { - fn default() -> SendChecklistItemsType { - SendChecklistItemsType::Noop - } -} impl SendChecklistItemsType { pub fn is_noop(&self) -> bool { matches!(self, SendChecklistItemsType::Noop) @@ -12699,15 +12147,16 @@ pub struct ConnectedSite { } /** -* Whether a conversation message has been marked as read. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether a conversation message has been marked as read. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IsRead { #[serde(rename = "false")] False, #[serde(rename = "true")] True, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -12725,11 +12174,6 @@ impl std::fmt::Display for IsRead { } } -impl Default for IsRead { - fn default() -> IsRead { - IsRead::Noop - } -} impl IsRead { pub fn is_noop(&self) -> bool { matches!(self, IsRead::Noop) @@ -13057,13 +12501,14 @@ pub struct CollectionOfConversationMessages { } /** -* Returns files sorted by the specified field. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Returns files sorted by the specified field. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetFileManagerFilesSortField { #[serde(rename = "added_date")] AddedDate, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13080,11 +12525,6 @@ impl std::fmt::Display for GetFileManagerFilesSortField { } } -impl Default for GetFileManagerFilesSortField { - fn default() -> GetFileManagerFilesSortField { - GetFileManagerFilesSortField::Noop - } -} impl GetFileManagerFilesSortField { pub fn is_noop(&self) -> bool { matches!(self, GetFileManagerFilesSortField::Noop) @@ -13092,15 +12532,16 @@ impl GetFileManagerFilesSortField { } /** -* The type of file in the File Manager. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of file in the File Manager. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FileType { #[serde(rename = "file")] File, #[serde(rename = "image")] Image, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13118,11 +12559,6 @@ impl std::fmt::Display for FileType { } } -impl Default for FileType { - fn default() -> FileType { - FileType::Noop - } -} impl FileType { pub fn is_noop(&self) -> bool { matches!(self, FileType::Noop) @@ -13430,13 +12866,14 @@ pub struct FileManagerFolders { } /** -* Returns files sorted by the specified field. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Returns files sorted by the specified field. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetListsSortField { #[serde(rename = "date_created")] DateCreated, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13453,11 +12890,6 @@ impl std::fmt::Display for GetListsSortField { } } -impl Default for GetListsSortField { - fn default() -> GetListsSortField { - GetListsSortField::Noop - } -} impl GetListsSortField { pub fn is_noop(&self) -> bool { matches!(self, GetListsSortField::Noop) @@ -13585,15 +13017,16 @@ pub struct CampaignDefaults { } /** -* Legacy - visibility settings are no longer used -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Legacy - visibility settings are no longer used + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Visibility { #[serde(rename = "prv")] Prv, #[serde(rename = "pub")] Pub, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13611,11 +13044,6 @@ impl std::fmt::Display for Visibility { } } -impl Default for Visibility { - fn default() -> Visibility { - Visibility::Noop - } -} impl Visibility { pub fn is_noop(&self) -> bool { matches!(self, Visibility::Noop) @@ -14234,9 +13662,9 @@ pub struct SubscriberList { } /** -* Subscriber's current status. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Subscriber's current status. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MembersSubscribeUnsubscribeFromAListInBatchStatus { #[serde(rename = "cleaned")] Cleaned, @@ -14247,6 +13675,7 @@ pub enum MembersSubscribeUnsubscribeFromAListInBatchStatus { #[serde(rename = "unsubscribed")] Unsubscribed, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14266,11 +13695,6 @@ impl std::fmt::Display for MembersSubscribeUnsubscribeFromAListInBatchStatus { } } -impl Default for MembersSubscribeUnsubscribeFromAListInBatchStatus { - fn default() -> MembersSubscribeUnsubscribeFromAListInBatchStatus { - MembersSubscribeUnsubscribeFromAListInBatchStatus::Noop - } -} impl MembersSubscribeUnsubscribeFromAListInBatchStatus { pub fn is_noop(&self) -> bool { matches!( @@ -14425,9 +13849,9 @@ pub struct MembersSubscribeUnsubscribeFromAListInBatch { } /** -* Subscriber's status. This value is required only if the email address is not already present on the list. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Subscriber's status. This value is required only if the email address is not already present on the list. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum StatusIfNew { #[serde(rename = "cleaned")] Cleaned, @@ -14440,6 +13864,7 @@ pub enum StatusIfNew { #[serde(rename = "unsubscribed")] Unsubscribed, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14460,11 +13885,6 @@ impl std::fmt::Display for StatusIfNew { } } -impl Default for StatusIfNew { - fn default() -> StatusIfNew { - StatusIfNew::Noop - } -} impl StatusIfNew { pub fn is_noop(&self) -> bool { matches!(self, StatusIfNew::Noop) @@ -14808,15 +14228,16 @@ pub struct NewMembers { } /** -* A unique code that identifies this specifc error. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * A unique code that identifies this specifc error. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ErrorCode { #[serde(rename = "ERROR_CONTACT_EXISTS")] ErrorContactExists, #[serde(rename = "ERROR_GENERIC")] ErrorGeneric, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14834,11 +14255,6 @@ impl std::fmt::Display for ErrorCode { } } -impl Default for ErrorCode { - fn default() -> ErrorCode { - ErrorCode::Noop - } -} impl ErrorCode { pub fn is_noop(&self) -> bool { matches!(self, ErrorCode::Noop) @@ -15438,13 +14854,14 @@ pub struct EmailClients { } /** -* Returns files sorted by the specified field. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Returns files sorted by the specified field. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetListsGrowthHistorySortField { #[serde(rename = "month")] Month, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -15461,11 +14878,6 @@ impl std::fmt::Display for GetListsGrowthHistorySortField { } } -impl Default for GetListsGrowthHistorySortField { - fn default() -> GetListsGrowthHistorySortField { - GetListsGrowthHistorySortField::Noop - } -} impl GetListsGrowthHistorySortField { pub fn is_noop(&self) -> bool { matches!(self, GetListsGrowthHistorySortField::Noop) @@ -15856,9 +15268,9 @@ pub struct InterestsData { } /** -* The type of segment. Static segments are now known as tags. Learn more about [tags](https://mailchimp.com/help/getting-started-tags?utm_source=mc-api&utm_medium=docs&utm_campaign=apidocs). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of segment. Static segments are now known as tags. Learn more about [tags](https://mailchimp.com/help/getting-started-tags?utm_source=mc-api&utm_medium=docs&utm_campaign=apidocs). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CollectionOfSegmentsType { #[serde(rename = "fuzzy")] Fuzzy, @@ -15867,6 +15279,7 @@ pub enum CollectionOfSegmentsType { #[serde(rename = "static")] Static, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -15885,11 +15298,6 @@ impl std::fmt::Display for CollectionOfSegmentsType { } } -impl Default for CollectionOfSegmentsType { - fn default() -> CollectionOfSegmentsType { - CollectionOfSegmentsType::Noop - } -} impl CollectionOfSegmentsType { pub fn is_noop(&self) -> bool { matches!(self, CollectionOfSegmentsType::Noop) @@ -16474,9 +15882,9 @@ pub struct TagSearchResults { } /** -* The subscriber's status. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The subscriber's status. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetListsMembersStatus { #[serde(rename = "archived")] Archived, @@ -16491,6 +15899,7 @@ pub enum GetListsMembersStatus { #[serde(rename = "unsubscribed")] Unsubscribed, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -16512,11 +15921,6 @@ impl std::fmt::Display for GetListsMembersStatus { } } -impl Default for GetListsMembersStatus { - fn default() -> GetListsMembersStatus { - GetListsMembersStatus::Noop - } -} impl GetListsMembersStatus { pub fn is_noop(&self) -> bool { matches!(self, GetListsMembersStatus::Noop) @@ -16524,9 +15928,9 @@ impl GetListsMembersStatus { } /** -* Used to filter list members by interests. Must be accompanied by interest_category_id and interest_ids. "any" will match a member with any of the interest supplied, "all" will only match members with every interest supplied, and "none" will match members without any of the interest supplied. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Used to filter list members by interests. Must be accompanied by interest_category_id and interest_ids. "any" will match a member with any of the interest supplied, "all" will only match members with every interest supplied, and "none" will match members without any of the interest supplied. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum InterestMatch { #[serde(rename = "all")] All, @@ -16535,6 +15939,7 @@ pub enum InterestMatch { #[serde(rename = "none")] None, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -16553,11 +15958,6 @@ impl std::fmt::Display for InterestMatch { } } -impl Default for InterestMatch { - fn default() -> InterestMatch { - InterestMatch::Noop - } -} impl InterestMatch { pub fn is_noop(&self) -> bool { matches!(self, InterestMatch::Noop) @@ -16565,9 +15965,9 @@ impl InterestMatch { } /** -* Returns files sorted by the specified field. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Returns files sorted by the specified field. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetListsMembersSortField { #[serde(rename = "last_changed")] LastChanged, @@ -16576,6 +15976,7 @@ pub enum GetListsMembersSortField { #[serde(rename = "timestamp_signup")] TimestampSignup, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -16594,11 +15995,6 @@ impl std::fmt::Display for GetListsMembersSortField { } } -impl Default for GetListsMembersSortField { - fn default() -> GetListsMembersSortField { - GetListsMembersSortField::Noop - } -} impl GetListsMembersSortField { pub fn is_noop(&self) -> bool { matches!(self, GetListsMembersSortField::Noop) @@ -17455,13 +16851,14 @@ pub struct MemberActivityEvents { } /** -* The type of event activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of event activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ActivityType { #[serde(rename = "open")] Open, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -17478,11 +16875,6 @@ impl std::fmt::Display for ActivityType { } } -impl Default for ActivityType { - fn default() -> ActivityType { - ActivityType::Noop - } -} impl ActivityType { pub fn is_noop(&self) -> bool { matches!(self, ActivityType::Noop) @@ -17527,13 +16919,14 @@ pub struct EmailOpens { } /** -* The type of event activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of event activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EmailClicksActivityType { #[serde(rename = "click")] Click, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -17550,11 +16943,6 @@ impl std::fmt::Display for EmailClicksActivityType { } } -impl Default for EmailClicksActivityType { - fn default() -> EmailClicksActivityType { - EmailClicksActivityType::Noop - } -} impl EmailClicksActivityType { pub fn is_noop(&self) -> bool { matches!(self, EmailClicksActivityType::Noop) @@ -17608,13 +16996,14 @@ pub struct EmailClicks { } /** -* The type of event activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of event activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EmailBouncedActivityType { #[serde(rename = "bounce")] Bounce, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -17631,11 +17020,6 @@ impl std::fmt::Display for EmailBouncedActivityType { } } -impl Default for EmailBouncedActivityType { - fn default() -> EmailBouncedActivityType { - EmailBouncedActivityType::Noop - } -} impl EmailBouncedActivityType { pub fn is_noop(&self) -> bool { matches!(self, EmailBouncedActivityType::Noop) @@ -17643,15 +17027,16 @@ impl EmailBouncedActivityType { } /** -* The type of bounce. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of bounce. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BounceType { #[serde(rename = "hard")] Hard, #[serde(rename = "soft")] Soft, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -17669,11 +17054,6 @@ impl std::fmt::Display for BounceType { } } -impl Default for BounceType { - fn default() -> BounceType { - BounceType::Noop - } -} impl BounceType { pub fn is_noop(&self) -> bool { matches!(self, BounceType::Noop) @@ -17731,13 +17111,14 @@ pub struct EmailBounced { } /** -* The type of event activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of event activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ListUnsubscribedActivityType { #[serde(rename = "unsub")] Unsub, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -17754,11 +17135,6 @@ impl std::fmt::Display for ListUnsubscribedActivityType { } } -impl Default for ListUnsubscribedActivityType { - fn default() -> ListUnsubscribedActivityType { - ListUnsubscribedActivityType::Noop - } -} impl ListUnsubscribedActivityType { pub fn is_noop(&self) -> bool { matches!(self, ListUnsubscribedActivityType::Noop) @@ -17820,13 +17196,14 @@ pub struct ListUnsubscribed { } /** -* The type of event activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of event activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EmailSentActivityType { #[serde(rename = "sent")] Sent, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -17843,11 +17220,6 @@ impl std::fmt::Display for EmailSentActivityType { } } -impl Default for EmailSentActivityType { - fn default() -> EmailSentActivityType { - EmailSentActivityType::Noop - } -} impl EmailSentActivityType { pub fn is_noop(&self) -> bool { matches!(self, EmailSentActivityType::Noop) @@ -17990,13 +17362,14 @@ pub struct EmailConversation { } /** -* The type of event activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of event activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum NoteActivityType { #[serde(rename = "note")] Note, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18013,11 +17386,6 @@ impl std::fmt::Display for NoteActivityType { } } -impl Default for NoteActivityType { - fn default() -> NoteActivityType { - NoteActivityType::Noop - } -} impl NoteActivityType { pub fn is_noop(&self) -> bool { matches!(self, NoteActivityType::Noop) @@ -18089,13 +17457,14 @@ pub struct Note { } /** -* The type of event activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of event activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MarketingPermissionActivityType { #[serde(rename = "marketing_permission")] MarketingPermission, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18112,11 +17481,6 @@ impl std::fmt::Display for MarketingPermissionActivityType { } } -impl Default for MarketingPermissionActivityType { - fn default() -> MarketingPermissionActivityType { - MarketingPermissionActivityType::Noop - } -} impl MarketingPermissionActivityType { pub fn is_noop(&self) -> bool { matches!(self, MarketingPermissionActivityType::Noop) @@ -18169,13 +17533,14 @@ pub struct MarketingPermissionData { } /** -* The type of event activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of event activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PostcardSentActivityType { #[serde(rename = "postcard_sent")] PostcardSent, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18192,11 +17557,6 @@ impl std::fmt::Display for PostcardSentActivityType { } } -impl Default for PostcardSentActivityType { - fn default() -> PostcardSentActivityType { - PostcardSentActivityType::Noop - } -} impl PostcardSentActivityType { pub fn is_noop(&self) -> bool { matches!(self, PostcardSentActivityType::Noop) @@ -18241,13 +17601,14 @@ pub struct PostcardSent { } /** -* The type of event activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of event activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SquatterSignupActivityType { #[serde(rename = "squatter_signup")] SquatterSignup, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18264,11 +17625,6 @@ impl std::fmt::Display for SquatterSignupActivityType { } } -impl Default for SquatterSignupActivityType { - fn default() -> SquatterSignupActivityType { - SquatterSignupActivityType::Noop - } -} impl SquatterSignupActivityType { pub fn is_noop(&self) -> bool { matches!(self, SquatterSignupActivityType::Noop) @@ -18313,13 +17669,14 @@ pub struct SquatterSignup { } /** -* The type of event activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of event activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum WebsiteSignupActivityType { #[serde(rename = "website_signup")] WebsiteSignup, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18336,11 +17693,6 @@ impl std::fmt::Display for WebsiteSignupActivityType { } } -impl Default for WebsiteSignupActivityType { - fn default() -> WebsiteSignupActivityType { - WebsiteSignupActivityType::Noop - } -} impl WebsiteSignupActivityType { pub fn is_noop(&self) -> bool { matches!(self, WebsiteSignupActivityType::Noop) @@ -18385,13 +17737,14 @@ pub struct WebsiteSignup { } /** -* The type of event activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of event activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LandingPageSignupActivityType { #[serde(rename = "landing_page_signup")] LandingPageSignup, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18408,11 +17761,6 @@ impl std::fmt::Display for LandingPageSignupActivityType { } } -impl Default for LandingPageSignupActivityType { - fn default() -> LandingPageSignupActivityType { - LandingPageSignupActivityType::Noop - } -} impl LandingPageSignupActivityType { pub fn is_noop(&self) -> bool { matches!(self, LandingPageSignupActivityType::Noop) @@ -18457,13 +17805,14 @@ pub struct LandingPageSignup { } /** -* The type of event activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of event activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EcommerceSignupActivityType { #[serde(rename = "ecommerce_signup")] EcommerceSignup, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18480,11 +17829,6 @@ impl std::fmt::Display for EcommerceSignupActivityType { } } -impl Default for EcommerceSignupActivityType { - fn default() -> EcommerceSignupActivityType { - EcommerceSignupActivityType::Noop - } -} impl EcommerceSignupActivityType { pub fn is_noop(&self) -> bool { matches!(self, EcommerceSignupActivityType::Noop) @@ -18520,13 +17864,14 @@ pub struct EcommerceSignup { } /** -* The type of event activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of event activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GenericSignupActivityType { #[serde(rename = "generic_signup")] GenericSignup, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18543,11 +17888,6 @@ impl std::fmt::Display for GenericSignupActivityType { } } -impl Default for GenericSignupActivityType { - fn default() -> GenericSignupActivityType { - GenericSignupActivityType::Noop - } -} impl GenericSignupActivityType { pub fn is_noop(&self) -> bool { matches!(self, GenericSignupActivityType::Noop) @@ -18583,13 +17923,14 @@ pub struct GenericSignup { } /** -* The type of event activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of event activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EcommerceOrderActivityType { #[serde(rename = "order")] Order, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18606,11 +17947,6 @@ impl std::fmt::Display for EcommerceOrderActivityType { } } -impl Default for EcommerceOrderActivityType { - fn default() -> EcommerceOrderActivityType { - EcommerceOrderActivityType::Noop - } -} impl EcommerceOrderActivityType { pub fn is_noop(&self) -> bool { matches!(self, EcommerceOrderActivityType::Noop) @@ -18805,13 +18141,14 @@ pub struct EcommerceOrder { } /** -* The type of event activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of event activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ContactActivityEventType { #[serde(rename = "event")] Event, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18828,11 +18165,6 @@ impl std::fmt::Display for ContactActivityEventType { } } -impl Default for ContactActivityEventType { - fn default() -> ContactActivityEventType { - ContactActivityEventType::Noop - } -} impl ContactActivityEventType { pub fn is_noop(&self) -> bool { matches!(self, ContactActivityEventType::Noop) @@ -18877,13 +18209,14 @@ pub struct ContactActivityEvent { } /** -* The type of event activity. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of event activity. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SurveyResponseActivityType { #[serde(rename = "survey_response")] SurveyResponse, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18900,11 +18233,6 @@ impl std::fmt::Display for SurveyResponseActivityType { } } -impl Default for SurveyResponseActivityType { - fn default() -> SurveyResponseActivityType { - SurveyResponseActivityType::Noop - } -} impl SurveyResponseActivityType { pub fn is_noop(&self) -> bool { matches!(self, SurveyResponseActivityType::Noop) @@ -19240,15 +18568,16 @@ pub struct CollectionOfTags { } /** -* The status for the tag on the member, pass in active to add a tag or inactive to remove it. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status for the tag on the member, pass in active to add a tag or inactive to remove it. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MemberTagsTagStatus { #[serde(rename = "active")] Active, #[serde(rename = "inactive")] Inactive, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -19266,11 +18595,6 @@ impl std::fmt::Display for MemberTagsTagStatus { } } -impl Default for MemberTagsTagStatus { - fn default() -> MemberTagsTagStatus { - MemberTagsTagStatus::Noop - } -} impl MemberTagsTagStatus { pub fn is_noop(&self) -> bool { matches!(self, MemberTagsTagStatus::Noop) @@ -19516,9 +18840,9 @@ pub struct CollectionOfMemberActivityEvents { } /** -* Returns notes sorted by the specified field. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Returns notes sorted by the specified field. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetListsMembersNotesSortField { #[serde(rename = "created_at")] CreatedAt, @@ -19527,6 +18851,7 @@ pub enum GetListsMembersNotesSortField { #[serde(rename = "updated_at")] UpdatedAt, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -19545,11 +18870,6 @@ impl std::fmt::Display for GetListsMembersNotesSortField { } } -impl Default for GetListsMembersNotesSortField { - fn default() -> GetListsMembersNotesSortField { - GetListsMembersNotesSortField::Noop - } -} impl GetListsMembersNotesSortField { pub fn is_noop(&self) -> bool { matches!(self, GetListsMembersNotesSortField::Noop) @@ -19686,9 +19006,9 @@ pub struct CollectionOfNotes { } /** -* The [type](https://mailchimp.com/help/manage-audience-signup-form-fields/#Audience_field_types) for the merge field. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The [type](https://mailchimp.com/help/manage-audience-signup-form-fields/#Audience_field_types) for the merge field. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MergeFieldType { #[serde(rename = "address")] Address, @@ -19713,6 +19033,7 @@ pub enum MergeFieldType { #[serde(rename = "zip")] Zip, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -19739,11 +19060,6 @@ impl std::fmt::Display for MergeFieldType { } } -impl Default for MergeFieldType { - fn default() -> MergeFieldType { - MergeFieldType::Noop - } -} impl MergeFieldType { pub fn is_noop(&self) -> bool { matches!(self, MergeFieldType::Noop) @@ -20315,9 +19631,9 @@ pub struct ListWebhooksData { } /** -* Image alignment. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Image alignment. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ImageAlign { #[serde(rename = "center")] Center, @@ -20328,6 +19644,7 @@ pub enum ImageAlign { #[serde(rename = "right")] Right, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -20347,11 +19664,6 @@ impl std::fmt::Display for ImageAlign { } } -impl Default for ImageAlign { - fn default() -> ImageAlign { - ImageAlign::Noop - } -} impl ImageAlign { pub fn is_noop(&self) -> bool { matches!(self, ImageAlign::Noop) @@ -20359,9 +19671,9 @@ impl ImageAlign { } /** -* Image border style. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Image border style. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ImageBorderStyle { #[serde(rename = "dashed")] Dashed, @@ -20382,6 +19694,7 @@ pub enum ImageBorderStyle { #[serde(rename = "solid")] Solid, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -20406,11 +19719,6 @@ impl std::fmt::Display for ImageBorderStyle { } } -impl Default for ImageBorderStyle { - fn default() -> ImageBorderStyle { - ImageBorderStyle::Noop - } -} impl ImageBorderStyle { pub fn is_noop(&self) -> bool { matches!(self, ImageBorderStyle::Noop) @@ -20418,15 +19726,16 @@ impl ImageBorderStyle { } /** -* Image link target. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Image link target. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ImageTarget { #[serde(rename = "_blank")] Blank, #[serde(rename = "null")] Null, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -20444,11 +19753,6 @@ impl std::fmt::Display for ImageTarget { } } -impl Default for ImageTarget { - fn default() -> ImageTarget { - ImageTarget::Noop - } -} impl ImageTarget { pub fn is_noop(&self) -> bool { matches!(self, ImageTarget::Noop) @@ -20548,9 +19852,9 @@ pub struct Header { } /** -* The content section name. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The content section name. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Section { #[serde(rename = "signup_message")] SignupMessage, @@ -20559,6 +19863,7 @@ pub enum Section { #[serde(rename = "unsub_message")] UnsubMessage, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -20577,11 +19882,6 @@ impl std::fmt::Display for Section { } } -impl Default for Section { - fn default() -> Section { - Section::Noop - } -} impl Section { pub fn is_noop(&self) -> bool { matches!(self, Section::Noop) @@ -20608,9 +19908,9 @@ pub struct Contents { } /** -* A string that identifies the element selector. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * A string that identifies the element selector. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Selector { #[serde(rename = "body_background")] BodyBackground, @@ -20641,6 +19941,7 @@ pub enum Selector { #[serde(rename = "page_outer_wrapper")] PageOuterWrapper, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -20670,11 +19971,6 @@ impl std::fmt::Display for Selector { } } -impl Default for Selector { - fn default() -> Selector { - Selector::Noop - } -} impl Selector { pub fn is_noop(&self) -> bool { matches!(self, Selector::Noop) @@ -20920,15 +20216,16 @@ pub struct ListLocations { } /** -* Returns files sorted by the specified field. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Returns files sorted by the specified field. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetAllLandingPagesSortField { #[serde(rename = "created_at")] CreatedAt, #[serde(rename = "updated_at")] UpdatedAt, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -20946,11 +20243,6 @@ impl std::fmt::Display for GetAllLandingPagesSortField { } } -impl Default for GetAllLandingPagesSortField { - fn default() -> GetAllLandingPagesSortField { - GetAllLandingPagesSortField::Noop - } -} impl GetAllLandingPagesSortField { pub fn is_noop(&self) -> bool { matches!(self, GetAllLandingPagesSortField::Noop) @@ -20958,9 +20250,9 @@ impl GetAllLandingPagesSortField { } /** -* The status of this landing page. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of this landing page. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LandingPageStatus { #[serde(rename = "draft")] Draft, @@ -20969,6 +20261,7 @@ pub enum LandingPageStatus { #[serde(rename = "unpublished")] Unpublished, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -20987,11 +20280,6 @@ impl std::fmt::Display for LandingPageStatus { } } -impl Default for LandingPageStatus { - fn default() -> LandingPageStatus { - LandingPageStatus::Noop - } -} impl LandingPageStatus { pub fn is_noop(&self) -> bool { matches!(self, LandingPageStatus::Noop) @@ -21204,15 +20492,16 @@ pub struct GetAllLandingPagesResponse { } /** -* The type of template the landing page has. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of template the landing page has. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LandingPageTemplateType { #[serde(rename = "product")] Product, #[serde(rename = "signup")] Signup, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -21230,11 +20519,6 @@ impl std::fmt::Display for LandingPageTemplateType { } } -impl Default for LandingPageTemplateType { - fn default() -> LandingPageTemplateType { - LandingPageTemplateType::Noop - } -} impl LandingPageTemplateType { pub fn is_noop(&self) -> bool { matches!(self, LandingPageTemplateType::Noop) @@ -22424,9 +21708,9 @@ pub struct AbuseComplaintsData { } /** -* The sentiment type for a feedback message. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The sentiment type for a feedback message. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AdviceType { #[serde(rename = "negative")] Negative, @@ -22435,6 +21719,7 @@ pub enum AdviceType { #[serde(rename = "positive")] Positive, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -22453,11 +21738,6 @@ impl std::fmt::Display for AdviceType { } } -impl Default for AdviceType { - fn default() -> AdviceType { - AdviceType::Noop - } -} impl AdviceType { pub fn is_noop(&self) -> bool { matches!(self, AdviceType::Noop) @@ -24077,9 +23357,9 @@ pub struct UnsubscribesData { } /** -* Returns files sorted by the specified field. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Returns files sorted by the specified field. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetReportsEcommerceProductActivitySortField { #[serde(rename = "title")] Title, @@ -24088,6 +23368,7 @@ pub enum GetReportsEcommerceProductActivitySortField { #[serde(rename = "total_revenue")] TotalRevenue, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -24106,11 +23387,6 @@ impl std::fmt::Display for GetReportsEcommerceProductActivitySortField { } } -impl Default for GetReportsEcommerceProductActivitySortField { - fn default() -> GetReportsEcommerceProductActivitySortField { - GetReportsEcommerceProductActivitySortField::Noop - } -} impl GetReportsEcommerceProductActivitySortField { pub fn is_noop(&self) -> bool { matches!(self, GetReportsEcommerceProductActivitySortField::Noop) @@ -24227,9 +23503,9 @@ pub struct GetReportsEcommerceProductActivityResponse { } /** -* Returns user templates sorted by the specified field. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Returns user templates sorted by the specified field. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetTemplatesSortField { #[serde(rename = "date_created")] DateCreated, @@ -24238,6 +23514,7 @@ pub enum GetTemplatesSortField { #[serde(rename = "name")] Name, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -24256,11 +23533,6 @@ impl std::fmt::Display for GetTemplatesSortField { } } -impl Default for GetTemplatesSortField { - fn default() -> GetTemplatesSortField { - GetTemplatesSortField::Noop - } -} impl GetTemplatesSortField { pub fn is_noop(&self) -> bool { matches!(self, GetTemplatesSortField::Noop) @@ -24648,13 +23920,14 @@ pub struct Customer { } /** -* The Mailchimp tracking code for the order. Uses the 'mc_tc' parameter in E-Commerce tracking URLs. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The Mailchimp tracking code for the order. Uses the 'mc_tc' parameter in E-Commerce tracking URLs. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TrackingCode { #[serde(rename = "prec")] Prec, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -24671,11 +23944,6 @@ impl std::fmt::Display for TrackingCode { } } -impl Default for TrackingCode { - fn default() -> TrackingCode { - TrackingCode::Noop - } -} impl TrackingCode { pub fn is_noop(&self) -> bool { matches!(self, TrackingCode::Noop) @@ -24931,15 +24199,16 @@ pub struct BillingAddress { } /** -* Type of discount. For free shipping set type to fixed -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Type of discount. For free shipping set type to fixed + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OrdersPromosType { #[serde(rename = "fixed")] Fixed, #[serde(rename = "percentage")] Percentage, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -24957,11 +24226,6 @@ impl std::fmt::Display for OrdersPromosType { } } -impl Default for OrdersPromosType { - fn default() -> OrdersPromosType { - OrdersPromosType::Noop - } -} impl OrdersPromosType { pub fn is_noop(&self) -> bool { matches!(self, OrdersPromosType::Noop) @@ -26636,9 +25900,9 @@ pub struct ECommerceCustomerDataType { } /** -* The target that the discount applies to. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The target that the discount applies to. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Target { #[serde(rename = "per_item")] PerItem, @@ -26647,6 +25911,7 @@ pub enum Target { #[serde(rename = "total")] Total, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -26665,11 +25930,6 @@ impl std::fmt::Display for Target { } } -impl Default for Target { - fn default() -> Target { - Target::Noop - } -} impl Target { pub fn is_noop(&self) -> bool { matches!(self, Target::Noop) @@ -28740,9 +28000,9 @@ pub struct ApiHealthStatus { } /** -* Returns files sorted by the specified field. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Returns files sorted by the specified field. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetAllFacebookAdsSortField { #[serde(rename = "created_at")] CreatedAt, @@ -28751,6 +28011,7 @@ pub enum GetAllFacebookAdsSortField { #[serde(rename = "updated_at")] UpdatedAt, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -28769,11 +28030,6 @@ impl std::fmt::Display for GetAllFacebookAdsSortField { } } -impl Default for GetAllFacebookAdsSortField { - fn default() -> GetAllFacebookAdsSortField { - GetAllFacebookAdsSortField::Noop - } -} impl GetAllFacebookAdsSortField { pub fn is_noop(&self) -> bool { matches!(self, GetAllFacebookAdsSortField::Noop) @@ -28781,9 +28037,9 @@ impl GetAllFacebookAdsSortField { } /** -* Supported Campaign, Ad, Page type -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Supported Campaign, Ad, Page type + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OutreachType { #[serde(rename = "absplit")] Absplit, @@ -28814,6 +28070,7 @@ pub enum OutreachType { #[serde(rename = "website")] Website, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -28843,11 +28100,6 @@ impl std::fmt::Display for OutreachType { } } -impl Default for OutreachType { - fn default() -> OutreachType { - OutreachType::Noop - } -} impl OutreachType { pub fn is_noop(&self) -> bool { matches!(self, OutreachType::Noop) @@ -28855,9 +28107,9 @@ impl OutreachType { } /** -* Campaign, Ad, or Page status -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Campaign, Ad, or Page status + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OutreachStatus { #[serde(rename = "active")] Active, @@ -28894,6 +28146,7 @@ pub enum OutreachStatus { #[serde(rename = "unpublished")] Unpublished, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -28926,11 +28179,6 @@ impl std::fmt::Display for OutreachStatus { } } -impl Default for OutreachStatus { - fn default() -> OutreachStatus { - OutreachStatus::Noop - } -} impl OutreachStatus { pub fn is_noop(&self) -> bool { matches!(self, OutreachStatus::Noop) @@ -29422,9 +28670,9 @@ pub struct Site { } /** -* Type of the audience -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Type of the audience + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FacebookAdsAudienceType { #[serde(rename = "Custom Audience")] CustomAudience, @@ -29433,6 +28681,7 @@ pub enum FacebookAdsAudienceType { #[serde(rename = "Lookalike Audience")] LookalikeAudience, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -29451,11 +28700,6 @@ impl std::fmt::Display for FacebookAdsAudienceType { } } -impl Default for FacebookAdsAudienceType { - fn default() -> FacebookAdsAudienceType { - FacebookAdsAudienceType::Noop - } -} impl FacebookAdsAudienceType { pub fn is_noop(&self) -> bool { matches!(self, FacebookAdsAudienceType::Noop) @@ -29463,15 +28707,16 @@ impl FacebookAdsAudienceType { } /** -* List or Facebook based audience -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * List or Facebook based audience + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SourceType { #[serde(rename = "facebook")] Facebook, #[serde(rename = "list")] List, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -29489,11 +28734,6 @@ impl std::fmt::Display for SourceType { } } -impl Default for SourceType { - fn default() -> SourceType { - SourceType::Noop - } -} impl SourceType { pub fn is_noop(&self) -> bool { matches!(self, SourceType::Noop) diff --git a/okta/src/types.rs b/okta/src/types.rs index 2092f074..eff6146a 100644 --- a/okta/src/types.rs +++ b/okta/src/types.rs @@ -56,13 +56,14 @@ pub struct ActivateFactorRequest { pub state_token: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Type { #[serde(rename = "APP")] App, #[serde(rename = "APP_TYPE")] AppType, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -80,11 +81,6 @@ impl std::fmt::Display for Type { } } -impl Default for Type { - fn default() -> Type { - Type::Noop - } -} impl Type { pub fn is_noop(&self) -> bool { matches!(self, Type::Noop) @@ -314,7 +310,7 @@ pub struct AppUserPasswordCredential { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Status { #[serde(rename = "ACTIVE")] Active, @@ -323,6 +319,7 @@ pub enum Status { #[serde(rename = "INACTIVE")] Inactive, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -341,11 +338,6 @@ impl std::fmt::Display for Status { } } -impl Default for Status { - fn default() -> Status { - Status::Noop - } -} impl Status { pub fn is_noop(&self) -> bool { matches!(self, Status::Noop) @@ -477,7 +469,7 @@ pub struct ApplicationCredentialsOAuthClient { pub token_endpoint_auth_method: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ApplicationCredentialsScheme { #[serde(rename = "ADMIN_SETS_CREDENTIALS")] AdminSetsCredentials, @@ -490,6 +482,7 @@ pub enum ApplicationCredentialsScheme { #[serde(rename = "SHARED_USERNAME_AND_PASSWORD")] SharedUsernameAndPassword, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -512,11 +505,6 @@ impl std::fmt::Display for ApplicationCredentialsScheme { } } -impl Default for ApplicationCredentialsScheme { - fn default() -> ApplicationCredentialsScheme { - ApplicationCredentialsScheme::Noop - } -} impl ApplicationCredentialsScheme { pub fn is_noop(&self) -> bool { matches!(self, ApplicationCredentialsScheme::Noop) @@ -556,11 +544,12 @@ pub struct ApplicationCredentialsSigning { pub use_: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Use { #[serde(rename = "sig")] Sig, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -577,11 +566,6 @@ impl std::fmt::Display for Use { } } -impl Default for Use { - fn default() -> Use { - Use::Noop - } -} impl Use { pub fn is_noop(&self) -> bool { matches!(self, Use::Noop) @@ -719,7 +703,7 @@ pub struct ApplicationSettingsNotificationsVpnNetwork { pub include: Vec, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ApplicationSignOnMode { #[serde(rename = "AUTO_LOGIN")] AutoLogin, @@ -740,6 +724,7 @@ pub enum ApplicationSignOnMode { #[serde(rename = "WS_FEDERATION")] WsFederation, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -764,11 +749,6 @@ impl std::fmt::Display for ApplicationSignOnMode { } } -impl Default for ApplicationSignOnMode { - fn default() -> ApplicationSignOnMode { - ApplicationSignOnMode::Noop - } -} impl ApplicationSignOnMode { pub fn is_noop(&self) -> bool { matches!(self, ApplicationSignOnMode::Noop) @@ -826,7 +806,7 @@ pub struct AuthenticationProvider { pub type_: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AuthenticationProviderType { #[serde(rename = "ACTIVE_DIRECTORY")] ActiveDirectory, @@ -841,6 +821,7 @@ pub enum AuthenticationProviderType { #[serde(rename = "SOCIAL")] Social, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -862,24 +843,20 @@ impl std::fmt::Display for AuthenticationProviderType { } } -impl Default for AuthenticationProviderType { - fn default() -> AuthenticationProviderType { - AuthenticationProviderType::Noop - } -} impl AuthenticationProviderType { pub fn is_noop(&self) -> bool { matches!(self, AuthenticationProviderType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuerMode { #[serde(rename = "CUSTOM_URL")] CustomUrl, #[serde(rename = "ORG_URL")] OrgUrl, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -897,24 +874,20 @@ impl std::fmt::Display for IssuerMode { } } -impl Default for IssuerMode { - fn default() -> IssuerMode { - IssuerMode::Noop - } -} impl IssuerMode { pub fn is_noop(&self) -> bool { matches!(self, IssuerMode::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RoleStatus { #[serde(rename = "ACTIVE")] Active, #[serde(rename = "INACTIVE")] Inactive, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -932,11 +905,6 @@ impl std::fmt::Display for RoleStatus { } } -impl Default for RoleStatus { - fn default() -> RoleStatus { - RoleStatus::Noop - } -} impl RoleStatus { pub fn is_noop(&self) -> bool { matches!(self, RoleStatus::Noop) @@ -1008,13 +976,14 @@ pub struct AuthorizationServerCredentials { pub signing: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AuthorizationServerCredentialsRotationMode { #[serde(rename = "AUTO")] Auto, #[serde(rename = "MANUAL")] Manual, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1032,11 +1001,6 @@ impl std::fmt::Display for AuthorizationServerCredentialsRotationMode { } } -impl Default for AuthorizationServerCredentialsRotationMode { - fn default() -> AuthorizationServerCredentialsRotationMode { - AuthorizationServerCredentialsRotationMode::Noop - } -} impl AuthorizationServerCredentialsRotationMode { pub fn is_noop(&self) -> bool { matches!(self, AuthorizationServerCredentialsRotationMode::Noop) @@ -1131,11 +1095,12 @@ pub struct AuthorizationServerPolicy { pub type_: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AuthorizationServerPolicyRuleType { #[serde(rename = "RESOURCE_ACCESS")] ResourceAccess, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1152,11 +1117,6 @@ impl std::fmt::Display for AuthorizationServerPolicyRuleType { } } -impl Default for AuthorizationServerPolicyRuleType { - fn default() -> AuthorizationServerPolicyRuleType { - AuthorizationServerPolicyRuleType::Noop - } -} impl AuthorizationServerPolicyRuleType { pub fn is_noop(&self) -> bool { matches!(self, AuthorizationServerPolicyRuleType::Noop) @@ -1655,13 +1615,14 @@ pub struct DnsRecord { pub values: Vec, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DnsRecordType { #[serde(rename = "CNAME")] Cname, #[serde(rename = "TXT")] Txt, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1679,24 +1640,20 @@ impl std::fmt::Display for DnsRecordType { } } -impl Default for DnsRecordType { - fn default() -> DnsRecordType { - DnsRecordType::Noop - } -} impl DnsRecordType { pub fn is_noop(&self) -> bool { matches!(self, DnsRecordType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TrustLevel { #[serde(rename = "ANY")] Any, #[serde(rename = "TRUSTED")] Trusted, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1714,11 +1671,6 @@ impl std::fmt::Display for TrustLevel { } } -impl Default for TrustLevel { - fn default() -> TrustLevel { - TrustLevel::Noop - } -} impl TrustLevel { pub fn is_noop(&self) -> bool { matches!(self, TrustLevel::Noop) @@ -1747,7 +1699,7 @@ pub struct DevicePolicyRuleCondition { pub trust_level: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SupportedMdmFrameworks { #[serde(rename = "AFW")] Afw, @@ -1756,6 +1708,7 @@ pub enum SupportedMdmFrameworks { #[serde(rename = "SAFE")] Safe, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1774,18 +1727,13 @@ impl std::fmt::Display for SupportedMdmFrameworks { } } -impl Default for SupportedMdmFrameworks { - fn default() -> SupportedMdmFrameworks { - SupportedMdmFrameworks::Noop - } -} impl SupportedMdmFrameworks { pub fn is_noop(&self) -> bool { matches!(self, SupportedMdmFrameworks::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Types { #[serde(rename = "ANDROID")] Android, @@ -1796,6 +1744,7 @@ pub enum Types { #[serde(rename = "WINDOWS")] Windows, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1815,11 +1764,6 @@ impl std::fmt::Display for Types { } } -impl Default for Types { - fn default() -> Types { - Types::Noop - } -} impl Types { pub fn is_noop(&self) -> bool { matches!(self, Types::Noop) @@ -1932,11 +1876,12 @@ pub struct DomainCertificateMetadata { pub subject: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DomainCertificateSourceType { #[serde(rename = "MANUAL")] Manual, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1953,22 +1898,18 @@ impl std::fmt::Display for DomainCertificateSourceType { } } -impl Default for DomainCertificateSourceType { - fn default() -> DomainCertificateSourceType { - DomainCertificateSourceType::Noop - } -} impl DomainCertificateSourceType { pub fn is_noop(&self) -> bool { matches!(self, DomainCertificateSourceType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DomainCertificateType { #[serde(rename = "PEM")] Pem, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1985,11 +1926,6 @@ impl std::fmt::Display for DomainCertificateType { } } -impl Default for DomainCertificateType { - fn default() -> DomainCertificateType { - DomainCertificateType::Noop - } -} impl DomainCertificateType { pub fn is_noop(&self) -> bool { matches!(self, DomainCertificateType::Noop) @@ -2006,7 +1942,7 @@ pub struct DomainListResponse { pub domains: Vec, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DomainValidationStatus { #[serde(rename = "COMPLETED")] Completed, @@ -2017,6 +1953,7 @@ pub enum DomainValidationStatus { #[serde(rename = "VERIFIED")] Verified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2036,11 +1973,6 @@ impl std::fmt::Display for DomainValidationStatus { } } -impl Default for DomainValidationStatus { - fn default() -> DomainValidationStatus { - DomainValidationStatus::Noop - } -} impl DomainValidationStatus { pub fn is_noop(&self) -> bool { matches!(self, DomainValidationStatus::Noop) @@ -2079,13 +2011,14 @@ pub struct EmailUserFactorProfile { pub email: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EnabledStatus { #[serde(rename = "DISABLED")] Disabled, #[serde(rename = "ENABLED")] Enabled, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2103,24 +2036,20 @@ impl std::fmt::Display for EnabledStatus { } } -impl Default for EnabledStatus { - fn default() -> EnabledStatus { - EnabledStatus::Noop - } -} impl EnabledStatus { pub fn is_noop(&self) -> bool { matches!(self, EnabledStatus::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum VerificationStatus { #[serde(rename = "UNVERIFIED")] Unverified, #[serde(rename = "VERIFIED")] Verified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2138,11 +2067,6 @@ impl std::fmt::Display for VerificationStatus { } } -impl Default for VerificationStatus { - fn default() -> VerificationStatus { - VerificationStatus::Noop - } -} impl VerificationStatus { pub fn is_noop(&self) -> bool { matches!(self, VerificationStatus::Noop) @@ -2199,11 +2123,12 @@ pub struct EventHook { pub verification_status: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EventHookChannelType { #[serde(rename = "HTTP")] Http, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2220,11 +2145,6 @@ impl std::fmt::Display for EventHookChannelType { } } -impl Default for EventHookChannelType { - fn default() -> EventHookChannelType { - EventHookChannelType::Noop - } -} impl EventHookChannelType { pub fn is_noop(&self) -> bool { matches!(self, EventHookChannelType::Noop) @@ -2285,11 +2205,12 @@ pub struct EventHookChannelConfigAuthScheme { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EventHookChannelConfigAuthSchemeType { #[serde(rename = "HEADER")] Header, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2306,11 +2227,6 @@ impl std::fmt::Display for EventHookChannelConfigAuthSchemeType { } } -impl Default for EventHookChannelConfigAuthSchemeType { - fn default() -> EventHookChannelConfigAuthSchemeType { - EventHookChannelConfigAuthSchemeType::Noop - } -} impl EventHookChannelConfigAuthSchemeType { pub fn is_noop(&self) -> bool { matches!(self, EventHookChannelConfigAuthSchemeType::Noop) @@ -2333,13 +2249,14 @@ pub struct EventHookChannelConfigHeader { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EventSubscriptionsType { #[serde(rename = "EVENT_TYPE")] EventType, #[serde(rename = "FLOW_EVENT")] FlowEvent, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2357,11 +2274,6 @@ impl std::fmt::Display for EventSubscriptionsType { } } -impl Default for EventSubscriptionsType { - fn default() -> EventSubscriptionsType { - EventSubscriptionsType::Noop - } -} impl EventSubscriptionsType { pub fn is_noop(&self) -> bool { matches!(self, EventSubscriptionsType::Noop) @@ -2380,7 +2292,7 @@ pub struct EventSubscriptions { pub type_: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FactorProvider { #[serde(rename = "CUSTOM")] Custom, @@ -2399,6 +2311,7 @@ pub enum FactorProvider { #[serde(rename = "YUBICO")] Yubico, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2422,18 +2335,13 @@ impl std::fmt::Display for FactorProvider { } } -impl Default for FactorProvider { - fn default() -> FactorProvider { - FactorProvider::Noop - } -} impl FactorProvider { pub fn is_noop(&self) -> bool { matches!(self, FactorProvider::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FactorResultType { #[serde(rename = "CANCELLED")] Cancelled, @@ -2456,6 +2364,7 @@ pub enum FactorResultType { #[serde(rename = "WAITING")] Waiting, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2481,18 +2390,13 @@ impl std::fmt::Display for FactorResultType { } } -impl Default for FactorResultType { - fn default() -> FactorResultType { - FactorResultType::Noop - } -} impl FactorResultType { pub fn is_noop(&self) -> bool { matches!(self, FactorResultType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FactorStatus { #[serde(rename = "ACTIVE")] Active, @@ -2509,6 +2413,7 @@ pub enum FactorStatus { #[serde(rename = "PENDING_ACTIVATION")] PendingActivation, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2531,18 +2436,13 @@ impl std::fmt::Display for FactorStatus { } } -impl Default for FactorStatus { - fn default() -> FactorStatus { - FactorStatus::Noop - } -} impl FactorStatus { pub fn is_noop(&self) -> bool { matches!(self, FactorStatus::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FactorType { #[serde(rename = "call")] Call, @@ -2571,6 +2471,7 @@ pub enum FactorType { #[serde(rename = "webauthn")] Webauthn, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2599,11 +2500,6 @@ impl std::fmt::Display for FactorType { } } -impl Default for FactorType { - fn default() -> FactorType { - FactorType::Noop - } -} impl FactorType { pub fn is_noop(&self) -> bool { matches!(self, FactorType::Noop) @@ -2648,13 +2544,14 @@ pub struct FeatureStage { pub value: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FeatureStageState { #[serde(rename = "CLOSED")] Closed, #[serde(rename = "OPEN")] Open, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2672,24 +2569,20 @@ impl std::fmt::Display for FeatureStageState { } } -impl Default for FeatureStageState { - fn default() -> FeatureStageState { - FeatureStageState::Noop - } -} impl FeatureStageState { pub fn is_noop(&self) -> bool { matches!(self, FeatureStageState::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FeatureStageValue { #[serde(rename = "BETA")] Beta, #[serde(rename = "EA")] Ea, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2707,22 +2600,18 @@ impl std::fmt::Display for FeatureStageValue { } } -impl Default for FeatureStageValue { - fn default() -> FeatureStageValue { - FeatureStageValue::Noop - } -} impl FeatureStageValue { pub fn is_noop(&self) -> bool { matches!(self, FeatureStageValue::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FeatureType { #[serde(rename = "self-service")] SelfService, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2739,11 +2628,6 @@ impl std::fmt::Display for FeatureType { } } -impl Default for FeatureType { - fn default() -> FeatureType { - FeatureType::Noop - } -} impl FeatureType { pub fn is_noop(&self) -> bool { matches!(self, FeatureType::Noop) @@ -2934,7 +2818,7 @@ pub struct GroupRulePeopleCondition { pub users: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GroupRuleStatus { #[serde(rename = "ACTIVE")] Active, @@ -2943,6 +2827,7 @@ pub enum GroupRuleStatus { #[serde(rename = "INVALID")] Invalid, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2961,18 +2846,13 @@ impl std::fmt::Display for GroupRuleStatus { } } -impl Default for GroupRuleStatus { - fn default() -> GroupRuleStatus { - GroupRuleStatus::Noop - } -} impl GroupRuleStatus { pub fn is_noop(&self) -> bool { matches!(self, GroupRuleStatus::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GroupType { #[serde(rename = "APP_GROUP")] AppGroup, @@ -2981,6 +2861,7 @@ pub enum GroupType { #[serde(rename = "OKTA_GROUP")] OktaGroup, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2999,11 +2880,6 @@ impl std::fmt::Display for GroupType { } } -impl Default for GroupType { - fn default() -> GroupType { - GroupType::Noop - } -} impl GroupType { pub fn is_noop(&self) -> bool { matches!(self, GroupType::Noop) @@ -3027,13 +2903,14 @@ pub struct WebUserFactorProfile { pub credential_id: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IdentityProviderIssuerMode { #[serde(rename = "CUSTOM_URL_DOMAIN")] CustomUrlDomain, #[serde(rename = "ORG_URL")] OrgUrl, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3051,18 +2928,13 @@ impl std::fmt::Display for IdentityProviderIssuerMode { } } -impl Default for IdentityProviderIssuerMode { - fn default() -> IdentityProviderIssuerMode { - IdentityProviderIssuerMode::Noop - } -} impl IdentityProviderIssuerMode { pub fn is_noop(&self) -> bool { matches!(self, IdentityProviderIssuerMode::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IdentityProviderType { #[serde(rename = "AgentlessDSSO")] AgentlessDsso, @@ -3085,6 +2957,7 @@ pub enum IdentityProviderType { #[serde(rename = "X509")] X509, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3110,11 +2983,6 @@ impl std::fmt::Display for IdentityProviderType { } } -impl Default for IdentityProviderType { - fn default() -> IdentityProviderType { - IdentityProviderType::Noop - } -} impl IdentityProviderType { pub fn is_noop(&self) -> bool { matches!(self, IdentityProviderType::Noop) @@ -3238,7 +3106,7 @@ pub struct IdentityProviderCredentialsSigning { pub kid: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Revocation { #[serde(rename = "CRL")] Crl, @@ -3247,6 +3115,7 @@ pub enum Revocation { #[serde(rename = "OCSP")] Ocsp, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3265,11 +3134,6 @@ impl std::fmt::Display for Revocation { } } -impl Default for Revocation { - fn default() -> Revocation { - Revocation::Noop - } -} impl Revocation { pub fn is_noop(&self) -> bool { matches!(self, Revocation::Noop) @@ -3328,7 +3192,7 @@ pub struct IdentityProviderPolicy { pub subject: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Provider { #[serde(rename = "ANY")] Any, @@ -3337,6 +3201,7 @@ pub enum Provider { #[serde(rename = "SPECIFIC_IDP")] SpecificIdp, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3355,11 +3220,6 @@ impl std::fmt::Display for Provider { } } -impl Default for Provider { - fn default() -> Provider { - Provider::Noop - } -} impl Provider { pub fn is_noop(&self) -> bool { matches!(self, Provider::Noop) @@ -3552,7 +3412,7 @@ pub struct InlineHookResponseCommands { pub value: Vec, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum InlineHookType { #[serde(rename = "com.okta.import.transform")] ComOktaImportTransform, @@ -3565,6 +3425,7 @@ pub enum InlineHookType { #[serde(rename = "com.okta.user.pre-registration")] ComOktaUserPreRegistration, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3587,11 +3448,6 @@ impl std::fmt::Display for InlineHookType { } } -impl Default for InlineHookType { - fn default() -> InlineHookType { - InlineHookType::Noop - } -} impl InlineHookType { pub fn is_noop(&self) -> bool { matches!(self, InlineHookType::Noop) @@ -3870,11 +3726,12 @@ pub struct LinkedObjectDetails { pub type_: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LinkedObjectDetailsType { #[serde(rename = "USER")] User, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3891,11 +3748,6 @@ impl std::fmt::Display for LinkedObjectDetailsType { } } -impl Default for LinkedObjectDetailsType { - fn default() -> LinkedObjectDetailsType { - LinkedObjectDetailsType::Noop - } -} impl LinkedObjectDetailsType { pub fn is_noop(&self) -> bool { matches!(self, LinkedObjectDetailsType::Noop) @@ -3979,7 +3831,7 @@ pub struct LogAuthenticationContext { pub issuer: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LogAuthenticationProvider { #[serde(rename = "ACTIVE_DIRECTORY")] ActiveDirectory, @@ -3994,6 +3846,7 @@ pub enum LogAuthenticationProvider { #[serde(rename = "SOCIAL")] Social, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4015,11 +3868,6 @@ impl std::fmt::Display for LogAuthenticationProvider { } } -impl Default for LogAuthenticationProvider { - fn default() -> LogAuthenticationProvider { - LogAuthenticationProvider::Noop - } -} impl LogAuthenticationProvider { pub fn is_noop(&self) -> bool { matches!(self, LogAuthenticationProvider::Noop) @@ -4063,7 +3911,7 @@ pub struct LogClient { pub zone: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LogCredentialProvider { #[serde(rename = "DUO")] Duo, @@ -4080,6 +3928,7 @@ pub enum LogCredentialProvider { #[serde(rename = "YUBIKEY")] Yubikey, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4102,18 +3951,13 @@ impl std::fmt::Display for LogCredentialProvider { } } -impl Default for LogCredentialProvider { - fn default() -> LogCredentialProvider { - LogCredentialProvider::Noop - } -} impl LogCredentialProvider { pub fn is_noop(&self) -> bool { matches!(self, LogCredentialProvider::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LogCredentialType { #[serde(rename = "ASSERTION")] Assertion, @@ -4132,6 +3976,7 @@ pub enum LogCredentialType { #[serde(rename = "SMS")] Sms, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4155,11 +4000,6 @@ impl std::fmt::Display for LogCredentialType { } } -impl Default for LogCredentialType { - fn default() -> LogCredentialType { - LogCredentialType::Noop - } -} impl LogCredentialType { pub fn is_noop(&self) -> bool { matches!(self, LogCredentialType::Noop) @@ -4406,7 +4246,7 @@ pub struct LogSecurityContext { pub isp: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LogSeverity { #[serde(rename = "DEBUG")] Debug, @@ -4417,6 +4257,7 @@ pub enum LogSeverity { #[serde(rename = "WARN")] Warn, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4436,11 +4277,6 @@ impl std::fmt::Display for LogSeverity { } } -impl Default for LogSeverity { - fn default() -> LogSeverity { - LogSeverity::Noop - } -} impl LogSeverity { pub fn is_noop(&self) -> bool { matches!(self, LogSeverity::Noop) @@ -4526,13 +4362,14 @@ pub struct LogUserAgent { pub raw_user_agent: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Enrollment { #[serde(rename = "ANY_OR_NONE")] AnyOrNone, #[serde(rename = "OMM")] Omm, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4550,11 +4387,6 @@ impl std::fmt::Display for Enrollment { } } -impl Default for Enrollment { - fn default() -> Enrollment { - Enrollment::Noop - } -} impl Enrollment { pub fn is_noop(&self) -> bool { matches!(self, Enrollment::Noop) @@ -4658,13 +4490,14 @@ pub struct NetworkZoneAddress { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum NetworkZoneAddressType { #[serde(rename = "CIDR")] Cidr, #[serde(rename = "RANGE")] Range, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4682,11 +4515,6 @@ impl std::fmt::Display for NetworkZoneAddressType { } } -impl Default for NetworkZoneAddressType { - fn default() -> NetworkZoneAddressType { - NetworkZoneAddressType::Noop - } -} impl NetworkZoneAddressType { pub fn is_noop(&self) -> bool { matches!(self, NetworkZoneAddressType::Noop) @@ -4709,13 +4537,14 @@ pub struct NetworkZoneLocation { pub region: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum NetworkZoneType { #[serde(rename = "DYNAMIC")] Dynamic, #[serde(rename = "IP")] Ip, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4733,24 +4562,20 @@ impl std::fmt::Display for NetworkZoneType { } } -impl Default for NetworkZoneType { - fn default() -> NetworkZoneType { - NetworkZoneType::Noop - } -} impl NetworkZoneType { pub fn is_noop(&self) -> bool { matches!(self, NetworkZoneType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum NetworkZoneUsage { #[serde(rename = "BLOCKLIST")] Blocklist, #[serde(rename = "POLICY")] Policy, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4768,11 +4593,6 @@ impl std::fmt::Display for NetworkZoneUsage { } } -impl Default for NetworkZoneUsage { - fn default() -> NetworkZoneUsage { - NetworkZoneUsage::Noop - } -} impl NetworkZoneUsage { pub fn is_noop(&self) -> bool { matches!(self, NetworkZoneUsage::Noop) @@ -4796,13 +4616,14 @@ pub struct OAuth2Actor { pub type_: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ClaimType { #[serde(rename = "IDENTITY")] Identity, #[serde(rename = "RESOURCE")] Resource, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4820,18 +4641,13 @@ impl std::fmt::Display for ClaimType { } } -impl Default for ClaimType { - fn default() -> ClaimType { - ClaimType::Noop - } -} impl ClaimType { pub fn is_noop(&self) -> bool { matches!(self, ClaimType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GroupFilterType { #[serde(rename = "CONTAINS")] Contains, @@ -4842,6 +4658,7 @@ pub enum GroupFilterType { #[serde(rename = "STARTS_WITH")] StartsWith, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4861,18 +4678,13 @@ impl std::fmt::Display for GroupFilterType { } } -impl Default for GroupFilterType { - fn default() -> GroupFilterType { - GroupFilterType::Noop - } -} impl GroupFilterType { pub fn is_noop(&self) -> bool { matches!(self, GroupFilterType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ValueType { #[serde(rename = "EXPRESSION")] Expression, @@ -4881,6 +4693,7 @@ pub enum ValueType { #[serde(rename = "SYSTEM")] System, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4899,11 +4712,6 @@ impl std::fmt::Display for ValueType { } } -impl Default for ValueType { - fn default() -> ValueType { - ValueType::Noop - } -} impl ValueType { pub fn is_noop(&self) -> bool { matches!(self, ValueType::Noop) @@ -4995,13 +4803,14 @@ pub struct OAuth2Client { pub logo_uri: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OAuth2RefreshTokenStatus { #[serde(rename = "ACTIVE")] Active, #[serde(rename = "REVOKED")] Revoked, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5019,11 +4828,6 @@ impl std::fmt::Display for OAuth2RefreshTokenStatus { } } -impl Default for OAuth2RefreshTokenStatus { - fn default() -> OAuth2RefreshTokenStatus { - OAuth2RefreshTokenStatus::Noop - } -} impl OAuth2RefreshTokenStatus { pub fn is_noop(&self) -> bool { matches!(self, OAuth2RefreshTokenStatus::Noop) @@ -5094,7 +4898,7 @@ pub struct OAuth2RefreshToken { pub user_id: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Consent { #[serde(rename = "ADMIN")] Admin, @@ -5103,6 +4907,7 @@ pub enum Consent { #[serde(rename = "REQUIRED")] Required, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5121,24 +4926,20 @@ impl std::fmt::Display for Consent { } } -impl Default for Consent { - fn default() -> Consent { - Consent::Noop - } -} impl Consent { pub fn is_noop(&self) -> bool { matches!(self, Consent::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MetadataPublish { #[serde(rename = "ALL_CLIENTS")] AllClients, #[serde(rename = "NO_CLIENTS")] NoClients, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5156,11 +4957,6 @@ impl std::fmt::Display for MetadataPublish { } } -impl Default for MetadataPublish { - fn default() -> MetadataPublish { - MetadataPublish::Noop - } -} impl MetadataPublish { pub fn is_noop(&self) -> bool { matches!(self, MetadataPublish::Noop) @@ -5274,13 +5070,14 @@ pub struct OAuth2ScopeConsentGrant { pub user_id: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OAuth2ScopeConsentGrantSource { #[serde(rename = "ADMIN")] Admin, #[serde(rename = "END_USER")] EndUser, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5298,11 +5095,6 @@ impl std::fmt::Display for OAuth2ScopeConsentGrantSource { } } -impl Default for OAuth2ScopeConsentGrantSource { - fn default() -> OAuth2ScopeConsentGrantSource { - OAuth2ScopeConsentGrantSource::Noop - } -} impl OAuth2ScopeConsentGrantSource { pub fn is_noop(&self) -> bool { matches!(self, OAuth2ScopeConsentGrantSource::Noop) @@ -5391,7 +5183,7 @@ pub struct OAuthApplicationCredentials { pub oauth_client: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OAuthEndpointAuthenticationMethod { #[serde(rename = "client_secret_basic")] ClientSecretBasic, @@ -5404,6 +5196,7 @@ pub enum OAuthEndpointAuthenticationMethod { #[serde(rename = "private_key_jwt")] PrivateKeyJwt, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5424,18 +5217,13 @@ impl std::fmt::Display for OAuthEndpointAuthenticationMethod { } } -impl Default for OAuthEndpointAuthenticationMethod { - fn default() -> OAuthEndpointAuthenticationMethod { - OAuthEndpointAuthenticationMethod::Noop - } -} impl OAuthEndpointAuthenticationMethod { pub fn is_noop(&self) -> bool { matches!(self, OAuthEndpointAuthenticationMethod::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OAuthGrantType { #[serde(rename = "authorization_code")] AuthorizationCode, @@ -5448,6 +5236,7 @@ pub enum OAuthGrantType { #[serde(rename = "refresh_token")] RefreshToken, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5468,18 +5257,13 @@ impl std::fmt::Display for OAuthGrantType { } } -impl Default for OAuthGrantType { - fn default() -> OAuthGrantType { - OAuthGrantType::Noop - } -} impl OAuthGrantType { pub fn is_noop(&self) -> bool { matches!(self, OAuthGrantType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OAuthResponseType { #[serde(rename = "code")] Code, @@ -5488,6 +5272,7 @@ pub enum OAuthResponseType { #[serde(rename = "token")] Token, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5506,11 +5291,6 @@ impl std::fmt::Display for OAuthResponseType { } } -impl Default for OAuthResponseType { - fn default() -> OAuthResponseType { - OAuthResponseType::Noop - } -} impl OAuthResponseType { pub fn is_noop(&self) -> bool { matches!(self, OAuthResponseType::Noop) @@ -5563,13 +5343,14 @@ pub struct OktaSignOnPolicyRuleConditions { pub people: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Access { #[serde(rename = "ALLOW")] Allow, #[serde(rename = "DENY")] Deny, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5587,18 +5368,13 @@ impl std::fmt::Display for Access { } } -impl Default for Access { - fn default() -> Access { - Access::Noop - } -} impl Access { pub fn is_noop(&self) -> bool { matches!(self, Access::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FactorPromptMode { #[serde(rename = "ALWAYS")] Always, @@ -5607,6 +5383,7 @@ pub enum FactorPromptMode { #[serde(rename = "SESSION")] Session, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5625,11 +5402,6 @@ impl std::fmt::Display for FactorPromptMode { } } -impl Default for FactorPromptMode { - fn default() -> FactorPromptMode { - FactorPromptMode::Noop - } -} impl FactorPromptMode { pub fn is_noop(&self) -> bool { matches!(self, FactorPromptMode::Noop) @@ -5703,13 +5475,14 @@ pub struct OpenConnectApplication { pub settings: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OpenConnectApplicationConsentMethod { #[serde(rename = "REQUIRED")] Required, #[serde(rename = "TRUSTED")] Trusted, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5727,11 +5500,6 @@ impl std::fmt::Display for OpenConnectApplicationConsentMethod { } } -impl Default for OpenConnectApplicationConsentMethod { - fn default() -> OpenConnectApplicationConsentMethod { - OpenConnectApplicationConsentMethod::Noop - } -} impl OpenConnectApplicationConsentMethod { pub fn is_noop(&self) -> bool { matches!(self, OpenConnectApplicationConsentMethod::Noop) @@ -5862,7 +5630,7 @@ pub struct OpenConnectApplicationSettingsRefreshToken { pub rotation_type: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OpenConnectApplicationType { #[serde(rename = "browser")] Browser, @@ -5873,6 +5641,7 @@ pub enum OpenConnectApplicationType { #[serde(rename = "web")] Web, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5892,24 +5661,20 @@ impl std::fmt::Display for OpenConnectApplicationType { } } -impl Default for OpenConnectApplicationType { - fn default() -> OpenConnectApplicationType { - OpenConnectApplicationType::Noop - } -} impl OpenConnectApplicationType { pub fn is_noop(&self) -> bool { matches!(self, OpenConnectApplicationType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OpenConnectRefreshTokenRotationType { #[serde(rename = "rotate")] Rotate, #[serde(rename = "static")] Static, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5927,11 +5692,6 @@ impl std::fmt::Display for OpenConnectRefreshTokenRotationType { } } -impl Default for OpenConnectRefreshTokenRotationType { - fn default() -> OpenConnectRefreshTokenRotationType { - OpenConnectRefreshTokenRotationType::Noop - } -} impl OpenConnectRefreshTokenRotationType { pub fn is_noop(&self) -> bool { matches!(self, OpenConnectRefreshTokenRotationType::Noop) @@ -5984,7 +5744,7 @@ pub struct PasswordCredentialHash { pub work_factor: i64, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PasswordCredentialHashAlgorithm { #[serde(rename = "BCRYPT")] Bcrypt, @@ -5997,6 +5757,7 @@ pub enum PasswordCredentialHashAlgorithm { #[serde(rename = "SHA-512")] Sha512, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6017,11 +5778,6 @@ impl std::fmt::Display for PasswordCredentialHashAlgorithm { } } -impl Default for PasswordCredentialHashAlgorithm { - fn default() -> PasswordCredentialHashAlgorithm { - PasswordCredentialHashAlgorithm::Noop - } -} impl PasswordCredentialHashAlgorithm { pub fn is_noop(&self) -> bool { matches!(self, PasswordCredentialHashAlgorithm::Noop) @@ -6062,7 +5818,7 @@ pub struct PasswordPolicy { pub settings: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PasswordPolicyAuthenticationProviderCondition { #[serde(rename = "ACTIVE_DIRECTORY")] ActiveDirectory, @@ -6073,6 +5829,7 @@ pub enum PasswordPolicyAuthenticationProviderCondition { #[serde(rename = "OKTA")] Okta, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6092,11 +5849,6 @@ impl std::fmt::Display for PasswordPolicyAuthenticationProviderCondition { } } -impl Default for PasswordPolicyAuthenticationProviderCondition { - fn default() -> PasswordPolicyAuthenticationProviderCondition { - PasswordPolicyAuthenticationProviderCondition::Noop - } -} impl PasswordPolicyAuthenticationProviderCondition { pub fn is_noop(&self) -> bool { matches!(self, PasswordPolicyAuthenticationProviderCondition::Noop) @@ -6408,7 +6160,7 @@ pub struct PasswordPolicySettingsData { pub recovery: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PlatformConditionEvaluatorType { #[serde(rename = "ANY")] Any, @@ -6419,6 +6171,7 @@ pub enum PlatformConditionEvaluatorType { #[serde(rename = "OTHER")] Other, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6438,11 +6191,6 @@ impl std::fmt::Display for PlatformConditionEvaluatorType { } } -impl Default for PlatformConditionEvaluatorType { - fn default() -> PlatformConditionEvaluatorType { - PlatformConditionEvaluatorType::Noop - } -} impl PlatformConditionEvaluatorType { pub fn is_noop(&self) -> bool { matches!(self, PlatformConditionEvaluatorType::Noop) @@ -6457,7 +6205,7 @@ pub struct PlatformConditionEvaluator { pub type_: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PlatformConditionEvaluatorOperatingSystemType { #[serde(rename = "ANDROID")] Android, @@ -6472,6 +6220,7 @@ pub enum PlatformConditionEvaluatorOperatingSystemType { #[serde(rename = "WINDOWS")] Windows, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6493,11 +6242,6 @@ impl std::fmt::Display for PlatformConditionEvaluatorOperatingSystemType { } } -impl Default for PlatformConditionEvaluatorOperatingSystemType { - fn default() -> PlatformConditionEvaluatorOperatingSystemType { - PlatformConditionEvaluatorOperatingSystemType::Noop - } -} impl PlatformConditionEvaluatorOperatingSystemType { pub fn is_noop(&self) -> bool { matches!(self, PlatformConditionEvaluatorOperatingSystemType::Noop) @@ -6518,13 +6262,14 @@ pub struct PlatformConditionEvaluatorOperatingSystem { pub version: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MatchType { #[serde(rename = "EXPRESSION")] Expression, #[serde(rename = "SEMVER")] Semver, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6542,11 +6287,6 @@ impl std::fmt::Display for MatchType { } } -impl Default for MatchType { - fn default() -> MatchType { - MatchType::Noop - } -} impl MatchType { pub fn is_noop(&self) -> bool { matches!(self, MatchType::Noop) @@ -6637,13 +6377,14 @@ pub struct Policy { pub type_: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Action { #[serde(rename = "AUTO")] Auto, #[serde(rename = "DISABLED")] Disabled, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6661,11 +6402,6 @@ impl std::fmt::Display for Action { } } -impl Default for Action { - fn default() -> Action { - Action::Noop - } -} impl Action { pub fn is_noop(&self) -> bool { matches!(self, Action::Noop) @@ -6686,13 +6422,14 @@ pub struct PolicyAccountLinkFilter { pub groups: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Connection { #[serde(rename = "ANYWHERE")] Anywhere, #[serde(rename = "ZONE")] Zone, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6710,11 +6447,6 @@ impl std::fmt::Display for Connection { } } -impl Default for Connection { - fn default() -> Connection { - Connection::Noop - } -} impl Connection { pub fn is_noop(&self) -> bool { matches!(self, Connection::Noop) @@ -6747,13 +6479,14 @@ pub struct PolicyPeopleCondition { pub users: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PolicyRuleType { #[serde(rename = "PASSWORD")] Password, #[serde(rename = "SIGN_ON")] SignOn, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6771,11 +6504,6 @@ impl std::fmt::Display for PolicyRuleType { } } -impl Default for PolicyRuleType { - fn default() -> PolicyRuleType { - PolicyRuleType::Noop - } -} impl PolicyRuleType { pub fn is_noop(&self) -> bool { matches!(self, PolicyRuleType::Noop) @@ -6862,7 +6590,7 @@ pub struct PolicyRuleActionsEnroll { pub self_: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PolicyRuleActionsEnrollSelf { #[serde(rename = "CHALLENGE")] Challenge, @@ -6871,6 +6599,7 @@ pub enum PolicyRuleActionsEnrollSelf { #[serde(rename = "NEVER")] Never, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6889,24 +6618,20 @@ impl std::fmt::Display for PolicyRuleActionsEnrollSelf { } } -impl Default for PolicyRuleActionsEnrollSelf { - fn default() -> PolicyRuleActionsEnrollSelf { - PolicyRuleActionsEnrollSelf::Noop - } -} impl PolicyRuleActionsEnrollSelf { pub fn is_noop(&self) -> bool { matches!(self, PolicyRuleActionsEnrollSelf::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AuthType { #[serde(rename = "ANY")] Any, #[serde(rename = "RADIUS")] Radius, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6924,11 +6649,6 @@ impl std::fmt::Display for AuthType { } } -impl Default for AuthType { - fn default() -> AuthType { - AuthType::Noop - } -} impl AuthType { pub fn is_noop(&self) -> bool { matches!(self, AuthType::Noop) @@ -7050,7 +6770,7 @@ pub struct PolicySubject { pub user_name_template: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PolicySubjectMatchType { #[serde(rename = "CUSTOM_ATTRIBUTE")] CustomAttribute, @@ -7061,6 +6781,7 @@ pub enum PolicySubjectMatchType { #[serde(rename = "USERNAME_OR_EMAIL")] UsernameOrEmail, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7080,18 +6801,13 @@ impl std::fmt::Display for PolicySubjectMatchType { } } -impl Default for PolicySubjectMatchType { - fn default() -> PolicySubjectMatchType { - PolicySubjectMatchType::Noop - } -} impl PolicySubjectMatchType { pub fn is_noop(&self) -> bool { matches!(self, PolicySubjectMatchType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PolicyType { #[serde(rename = "IDP_DISCOVERY")] IdpDiscovery, @@ -7102,6 +6818,7 @@ pub enum PolicyType { #[serde(rename = "PASSWORD")] Password, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7121,11 +6838,6 @@ impl std::fmt::Display for PolicyType { } } -impl Default for PolicyType { - fn default() -> PolicyType { - PolicyType::Noop - } -} impl PolicyType { pub fn is_noop(&self) -> bool { matches!(self, PolicyType::Noop) @@ -7201,7 +6913,7 @@ pub struct ProfileMappingSource { pub type_: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ProtocolType { #[serde(rename = "MTLS")] Mtls, @@ -7212,6 +6924,7 @@ pub enum ProtocolType { #[serde(rename = "SAML2")] Saml2, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7231,11 +6944,6 @@ impl std::fmt::Display for ProtocolType { } } -impl Default for ProtocolType { - fn default() -> ProtocolType { - ProtocolType::Noop - } -} impl ProtocolType { pub fn is_noop(&self) -> bool { matches!(self, ProtocolType::Noop) @@ -7276,7 +6984,7 @@ pub struct ProtocolAlgorithmType { pub signature: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Scope { #[serde(rename = "ANY")] Any, @@ -7289,6 +6997,7 @@ pub enum Scope { #[serde(rename = "TOKEN")] Token, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7309,11 +7018,6 @@ impl std::fmt::Display for Scope { } } -impl Default for Scope { - fn default() -> Scope { - Scope::Noop - } -} impl Scope { pub fn is_noop(&self) -> bool { matches!(self, Scope::Noop) @@ -7340,13 +7044,14 @@ pub struct ProtocolAlgorithms { pub response: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Binding { #[serde(rename = "HTTP-POST")] HttpPost, #[serde(rename = "HTTP-REDIRECT")] HttpRedirect, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7364,24 +7069,20 @@ impl std::fmt::Display for Binding { } } -impl Default for Binding { - fn default() -> Binding { - Binding::Noop - } -} impl Binding { pub fn is_noop(&self) -> bool { matches!(self, Binding::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ProtocolEndpointType { #[serde(rename = "INSTANCE")] Instance, #[serde(rename = "ORG")] Org, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7399,11 +7100,6 @@ impl std::fmt::Display for ProtocolEndpointType { } } -impl Default for ProtocolEndpointType { - fn default() -> ProtocolEndpointType { - ProtocolEndpointType::Noop - } -} impl ProtocolEndpointType { pub fn is_noop(&self) -> bool { matches!(self, ProtocolEndpointType::Noop) @@ -7456,13 +7152,14 @@ pub struct ProtocolRelayState { pub format: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ProtocolRelayStateFormat { #[serde(rename = "FROM_URL")] FromUrl, #[serde(rename = "OPAQUE")] Opaque, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7480,11 +7177,6 @@ impl std::fmt::Display for ProtocolRelayStateFormat { } } -impl Default for ProtocolRelayStateFormat { - fn default() -> ProtocolRelayStateFormat { - ProtocolRelayStateFormat::Noop - } -} impl ProtocolRelayStateFormat { pub fn is_noop(&self) -> bool { matches!(self, ProtocolRelayStateFormat::Noop) @@ -7502,7 +7194,7 @@ pub struct ProtocolSettings { pub name_format: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ProvisioningAction { #[serde(rename = "AUTO")] Auto, @@ -7511,6 +7203,7 @@ pub enum ProvisioningAction { #[serde(rename = "DISABLED")] Disabled, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7529,11 +7222,6 @@ impl std::fmt::Display for ProvisioningAction { } } -impl Default for ProvisioningAction { - fn default() -> ProvisioningAction { - ProvisioningAction::Noop - } -} impl ProvisioningAction { pub fn is_noop(&self) -> bool { matches!(self, ProvisioningAction::Noop) @@ -7564,13 +7252,14 @@ pub struct ProvisioningConditions { pub suspended: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ProvisioningDeprovisionedConditionAction { #[serde(rename = "NONE")] None, #[serde(rename = "REACTIVATE")] Reactivate, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7588,11 +7277,6 @@ impl std::fmt::Display for ProvisioningDeprovisionedConditionAction { } } -impl Default for ProvisioningDeprovisionedConditionAction { - fn default() -> ProvisioningDeprovisionedConditionAction { - ProvisioningDeprovisionedConditionAction::Noop - } -} impl ProvisioningDeprovisionedConditionAction { pub fn is_noop(&self) -> bool { matches!(self, ProvisioningDeprovisionedConditionAction::Noop) @@ -7605,7 +7289,7 @@ pub struct ProvisioningDeprovisionedCondition { pub action: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ProvisioningGroupsAction { #[serde(rename = "APPEND")] Append, @@ -7616,6 +7300,7 @@ pub enum ProvisioningGroupsAction { #[serde(rename = "SYNC")] Sync, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7635,11 +7320,6 @@ impl std::fmt::Display for ProvisioningGroupsAction { } } -impl Default for ProvisioningGroupsAction { - fn default() -> ProvisioningGroupsAction { - ProvisioningGroupsAction::Noop - } -} impl ProvisioningGroupsAction { pub fn is_noop(&self) -> bool { matches!(self, ProvisioningGroupsAction::Noop) @@ -7671,13 +7351,14 @@ pub struct ProvisioningGroups { pub source_attribute_name: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ProvisioningSuspendedConditionAction { #[serde(rename = "NONE")] None, #[serde(rename = "UNSUSPEND")] Unsuspend, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7695,11 +7376,6 @@ impl std::fmt::Display for ProvisioningSuspendedConditionAction { } } -impl Default for ProvisioningSuspendedConditionAction { - fn default() -> ProvisioningSuspendedConditionAction { - ProvisioningSuspendedConditionAction::Noop - } -} impl ProvisioningSuspendedConditionAction { pub fn is_noop(&self) -> bool { matches!(self, ProvisioningSuspendedConditionAction::Noop) @@ -7859,13 +7535,14 @@ pub struct Role { pub type_: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RoleAssignmentType { #[serde(rename = "GROUP")] Group, #[serde(rename = "USER")] User, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7883,18 +7560,13 @@ impl std::fmt::Display for RoleAssignmentType { } } -impl Default for RoleAssignmentType { - fn default() -> RoleAssignmentType { - RoleAssignmentType::Noop - } -} impl RoleAssignmentType { pub fn is_noop(&self) -> bool { matches!(self, RoleAssignmentType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RoleType { #[serde(rename = "API_ACCESS_MANAGEMENT_ADMIN")] ApiAccessManagementAdmin, @@ -7915,6 +7587,7 @@ pub enum RoleType { #[serde(rename = "USER_ADMIN")] UserAdmin, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7939,11 +7612,6 @@ impl std::fmt::Display for RoleType { } } -impl Default for RoleType { - fn default() -> RoleType { - RoleType::Noop - } -} impl RoleType { pub fn is_noop(&self) -> bool { matches!(self, RoleType::Noop) @@ -8177,7 +7845,7 @@ pub struct SamlAttributeStatement { pub values: Vec, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Value { #[serde(rename = "ACTIVATING")] Activating, @@ -8196,6 +7864,7 @@ pub enum Value { #[serde(rename = "SUSPENDED")] Suspended, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8219,11 +7888,6 @@ impl std::fmt::Display for Value { } } -impl Default for Value { - fn default() -> Value { - Value::Noop - } -} impl Value { pub fn is_noop(&self) -> bool { matches!(self, Value::Noop) @@ -8272,13 +7936,14 @@ pub struct ScopeData { pub type_: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ScopeType { #[serde(rename = "CORS")] Cors, #[serde(rename = "REDIRECT")] Redirect, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8296,11 +7961,6 @@ impl std::fmt::Display for ScopeType { } } -impl Default for ScopeType { - fn default() -> ScopeType { - ScopeType::Noop - } -} impl ScopeType { pub fn is_noop(&self) -> bool { matches!(self, ScopeType::Noop) @@ -8481,7 +8141,7 @@ pub struct Session { pub user_id: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SessionAuthenticationMethod { #[serde(rename = "fpt")] Fpt, @@ -8504,6 +8164,7 @@ pub enum SessionAuthenticationMethod { #[serde(rename = "tel")] Tel, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8529,11 +8190,6 @@ impl std::fmt::Display for SessionAuthenticationMethod { } } -impl Default for SessionAuthenticationMethod { - fn default() -> SessionAuthenticationMethod { - SessionAuthenticationMethod::Noop - } -} impl SessionAuthenticationMethod { pub fn is_noop(&self) -> bool { matches!(self, SessionAuthenticationMethod::Noop) @@ -8552,7 +8208,7 @@ pub struct SessionIdentityProvider { pub type_: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SessionIdentityProviderType { #[serde(rename = "ACTIVE_DIRECTORY")] ActiveDirectory, @@ -8565,6 +8221,7 @@ pub enum SessionIdentityProviderType { #[serde(rename = "SOCIAL")] Social, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8585,18 +8242,13 @@ impl std::fmt::Display for SessionIdentityProviderType { } } -impl Default for SessionIdentityProviderType { - fn default() -> SessionIdentityProviderType { - SessionIdentityProviderType::Noop - } -} impl SessionIdentityProviderType { pub fn is_noop(&self) -> bool { matches!(self, SessionIdentityProviderType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SessionStatus { #[serde(rename = "ACTIVE")] Active, @@ -8605,6 +8257,7 @@ pub enum SessionStatus { #[serde(rename = "MFA_REQUIRED")] MfaRequired, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8623,11 +8276,6 @@ impl std::fmt::Display for SessionStatus { } } -impl Default for SessionStatus { - fn default() -> SessionStatus { - SessionStatus::Noop - } -} impl SessionStatus { pub fn is_noop(&self) -> bool { matches!(self, SessionStatus::Noop) @@ -8705,11 +8353,12 @@ pub struct SmsTemplate { pub type_: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SmsTemplateType { #[serde(rename = "SMS_VERIFY_CODE")] SmsVerifyCode, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8726,11 +8375,6 @@ impl std::fmt::Display for SmsTemplateType { } } -impl Default for SmsTemplateType { - fn default() -> SmsTemplateType { - SmsTemplateType::Noop - } -} impl SmsTemplateType { pub fn is_noop(&self) -> bool { matches!(self, SmsTemplateType::Noop) @@ -8754,13 +8398,14 @@ pub struct SmsUserFactorProfile { pub phone_number: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TokenType { #[serde(rename = "ACCESS")] Access, #[serde(rename = "REFRESH")] Refresh, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8778,11 +8423,6 @@ impl std::fmt::Display for TokenType { } } -impl Default for TokenType { - fn default() -> TokenType { - TokenType::Noop - } -} impl TokenType { pub fn is_noop(&self) -> bool { matches!(self, TokenType::Noop) @@ -9257,7 +8897,7 @@ pub struct UserFactor { pub verify: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UserIdentifierConditionEvaluatorPatternMatchType { #[serde(rename = "CONTAINS")] Contains, @@ -9270,6 +8910,7 @@ pub enum UserIdentifierConditionEvaluatorPatternMatchType { #[serde(rename = "SUFFIX")] Suffix, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9290,11 +8931,6 @@ impl std::fmt::Display for UserIdentifierConditionEvaluatorPatternMatchType { } } -impl Default for UserIdentifierConditionEvaluatorPatternMatchType { - fn default() -> UserIdentifierConditionEvaluatorPatternMatchType { - UserIdentifierConditionEvaluatorPatternMatchType::Noop - } -} impl UserIdentifierConditionEvaluatorPatternMatchType { pub fn is_noop(&self) -> bool { matches!(self, UserIdentifierConditionEvaluatorPatternMatchType::Noop) @@ -9313,13 +8949,14 @@ pub struct UserIdentifierConditionEvaluatorPattern { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UserIdentifierPolicyRuleConditionType { #[serde(rename = "ATTRIBUTE")] Attribute, #[serde(rename = "IDENTIFIER")] Identifier, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9337,11 +8974,6 @@ impl std::fmt::Display for UserIdentifierPolicyRuleConditionType { } } -impl Default for UserIdentifierPolicyRuleConditionType { - fn default() -> UserIdentifierPolicyRuleConditionType { - UserIdentifierPolicyRuleConditionType::Noop - } -} impl UserIdentifierPolicyRuleConditionType { pub fn is_noop(&self) -> bool { matches!(self, UserIdentifierPolicyRuleConditionType::Noop) @@ -9395,11 +9027,12 @@ pub struct UserLifecycleAttributePolicyRuleCondition { pub matching_value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UserNextLogin { #[serde(rename = "changePassword")] ChangePassword, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9416,11 +9049,6 @@ impl std::fmt::Display for UserNextLogin { } } -impl Default for UserNextLogin { - fn default() -> UserNextLogin { - UserNextLogin::Noop - } -} impl UserNextLogin { pub fn is_noop(&self) -> bool { matches!(self, UserNextLogin::Noop) @@ -9979,7 +9607,7 @@ pub struct UserSchemaAttributeMasterPriority { pub value: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UserSchemaAttributeMasterType { #[serde(rename = "OKTA")] Okta, @@ -9988,6 +9616,7 @@ pub enum UserSchemaAttributeMasterType { #[serde(rename = "PROFILE_MASTER")] ProfileMaster, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10006,11 +9635,6 @@ impl std::fmt::Display for UserSchemaAttributeMasterType { } } -impl Default for UserSchemaAttributeMasterType { - fn default() -> UserSchemaAttributeMasterType { - UserSchemaAttributeMasterType::Noop - } -} impl UserSchemaAttributeMasterType { pub fn is_noop(&self) -> bool { matches!(self, UserSchemaAttributeMasterType::Noop) @@ -10033,7 +9657,7 @@ pub struct UserSchemaAttributePermission { pub principal: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UserSchemaAttributeType { #[serde(rename = "array")] Array, @@ -10046,6 +9670,7 @@ pub enum UserSchemaAttributeType { #[serde(rename = "string")] String, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10066,11 +9691,6 @@ impl std::fmt::Display for UserSchemaAttributeType { } } -impl Default for UserSchemaAttributeType { - fn default() -> UserSchemaAttributeType { - UserSchemaAttributeType::Noop - } -} impl UserSchemaAttributeType { pub fn is_noop(&self) -> bool { matches!(self, UserSchemaAttributeType::Noop) @@ -10285,7 +9905,7 @@ pub struct UserSchemaPublic { pub type_: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UserStatus { #[serde(rename = "ACTIVE")] Active, @@ -10304,6 +9924,7 @@ pub enum UserStatus { #[serde(rename = "SUSPENDED")] Suspended, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10327,11 +9948,6 @@ impl std::fmt::Display for UserStatus { } } -impl Default for UserStatus { - fn default() -> UserStatus { - UserStatus::Noop - } -} impl UserStatus { pub fn is_noop(&self) -> bool { matches!(self, UserStatus::Noop) @@ -10465,7 +10081,7 @@ pub struct VerifyFactorRequest { pub state_token: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FactorResult { #[serde(rename = "CHALLENGE")] Challenge, @@ -10488,6 +10104,7 @@ pub enum FactorResult { #[serde(rename = "WAITING")] Waiting, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10513,11 +10130,6 @@ impl std::fmt::Display for FactorResult { } } -impl Default for FactorResult { - fn default() -> FactorResult { - FactorResult::Noop - } -} impl FactorResult { pub fn is_noop(&self) -> bool { matches!(self, FactorResult::Noop) diff --git a/ramp/src/types.rs b/ramp/src/types.rs index 58080357..468c472f 100644 --- a/ramp/src/types.rs +++ b/ramp/src/types.rs @@ -43,7 +43,7 @@ pub struct TaskResponse { pub id: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Role { #[serde(rename = "BUSINESS_ADMIN")] BusinessAdmin, @@ -54,6 +54,7 @@ pub enum Role { #[serde(rename = "BUSINESS_USER")] BusinessUser, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -73,11 +74,6 @@ impl std::fmt::Display for Role { } } -impl Default for Role { - fn default() -> Role { - Role::Noop - } -} impl Role { pub fn is_noop(&self) -> bool { matches!(self, Role::Noop) @@ -307,13 +303,14 @@ pub struct AccountingCategories { pub category_name: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Type { #[serde(rename = "POLICY_VIOLATION_FROM_ADMIN")] PolicyViolationFromAdmin, #[serde(rename = "POLICY_VIOLATION_FROM_USER")] PolicyViolationFromUser, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -331,11 +328,6 @@ impl std::fmt::Display for Type { } } -impl Default for Type { - fn default() -> Type { - Type::Noop - } -} impl Type { pub fn is_noop(&self) -> bool { matches!(self, Type::Noop) @@ -372,7 +364,7 @@ pub struct PolicyViolations { pub type_: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetTransactionResponseDataDisputesType { #[serde(rename = "DISPUTE_CANCELLED")] DisputeCancelled, @@ -383,6 +375,7 @@ pub enum GetTransactionResponseDataDisputesType { #[serde(rename = "UNRECOGNIZED_CHARGE")] UnrecognizedCharge, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -402,11 +395,6 @@ impl std::fmt::Display for GetTransactionResponseDataDisputesType { } } -impl Default for GetTransactionResponseDataDisputesType { - fn default() -> GetTransactionResponseDataDisputesType { - GetTransactionResponseDataDisputesType::Noop - } -} impl GetTransactionResponseDataDisputesType { pub fn is_noop(&self) -> bool { matches!(self, GetTransactionResponseDataDisputesType::Noop) @@ -766,9 +754,9 @@ pub struct Fulfillment { } /** -* Time interval to apply limit to. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Time interval to apply limit to. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Interval { #[serde(rename = "DAILY")] Daily, @@ -779,6 +767,7 @@ pub enum Interval { #[serde(rename = "YEARLY")] Yearly, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -798,11 +787,6 @@ impl std::fmt::Display for Interval { } } -impl Default for Interval { - fn default() -> Interval { - Interval::Noop - } -} impl Interval { pub fn is_noop(&self) -> bool { matches!(self, Interval::Noop) @@ -1273,11 +1257,12 @@ pub struct PostResourcesCardVirtualRequest { pub user_id: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TokenType { #[serde(rename = "Bearer")] Bearer, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1294,11 +1279,6 @@ impl std::fmt::Display for TokenType { } } -impl Default for TokenType { - fn default() -> TokenType { - TokenType::Noop - } -} impl TokenType { pub fn is_noop(&self) -> bool { matches!(self, TokenType::Noop) @@ -1486,7 +1466,7 @@ pub struct GetResourcesCardsDeferredResponseData { pub misc: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Status { #[serde(rename = "ERROR")] Error, @@ -1497,6 +1477,7 @@ pub enum Status { #[serde(rename = "SUCCESS")] Success, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1516,11 +1497,6 @@ impl std::fmt::Display for Status { } } -impl Default for Status { - fn default() -> Status { - Status::Noop - } -} impl Status { pub fn is_noop(&self) -> bool { matches!(self, Status::Noop) @@ -1544,7 +1520,7 @@ pub struct GetResourcesCardsDeferredResponse { pub status: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Icon { #[serde(rename = "AdvertisingIcon")] AdvertisingIcon, @@ -1567,6 +1543,7 @@ pub enum Icon { #[serde(rename = "WellnessIcon")] WellnessIcon, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1592,11 +1569,6 @@ impl std::fmt::Display for Icon { } } -impl Default for Icon { - fn default() -> Icon { - Icon::Noop - } -} impl Icon { pub fn is_noop(&self) -> bool { matches!(self, Icon::Noop) diff --git a/rev.ai/src/types.rs b/rev.ai/src/types.rs index c6a0c9de..8f34b3bd 100644 --- a/rev.ai/src/types.rs +++ b/rev.ai/src/types.rs @@ -51,7 +51,7 @@ pub struct DescriptionlessJobOptionsData { pub callback_url: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Language { #[serde(rename = "ar")] Ar, @@ -70,6 +70,7 @@ pub enum Language { #[serde(rename = "el")] El, #[serde(rename = "en")] + #[default] En, #[serde(rename = "es")] Es, @@ -159,12 +160,6 @@ impl std::fmt::Display for Language { } } -impl Default for Language { - fn default() -> Language { - Language::En - } -} - #[derive(Serialize, Default, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct DescriptionlessJobOptionsDataType { /** @@ -244,9 +239,9 @@ pub struct DescriptionlessJobOptionsAllOf { } /** -* Simple reason of why the transcription job failed. Check `failure_detail` for specific details and solutions -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Simple reason of why the transcription job failed. Check `failure_detail` for specific details and solutions + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Failure { #[serde(rename = "download_failure")] DownloadFailure, @@ -267,6 +262,7 @@ pub enum Failure { #[serde(rename = "transcription")] Transcription, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -291,11 +287,6 @@ impl std::fmt::Display for Failure { } } -impl Default for Failure { - fn default() -> Failure { - Failure::Noop - } -} impl Failure { pub fn is_noop(&self) -> bool { matches!(self, Failure::Noop) @@ -303,9 +294,9 @@ impl Failure { } /** -* Current status of the job -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Current status of the job + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Status { #[serde(rename = "failed")] Failed, @@ -314,6 +305,7 @@ pub enum Status { #[serde(rename = "transcribed")] Transcribed, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -332,11 +324,6 @@ impl std::fmt::Display for Status { } } -impl Default for Status { - fn default() -> Status { - Status::Noop - } -} impl Status { pub fn is_noop(&self) -> bool { matches!(self, Status::Noop) @@ -344,13 +331,14 @@ impl Status { } /** -* Type of speech recognition performed. Currently the only supported values are 'async' for asynchronous jobs and `stream` for streaming jobs -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Type of speech recognition performed. Currently the only supported values are 'async' for asynchronous jobs and `stream` for streaming jobs + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Type { #[serde(rename = "async")] Async, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -367,11 +355,6 @@ impl std::fmt::Display for Type { } } -impl Default for Type { - fn default() -> Type { - Type::Noop - } -} impl Type { pub fn is_noop(&self) -> bool { matches!(self, Type::Noop) @@ -707,9 +690,9 @@ pub struct SubmitJobOptionsAllOf { } /** -* Type of transcript element. If Rev.ai was unable to determine the spoken word, the `type` will be `unknown`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Type of transcript element. If Rev.ai was unable to determine the spoken word, the `type` will be `unknown`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TranscriptMonologuesElementsType { #[serde(rename = "punct")] Punct, @@ -718,6 +701,7 @@ pub enum TranscriptMonologuesElementsType { #[serde(rename = "unknown")] Unknown, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -736,11 +720,6 @@ impl std::fmt::Display for TranscriptMonologuesElementsType { } } -impl Default for TranscriptMonologuesElementsType { - fn default() -> TranscriptMonologuesElementsType { - TranscriptMonologuesElementsType::Noop - } -} impl TranscriptMonologuesElementsType { pub fn is_noop(&self) -> bool { matches!(self, TranscriptMonologuesElementsType::Noop) @@ -839,15 +818,16 @@ pub struct Transcript { } /** -* MIME type specifying the caption output format -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * MIME type specifying the caption output format + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Accept { #[serde(rename = "application/x-subrip")] ApplicationXSubrip, #[serde(rename = "text/vtt")] TextVtt, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -865,11 +845,6 @@ impl std::fmt::Display for Accept { } } -impl Default for Accept { - fn default() -> Accept { - Accept::Noop - } -} impl Accept { pub fn is_noop(&self) -> bool { matches!(self, Accept::Noop) @@ -877,15 +852,16 @@ impl Accept { } /** -* MIME type specifying the transcription output format -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * MIME type specifying the transcription output format + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AcceptTranscript { #[serde(rename = "application/vnd.rev.transcript.v1.0+json")] ApplicationVndRevTranscript0Json, #[serde(rename = "text/plain")] TextPlain, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -905,11 +881,6 @@ impl std::fmt::Display for AcceptTranscript { } } -impl Default for AcceptTranscript { - fn default() -> AcceptTranscript { - AcceptTranscript::Noop - } -} impl AcceptTranscript { pub fn is_noop(&self) -> bool { matches!(self, AcceptTranscript::Noop) diff --git a/sendgrid/src/types.rs b/sendgrid/src/types.rs index 90c1b627..3fa746e8 100644 --- a/sendgrid/src/types.rs +++ b/sendgrid/src/types.rs @@ -173,7 +173,7 @@ pub struct CampaignResponseAllOf { pub campaign_response: CampaignResponse, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Operator { #[serde(rename = "contains")] Contains, @@ -186,6 +186,7 @@ pub enum Operator { #[serde(rename = "ne")] Ne, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -206,24 +207,20 @@ impl std::fmt::Display for Operator { } } -impl Default for Operator { - fn default() -> Operator { - Operator::Noop - } -} impl Operator { pub fn is_noop(&self) -> bool { matches!(self, Operator::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AndOr { #[serde(rename = "and")] And, #[serde(rename = "or")] Or, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -241,11 +238,6 @@ impl std::fmt::Display for AndOr { } } -impl Default for AndOr { - fn default() -> AndOr { - AndOr::Noop - } -} impl AndOr { pub fn is_noop(&self) -> bool { matches!(self, AndOr::Noop) @@ -572,9 +564,9 @@ pub struct SenderAllOf { } /** -* The type of the field. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of the field. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Type { #[serde(rename = "date")] Date, @@ -583,6 +575,7 @@ pub enum Type { #[serde(rename = "text")] Text, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -601,11 +594,6 @@ impl std::fmt::Display for Type { } } -impl Default for Type { - fn default() -> Type { - Type::Noop - } -} impl Type { pub fn is_noop(&self) -> bool { matches!(self, Type::Noop) @@ -679,9 +667,9 @@ pub struct MailSettingsAddressWhitelabel { } /** -* The type of DNS record that was generated. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of DNS record that was generated. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LinkBranding200ResponseDnsDomainCnameType { #[serde(rename = "cname")] Cname, @@ -690,6 +678,7 @@ pub enum LinkBranding200ResponseDnsDomainCnameType { #[serde(rename = "txt")] Txt, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -708,11 +697,6 @@ impl std::fmt::Display for LinkBranding200ResponseDnsDomainCnameType { } } -impl Default for LinkBranding200ResponseDnsDomainCnameType { - fn default() -> LinkBranding200ResponseDnsDomainCnameType { - LinkBranding200ResponseDnsDomainCnameType::Noop - } -} impl LinkBranding200ResponseDnsDomainCnameType { pub fn is_noop(&self) -> bool { matches!(self, LinkBranding200ResponseDnsDomainCnameType::Noop) @@ -1842,15 +1826,16 @@ pub struct MailSettingsForwardSpam { } /** -* The editor used in the UI. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The editor used in the UI. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Editor { #[serde(rename = "code")] Code, #[serde(rename = "design")] Design, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1868,11 +1853,6 @@ impl std::fmt::Display for Editor { } } -impl Default for Editor { - fn default() -> Editor { - Editor::Noop - } -} impl Editor { pub fn is_noop(&self) -> bool { matches!(self, Editor::Noop) @@ -2120,15 +2100,16 @@ pub struct SubuserStatsData { } /** -* The status of the scheduled send. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the scheduled send. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Status { #[serde(rename = "cancel")] Cancel, #[serde(rename = "pause")] Pause, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2146,11 +2127,6 @@ impl std::fmt::Display for Status { } } -impl Default for Status { - fn default() -> Status { - Status::Noop - } -} impl Status { pub fn is_noop(&self) -> bool { matches!(self, Status::Noop) @@ -2603,15 +2579,16 @@ pub struct TransactionalTemplatesVersionOutputLean { } /** -* Defines the generation of the template. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Defines the generation of the template. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Generation { #[serde(rename = "dynamic")] Dynamic, #[serde(rename = "legacy")] Legacy, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2629,11 +2606,6 @@ impl std::fmt::Display for Generation { } } -impl Default for Generation { - fn default() -> Generation { - Generation::Noop - } -} impl Generation { pub fn is_noop(&self) -> bool { matches!(self, Generation::Noop) @@ -3015,9 +2987,9 @@ pub struct SingleContactRequest { } /** -* The export job's status. Allowed values: `pending`, `ready`, or `failure`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The export job's status. Allowed values: `pending`, `ready`, or `failure`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ContactExportStatus { #[serde(rename = "failure")] Failure, @@ -3026,6 +2998,7 @@ pub enum ContactExportStatus { #[serde(rename = "ready")] Ready, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3044,11 +3017,6 @@ impl std::fmt::Display for ContactExportStatus { } } -impl Default for ContactExportStatus { - fn default() -> ContactExportStatus { - ContactExportStatus::Noop - } -} impl ContactExportStatus { pub fn is_noop(&self) -> bool { matches!(self, ContactExportStatus::Noop) @@ -3522,7 +3490,7 @@ pub struct List { pub name: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FieldType { #[serde(rename = "Date")] Date, @@ -3531,6 +3499,7 @@ pub enum FieldType { #[serde(rename = "Text")] Text, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3549,11 +3518,6 @@ impl std::fmt::Display for FieldType { } } -impl Default for FieldType { - fn default() -> FieldType { - FieldType::Noop - } -} impl FieldType { pub fn is_noop(&self) -> bool { matches!(self, FieldType::Noop) @@ -4444,11 +4408,12 @@ pub struct ErrorsDataType { } /** -* This is the A/B phase of the Single Send stat returned. If the `group_by` parameter doesn't include `ab_phase` in the request, then the value is "all". -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * This is the A/B phase of the Single Send stat returned. If the `group_by` parameter doesn't include `ab_phase` in the request, then the value is "all". + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AbPhase { #[serde(rename = "all")] + #[default] All, #[serde(rename = "send")] Send, @@ -4470,12 +4435,6 @@ impl std::fmt::Display for AbPhase { } } -impl Default for AbPhase { - fn default() -> AbPhase { - AbPhase::All - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct SinglesendsResponseResults { /** @@ -4647,7 +4606,7 @@ pub struct MetricsData { pub unsubscribes: i64, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SinglesendSearchStatus { #[serde(rename = "draft")] Draft, @@ -4656,6 +4615,7 @@ pub enum SinglesendSearchStatus { #[serde(rename = "triggered")] Triggered, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4674,11 +4634,6 @@ impl std::fmt::Display for SinglesendSearchStatus { } } -impl Default for SinglesendSearchStatus { - fn default() -> SinglesendSearchStatus { - SinglesendSearchStatus::Noop - } -} impl SinglesendSearchStatus { pub fn is_noop(&self) -> bool { matches!(self, SinglesendSearchStatus::Noop) @@ -5312,15 +5267,16 @@ pub struct DomainAuthentication200ResponseAllOf { } /** -* What differs between the A/B tests -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * What differs between the A/B tests + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AbTestSummaryType { #[serde(rename = "content")] Content, #[serde(rename = "subject")] Subject, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5338,11 +5294,6 @@ impl std::fmt::Display for AbTestSummaryType { } } -impl Default for AbTestSummaryType { - fn default() -> AbTestSummaryType { - AbTestSummaryType::Noop - } -} impl AbTestSummaryType { pub fn is_noop(&self) -> bool { matches!(self, AbTestSummaryType::Noop) @@ -5350,9 +5301,9 @@ impl AbTestSummaryType { } /** -* How the winner will be decided -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * How the winner will be decided + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum WinnerCriteria { #[serde(rename = "click")] Click, @@ -5361,6 +5312,7 @@ pub enum WinnerCriteria { #[serde(rename = "open")] Open, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5379,11 +5331,6 @@ impl std::fmt::Display for WinnerCriteria { } } -impl Default for WinnerCriteria { - fn default() -> WinnerCriteria { - WinnerCriteria::Noop - } -} impl WinnerCriteria { pub fn is_noop(&self) -> bool { matches!(self, WinnerCriteria::Noop) @@ -6098,9 +6045,9 @@ pub struct InvalidEmail { } /** -* The message's status. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The message's status. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EmailActivityResponseCommonFieldsStatus { #[serde(rename = "delivered")] Delivered, @@ -6109,6 +6056,7 @@ pub enum EmailActivityResponseCommonFieldsStatus { #[serde(rename = "processed")] Processed, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6127,11 +6075,6 @@ impl std::fmt::Display for EmailActivityResponseCommonFieldsStatus { } } -impl Default for EmailActivityResponseCommonFieldsStatus { - fn default() -> EmailActivityResponseCommonFieldsStatus { - EmailActivityResponseCommonFieldsStatus::Noop - } -} impl EmailActivityResponseCommonFieldsStatus { pub fn is_noop(&self) -> bool { matches!(self, EmailActivityResponseCommonFieldsStatus::Noop) @@ -6397,9 +6340,9 @@ pub struct SsoTeammateRequestAllOf { } /** -* A Teammate can be an “admin,” “owner,” or “teammate.” Each role is associated with the scope of the Teammate’s permissions. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * A Teammate can be an “admin,” “owner,” or “teammate.” Each role is associated with the scope of the Teammate’s permissions. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UserType { #[serde(rename = "admin")] Admin, @@ -6408,6 +6351,7 @@ pub enum UserType { #[serde(rename = "teammate")] Teammate, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6426,11 +6370,6 @@ impl std::fmt::Display for UserType { } } -impl Default for UserType { - fn default() -> UserType { - UserType::Noop - } -} impl UserType { pub fn is_noop(&self) -> bool { matches!(self, UserType::Noop) @@ -7101,7 +7040,7 @@ pub struct SegmentUpdate { pub query_dsl: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AbbvMessageStatus { #[serde(rename = "delivered")] Delivered, @@ -7110,6 +7049,7 @@ pub enum AbbvMessageStatus { #[serde(rename = "processed")] Processed, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7128,11 +7068,6 @@ impl std::fmt::Display for AbbvMessageStatus { } } -impl Default for AbbvMessageStatus { - fn default() -> AbbvMessageStatus { - AbbvMessageStatus::Noop - } -} impl AbbvMessageStatus { pub fn is_noop(&self) -> bool { matches!(self, AbbvMessageStatus::Noop) @@ -7203,9 +7138,9 @@ pub struct Messages { } /** -* Name of event -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Name of event + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EventName { #[serde(rename = "bounced")] Bounced, @@ -7230,6 +7165,7 @@ pub enum EventName { #[serde(rename = "unsubscribe")] Unsubscribe, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7256,11 +7192,6 @@ impl std::fmt::Display for EventName { } } -impl Default for EventName { - fn default() -> EventName { - EventName::Noop - } -} impl EventName { pub fn is_noop(&self) -> bool { matches!(self, EventName::Noop) @@ -7268,9 +7199,9 @@ impl EventName { } /** -* Use to distinguish between types of bounces -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Use to distinguish between types of bounces + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BounceType { #[serde(rename = "blocked")] Blocked, @@ -7279,6 +7210,7 @@ pub enum BounceType { #[serde(rename = "expired")] Expired, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7297,11 +7229,6 @@ impl std::fmt::Display for BounceType { } } -impl Default for BounceType { - fn default() -> BounceType { - BounceType::Noop - } -} impl BounceType { pub fn is_noop(&self) -> bool { matches!(self, BounceType::Noop) @@ -7371,15 +7298,16 @@ pub struct Event { } /** -* Whether or not the outbound IP is dedicated vs shared -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether or not the outbound IP is dedicated vs shared + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OutboundIpType { #[serde(rename = "dedicated")] Dedicated, #[serde(rename = "shared")] Shared, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7397,11 +7325,6 @@ impl std::fmt::Display for OutboundIpType { } } -impl Default for OutboundIpType { - fn default() -> OutboundIpType { - OutboundIpType::Noop - } -} impl OutboundIpType { pub fn is_noop(&self) -> bool { matches!(self, OutboundIpType::Noop) @@ -7765,13 +7688,14 @@ pub struct AuthenticationDomain { } /** -* Dictates how the stats are time-sliced. Currently, `"total"` and `"day"` are supported. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Dictates how the stats are time-sliced. Currently, `"total"` and `"day"` are supported. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AggregatedBy { #[serde(rename = "day")] Day, #[serde(rename = "total")] + #[default] Total, #[serde(other)] FallthroughString, @@ -7788,19 +7712,14 @@ impl std::fmt::Display for AggregatedBy { } } -impl Default for AggregatedBy { - fn default() -> AggregatedBy { - AggregatedBy::Total - } -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GroupBy { #[serde(rename = "ab_phase")] AbPhase, #[serde(rename = "ab_variation")] AbVariation, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7818,22 +7737,18 @@ impl std::fmt::Display for GroupBy { } } -impl Default for GroupBy { - fn default() -> GroupBy { - GroupBy::Noop - } -} impl GroupBy { pub fn is_noop(&self) -> bool { matches!(self, GroupBy::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TraitAutomationQueryParamsGroupBy { #[serde(rename = "step_id")] StepId, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7850,24 +7765,20 @@ impl std::fmt::Display for TraitAutomationQueryParamsGroupBy { } } -impl Default for TraitAutomationQueryParamsGroupBy { - fn default() -> TraitAutomationQueryParamsGroupBy { - TraitAutomationQueryParamsGroupBy::Noop - } -} impl TraitAutomationQueryParamsGroupBy { pub fn is_noop(&self) -> bool { matches!(self, TraitAutomationQueryParamsGroupBy::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AbPhaseId { #[serde(rename = "send")] Send, #[serde(rename = "test")] Test, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7885,11 +7796,6 @@ impl std::fmt::Display for AbPhaseId { } } -impl Default for AbPhaseId { - fn default() -> AbPhaseId { - AbPhaseId::Noop - } -} impl AbPhaseId { pub fn is_noop(&self) -> bool { matches!(self, AbPhaseId::Noop) @@ -7897,9 +7803,9 @@ impl AbPhaseId { } /** -* How to group the statistics. Must be either "day", "week", or "month". -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * How to group the statistics. Must be either "day", "week", or "month". + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TraitStatsAdvancedBaseQueryStringsAggregatedBy { #[serde(rename = "day")] Day, @@ -7908,6 +7814,7 @@ pub enum TraitStatsAdvancedBaseQueryStringsAggregatedBy { #[serde(rename = "week")] Week, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7926,11 +7833,6 @@ impl std::fmt::Display for TraitStatsAdvancedBaseQueryStringsAggregatedBy { } } -impl Default for TraitStatsAdvancedBaseQueryStringsAggregatedBy { - fn default() -> TraitStatsAdvancedBaseQueryStringsAggregatedBy { - TraitStatsAdvancedBaseQueryStringsAggregatedBy::Noop - } -} impl TraitStatsAdvancedBaseQueryStringsAggregatedBy { pub fn is_noop(&self) -> bool { matches!(self, TraitStatsAdvancedBaseQueryStringsAggregatedBy::Noop) @@ -8151,11 +8053,12 @@ pub struct Content { } /** -* The attachment's content-disposition, specifying how you would like the attachment to be displayed. For example, `“inline”` results in the attached file are displayed automatically within the message while `“attachment”` results in the attached file require some action to be taken before it is displayed, such as opening or downloading the file. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The attachment's content-disposition, specifying how you would like the attachment to be displayed. For example, `“inline”` results in the attached file are displayed automatically within the message while `“attachment”` results in the attached file require some action to be taken before it is displayed, such as opening or downloading the file. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Disposition { #[serde(rename = "attachment")] + #[default] Attachment, #[serde(rename = "inline")] Inline, @@ -8174,12 +8077,6 @@ impl std::fmt::Display for Disposition { } } -impl Default for Disposition { - fn default() -> Disposition { - Disposition::Attachment - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct Attachments { /** @@ -9579,15 +9476,16 @@ pub struct PatchScopesRequestsApproveResponse { } /** -* The type of alert. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of alert. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetAlertsResponseType { #[serde(rename = "stats_notification")] StatsNotification, #[serde(rename = "usage_limit")] UsageLimit, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9605,11 +9503,6 @@ impl std::fmt::Display for GetAlertsResponseType { } } -impl Default for GetAlertsResponseType { - fn default() -> GetAlertsResponseType { - GetAlertsResponseType::Noop - } -} impl GetAlertsResponseType { pub fn is_noop(&self) -> bool { matches!(self, GetAlertsResponseType::Noop) @@ -9762,15 +9655,16 @@ pub struct PostAlertsResponse { } /** -* The type of alert. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of alert. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetAlertsAlertResponseType { #[serde(rename = "stats_notification")] StatsNotification, #[serde(rename = "usage_alert")] UsageAlert, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9788,11 +9682,6 @@ impl std::fmt::Display for GetAlertsAlertResponseType { } } -impl Default for GetAlertsAlertResponseType { - fn default() -> GetAlertsAlertResponseType { - GetAlertsAlertResponseType::Noop - } -} impl GetAlertsAlertResponseType { pub fn is_noop(&self) -> bool { matches!(self, GetAlertsAlertResponseType::Noop) @@ -9978,15 +9867,16 @@ pub struct GetUserProfileResponse { } /** -* The type of account for this user. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of account for this user. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetUserAccountResponseType { #[serde(rename = "free")] Free, #[serde(rename = "paid")] Paid, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10004,11 +9894,6 @@ impl std::fmt::Display for GetUserAccountResponseType { } } -impl Default for GetUserAccountResponseType { - fn default() -> GetUserAccountResponseType { - GetUserAccountResponseType::Noop - } -} impl GetUserAccountResponseType { pub fn is_noop(&self) -> bool { matches!(self, GetUserAccountResponseType::Noop) @@ -10242,13 +10127,14 @@ pub struct PutSubusersSubuserNameIpsResponse { } /** -* The direction you want to sort. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The direction you want to sort. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SortByDirection { #[serde(rename = "asc")] Asc, #[serde(rename = "desc")] + #[default] Desc, #[serde(other)] FallthroughString, @@ -10265,16 +10151,10 @@ impl std::fmt::Display for SortByDirection { } } -impl Default for SortByDirection { - fn default() -> SortByDirection { - SortByDirection::Desc - } -} - /** -* The metric that you want to sort by. Metrics that you can sort by are: `blocks`, `bounces`, `clicks`, `delivered`, `opens`, `requests`, `unique_clicks`, `unique_opens`, and `unsubscribes`.' -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The metric that you want to sort by. Metrics that you can sort by are: `blocks`, `bounces`, `clicks`, `delivered`, `opens`, `requests`, `unique_clicks`, `unique_opens`, and `unsubscribes`.' + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SortByMetric { #[serde(rename = "blocks")] Blocks, @@ -10283,6 +10163,7 @@ pub enum SortByMetric { #[serde(rename = "clicks")] Clicks, #[serde(rename = "delivered")] + #[default] Delivered, #[serde(rename = "opens")] Opens, @@ -10316,12 +10197,6 @@ impl std::fmt::Display for SortByMetric { } } -impl Default for SortByMetric { - fn default() -> SortByMetric { - SortByMetric::Delivered - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct PostWhitelabelLinksRequest { #[serde(default, skip_serializing_if = "Option::is_none")] @@ -10561,9 +10436,9 @@ pub struct PostValidationsEmailRequest { } /** -* A generic classification of whether or not the email address is valid. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * A generic classification of whether or not the email address is valid. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Verdict { #[serde(rename = "Invalid")] Invalid, @@ -10572,6 +10447,7 @@ pub enum Verdict { #[serde(rename = "Valid")] Valid, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10590,11 +10466,6 @@ impl std::fmt::Display for Verdict { } } -impl Default for Verdict { - fn default() -> Verdict { - Verdict::Noop - } -} impl Verdict { pub fn is_noop(&self) -> bool { matches!(self, Verdict::Noop) @@ -11837,11 +11708,12 @@ pub struct Notifications { } /** -* File type for export file. Choose from `json` or `csv`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * File type for export file. Choose from `json` or `csv`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FileType { #[serde(rename = "csv")] + #[default] Csv, #[serde(rename = "json")] Json, @@ -11860,12 +11732,6 @@ impl std::fmt::Display for FileType { } } -impl Default for FileType { - fn default() -> FileType { - FileType::Csv - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct PostMcContactsExportsRequest { /** @@ -11951,13 +11817,14 @@ pub struct PostMcContactsSearchResponse { } /** -* Upload file type. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Upload file type. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PutMcContactsImportsRequestFileType { #[serde(rename = "csv")] Csv, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11974,11 +11841,6 @@ impl std::fmt::Display for PutMcContactsImportsRequestFileType { } } -impl Default for PutMcContactsImportsRequestFileType { - fn default() -> PutMcContactsImportsRequestFileType { - PutMcContactsImportsRequestFileType::Noop - } -} impl PutMcContactsImportsRequestFileType { pub fn is_noop(&self) -> bool { matches!(self, PutMcContactsImportsRequestFileType::Noop) @@ -12488,13 +12350,14 @@ pub struct PostMarketingSinglesendsRequest { } /** -* This is the ISO 8601 time at which to send the Single Send; must be in future, or the string "now" -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * This is the ISO 8601 time at which to send the Single Send; must be in future, or the string "now" + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SendAt { #[serde(rename = "now")] Now, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -12511,11 +12374,6 @@ impl std::fmt::Display for SendAt { } } -impl Default for SendAt { - fn default() -> SendAt { - SendAt::Noop - } -} impl SendAt { pub fn is_noop(&self) -> bool { matches!(self, SendAt::Noop) @@ -12531,11 +12389,12 @@ pub struct PutMarketingSinglesendsScheduleRequest { pub send_at: SendAt, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PutMarketingSinglesendsScheduleResponseStatus { #[serde(rename = "scheduled")] Scheduled, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -12552,11 +12411,6 @@ impl std::fmt::Display for PutMarketingSinglesendsScheduleResponseStatus { } } -impl Default for PutMarketingSinglesendsScheduleResponseStatus { - fn default() -> PutMarketingSinglesendsScheduleResponseStatus { - PutMarketingSinglesendsScheduleResponseStatus::Noop - } -} impl PutMarketingSinglesendsScheduleResponseStatus { pub fn is_noop(&self) -> bool { matches!(self, PutMarketingSinglesendsScheduleResponseStatus::Noop) @@ -13320,13 +13174,14 @@ pub struct ScheduleACampaignRequest { } /** -* The status of your campaign. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of your campaign. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ScheduleACampaignResponseStatus { #[serde(rename = "Scheduled")] Scheduled, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13343,11 +13198,6 @@ impl std::fmt::Display for ScheduleACampaignResponseStatus { } } -impl Default for ScheduleACampaignResponseStatus { - fn default() -> ScheduleACampaignResponseStatus { - ScheduleACampaignResponseStatus::Noop - } -} impl ScheduleACampaignResponseStatus { pub fn is_noop(&self) -> bool { matches!(self, ScheduleACampaignResponseStatus::Noop) @@ -13417,13 +13267,14 @@ pub struct SendATestCampaignRequest { } /** -* Comma-delimited list specifying which generations of templates to return. Options are `legacy`, `dynamic` or `legacy,dynamic`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Comma-delimited list specifying which generations of templates to return. Options are `legacy`, `dynamic` or `legacy,dynamic`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Generations { #[serde(rename = "dynamic")] Dynamic, #[serde(rename = "legacy")] + #[default] Legacy, #[serde(rename = "legacy,dynamic")] LegacyDynamic, @@ -13443,12 +13294,6 @@ impl std::fmt::Display for Generations { } } -impl Default for Generations { - fn default() -> Generations { - Generations::Legacy - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct GetTemplatesResponse { #[serde(default, skip_serializing_if = "Option::is_none", rename = "_metadata")] @@ -13680,11 +13525,12 @@ pub struct GetMessagesResponse { pub messages: Vec, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PostMessagesDownloadResponseStatus { #[serde(rename = "pending")] Pending, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13701,11 +13547,6 @@ impl std::fmt::Display for PostMessagesDownloadResponseStatus { } } -impl Default for PostMessagesDownloadResponseStatus { - fn default() -> PostMessagesDownloadResponseStatus { - PostMessagesDownloadResponseStatus::Noop - } -} impl PostMessagesDownloadResponseStatus { pub fn is_noop(&self) -> bool { matches!(self, PostMessagesDownloadResponseStatus::Noop) @@ -13836,15 +13677,16 @@ pub struct GetStatsResponseData { } /** -* The country you would like to see statistics for. Currently only supported for US and CA. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The country you would like to see statistics for. Currently only supported for US and CA. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Country { #[serde(rename = "CA")] Ca, #[serde(rename = "US")] Us, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13862,11 +13704,6 @@ impl std::fmt::Display for Country { } } -impl Default for Country { - fn default() -> Country { - Country::Noop - } -} impl Country { pub fn is_noop(&self) -> bool { matches!(self, Country::Noop) @@ -13971,9 +13808,9 @@ pub struct GetClientsStatsResponse { } /** -* Specifies the type of client to retrieve stats for. Must be either "phone", "tablet", "webmail", or "desktop". -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Specifies the type of client to retrieve stats for. Must be either "phone", "tablet", "webmail", or "desktop". + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ClientType { #[serde(rename = "desktop")] Desktop, @@ -13984,6 +13821,7 @@ pub enum ClientType { #[serde(rename = "webmail")] Webmail, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14003,11 +13841,6 @@ impl std::fmt::Display for ClientType { } } -impl Default for ClientType { - fn default() -> ClientType { - ClientType::Noop - } -} impl ClientType { pub fn is_noop(&self) -> bool { matches!(self, ClientType::Noop) diff --git a/shipbob/src/types.rs b/shipbob/src/types.rs index 70043d00..2847206e 100644 --- a/shipbob/src/types.rs +++ b/shipbob/src/types.rs @@ -229,9 +229,9 @@ pub struct InventoryLotQuantity { } /** -* Attribute influencing the packaging requirements of this inventory item -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Attribute influencing the packaging requirements of this inventory item + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PackagingAttribute { #[serde(rename = "Book")] Book, @@ -252,6 +252,7 @@ pub enum PackagingAttribute { #[serde(rename = "Stackable")] Stackable, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -276,11 +277,6 @@ impl std::fmt::Display for PackagingAttribute { } } -impl Default for PackagingAttribute { - fn default() -> PackagingAttribute { - PackagingAttribute::Noop - } -} impl PackagingAttribute { pub fn is_noop(&self) -> bool { matches!(self, PackagingAttribute::Noop) @@ -652,17 +648,18 @@ pub struct OrdersChannelInfo { } /** -* Specifies the type of address: -* ShipFrom -* MarkFor -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Specifies the type of address: + * ShipFrom + * MarkFor + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Type { #[serde(rename = "MarkFor")] MarkFor, #[serde(rename = "ShipFrom")] ShipFrom, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -680,11 +677,6 @@ impl std::fmt::Display for Type { } } -impl Default for Type { - fn default() -> Type { - Type::Noop - } -} impl Type { pub fn is_noop(&self) -> bool { matches!(self, Type::Noop) @@ -1161,9 +1153,9 @@ pub struct OrdersMeasurements { } /** -* The shipment status -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The shipment status + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Status { #[serde(rename = "Cancelled")] Cancelled, @@ -1186,6 +1178,7 @@ pub enum Status { #[serde(rename = "Processing")] Processing, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1211,11 +1204,6 @@ impl std::fmt::Display for Status { } } -impl Default for Status { - fn default() -> Status { - Status::Noop - } -} impl Status { pub fn is_noop(&self) -> bool { matches!(self, Status::Noop) @@ -1223,9 +1211,9 @@ impl Status { } /** -* Container type for the shipment -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Container type for the shipment + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PackageMaterialType { #[serde(rename = "Bookfold")] Bookfold, @@ -1248,6 +1236,7 @@ pub enum PackageMaterialType { #[serde(rename = "Unknown")] Unknown, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1273,11 +1262,6 @@ impl std::fmt::Display for PackageMaterialType { } } -impl Default for PackageMaterialType { - fn default() -> PackageMaterialType { - PackageMaterialType::Noop - } -} impl PackageMaterialType { pub fn is_noop(&self) -> bool { matches!(self, PackageMaterialType::Noop) @@ -1285,9 +1269,9 @@ impl PackageMaterialType { } /** -* Status of ShipBob’s completion of the fulfillment operation. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Status of ShipBob’s completion of the fulfillment operation. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EstimatedFulfillmentDateStatus { #[serde(rename = "AwaitingInventoryAllocation")] AwaitingInventoryAllocation, @@ -1304,6 +1288,7 @@ pub enum EstimatedFulfillmentDateStatus { #[serde(rename = "Unavailable")] Unavailable, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1328,11 +1313,6 @@ impl std::fmt::Display for EstimatedFulfillmentDateStatus { } } -impl Default for EstimatedFulfillmentDateStatus { - fn default() -> EstimatedFulfillmentDateStatus { - EstimatedFulfillmentDateStatus::Noop - } -} impl EstimatedFulfillmentDateStatus { pub fn is_noop(&self) -> bool { matches!(self, EstimatedFulfillmentDateStatus::Noop) @@ -1513,19 +1493,20 @@ pub struct OrdersShipment { } /** -* Identifies whether to ship parcel or freight. -* -* Parcel: Smaller, light weight boxes. -* -* Freight: Larger boxes, usually transported by truckload. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Identifies whether to ship parcel or freight. + * + * Parcel: Smaller, light weight boxes. + * + * Freight: Larger boxes, usually transported by truckload. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CarrierType { #[serde(rename = "Freight")] Freight, #[serde(rename = "Parcel")] Parcel, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1543,11 +1524,6 @@ impl std::fmt::Display for CarrierType { } } -impl Default for CarrierType { - fn default() -> CarrierType { - CarrierType::Noop - } -} impl CarrierType { pub fn is_noop(&self) -> bool { matches!(self, CarrierType::Noop) @@ -1555,15 +1531,15 @@ impl CarrierType { } /** -* Identifies the party responsible for shipping charges. -* -* Collect: The person/entity receiving the product pays the shipping charges [freight only]. -* -* ThirdParty: Another party pays for the shipping charges (not Shipbob) [parcel only]. -* -* Prepaid: The shipper pays the shipping charges (Shipbob or merchant). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Identifies the party responsible for shipping charges. + * + * Collect: The person/entity receiving the product pays the shipping charges [freight only]. + * + * ThirdParty: Another party pays for the shipping charges (not Shipbob) [parcel only]. + * + * Prepaid: The shipper pays the shipping charges (Shipbob or merchant). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentTerm { #[serde(rename = "Collect")] Collect, @@ -1572,6 +1548,7 @@ pub enum PaymentTerm { #[serde(rename = "ThirdParty")] ThirdParty, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1590,11 +1567,6 @@ impl std::fmt::Display for PaymentTerm { } } -impl Default for PaymentTerm { - fn default() -> PaymentTerm { - PaymentTerm::Noop - } -} impl PaymentTerm { pub fn is_noop(&self) -> bool { matches!(self, PaymentTerm::Noop) @@ -1677,9 +1649,9 @@ pub struct OrdersRetailerProgramData { } /** -* The order status -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The order status + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OrderStatus { #[serde(rename = "Cancelled")] Cancelled, @@ -1694,6 +1666,7 @@ pub enum OrderStatus { #[serde(rename = "Processing")] Processing, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1715,11 +1688,6 @@ impl std::fmt::Display for OrderStatus { } } -impl Default for OrderStatus { - fn default() -> OrderStatus { - OrderStatus::Noop - } -} impl OrderStatus { pub fn is_noop(&self) -> bool { matches!(self, OrderStatus::Noop) @@ -1727,9 +1695,9 @@ impl OrderStatus { } /** -* Shipment type of the order -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Shipment type of the order + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OrderType { #[serde(rename = "B2B")] B2B, @@ -1738,6 +1706,7 @@ pub enum OrderType { #[serde(rename = "DropShip")] DropShip, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1756,11 +1725,6 @@ impl std::fmt::Display for OrderType { } } -impl Default for OrderType { - fn default() -> OrderType { - OrderType::Noop - } -} impl OrderType { pub fn is_noop(&self) -> bool { matches!(self, OrderType::Noop) @@ -2071,11 +2035,12 @@ pub struct OrdersCreateOrderModel { pub type_: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Action { #[serde(rename = "Cancel")] Cancel, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2092,11 +2057,6 @@ impl std::fmt::Display for Action { } } -impl Default for Action { - fn default() -> Action { - Action::Noop - } -} impl Action { pub fn is_noop(&self) -> bool { matches!(self, Action::Noop) @@ -2140,9 +2100,9 @@ pub struct OrdersCanceledShipment { } /** -* The overall result of canceling the shipments associated with the order -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The overall result of canceling the shipments associated with the order + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OrdersCanceledOrderStatus { #[serde(rename = "Failure")] Failure, @@ -2151,6 +2111,7 @@ pub enum OrdersCanceledOrderStatus { #[serde(rename = "Success")] Success, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2169,11 +2130,6 @@ impl std::fmt::Display for OrdersCanceledOrderStatus { } } -impl Default for OrdersCanceledOrderStatus { - fn default() -> OrdersCanceledOrderStatus { - OrdersCanceledOrderStatus::Noop - } -} impl OrdersCanceledOrderStatus { pub fn is_noop(&self) -> bool { matches!(self, OrdersCanceledOrderStatus::Noop) @@ -2366,7 +2322,7 @@ pub struct OrdersShipMethodDetail { pub service_level: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ProductActiveStatus { #[serde(rename = "Active")] Active, @@ -2375,6 +2331,7 @@ pub enum ProductActiveStatus { #[serde(rename = "Inactive")] Inactive, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2393,18 +2350,13 @@ impl std::fmt::Display for ProductActiveStatus { } } -impl Default for ProductActiveStatus { - fn default() -> ProductActiveStatus { - ProductActiveStatus::Noop - } -} impl ProductActiveStatus { pub fn is_noop(&self) -> bool { matches!(self, ProductActiveStatus::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ProductBundleStatus { #[serde(rename = "Any")] Any, @@ -2413,6 +2365,7 @@ pub enum ProductBundleStatus { #[serde(rename = "NotBundle")] NotBundle, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2431,11 +2384,6 @@ impl std::fmt::Display for ProductBundleStatus { } } -impl Default for ProductBundleStatus { - fn default() -> ProductBundleStatus { - ProductBundleStatus::Noop - } -} impl ProductBundleStatus { pub fn is_noop(&self) -> bool { matches!(self, ProductBundleStatus::Noop) @@ -2917,7 +2865,7 @@ pub struct ReceivingFulfillmentCenter { pub zip_code: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReceivingStatus { #[serde(rename = "Arrived")] Arrived, @@ -2934,6 +2882,7 @@ pub enum ReceivingStatus { #[serde(rename = "Processing")] Processing, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2956,18 +2905,13 @@ impl std::fmt::Display for ReceivingStatus { } } -impl Default for ReceivingStatus { - fn default() -> ReceivingStatus { - ReceivingStatus::Noop - } -} impl ReceivingStatus { pub fn is_noop(&self) -> bool { matches!(self, ReceivingStatus::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReceivingPackageType { #[serde(rename = "FloorLoadedContainer")] FloorLoadedContainer, @@ -2976,6 +2920,7 @@ pub enum ReceivingPackageType { #[serde(rename = "Pallet")] Pallet, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2994,18 +2939,13 @@ impl std::fmt::Display for ReceivingPackageType { } } -impl Default for ReceivingPackageType { - fn default() -> ReceivingPackageType { - ReceivingPackageType::Noop - } -} impl ReceivingPackageType { pub fn is_noop(&self) -> bool { matches!(self, ReceivingPackageType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReceivingPackingType { #[serde(rename = "EverythingInOneBox")] EverythingInOneBox, @@ -3014,6 +2954,7 @@ pub enum ReceivingPackingType { #[serde(rename = "OneSkuPerBox")] OneSkuPerBox, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3032,18 +2973,13 @@ impl std::fmt::Display for ReceivingPackingType { } } -impl Default for ReceivingPackingType { - fn default() -> ReceivingPackingType { - ReceivingPackingType::Noop - } -} impl ReceivingPackingType { pub fn is_noop(&self) -> bool { matches!(self, ReceivingPackingType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReceivingBoxStatus { #[serde(rename = "Arrived")] Arrived, @@ -3058,6 +2994,7 @@ pub enum ReceivingBoxStatus { #[serde(rename = "Stowing")] Stowing, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3079,11 +3016,6 @@ impl std::fmt::Display for ReceivingBoxStatus { } } -impl Default for ReceivingBoxStatus { - fn default() -> ReceivingBoxStatus { - ReceivingBoxStatus::Noop - } -} impl ReceivingBoxStatus { pub fn is_noop(&self) -> bool { matches!(self, ReceivingBoxStatus::Noop) @@ -3451,7 +3383,7 @@ pub struct ReceivingCreateOrderModel { pub package_type: ReceivingPackageType, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReturnStatus { #[serde(rename = "Arrived")] Arrived, @@ -3464,6 +3396,7 @@ pub enum ReturnStatus { #[serde(rename = "Processing")] Processing, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3484,18 +3417,13 @@ impl std::fmt::Display for ReturnStatus { } } -impl Default for ReturnStatus { - fn default() -> ReturnStatus { - ReturnStatus::Noop - } -} impl ReturnStatus { pub fn is_noop(&self) -> bool { matches!(self, ReturnStatus::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReturnsTransactionLogSource { #[serde(rename = "ReturnLabelInvoice")] ReturnLabelInvoice, @@ -3504,6 +3432,7 @@ pub enum ReturnsTransactionLogSource { #[serde(rename = "ReturnToSenderFee")] ReturnToSenderFee, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3522,11 +3451,6 @@ impl std::fmt::Display for ReturnsTransactionLogSource { } } -impl Default for ReturnsTransactionLogSource { - fn default() -> ReturnsTransactionLogSource { - ReturnsTransactionLogSource::Noop - } -} impl ReturnsTransactionLogSource { pub fn is_noop(&self) -> bool { matches!(self, ReturnsTransactionLogSource::Noop) @@ -3571,7 +3495,7 @@ pub struct ReturnsFulfillmentCenter { pub name: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReturnAction { #[serde(rename = "Default")] Default, @@ -3582,6 +3506,7 @@ pub enum ReturnAction { #[serde(rename = "Restock")] Restock, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3601,24 +3526,20 @@ impl std::fmt::Display for ReturnAction { } } -impl Default for ReturnAction { - fn default() -> ReturnAction { - ReturnAction::Noop - } -} impl ReturnAction { pub fn is_noop(&self) -> bool { matches!(self, ReturnAction::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReturnActionSource { #[serde(rename = "InventoryDefault")] InventoryDefault, #[serde(rename = "Override")] Override, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3636,11 +3557,6 @@ impl std::fmt::Display for ReturnActionSource { } } -impl Default for ReturnActionSource { - fn default() -> ReturnActionSource { - ReturnActionSource::Noop - } -} impl ReturnActionSource { pub fn is_noop(&self) -> bool { matches!(self, ReturnActionSource::Noop) @@ -3730,13 +3646,14 @@ pub struct ReturnsInventoryItem { pub quantity: i64, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReturnType { #[serde(rename = "Regular")] Regular, #[serde(rename = "ReturnToSender")] ReturnToSender, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3754,11 +3671,6 @@ impl std::fmt::Display for ReturnType { } } -impl Default for ReturnType { - fn default() -> ReturnType { - ReturnType::Noop - } -} impl ReturnType { pub fn is_noop(&self) -> bool { matches!(self, ReturnType::Noop) @@ -3924,15 +3836,16 @@ pub struct ReturnsCreateReturn { } /** -* Order to sort results in -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Order to sort results in + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SortOrder { #[serde(rename = "Newest")] Newest, #[serde(rename = "Oldest")] Oldest, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3950,11 +3863,6 @@ impl std::fmt::Display for SortOrder { } } -impl Default for SortOrder { - fn default() -> SortOrder { - SortOrder::Noop - } -} impl SortOrder { pub fn is_noop(&self) -> bool { matches!(self, SortOrder::Noop) @@ -3976,7 +3884,7 @@ pub struct ReturnOrderStatusHistory { pub time_stamp: Option>, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum WebhooksTopics { #[serde(rename = "order_shipped")] OrderShipped, @@ -3987,6 +3895,7 @@ pub enum WebhooksTopics { #[serde(rename = "shipment_onhold")] ShipmentOnhold, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4006,11 +3915,6 @@ impl std::fmt::Display for WebhooksTopics { } } -impl Default for WebhooksTopics { - fn default() -> WebhooksTopics { - WebhooksTopics::Noop - } -} impl WebhooksTopics { pub fn is_noop(&self) -> bool { matches!(self, WebhooksTopics::Noop) @@ -4123,13 +4027,14 @@ pub struct MicrosoftAspNetCoreMvcProblemDetails { pub type_: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IntegrationsLocationServiceTypeEnum { #[serde(rename = "Receiving")] Receiving, #[serde(rename = "Returns")] Returns, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4147,11 +4052,6 @@ impl std::fmt::Display for IntegrationsLocationServiceTypeEnum { } } -impl Default for IntegrationsLocationServiceTypeEnum { - fn default() -> IntegrationsLocationServiceTypeEnum { - IntegrationsLocationServiceTypeEnum::Noop - } -} impl IntegrationsLocationServiceTypeEnum { pub fn is_noop(&self) -> bool { matches!(self, IntegrationsLocationServiceTypeEnum::Noop) diff --git a/shopify/src/billing.rs b/shopify/src/billing.rs index 06ab37c8..0c885801 100644 --- a/shopify/src/billing.rs +++ b/shopify/src/billing.rs @@ -116,21 +116,21 @@ impl Billing { .await } /** - * Caution + * Caution This endpoint is no longer required and is deprecated as of API version 2021-01. "Activates an accepted application charge. One-time charges are now immediately activated when approved by a merchant. - * - * This function performs a `POST` to the `/admin/api/2020-01/application_charges/{application_charge_id}/activate.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/billing/applicationcharge#activate-2020-01 - * - * **Parameters:** - * - * * `application_charge_id: &str` -- storefront_access_token_id. - */ + * + * This function performs a `POST` to the `/admin/api/2020-01/application_charges/{application_charge_id}/activate.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/billing/applicationcharge#activate-2020-01 + * + * **Parameters:** + * + * * `application_charge_id: &str` -- storefront_access_token_id. + */ pub async fn deprecated_202001_create_application_charges_param_charge_activate( &self, application_charge_id: &str, @@ -257,21 +257,21 @@ impl Billing { .await } /** - * Caution + * Caution This endpoint is no longer required and is deprecated as of API version 2021-01. "Activates an accepted application charge. One-time charges are now immediately activated when approved by a merchant. - * - * This function performs a `POST` to the `/admin/api/2020-04/application_charges/{application_charge_id}/activate.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/billing/applicationcharge#activate-2020-04 - * - * **Parameters:** - * - * * `application_charge_id: &str` -- storefront_access_token_id. - */ + * + * This function performs a `POST` to the `/admin/api/2020-04/application_charges/{application_charge_id}/activate.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/billing/applicationcharge#activate-2020-04 + * + * **Parameters:** + * + * * `application_charge_id: &str` -- storefront_access_token_id. + */ pub async fn deprecated_202004_create_application_charges_param_charge_activate( &self, application_charge_id: &str, @@ -398,21 +398,21 @@ impl Billing { .await } /** - * Caution + * Caution This endpoint is no longer required and is deprecated as of API version 2021-01. "Activates an accepted application charge. One-time charges are now immediately activated when approved by a merchant. - * - * This function performs a `POST` to the `/admin/api/2020-07/application_charges/{application_charge_id}/activate.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/billing/applicationcharge#activate-2020-07 - * - * **Parameters:** - * - * * `application_charge_id: &str` -- storefront_access_token_id. - */ + * + * This function performs a `POST` to the `/admin/api/2020-07/application_charges/{application_charge_id}/activate.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/billing/applicationcharge#activate-2020-07 + * + * **Parameters:** + * + * * `application_charge_id: &str` -- storefront_access_token_id. + */ pub async fn deprecated_202007_create_application_charges_param_charge_activate( &self, application_charge_id: &str, @@ -532,21 +532,21 @@ impl Billing { .await } /** - * Caution + * Caution This endpoint is no longer required and is deprecated as of API version 2021-01. "Activates an accepted application charge. One-time charges are now immediately activated when approved by a merchant. - * - * This function performs a `POST` to the `/admin/api/2020-10/application_charges/{application_charge_id}/activate.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/billing/applicationcharge#activate-2020-10 - * - * **Parameters:** - * - * * `application_charge_id: &str` -- storefront_access_token_id. - */ + * + * This function performs a `POST` to the `/admin/api/2020-10/application_charges/{application_charge_id}/activate.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/billing/applicationcharge#activate-2020-10 + * + * **Parameters:** + * + * * `application_charge_id: &str` -- storefront_access_token_id. + */ pub async fn create_application_charges_param_charge_activate( &self, application_charge_id: &str, @@ -1482,21 +1482,21 @@ impl Billing { .await } /** - * Caution + * Caution This endpoint is no longer required and is deprecated as of API version 2021-01. Activates a previously accepted recurring application charge. Recurring charges are now immediately activated when approved by a merchant. - * - * This function performs a `POST` to the `/admin/api/2020-01/recurring_application_charges/{recurring_application_charge_id}/activate.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/billing/recurringapplicationcharge#activate-2020-01 - * - * **Parameters:** - * - * * `recurring_application_charge_id: &str` -- recurring_application_charge_id. - */ + * + * This function performs a `POST` to the `/admin/api/2020-01/recurring_application_charges/{recurring_application_charge_id}/activate.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/billing/recurringapplicationcharge#activate-2020-01 + * + * **Parameters:** + * + * * `recurring_application_charge_id: &str` -- recurring_application_charge_id. + */ pub async fn deprecated_202001_create_recurring_application_charges_param_charge_activate( &self, recurring_application_charge_id: &str, @@ -1702,21 +1702,21 @@ impl Billing { .await } /** - * Caution + * Caution This endpoint is no longer required and is deprecated as of API version 2021-01. Activates a previously accepted recurring application charge. Recurring charges are now immediately activated when approved by a merchant. - * - * This function performs a `POST` to the `/admin/api/2020-04/recurring_application_charges/{recurring_application_charge_id}/activate.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/billing/recurringapplicationcharge#activate-2020-04 - * - * **Parameters:** - * - * * `recurring_application_charge_id: &str` -- recurring_application_charge_id. - */ + * + * This function performs a `POST` to the `/admin/api/2020-04/recurring_application_charges/{recurring_application_charge_id}/activate.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/billing/recurringapplicationcharge#activate-2020-04 + * + * **Parameters:** + * + * * `recurring_application_charge_id: &str` -- recurring_application_charge_id. + */ pub async fn deprecated_202004_create_recurring_application_charges_param_charge_activate( &self, recurring_application_charge_id: &str, @@ -1922,21 +1922,21 @@ impl Billing { .await } /** - * Caution + * Caution This endpoint is no longer required and is deprecated as of API version 2021-01. Activates a previously accepted recurring application charge. Recurring charges are now immediately activated when approved by a merchant. - * - * This function performs a `POST` to the `/admin/api/2020-07/recurring_application_charges/{recurring_application_charge_id}/activate.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/billing/recurringapplicationcharge#activate-2020-07 - * - * **Parameters:** - * - * * `recurring_application_charge_id: &str` -- recurring_application_charge_id. - */ + * + * This function performs a `POST` to the `/admin/api/2020-07/recurring_application_charges/{recurring_application_charge_id}/activate.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/billing/recurringapplicationcharge#activate-2020-07 + * + * **Parameters:** + * + * * `recurring_application_charge_id: &str` -- recurring_application_charge_id. + */ pub async fn deprecated_202007_create_recurring_application_charges_param_charge_activate( &self, recurring_application_charge_id: &str, @@ -2142,21 +2142,21 @@ impl Billing { .await } /** - * Caution + * Caution This endpoint is no longer required and is deprecated as of API version 2021-01. Activates a previously accepted recurring application charge. Recurring charges are now immediately activated when approved by a merchant. - * - * This function performs a `POST` to the `/admin/api/2020-10/recurring_application_charges/{recurring_application_charge_id}/activate.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/billing/recurringapplicationcharge#activate-2020-10 - * - * **Parameters:** - * - * * `recurring_application_charge_id: &str` -- recurring_application_charge_id. - */ + * + * This function performs a `POST` to the `/admin/api/2020-10/recurring_application_charges/{recurring_application_charge_id}/activate.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/billing/recurringapplicationcharge#activate-2020-10 + * + * **Parameters:** + * + * * `recurring_application_charge_id: &str` -- recurring_application_charge_id. + */ pub async fn create_recurring_application_charges_param_charge_activate( &self, recurring_application_charge_id: &str, diff --git a/shopify/src/customers.rs b/shopify/src/customers.rs index 275f1810..cfa59b43 100644 --- a/shopify/src/customers.rs +++ b/shopify/src/customers.rs @@ -252,7 +252,7 @@ impl Customers { } /** * Generate an account activation URL for a customer whose account is not yet enabled. This is useful when you've imported a large number of customers and want to send them activation emails all at once. Using this approach, you'll need to generate and send the activation emails yourself. - The account activation URL generated by this endpoint is for one-time use and will expire after 30 days. If you make a new POST request to this endpoint, then a new URL will be generated. The new URL will be again valid for 30 days, but the previous URL will no longer be valid. + The account activation URL generated by this endpoint is for one-time use and will expire after 30 days. If you make a new POST request to this endpoint, then a new URL will be generated. The new URL will be again valid for 30 days, but the previous URL will no longer be valid. * * This function performs a `POST` to the `/admin/api/2020-01/customers/{customer_id}/account_activation_url.json` endpoint. * @@ -607,7 +607,7 @@ impl Customers { } /** * Generate an account activation URL for a customer whose account is not yet enabled. This is useful when you've imported a large number of customers and want to send them activation emails all at once. Using this approach, you'll need to generate and send the activation emails yourself. - The account activation URL generated by this endpoint is for one-time use and will expire after 30 days. If you make a new POST request to this endpoint, then a new URL will be generated. The new URL will be again valid for 30 days, but the previous URL will no longer be valid. + The account activation URL generated by this endpoint is for one-time use and will expire after 30 days. If you make a new POST request to this endpoint, then a new URL will be generated. The new URL will be again valid for 30 days, but the previous URL will no longer be valid. * * This function performs a `POST` to the `/admin/api/2020-04/customers/{customer_id}/account_activation_url.json` endpoint. * @@ -962,7 +962,7 @@ impl Customers { } /** * Generate an account activation URL for a customer whose account is not yet enabled. This is useful when you've imported a large number of customers and want to send them activation emails all at once. Using this approach, you'll need to generate and send the activation emails yourself. - The account activation URL generated by this endpoint is for one-time use and will expire after 30 days. If you make a new POST request to this endpoint, then a new URL will be generated. The new URL will be again valid for 30 days, but the previous URL will no longer be valid. + The account activation URL generated by this endpoint is for one-time use and will expire after 30 days. If you make a new POST request to this endpoint, then a new URL will be generated. The new URL will be again valid for 30 days, but the previous URL will no longer be valid. * * This function performs a `POST` to the `/admin/api/2020-07/customers/{customer_id}/account_activation_url.json` endpoint. * @@ -1313,7 +1313,7 @@ impl Customers { } /** * Generate an account activation URL for a customer whose account is not yet enabled. This is useful when you've imported a large number of customers and want to send them activation emails all at once. Using this approach, you'll need to generate and send the activation emails yourself. - The account activation URL generated by this endpoint is for one-time use and will expire after 30 days. If you make a new POST request to this endpoint, then a new URL will be generated. The new URL will be again valid for 30 days, but the previous URL will no longer be valid. + The account activation URL generated by this endpoint is for one-time use and will expire after 30 days. If you make a new POST request to this endpoint, then a new URL will be generated. The new URL will be again valid for 30 days, but the previous URL will no longer be valid. * * This function performs a `POST` to the `/admin/api/2020-10/customers/{customer_id}/account_activation_url.json` endpoint. * @@ -1668,7 +1668,7 @@ impl Customers { } /** * Generate an account activation URL for a customer whose account is not yet enabled. This is useful when you've imported a large number of customers and want to send them activation emails all at once. Using this approach, you'll need to generate and send the activation emails yourself. - The account activation URL generated by this endpoint is for one-time use and will expire after 30 days. If you make a new POST request to this endpoint, then a new URL will be generated. The new URL will be again valid for 30 days, but the previous URL will no longer be valid. + The account activation URL generated by this endpoint is for one-time use and will expire after 30 days. If you make a new POST request to this endpoint, then a new URL will be generated. The new URL will be again valid for 30 days, but the previous URL will no longer be valid. * * This function performs a `POST` to the `/admin/api/2021-01/customers/{customer_id}/account_activation_url.json` endpoint. * @@ -2027,7 +2027,7 @@ impl Customers { } /** * Generate an account activation URL for a customer whose account is not yet enabled. This is useful when you've imported a large number of customers and want to send them activation emails all at once. Using this approach, you'll need to generate and send the activation emails yourself. - The account activation URL generated by this endpoint is for one-time use and will expire after 30 days. If you make a new POST request to this endpoint, then a new URL will be generated. The new URL will be again valid for 30 days, but the previous URL will no longer be valid. + The account activation URL generated by this endpoint is for one-time use and will expire after 30 days. If you make a new POST request to this endpoint, then a new URL will be generated. The new URL will be again valid for 30 days, but the previous URL will no longer be valid. * * This function performs a `POST` to the `/admin/api/unstable/customers/{customer_id}/account_activation_url.json` endpoint. * diff --git a/shopify/src/discounts.rs b/shopify/src/discounts.rs index c9146ca6..5abc7176 100644 --- a/shopify/src/discounts.rs +++ b/shopify/src/discounts.rs @@ -185,8 +185,8 @@ impl Discounts { } /** * Retrieves the location of a discount code. - The discount code's location is returned in the location header, not in the DiscountCode object itself. - Depending on your HTTP client, the location of the discount code might follow the location header automatically. + The discount code's location is returned in the location header, not in the DiscountCode object itself. + Depending on your HTTP client, the location of the discount code might follow the location header automatically. * * This function performs a `GET` to the `/admin/api/2020-01/discount_codes/lookup.json` endpoint. * @@ -218,23 +218,23 @@ impl Discounts { } /** * Creates a discount code creation job. - The batch endpoint can be used to asynchronously create up to 100 discount codes in a single request. It - enqueues and returns a discount_code_creation object that can be monitored for completion. - Response fields that are specific to the batch endpoint include: + The batch endpoint can be used to asynchronously create up to 100 discount codes in a single request. It + enqueues and returns a discount_code_creation object that can be monitored for completion. + Response fields that are specific to the batch endpoint include: - status: The state of the discount code creation job. Possible values are: + status: The state of the discount code creation job. Possible values are: - queued: The job is acknowledged, but not started. - running: The job is in process. - completed: The job has finished. + queued: The job is acknowledged, but not started. + running: The job is in process. + completed: The job has finished. - codes_count: The number of discount codes to create. - imported_count: The number of discount codes created successfully. - failed_count: The number of discount codes that were not created successfully. Unsuccessful attempts will retry up to three times. - logs: A report that specifies when no discount codes were created because the provided data was invalid. Example responses: + codes_count: The number of discount codes to create. + imported_count: The number of discount codes created successfully. + failed_count: The number of discount codes that were not created successfully. Unsuccessful attempts will retry up to three times. + logs: A report that specifies when no discount codes were created because the provided data was invalid. Example responses: - "Price rule target selection can't be blank" - "Price rule allocation method can't be blank". + "Price rule target selection can't be blank" + "Price rule allocation method can't be blank". * * This function performs a `POST` to the `/admin/api/2020-01/price_rules/{price_rule_id}/batch.json` endpoint. * @@ -303,8 +303,8 @@ impl Discounts { } /** * Retrieves a list of discount codes for a discount code creation job. - Discount codes that have been successfully created include a populated id field. Discount codes that - encountered errors during the creation process include a populated errors field. + Discount codes that have been successfully created include a populated id field. Discount codes that + encountered errors during the creation process include a populated errors field. * * This function performs a `GET` to the `/admin/api/2020-01/price_rules/{price_rule_id}/batch/{batch_id}/discount_codes.json` endpoint. * @@ -511,8 +511,8 @@ impl Discounts { } /** * Retrieves the location of a discount code. - The discount code's location is returned in the location header, not in the DiscountCode object itself. - Depending on your HTTP client, the location of the discount code might follow the location header automatically. + The discount code's location is returned in the location header, not in the DiscountCode object itself. + Depending on your HTTP client, the location of the discount code might follow the location header automatically. * * This function performs a `GET` to the `/admin/api/2020-04/discount_codes/lookup.json` endpoint. * @@ -544,23 +544,23 @@ impl Discounts { } /** * Creates a discount code creation job. - The batch endpoint can be used to asynchronously create up to 100 discount codes in a single request. It - enqueues and returns a discount_code_creation object that can be monitored for completion. - Response fields that are specific to the batch endpoint include: + The batch endpoint can be used to asynchronously create up to 100 discount codes in a single request. It + enqueues and returns a discount_code_creation object that can be monitored for completion. + Response fields that are specific to the batch endpoint include: - status: The state of the discount code creation job. Possible values are: + status: The state of the discount code creation job. Possible values are: - queued: The job is acknowledged, but not started. - running: The job is in process. - completed: The job has finished. + queued: The job is acknowledged, but not started. + running: The job is in process. + completed: The job has finished. - codes_count: The number of discount codes to create. - imported_count: The number of discount codes created successfully. - failed_count: The number of discount codes that were not created successfully. Unsuccessful attempts will retry up to three times. - logs: A report that specifies when no discount codes were created because the provided data was invalid. Example responses: + codes_count: The number of discount codes to create. + imported_count: The number of discount codes created successfully. + failed_count: The number of discount codes that were not created successfully. Unsuccessful attempts will retry up to three times. + logs: A report that specifies when no discount codes were created because the provided data was invalid. Example responses: - "Price rule target selection can't be blank" - "Price rule allocation method can't be blank". + "Price rule target selection can't be blank" + "Price rule allocation method can't be blank". * * This function performs a `POST` to the `/admin/api/2020-04/price_rules/{price_rule_id}/batch.json` endpoint. * @@ -629,8 +629,8 @@ impl Discounts { } /** * Retrieves a list of discount codes for a discount code creation job. - Discount codes that have been successfully created include a populated id field. Discount codes that - encountered errors during the creation process include a populated errors field. + Discount codes that have been successfully created include a populated id field. Discount codes that + encountered errors during the creation process include a populated errors field. * * This function performs a `GET` to the `/admin/api/2020-04/price_rules/{price_rule_id}/batch/{batch_id}/discount_codes.json` endpoint. * @@ -837,8 +837,8 @@ impl Discounts { } /** * Retrieves the location of a discount code. - The discount code's location is returned in the location header, not in the DiscountCode object itself. - Depending on your HTTP client, the location of the discount code might follow the location header automatically. + The discount code's location is returned in the location header, not in the DiscountCode object itself. + Depending on your HTTP client, the location of the discount code might follow the location header automatically. * * This function performs a `GET` to the `/admin/api/2020-07/discount_codes/lookup.json` endpoint. * @@ -870,23 +870,23 @@ impl Discounts { } /** * Creates a discount code creation job. - The batch endpoint can be used to asynchronously create up to 100 discount codes in a single request. It - enqueues and returns a discount_code_creation object that can be monitored for completion. - Response fields that are specific to the batch endpoint include: + The batch endpoint can be used to asynchronously create up to 100 discount codes in a single request. It + enqueues and returns a discount_code_creation object that can be monitored for completion. + Response fields that are specific to the batch endpoint include: - status: The state of the discount code creation job. Possible values are: + status: The state of the discount code creation job. Possible values are: - queued: The job is acknowledged, but not started. - running: The job is in process. - completed: The job has finished. + queued: The job is acknowledged, but not started. + running: The job is in process. + completed: The job has finished. - codes_count: The number of discount codes to create. - imported_count: The number of discount codes created successfully. - failed_count: The number of discount codes that were not created successfully. Unsuccessful attempts will retry up to three times. - logs: A report that specifies when no discount codes were created because the provided data was invalid. Example responses: + codes_count: The number of discount codes to create. + imported_count: The number of discount codes created successfully. + failed_count: The number of discount codes that were not created successfully. Unsuccessful attempts will retry up to three times. + logs: A report that specifies when no discount codes were created because the provided data was invalid. Example responses: - "Price rule target selection can't be blank" - "Price rule allocation method can't be blank". + "Price rule target selection can't be blank" + "Price rule allocation method can't be blank". * * This function performs a `POST` to the `/admin/api/2020-07/price_rules/{price_rule_id}/batch.json` endpoint. * @@ -955,8 +955,8 @@ impl Discounts { } /** * Retrieves a list of discount codes for a discount code creation job. - Discount codes that have been successfully created include a populated id field. Discount codes that - encountered errors during the creation process include a populated errors field. + Discount codes that have been successfully created include a populated id field. Discount codes that + encountered errors during the creation process include a populated errors field. * * This function performs a `GET` to the `/admin/api/2020-07/price_rules/{price_rule_id}/batch/{batch_id}/discount_codes.json` endpoint. * @@ -1160,8 +1160,8 @@ impl Discounts { } /** * Retrieves the location of a discount code. - The discount code's location is returned in the location header, not in the DiscountCode object itself. - Depending on your HTTP client, the location of the discount code might follow the location header automatically. + The discount code's location is returned in the location header, not in the DiscountCode object itself. + Depending on your HTTP client, the location of the discount code might follow the location header automatically. * * This function performs a `GET` to the `/admin/api/2020-10/discount_codes/lookup.json` endpoint. * @@ -1193,23 +1193,23 @@ impl Discounts { } /** * Creates a discount code creation job. - The batch endpoint can be used to asynchronously create up to 100 discount codes in a single request. It - enqueues and returns a discount_code_creation object that can be monitored for completion. - Response fields that are specific to the batch endpoint include: + The batch endpoint can be used to asynchronously create up to 100 discount codes in a single request. It + enqueues and returns a discount_code_creation object that can be monitored for completion. + Response fields that are specific to the batch endpoint include: - status: The state of the discount code creation job. Possible values are: + status: The state of the discount code creation job. Possible values are: - queued: The job is acknowledged, but not started. - running: The job is in process. - completed: The job has finished. + queued: The job is acknowledged, but not started. + running: The job is in process. + completed: The job has finished. - codes_count: The number of discount codes to create. - imported_count: The number of discount codes created successfully. - failed_count: The number of discount codes that were not created successfully. Unsuccessful attempts will retry up to three times. - logs: A report that specifies when no discount codes were created because the provided data was invalid. Example responses: + codes_count: The number of discount codes to create. + imported_count: The number of discount codes created successfully. + failed_count: The number of discount codes that were not created successfully. Unsuccessful attempts will retry up to three times. + logs: A report that specifies when no discount codes were created because the provided data was invalid. Example responses: - "Price rule target selection can't be blank" - "Price rule allocation method can't be blank". + "Price rule target selection can't be blank" + "Price rule allocation method can't be blank". * * This function performs a `POST` to the `/admin/api/2020-10/price_rules/{price_rule_id}/batch.json` endpoint. * @@ -1278,8 +1278,8 @@ impl Discounts { } /** * Retrieves a list of discount codes for a discount code creation job. - Discount codes that have been successfully created include a populated id field. Discount codes that - encountered errors during the creation process include a populated errors field. + Discount codes that have been successfully created include a populated id field. Discount codes that + encountered errors during the creation process include a populated errors field. * * This function performs a `GET` to the `/admin/api/2020-10/price_rules/{price_rule_id}/batch/{batch_id}/discount_codes.json` endpoint. * @@ -1486,8 +1486,8 @@ impl Discounts { } /** * Retrieves the location of a discount code. - The discount code's location is returned in the location header, not in the DiscountCode object itself. - Depending on your HTTP client, the location of the discount code might follow the location header automatically. + The discount code's location is returned in the location header, not in the DiscountCode object itself. + Depending on your HTTP client, the location of the discount code might follow the location header automatically. * * This function performs a `GET` to the `/admin/api/2021-01/discount_codes/lookup.json` endpoint. * @@ -1519,23 +1519,23 @@ impl Discounts { } /** * Creates a discount code creation job. - The batch endpoint can be used to asynchronously create up to 100 discount codes in a single request. It - enqueues and returns a discount_code_creation object that can be monitored for completion. - Response fields that are specific to the batch endpoint include: + The batch endpoint can be used to asynchronously create up to 100 discount codes in a single request. It + enqueues and returns a discount_code_creation object that can be monitored for completion. + Response fields that are specific to the batch endpoint include: - status: The state of the discount code creation job. Possible values are: + status: The state of the discount code creation job. Possible values are: - queued: The job is acknowledged, but not started. - running: The job is in process. - completed: The job has finished. + queued: The job is acknowledged, but not started. + running: The job is in process. + completed: The job has finished. - codes_count: The number of discount codes to create. - imported_count: The number of discount codes created successfully. - failed_count: The number of discount codes that were not created successfully. Unsuccessful attempts will retry up to three times. - logs: A report that specifies when no discount codes were created because the provided data was invalid. Example responses: + codes_count: The number of discount codes to create. + imported_count: The number of discount codes created successfully. + failed_count: The number of discount codes that were not created successfully. Unsuccessful attempts will retry up to three times. + logs: A report that specifies when no discount codes were created because the provided data was invalid. Example responses: - "Price rule target selection can't be blank" - "Price rule allocation method can't be blank". + "Price rule target selection can't be blank" + "Price rule allocation method can't be blank". * * This function performs a `POST` to the `/admin/api/2021-01/price_rules/{price_rule_id}/batch.json` endpoint. * @@ -1604,8 +1604,8 @@ impl Discounts { } /** * Retrieves a list of discount codes for a discount code creation job. - Discount codes that have been successfully created include a populated id field. Discount codes that - encountered errors during the creation process include a populated errors field. + Discount codes that have been successfully created include a populated id field. Discount codes that + encountered errors during the creation process include a populated errors field. * * This function performs a `GET` to the `/admin/api/2021-01/price_rules/{price_rule_id}/batch/{batch_id}/discount_codes.json` endpoint. * @@ -1812,8 +1812,8 @@ impl Discounts { } /** * Retrieves the location of a discount code. - The discount code's location is returned in the location header, not in the DiscountCode object itself. - Depending on your HTTP client, the location of the discount code might follow the location header automatically. + The discount code's location is returned in the location header, not in the DiscountCode object itself. + Depending on your HTTP client, the location of the discount code might follow the location header automatically. * * This function performs a `GET` to the `/admin/api/unstable/discount_codes/lookup.json` endpoint. * @@ -1845,23 +1845,23 @@ impl Discounts { } /** * Creates a discount code creation job. - The batch endpoint can be used to asynchronously create up to 100 discount codes in a single request. It - enqueues and returns a discount_code_creation object that can be monitored for completion. - Response fields that are specific to the batch endpoint include: + The batch endpoint can be used to asynchronously create up to 100 discount codes in a single request. It + enqueues and returns a discount_code_creation object that can be monitored for completion. + Response fields that are specific to the batch endpoint include: - status: The state of the discount code creation job. Possible values are: + status: The state of the discount code creation job. Possible values are: - queued: The job is acknowledged, but not started. - running: The job is in process. - completed: The job has finished. + queued: The job is acknowledged, but not started. + running: The job is in process. + completed: The job has finished. - codes_count: The number of discount codes to create. - imported_count: The number of discount codes created successfully. - failed_count: The number of discount codes that were not created successfully. Unsuccessful attempts will retry up to three times. - logs: A report that specifies when no discount codes were created because the provided data was invalid. Example responses: + codes_count: The number of discount codes to create. + imported_count: The number of discount codes created successfully. + failed_count: The number of discount codes that were not created successfully. Unsuccessful attempts will retry up to three times. + logs: A report that specifies when no discount codes were created because the provided data was invalid. Example responses: - "Price rule target selection can't be blank" - "Price rule allocation method can't be blank". + "Price rule target selection can't be blank" + "Price rule allocation method can't be blank". * * This function performs a `POST` to the `/admin/api/unstable/price_rules/{price_rule_id}/batch.json` endpoint. * @@ -1930,8 +1930,8 @@ impl Discounts { } /** * Retrieves a list of discount codes for a discount code creation job. - Discount codes that have been successfully created include a populated id field. Discount codes that - encountered errors during the creation process include a populated errors field. + Discount codes that have been successfully created include a populated id field. Discount codes that + encountered errors during the creation process include a populated errors field. * * This function performs a `GET` to the `/admin/api/unstable/price_rules/{price_rule_id}/batch/{batch_id}/discount_codes.json` endpoint. * diff --git a/shopify/src/inventory.rs b/shopify/src/inventory.rs index 14570335..873b50ad 100644 --- a/shopify/src/inventory.rs +++ b/shopify/src/inventory.rs @@ -702,8 +702,8 @@ impl Inventory { } /** * Retrieves a list of inventory levels. - You must include inventory_item_ids, location_ids, or both as filter parameters. - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + You must include inventory_item_ids, location_ids, or both as filter parameters. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/2020-01/inventory_levels.json` endpoint. * @@ -712,11 +712,11 @@ impl Inventory { * **Parameters:** * * * `inventory_item_ids: &str` -- A comma-separated list of inventory item IDs. - * (maximum: 50). + * (maximum: 50). * * `location_ids: &str` -- A comma-separated list of location IDs. To find the ID of a location, use the Location resource. - * (maximum: 50). + * (maximum: 50). * * `limit: &str` -- The maximum number of results to show. - * (default: 50, maximum: 250). + * (default: 50, maximum: 250). * * `updated_at_min: &str` -- Show inventory levels updated at or after date (format: 2019-03-19T01:21:44-04:00). */ pub async fn deprecated_202001_get_level( @@ -759,9 +759,9 @@ impl Inventory { } /** * Deletes an inventory level of an inventory item at a location. - Deleting an inventory level for an inventory item removes that item from the specified location. - Every inventory item must have at least one inventory level. To move inventory to another location, - first connect the inventory item to another location, and then delete the previous inventory level. + Deleting an inventory level for an inventory item removes that item from the specified location. + Every inventory item must have at least one inventory level. To move inventory to another location, + first connect the inventory item to another location, and then delete the previous inventory level. * * This function performs a `DELETE` to the `/admin/api/2020-01/inventory_levels.json` endpoint. * @@ -884,8 +884,8 @@ impl Inventory { } /** * Connects an inventory item to a location by creating an inventory level at that location. - When connecting inventory items to locations, it's important to understand the rules around - fulfillment service locations. + When connecting inventory items to locations, it's important to understand the rules around + fulfillment service locations. * * This function performs a `POST` to the `/admin/api/2020-01/inventory_levels/connect.json` endpoint. * @@ -896,7 +896,7 @@ impl Inventory { * * `inventory_item_required: &str` -- The ID of the inventory item. * * `location_required: &str` -- The ID of the location that the inventory level belongs to. To find the ID of the location, use the Location resource. * * `relocate_if_necessary: &str` -- Whether inventory for any previously connected locations will be relocated. This property is ignored when no fulfillment service location is involved. For more information, see Inventory levels and fulfillment service locations. - * (default: false). + * (default: false). */ pub async fn deprecated_202001_create_levels_connect( &self, @@ -948,9 +948,9 @@ impl Inventory { } /** * Sets the inventory level for an inventory item at a location. - If the specified location is not connected, it will be automatically connected first. - When connecting inventory items to locations, it's important to understand the rules around - fulfillment service locations. + If the specified location is not connected, it will be automatically connected first. + When connecting inventory items to locations, it's important to understand the rules around + fulfillment service locations. * * This function performs a `POST` to the `/admin/api/2020-01/inventory_levels/set.json` endpoint. * @@ -962,7 +962,7 @@ impl Inventory { * * `location_required: &str` -- The ID of the location that the inventory level belongs to. To find the ID of the location, use the Location resource. * * `available_required: &str` -- Sets the available inventory quantity. * * `disconnect_if_necessary: &str` -- Whether inventory for any previously connected locations will be set to 0 and the locations disconnected. This property is ignored when no fulfillment service is involved. For more information, see Inventory levels and fulfillment service locations. - * (default: false). + * (default: false). */ pub async fn deprecated_202001_create_levels_set( &self, @@ -1020,8 +1020,8 @@ impl Inventory { } /** * Retrieves a list of inventory levels. - You must include inventory_item_ids, location_ids, or both as filter parameters. - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + You must include inventory_item_ids, location_ids, or both as filter parameters. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/2020-04/inventory_levels.json` endpoint. * @@ -1030,11 +1030,11 @@ impl Inventory { * **Parameters:** * * * `inventory_item_ids: &str` -- A comma-separated list of inventory item IDs. - * (maximum: 50). + * (maximum: 50). * * `location_ids: &str` -- A comma-separated list of location IDs. To find the ID of a location, use the Location resource. - * (maximum: 50). + * (maximum: 50). * * `limit: &str` -- The maximum number of results to show. - * (default: 50, maximum: 250). + * (default: 50, maximum: 250). * * `updated_at_min: &str` -- Show inventory levels updated at or after date (format: 2019-03-19T01:21:44-04:00). */ pub async fn deprecated_202004_get_level( @@ -1077,9 +1077,9 @@ impl Inventory { } /** * Deletes an inventory level of an inventory item at a location. - Deleting an inventory level for an inventory item removes that item from the specified location. - Every inventory item must have at least one inventory level. To move inventory to another location, - first connect the inventory item to another location, and then delete the previous inventory level. + Deleting an inventory level for an inventory item removes that item from the specified location. + Every inventory item must have at least one inventory level. To move inventory to another location, + first connect the inventory item to another location, and then delete the previous inventory level. * * This function performs a `DELETE` to the `/admin/api/2020-04/inventory_levels.json` endpoint. * @@ -1202,8 +1202,8 @@ impl Inventory { } /** * Connects an inventory item to a location by creating an inventory level at that location. - When connecting inventory items to locations, it's important to understand the rules around - fulfillment service locations. + When connecting inventory items to locations, it's important to understand the rules around + fulfillment service locations. * * This function performs a `POST` to the `/admin/api/2020-04/inventory_levels/connect.json` endpoint. * @@ -1214,7 +1214,7 @@ impl Inventory { * * `inventory_item_required: &str` -- The ID of the inventory item. * * `location_required: &str` -- The ID of the location that the inventory level belongs to. To find the ID of the location, use the Location resource. * * `relocate_if_necessary: &str` -- Whether inventory for any previously connected locations will be relocated. This property is ignored when no fulfillment service location is involved. For more information, see Inventory levels and fulfillment service locations. - * (default: false). + * (default: false). */ pub async fn deprecated_202004_create_levels_connect( &self, @@ -1266,9 +1266,9 @@ impl Inventory { } /** * Sets the inventory level for an inventory item at a location. - If the specified location is not connected, it will be automatically connected first. - When connecting inventory items to locations, it's important to understand the rules around - fulfillment service locations. + If the specified location is not connected, it will be automatically connected first. + When connecting inventory items to locations, it's important to understand the rules around + fulfillment service locations. * * This function performs a `POST` to the `/admin/api/2020-04/inventory_levels/set.json` endpoint. * @@ -1280,7 +1280,7 @@ impl Inventory { * * `location_required: &str` -- The ID of the location that the inventory level belongs to. To find the ID of the location, use the Location resource. * * `available_required: &str` -- Sets the available inventory quantity. * * `disconnect_if_necessary: &str` -- Whether inventory for any previously connected locations will be set to 0 and the locations disconnected. This property is ignored when no fulfillment service is involved. For more information, see Inventory levels and fulfillment service locations. - * (default: false). + * (default: false). */ pub async fn deprecated_202004_create_levels_set( &self, @@ -1338,8 +1338,8 @@ impl Inventory { } /** * Retrieves a list of inventory levels. - You must include inventory_item_ids, location_ids, or both as filter parameters. - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + You must include inventory_item_ids, location_ids, or both as filter parameters. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/2020-07/inventory_levels.json` endpoint. * @@ -1348,11 +1348,11 @@ impl Inventory { * **Parameters:** * * * `inventory_item_ids: &str` -- A comma-separated list of inventory item IDs. - * (maximum: 50). + * (maximum: 50). * * `location_ids: &str` -- A comma-separated list of location IDs. To find the ID of a location, use the Location resource. - * (maximum: 50). + * (maximum: 50). * * `limit: &str` -- The maximum number of results to show. - * (default: 50, maximum: 250). + * (default: 50, maximum: 250). * * `updated_at_min: &str` -- Show inventory levels updated at or after date (format: 2019-03-19T01:21:44-04:00). */ pub async fn deprecated_202007_get_level( @@ -1395,9 +1395,9 @@ impl Inventory { } /** * Deletes an inventory level of an inventory item at a location. - Deleting an inventory level for an inventory item removes that item from the specified location. - Every inventory item must have at least one inventory level. To move inventory to another location, - first connect the inventory item to another location, and then delete the previous inventory level. + Deleting an inventory level for an inventory item removes that item from the specified location. + Every inventory item must have at least one inventory level. To move inventory to another location, + first connect the inventory item to another location, and then delete the previous inventory level. * * This function performs a `DELETE` to the `/admin/api/2020-07/inventory_levels.json` endpoint. * @@ -1520,8 +1520,8 @@ impl Inventory { } /** * Connects an inventory item to a location by creating an inventory level at that location. - When connecting inventory items to locations, it's important to understand the rules around - fulfillment service locations. + When connecting inventory items to locations, it's important to understand the rules around + fulfillment service locations. * * This function performs a `POST` to the `/admin/api/2020-07/inventory_levels/connect.json` endpoint. * @@ -1532,7 +1532,7 @@ impl Inventory { * * `inventory_item_required: &str` -- The ID of the inventory item. * * `location_required: &str` -- The ID of the location that the inventory level belongs to. To find the ID of the location, use the Location resource. * * `relocate_if_necessary: &str` -- Whether inventory for any previously connected locations will be relocated. This property is ignored when no fulfillment service location is involved. For more information, see Inventory levels and fulfillment service locations. - * (default: false). + * (default: false). */ pub async fn deprecated_202007_create_levels_connect( &self, @@ -1584,9 +1584,9 @@ impl Inventory { } /** * Sets the inventory level for an inventory item at a location. - If the specified location is not connected, it will be automatically connected first. - When connecting inventory items to locations, it's important to understand the rules around - fulfillment service locations. + If the specified location is not connected, it will be automatically connected first. + When connecting inventory items to locations, it's important to understand the rules around + fulfillment service locations. * * This function performs a `POST` to the `/admin/api/2020-07/inventory_levels/set.json` endpoint. * @@ -1598,7 +1598,7 @@ impl Inventory { * * `location_required: &str` -- The ID of the location that the inventory level belongs to. To find the ID of the location, use the Location resource. * * `available_required: &str` -- Sets the available inventory quantity. * * `disconnect_if_necessary: &str` -- Whether inventory for any previously connected locations will be set to 0 and the locations disconnected. This property is ignored when no fulfillment service is involved. For more information, see Inventory levels and fulfillment service locations. - * (default: false). + * (default: false). */ pub async fn deprecated_202007_create_levels_set( &self, @@ -1656,8 +1656,8 @@ impl Inventory { } /** * Retrieves a list of inventory levels. - You must include inventory_item_ids, location_ids, or both as filter parameters. - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + You must include inventory_item_ids, location_ids, or both as filter parameters. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/2020-10/inventory_levels.json` endpoint. * @@ -1666,11 +1666,11 @@ impl Inventory { * **Parameters:** * * * `inventory_item_ids: &str` -- A comma-separated list of inventory item IDs. - * (maximum: 50). + * (maximum: 50). * * `location_ids: &str` -- A comma-separated list of location IDs. To find the ID of a location, use the Location resource. - * (maximum: 50). + * (maximum: 50). * * `limit: &str` -- The maximum number of results to show. - * (default: 50, maximum: 250). + * (default: 50, maximum: 250). * * `updated_at_min: &str` -- Show inventory levels updated at or after date (format: 2019-03-19T01:21:44-04:00). */ pub async fn get_level( @@ -1713,9 +1713,9 @@ impl Inventory { } /** * Deletes an inventory level of an inventory item at a location. - Deleting an inventory level for an inventory item removes that item from the specified location. - Every inventory item must have at least one inventory level. To move inventory to another location, - first connect the inventory item to another location, and then delete the previous inventory level. + Deleting an inventory level for an inventory item removes that item from the specified location. + Every inventory item must have at least one inventory level. To move inventory to another location, + first connect the inventory item to another location, and then delete the previous inventory level. * * This function performs a `DELETE` to the `/admin/api/2020-10/inventory_levels.json` endpoint. * @@ -1838,8 +1838,8 @@ impl Inventory { } /** * Connects an inventory item to a location by creating an inventory level at that location. - When connecting inventory items to locations, it's important to understand the rules around - fulfillment service locations. + When connecting inventory items to locations, it's important to understand the rules around + fulfillment service locations. * * This function performs a `POST` to the `/admin/api/2020-10/inventory_levels/connect.json` endpoint. * @@ -1850,7 +1850,7 @@ impl Inventory { * * `inventory_item_required: &str` -- The ID of the inventory item. * * `location_required: &str` -- The ID of the location that the inventory level belongs to. To find the ID of the location, use the Location resource. * * `relocate_if_necessary: &str` -- Whether inventory for any previously connected locations will be relocated. This property is ignored when no fulfillment service location is involved. For more information, see Inventory levels and fulfillment service locations. - * (default: false). + * (default: false). */ pub async fn create_levels_connect( &self, @@ -1902,9 +1902,9 @@ impl Inventory { } /** * Sets the inventory level for an inventory item at a location. - If the specified location is not connected, it will be automatically connected first. - When connecting inventory items to locations, it's important to understand the rules around - fulfillment service locations. + If the specified location is not connected, it will be automatically connected first. + When connecting inventory items to locations, it's important to understand the rules around + fulfillment service locations. * * This function performs a `POST` to the `/admin/api/2020-10/inventory_levels/set.json` endpoint. * @@ -1916,7 +1916,7 @@ impl Inventory { * * `location_required: &str` -- The ID of the location that the inventory level belongs to. To find the ID of the location, use the Location resource. * * `available_required: &str` -- Sets the available inventory quantity. * * `disconnect_if_necessary: &str` -- Whether inventory for any previously connected locations will be set to 0 and the locations disconnected. This property is ignored when no fulfillment service is involved. For more information, see Inventory levels and fulfillment service locations. - * (default: false). + * (default: false). */ pub async fn create_levels_set( &self, @@ -1974,8 +1974,8 @@ impl Inventory { } /** * Retrieves a list of inventory levels. - You must include inventory_item_ids, location_ids, or both as filter parameters. - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + You must include inventory_item_ids, location_ids, or both as filter parameters. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/2021-01/inventory_levels.json` endpoint. * @@ -1984,11 +1984,11 @@ impl Inventory { * **Parameters:** * * * `inventory_item_ids: &str` -- A comma-separated list of inventory item IDs. - * (maximum: 50). + * (maximum: 50). * * `location_ids: &str` -- A comma-separated list of location IDs. To find the ID of a location, use the Location resource. - * (maximum: 50). + * (maximum: 50). * * `limit: &str` -- The maximum number of results to show. - * (default: 50, maximum: 250). + * (default: 50, maximum: 250). * * `updated_at_min: &str` -- Show inventory levels updated at or after date (format: 2019-03-19T01:21:44-04:00). */ pub async fn deprecated_202101_get_level( @@ -2031,9 +2031,9 @@ impl Inventory { } /** * Deletes an inventory level of an inventory item at a location. - Deleting an inventory level for an inventory item removes that item from the specified location. - Every inventory item must have at least one inventory level. To move inventory to another location, - first connect the inventory item to another location, and then delete the previous inventory level. + Deleting an inventory level for an inventory item removes that item from the specified location. + Every inventory item must have at least one inventory level. To move inventory to another location, + first connect the inventory item to another location, and then delete the previous inventory level. * * This function performs a `DELETE` to the `/admin/api/2021-01/inventory_levels.json` endpoint. * @@ -2156,8 +2156,8 @@ impl Inventory { } /** * Connects an inventory item to a location by creating an inventory level at that location. - When connecting inventory items to locations, it's important to understand the rules around - fulfillment service locations. + When connecting inventory items to locations, it's important to understand the rules around + fulfillment service locations. * * This function performs a `POST` to the `/admin/api/2021-01/inventory_levels/connect.json` endpoint. * @@ -2168,7 +2168,7 @@ impl Inventory { * * `inventory_item_required: &str` -- The ID of the inventory item. * * `location_required: &str` -- The ID of the location that the inventory level belongs to. To find the ID of the location, use the Location resource. * * `relocate_if_necessary: &str` -- Whether inventory for any previously connected locations will be relocated. This property is ignored when no fulfillment service location is involved. For more information, see Inventory levels and fulfillment service locations. - * (default: false). + * (default: false). */ pub async fn deprecated_202101_create_levels_connect( &self, @@ -2220,9 +2220,9 @@ impl Inventory { } /** * Sets the inventory level for an inventory item at a location. - If the specified location is not connected, it will be automatically connected first. - When connecting inventory items to locations, it's important to understand the rules around - fulfillment service locations. + If the specified location is not connected, it will be automatically connected first. + When connecting inventory items to locations, it's important to understand the rules around + fulfillment service locations. * * This function performs a `POST` to the `/admin/api/2021-01/inventory_levels/set.json` endpoint. * @@ -2234,7 +2234,7 @@ impl Inventory { * * `location_required: &str` -- The ID of the location that the inventory level belongs to. To find the ID of the location, use the Location resource. * * `available_required: &str` -- Sets the available inventory quantity. * * `disconnect_if_necessary: &str` -- Whether inventory for any previously connected locations will be set to 0 and the locations disconnected. This property is ignored when no fulfillment service is involved. For more information, see Inventory levels and fulfillment service locations. - * (default: false). + * (default: false). */ pub async fn deprecated_202101_create_levels_set( &self, @@ -2292,8 +2292,8 @@ impl Inventory { } /** * Retrieves a list of inventory levels. - You must include inventory_item_ids, location_ids, or both as filter parameters. - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + You must include inventory_item_ids, location_ids, or both as filter parameters. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/unstable/inventory_levels.json` endpoint. * @@ -2302,11 +2302,11 @@ impl Inventory { * **Parameters:** * * * `inventory_item_ids: &str` -- A comma-separated list of inventory item IDs. - * (maximum: 50). + * (maximum: 50). * * `location_ids: &str` -- A comma-separated list of location IDs. To find the ID of a location, use the Location resource. - * (maximum: 50). + * (maximum: 50). * * `limit: &str` -- The maximum number of results to show. - * (default: 50, maximum: 250). + * (default: 50, maximum: 250). * * `updated_at_min: &str` -- Show inventory levels updated at or after date (format: 2019-03-19T01:21:44-04:00). */ pub async fn deprecated_unstable_get_level( @@ -2349,9 +2349,9 @@ impl Inventory { } /** * Deletes an inventory level of an inventory item at a location. - Deleting an inventory level for an inventory item removes that item from the specified location. - Every inventory item must have at least one inventory level. To move inventory to another location, - first connect the inventory item to another location, and then delete the previous inventory level. + Deleting an inventory level for an inventory item removes that item from the specified location. + Every inventory item must have at least one inventory level. To move inventory to another location, + first connect the inventory item to another location, and then delete the previous inventory level. * * This function performs a `DELETE` to the `/admin/api/unstable/inventory_levels.json` endpoint. * @@ -2477,8 +2477,8 @@ impl Inventory { } /** * Connects an inventory item to a location by creating an inventory level at that location. - When connecting inventory items to locations, it's important to understand the rules around - fulfillment service locations. + When connecting inventory items to locations, it's important to understand the rules around + fulfillment service locations. * * This function performs a `POST` to the `/admin/api/unstable/inventory_levels/connect.json` endpoint. * @@ -2489,7 +2489,7 @@ impl Inventory { * * `inventory_item_required: &str` -- The ID of the inventory item. * * `location_required: &str` -- The ID of the location that the inventory level belongs to. To find the ID of the location, use the Location resource. * * `relocate_if_necessary: &str` -- Whether inventory for any previously connected locations will be relocated. This property is ignored when no fulfillment service location is involved. For more information, see Inventory levels and fulfillment service locations. - * (default: false). + * (default: false). */ pub async fn deprecated_unstable_create_levels_connect( &self, @@ -2541,9 +2541,9 @@ impl Inventory { } /** * Sets the inventory level for an inventory item at a location. - If the specified location is not connected, it will be automatically connected first. - When connecting inventory items to locations, it's important to understand the rules around - fulfillment service locations. + If the specified location is not connected, it will be automatically connected first. + When connecting inventory items to locations, it's important to understand the rules around + fulfillment service locations. * * This function performs a `POST` to the `/admin/api/unstable/inventory_levels/set.json` endpoint. * @@ -2555,7 +2555,7 @@ impl Inventory { * * `location_required: &str` -- The ID of the location that the inventory level belongs to. To find the ID of the location, use the Location resource. * * `available_required: &str` -- Sets the available inventory quantity. * * `disconnect_if_necessary: &str` -- Whether inventory for any previously connected locations will be set to 0 and the locations disconnected. This property is ignored when no fulfillment service is involved. For more information, see Inventory levels and fulfillment service locations. - * (default: false). + * (default: false). */ pub async fn deprecated_unstable_create_levels_set( &self, diff --git a/shopify/src/online_store.rs b/shopify/src/online_store.rs index 1ff4c8a5..17fe5cb2 100644 --- a/shopify/src/online_store.rs +++ b/shopify/src/online_store.rs @@ -2338,8 +2338,8 @@ impl OnlineStore { } /** * Retrieves a single asset for a theme by its key. - To retrieve a single asset, include asset[key]=#{asset_key} as a request parameter. For example, to retrieve the asset with a key of templates/index.liquid, the request might be /admin/themes/828155753/assets.json?asset[key]=templates/index.liquid. - For more information on the key property, see Asset properties. + To retrieve a single asset, include asset[key]=#{asset_key} as a request parameter. For example, to retrieve the asset with a key of templates/index.liquid, the request might be /admin/themes/828155753/assets.json?asset[key]=templates/index.liquid. + For more information on the key property, see Asset properties. * * This function performs a `GET` to the `/admin/api/2020-01/themes/{theme_id}/assets.json` endpoint. * @@ -2385,7 +2385,7 @@ impl OnlineStore { } /** * Creates or updates an asset for a theme. - In the PUT request, you can include the src or source_key property to create the asset from an existing file. + In the PUT request, you can include the src or source_key property to create the asset from an existing file. * * This function performs a `PUT` to the `/admin/api/2020-01/themes/{theme_id}/assets.json` endpoint. * @@ -2472,8 +2472,8 @@ impl OnlineStore { } /** * Retrieves a single asset for a theme by its key. - To retrieve a single asset, include asset[key]=#{asset_key} as a request parameter. For example, to retrieve the asset with a key of templates/index.liquid, the request might be /admin/themes/828155753/assets.json?asset[key]=templates/index.liquid. - For more information on the key property, see Asset properties. + To retrieve a single asset, include asset[key]=#{asset_key} as a request parameter. For example, to retrieve the asset with a key of templates/index.liquid, the request might be /admin/themes/828155753/assets.json?asset[key]=templates/index.liquid. + For more information on the key property, see Asset properties. * * This function performs a `GET` to the `/admin/api/2020-04/themes/{theme_id}/assets.json` endpoint. * @@ -2519,7 +2519,7 @@ impl OnlineStore { } /** * Creates or updates an asset for a theme. - In the PUT request, you can include the src or source_key property to create the asset from an existing file. + In the PUT request, you can include the src or source_key property to create the asset from an existing file. * * This function performs a `PUT` to the `/admin/api/2020-04/themes/{theme_id}/assets.json` endpoint. * @@ -2606,8 +2606,8 @@ impl OnlineStore { } /** * Retrieves a single asset for a theme by its key. - To retrieve a single asset, include asset[key]=#{asset_key} as a request parameter. For example, to retrieve the asset with a key of templates/index.liquid, the request might be /admin/themes/828155753/assets.json?asset[key]=templates/index.liquid. - For more information on the key property, see Asset properties. + To retrieve a single asset, include asset[key]=#{asset_key} as a request parameter. For example, to retrieve the asset with a key of templates/index.liquid, the request might be /admin/themes/828155753/assets.json?asset[key]=templates/index.liquid. + For more information on the key property, see Asset properties. * * This function performs a `GET` to the `/admin/api/2020-07/themes/{theme_id}/assets.json` endpoint. * @@ -2653,7 +2653,7 @@ impl OnlineStore { } /** * Creates or updates an asset for a theme. - In the PUT request, you can include the src or source_key property to create the asset from an existing file. + In the PUT request, you can include the src or source_key property to create the asset from an existing file. * * This function performs a `PUT` to the `/admin/api/2020-07/themes/{theme_id}/assets.json` endpoint. * @@ -2740,8 +2740,8 @@ impl OnlineStore { } /** * Retrieves a single asset for a theme by its key. - To retrieve a single asset, include asset[key]=#{asset_key} as a request parameter. For example, to retrieve the asset with a key of templates/index.liquid, the request might be /admin/themes/828155753/assets.json?asset[key]=templates/index.liquid. - For more information on the key property, see Asset properties. + To retrieve a single asset, include asset[key]=#{asset_key} as a request parameter. For example, to retrieve the asset with a key of templates/index.liquid, the request might be /admin/themes/828155753/assets.json?asset[key]=templates/index.liquid. + For more information on the key property, see Asset properties. * * This function performs a `GET` to the `/admin/api/2020-10/themes/{theme_id}/assets.json` endpoint. * @@ -2787,7 +2787,7 @@ impl OnlineStore { } /** * Creates or updates an asset for a theme. - In the PUT request, you can include the src or source_key property to create the asset from an existing file. + In the PUT request, you can include the src or source_key property to create the asset from an existing file. * * This function performs a `PUT` to the `/admin/api/2020-10/themes/{theme_id}/assets.json` endpoint. * @@ -2874,8 +2874,8 @@ impl OnlineStore { } /** * Retrieves a single asset for a theme by its key. - To retrieve a single asset, include asset[key]=#{asset_key} as a request parameter. For example, to retrieve the asset with a key of templates/index.liquid, the request might be /admin/themes/828155753/assets.json?asset[key]=templates/index.liquid. - For more information on the key property, see Asset properties. + To retrieve a single asset, include asset[key]=#{asset_key} as a request parameter. For example, to retrieve the asset with a key of templates/index.liquid, the request might be /admin/themes/828155753/assets.json?asset[key]=templates/index.liquid. + For more information on the key property, see Asset properties. * * This function performs a `GET` to the `/admin/api/2021-01/themes/{theme_id}/assets.json` endpoint. * @@ -2921,7 +2921,7 @@ impl OnlineStore { } /** * Creates or updates an asset for a theme. - In the PUT request, you can include the src or source_key property to create the asset from an existing file. + In the PUT request, you can include the src or source_key property to create the asset from an existing file. * * This function performs a `PUT` to the `/admin/api/2021-01/themes/{theme_id}/assets.json` endpoint. * @@ -3008,8 +3008,8 @@ impl OnlineStore { } /** * Retrieves a single asset for a theme by its key. - To retrieve a single asset, include asset[key]=#{asset_key} as a request parameter. For example, to retrieve the asset with a key of templates/index.liquid, the request might be /admin/themes/828155753/assets.json?asset[key]=templates/index.liquid. - For more information on the key property, see Asset properties. + To retrieve a single asset, include asset[key]=#{asset_key} as a request parameter. For example, to retrieve the asset with a key of templates/index.liquid, the request might be /admin/themes/828155753/assets.json?asset[key]=templates/index.liquid. + For more information on the key property, see Asset properties. * * This function performs a `GET` to the `/admin/api/unstable/themes/{theme_id}/assets.json` endpoint. * @@ -3055,7 +3055,7 @@ impl OnlineStore { } /** * Creates or updates an asset for a theme. - In the PUT request, you can include the src or source_key property to create the asset from an existing file. + In the PUT request, you can include the src or source_key property to create the asset from an existing file. * * This function performs a `PUT` to the `/admin/api/unstable/themes/{theme_id}/assets.json` endpoint. * @@ -3835,7 +3835,7 @@ impl OnlineStore { } /** * Creates a redirect. When you provide a full URL as the value of the path property, it will be saved as an absolute path without the domain. - For example, "path": "http://www.johns-apparel.com/springwear" will be saved as "path": "springwear". + For example, "path": "http://www.johns-apparel.com/springwear" will be saved as "path": "springwear". * * This function performs a `POST` to the `/admin/api/2020-01/redirects.json` endpoint. * @@ -4054,7 +4054,7 @@ impl OnlineStore { } /** * Creates a redirect. When you provide a full URL as the value of the path property, it will be saved as an absolute path without the domain. - For example, "path": "http://www.johns-apparel.com/springwear" will be saved as "path": "springwear". + For example, "path": "http://www.johns-apparel.com/springwear" will be saved as "path": "springwear". * * This function performs a `POST` to the `/admin/api/2020-04/redirects.json` endpoint. * @@ -4273,7 +4273,7 @@ impl OnlineStore { } /** * Creates a redirect. When you provide a full URL as the value of the path property, it will be saved as an absolute path without the domain. - For example, "path": "http://www.johns-apparel.com/springwear" will be saved as "path": "springwear". + For example, "path": "http://www.johns-apparel.com/springwear" will be saved as "path": "springwear". * * This function performs a `POST` to the `/admin/api/2020-07/redirects.json` endpoint. * @@ -4492,7 +4492,7 @@ impl OnlineStore { } /** * Creates a redirect. When you provide a full URL as the value of the path property, it will be saved as an absolute path without the domain. - For example, "path": "http://www.johns-apparel.com/springwear" will be saved as "path": "springwear". + For example, "path": "http://www.johns-apparel.com/springwear" will be saved as "path": "springwear". * * This function performs a `POST` to the `/admin/api/2020-10/redirects.json` endpoint. * @@ -4704,7 +4704,7 @@ impl OnlineStore { } /** * Creates a redirect. When you provide a full URL as the value of the path property, it will be saved as an absolute path without the domain. - For example, "path": "http://www.johns-apparel.com/springwear" will be saved as "path": "springwear". + For example, "path": "http://www.johns-apparel.com/springwear" will be saved as "path": "springwear". * * This function performs a `POST` to the `/admin/api/2021-01/redirects.json` endpoint. * @@ -4923,7 +4923,7 @@ impl OnlineStore { } /** * Creates a redirect. When you provide a full URL as the value of the path property, it will be saved as an absolute path without the domain. - For example, "path": "http://www.johns-apparel.com/springwear" will be saved as "path": "springwear". + For example, "path": "http://www.johns-apparel.com/springwear" will be saved as "path": "springwear". * * This function performs a `POST` to the `/admin/api/unstable/redirects.json` endpoint. * @@ -6480,9 +6480,9 @@ impl OnlineStore { } /** * Creates a theme by providing the public URL of a ZIP file that contains the theme. - A new theme is always unpublished by default. To publish a theme when you create it, include - "role": "main" in the POST request. The theme will be published only after all - of its files have been extracted and stored by Shopify, which might take a couple of minutes. + A new theme is always unpublished by default. To publish a theme when you create it, include + "role": "main" in the POST request. The theme will be published only after all + of its files have been extracted and stored by Shopify, which might take a couple of minutes. * * This function performs a `POST` to the `/admin/api/2020-01/themes.json` endpoint. * @@ -6634,9 +6634,9 @@ impl OnlineStore { } /** * Creates a theme by providing the public URL of a ZIP file that contains the theme. - A new theme is always unpublished by default. To publish a theme when you create it, include - "role": "main" in the POST request. The theme will be published only after all - of its files have been extracted and stored by Shopify, which might take a couple of minutes. + A new theme is always unpublished by default. To publish a theme when you create it, include + "role": "main" in the POST request. The theme will be published only after all + of its files have been extracted and stored by Shopify, which might take a couple of minutes. * * This function performs a `POST` to the `/admin/api/2020-04/themes.json` endpoint. * @@ -6788,9 +6788,9 @@ impl OnlineStore { } /** * Creates a theme by providing the public URL of a ZIP file that contains the theme. - A new theme is always unpublished by default. To publish a theme when you create it, include - "role": "main" in the POST request. The theme will be published only after all - of its files have been extracted and stored by Shopify, which might take a couple of minutes. + A new theme is always unpublished by default. To publish a theme when you create it, include + "role": "main" in the POST request. The theme will be published only after all + of its files have been extracted and stored by Shopify, which might take a couple of minutes. * * This function performs a `POST` to the `/admin/api/2020-07/themes.json` endpoint. * @@ -6942,9 +6942,9 @@ impl OnlineStore { } /** * Creates a theme by providing the public URL of a ZIP file that contains the theme. - A new theme is always unpublished by default. To publish a theme when you create it, include - "role": "main" in the POST request. The theme will be published only after all - of its files have been extracted and stored by Shopify, which might take a couple of minutes. + A new theme is always unpublished by default. To publish a theme when you create it, include + "role": "main" in the POST request. The theme will be published only after all + of its files have been extracted and stored by Shopify, which might take a couple of minutes. * * This function performs a `POST` to the `/admin/api/2020-10/themes.json` endpoint. * @@ -7092,9 +7092,9 @@ impl OnlineStore { } /** * Creates a theme by providing the public URL of a ZIP file that contains the theme. - A new theme is always unpublished by default. To publish a theme when you create it, include - "role": "main" in the POST request. The theme will be published only after all - of its files have been extracted and stored by Shopify, which might take a couple of minutes. + A new theme is always unpublished by default. To publish a theme when you create it, include + "role": "main" in the POST request. The theme will be published only after all + of its files have been extracted and stored by Shopify, which might take a couple of minutes. * * This function performs a `POST` to the `/admin/api/2021-01/themes.json` endpoint. * @@ -7246,9 +7246,9 @@ impl OnlineStore { } /** * Creates a theme by providing the public URL of a ZIP file that contains the theme. - A new theme is always unpublished by default. To publish a theme when you create it, include - "role": "main" in the POST request. The theme will be published only after all - of its files have been extracted and stored by Shopify, which might take a couple of minutes. + A new theme is always unpublished by default. To publish a theme when you create it, include + "role": "main" in the POST request. The theme will be published only after all + of its files have been extracted and stored by Shopify, which might take a couple of minutes. * * This function performs a `POST` to the `/admin/api/unstable/themes.json` endpoint. * diff --git a/shopify/src/orders.rs b/shopify/src/orders.rs index a8d00943..6f313be2 100644 --- a/shopify/src/orders.rs +++ b/shopify/src/orders.rs @@ -521,29 +521,29 @@ impl Orders { } /** * Creates an order. By default, product inventory is not claimed. - When you create an order, you can include the following option parameters in the body of the request: + When you create an order, you can include the following option parameters in the body of the request: - inventory_behaviour: The behaviour to use when updating inventory. (default: bypass) + inventory_behaviour: The behaviour to use when updating inventory. (default: bypass) - bypass: Do not claim inventory. - decrement_ignoring_policy: Ignore the product's inventory policy and claim inventory. - decrement_obeying_policy: Follow the product's inventory policy and claim inventory, if possible. + bypass: Do not claim inventory. + decrement_ignoring_policy: Ignore the product's inventory policy and claim inventory. + decrement_obeying_policy: Follow the product's inventory policy and claim inventory, if possible. - send_receipt: Whether to send an order confirmation to the customer. + send_receipt: Whether to send an order confirmation to the customer. - Note - If you're working on a private app and order confirmations are still being sent to the customer when send_receipt is set to false, then you need to disable the Storefront API from the private app's page in the Shopify admin. + Note + If you're working on a private app and order confirmations are still being sent to the customer when send_receipt is set to false, then you need to disable the Storefront API from the private app's page in the Shopify admin. - send_fulfillment_receipt: Whether to send a shipping confirmation to the customer. + send_fulfillment_receipt: Whether to send a shipping confirmation to the customer. - Note - If you are including shipping_address or billing_address, make sure to pass both - first_name and last_name. Otherwise both these addresses will be ignored. - If you're using this endpoint with a trial or Partner development store, then you can create no more than 5 new orders per minute. + Note + If you are including shipping_address or billing_address, make sure to pass both + first_name and last_name. Otherwise both these addresses will be ignored. + If you're using this endpoint with a trial or Partner development store, then you can create no more than 5 new orders per minute. * * This function performs a `POST` to the `/admin/api/2020-01/orders.json` endpoint. * @@ -813,28 +813,28 @@ impl Orders { .await } /** - * Caution + * Caution For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. Cancels an order. Orders that have a fulfillment object can't be canceled. - * - * This function performs a `POST` to the `/admin/api/2020-01/orders/{order_id}/cancel.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/orders/order#cancel-2020-01 - * - * **Parameters:** - * - * * `order_id: &str` -- storefront_access_token_id. - * * `amount: &str` -- The amount to refund. If set, Shopify attempts to void or refund the payment, depending on its status. Shopify refunds through a manual gateway in cases where the original transaction was not made in Shopify. Refunds through a manual gateway are recorded as a refund on Shopify, but the customer is not refunded. - * * `currency: &str` -- The currency of the refund that's issued when the order is canceled. Required for multi-currency orders whenever the amount property is provided. - * * `restock_deprecated: &str` -- Whether to restock refunded items back to your store's inventory. - * (default: false). - * * `reason: &str` -- The reason for the order cancellation. Valid values: customer, inventory, fraud, declined, and other.) - * (default: other). - * * `email: &str` -- Whether to send an email to the customer notifying them of the cancellation. - * (default: false). - * * `refund: &str` -- The refund transactions to perform. Required for some more complex refund situations. For more information, see the Refund API. - */ + * + * This function performs a `POST` to the `/admin/api/2020-01/orders/{order_id}/cancel.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/orders/order#cancel-2020-01 + * + * **Parameters:** + * + * * `order_id: &str` -- storefront_access_token_id. + * * `amount: &str` -- The amount to refund. If set, Shopify attempts to void or refund the payment, depending on its status. Shopify refunds through a manual gateway in cases where the original transaction was not made in Shopify. Refunds through a manual gateway are recorded as a refund on Shopify, but the customer is not refunded. + * * `currency: &str` -- The currency of the refund that's issued when the order is canceled. Required for multi-currency orders whenever the amount property is provided. + * * `restock_deprecated: &str` -- Whether to restock refunded items back to your store's inventory. + * (default: false). + * * `reason: &str` -- The reason for the order cancellation. Valid values: customer, inventory, fraud, declined, and other.) + * (default: other). + * * `email: &str` -- Whether to send an email to the customer notifying them of the cancellation. + * (default: false). + * * `refund: &str` -- The refund transactions to perform. Required for some more complex refund situations. For more information, see the Refund API. + */ pub async fn deprecated_202001_create_param_cancel( &self, order_id: &str, @@ -1020,29 +1020,29 @@ impl Orders { } /** * Creates an order. By default, product inventory is not claimed. - When you create an order, you can include the following option parameters in the body of the request: + When you create an order, you can include the following option parameters in the body of the request: - inventory_behaviour: The behaviour to use when updating inventory. (default: bypass) + inventory_behaviour: The behaviour to use when updating inventory. (default: bypass) - bypass: Do not claim inventory. - decrement_ignoring_policy: Ignore the product's inventory policy and claim inventory. - decrement_obeying_policy: Follow the product's inventory policy and claim inventory, if possible. + bypass: Do not claim inventory. + decrement_ignoring_policy: Ignore the product's inventory policy and claim inventory. + decrement_obeying_policy: Follow the product's inventory policy and claim inventory, if possible. - send_receipt: Whether to send an order confirmation to the customer. + send_receipt: Whether to send an order confirmation to the customer. - Note - If you're working on a private app and order confirmations are still being sent to the customer when send_receipt is set to false, then you need to disable the Storefront API from the private app's page in the Shopify admin. + Note + If you're working on a private app and order confirmations are still being sent to the customer when send_receipt is set to false, then you need to disable the Storefront API from the private app's page in the Shopify admin. - send_fulfillment_receipt: Whether to send a shipping confirmation to the customer. + send_fulfillment_receipt: Whether to send a shipping confirmation to the customer. - Note - If you are including shipping_address or billing_address, make sure to pass both - first_name and last_name. Otherwise both these addresses will be ignored. - If you're using this endpoint with a trial or Partner development store, then you can create no more than 5 new orders per minute. + Note + If you are including shipping_address or billing_address, make sure to pass both + first_name and last_name. Otherwise both these addresses will be ignored. + If you're using this endpoint with a trial or Partner development store, then you can create no more than 5 new orders per minute. * * This function performs a `POST` to the `/admin/api/2020-04/orders.json` endpoint. * @@ -1312,28 +1312,28 @@ impl Orders { .await } /** - * Caution + * Caution For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. Cancels an order. Orders that have a fulfillment object can't be canceled. - * - * This function performs a `POST` to the `/admin/api/2020-04/orders/{order_id}/cancel.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/orders/order#cancel-2020-04 - * - * **Parameters:** - * - * * `order_id: &str` -- storefront_access_token_id. - * * `amount: &str` -- The amount to refund. If set, Shopify attempts to void or refund the payment, depending on its status. Shopify refunds through a manual gateway in cases where the original transaction was not made in Shopify. Refunds through a manual gateway are recorded as a refund on Shopify, but the customer is not refunded. - * * `currency: &str` -- The currency of the refund that's issued when the order is canceled. Required for multi-currency orders whenever the amount property is provided. - * * `restock_deprecated: &str` -- Whether to restock refunded items back to your store's inventory. - * (default: false). - * * `reason: &str` -- The reason for the order cancellation. Valid values: customer, inventory, fraud, declined, and other.) - * (default: other). - * * `email: &str` -- Whether to send an email to the customer notifying them of the cancellation. - * (default: false). - * * `refund: &str` -- The refund transactions to perform. Required for some more complex refund situations. For more information, see the Refund API. - */ + * + * This function performs a `POST` to the `/admin/api/2020-04/orders/{order_id}/cancel.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/orders/order#cancel-2020-04 + * + * **Parameters:** + * + * * `order_id: &str` -- storefront_access_token_id. + * * `amount: &str` -- The amount to refund. If set, Shopify attempts to void or refund the payment, depending on its status. Shopify refunds through a manual gateway in cases where the original transaction was not made in Shopify. Refunds through a manual gateway are recorded as a refund on Shopify, but the customer is not refunded. + * * `currency: &str` -- The currency of the refund that's issued when the order is canceled. Required for multi-currency orders whenever the amount property is provided. + * * `restock_deprecated: &str` -- Whether to restock refunded items back to your store's inventory. + * (default: false). + * * `reason: &str` -- The reason for the order cancellation. Valid values: customer, inventory, fraud, declined, and other.) + * (default: other). + * * `email: &str` -- Whether to send an email to the customer notifying them of the cancellation. + * (default: false). + * * `refund: &str` -- The refund transactions to perform. Required for some more complex refund situations. For more information, see the Refund API. + */ pub async fn deprecated_202004_create_param_cancel( &self, order_id: &str, @@ -1618,8 +1618,8 @@ impl Orders { * Updates an order risk - Note - You cannot modify an order risk that was created by another application. + Note + You cannot modify an order risk that was created by another application. * * This function performs a `PUT` to the `/admin/api/2020-01/orders/{order_id}/risks/{risk_id}.json` endpoint. * @@ -1658,8 +1658,8 @@ impl Orders { * Deletes an order risk for an order - Note - You cannot delete an order risk that was created by another application. + Note + You cannot delete an order risk that was created by another application. * * This function performs a `DELETE` to the `/admin/api/2020-01/orders/{order_id}/risks/{risk_id}.json` endpoint. * @@ -1794,8 +1794,8 @@ impl Orders { * Updates an order risk - Note - You cannot modify an order risk that was created by another application. + Note + You cannot modify an order risk that was created by another application. * * This function performs a `PUT` to the `/admin/api/2020-04/orders/{order_id}/risks/{risk_id}.json` endpoint. * @@ -1834,8 +1834,8 @@ impl Orders { * Deletes an order risk for an order - Note - You cannot delete an order risk that was created by another application. + Note + You cannot delete an order risk that was created by another application. * * This function performs a `DELETE` to the `/admin/api/2020-04/orders/{order_id}/risks/{risk_id}.json` endpoint. * @@ -1970,8 +1970,8 @@ impl Orders { * Updates an order risk - Note - You cannot modify an order risk that was created by another application. + Note + You cannot modify an order risk that was created by another application. * * This function performs a `PUT` to the `/admin/api/2020-07/orders/{order_id}/risks/{risk_id}.json` endpoint. * @@ -2010,8 +2010,8 @@ impl Orders { * Deletes an order risk for an order - Note - You cannot delete an order risk that was created by another application. + Note + You cannot delete an order risk that was created by another application. * * This function performs a `DELETE` to the `/admin/api/2020-07/orders/{order_id}/risks/{risk_id}.json` endpoint. * @@ -2138,8 +2138,8 @@ impl Orders { * Updates an order risk - Note - You cannot modify an order risk that was created by another application. + Note + You cannot modify an order risk that was created by another application. * * This function performs a `PUT` to the `/admin/api/2020-10/orders/{order_id}/risks/{risk_id}.json` endpoint. * @@ -2178,8 +2178,8 @@ impl Orders { * Deletes an order risk for an order - Note - You cannot delete an order risk that was created by another application. + Note + You cannot delete an order risk that was created by another application. * * This function performs a `DELETE` to the `/admin/api/2020-10/orders/{order_id}/risks/{risk_id}.json` endpoint. * @@ -2310,8 +2310,8 @@ impl Orders { * Updates an order risk - Note - You cannot modify an order risk that was created by another application. + Note + You cannot modify an order risk that was created by another application. * * This function performs a `PUT` to the `/admin/api/2021-01/orders/{order_id}/risks/{risk_id}.json` endpoint. * @@ -2350,8 +2350,8 @@ impl Orders { * Deletes an order risk for an order - Note - You cannot delete an order risk that was created by another application. + Note + You cannot delete an order risk that was created by another application. * * This function performs a `DELETE` to the `/admin/api/2021-01/orders/{order_id}/risks/{risk_id}.json` endpoint. * @@ -2486,8 +2486,8 @@ impl Orders { * Updates an order risk - Note - You cannot modify an order risk that was created by another application. + Note + You cannot modify an order risk that was created by another application. * * This function performs a `PUT` to the `/admin/api/unstable/orders/{order_id}/risks/{risk_id}.json` endpoint. * @@ -2526,8 +2526,8 @@ impl Orders { * Deletes an order risk for an order - Note - You cannot delete an order risk that was created by another application. + Note + You cannot delete an order risk that was created by another application. * * This function performs a `DELETE` to the `/admin/api/unstable/orders/{order_id}/risks/{risk_id}.json` endpoint. * @@ -2615,13 +2615,13 @@ impl Orders { } /** * Caution - For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. + For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. - Creates a refund. Use the calculate endpoint to produce the transactions to submit. + Creates a refund. Use the calculate endpoint to produce the transactions to submit. - Note - When you use this endpoint with a Partner development store or a trial store, you can create only five refunds per minute. + Note + When you use this endpoint with a Partner development store or a trial store, you can create only five refunds per minute. * * This function performs a `POST` to the `/admin/api/2020-01/orders/{order_id}/refunds.json` endpoint. * @@ -2635,32 +2635,32 @@ impl Orders { * * `note: &str` -- An optional note attached to a refund. * * `discrepancy_reason: &str` -- An optional comment that explains a discrepancy between calculated and actual refund amounts. Used to populate the reason property of the resulting order adjustment object attached to the refund. Valid values: restock, damage, customer, and other. * * `shipping: &str` -- Specify how much shipping to refund. It has the following properties: - * - * full_refund: Whether to refund all remaining shipping. - * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. + * + * full_refund: Whether to refund all remaining shipping. + * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. * * `refund_line_items: &str` -- A list of line item IDs, quantities to refund, and restock instructions. Each entry has the following properties: - * - * line_item_id: The ID of a line item to refund. - * quantity: The quantity to refund. - * restock_type: How this refund line item affects inventory levels. Valid values: - * - * no_restock: Refunding these items won't affect inventory. - * cancel: The items have not yet been fulfilled. - * The canceled quantity will be added back to the available count. - * The number of fulfillable units for this line item will decrease. - * return: The items were already delivered but will be returned to the merchant. - * The returned quantity will be added back to the available count. The number of fulfillable units for this - * line item will remain unchanged. - * - * - * location_id: The ID of the location where the items should be - * restocked. This is required when the value of restock_type is return or cancel. - * If the item is not already stocked at the location, then - * the item is connected to the location. An error is returned when the item is connected to - * a - * fulfillment service location and a different location is provided. + * + * line_item_id: The ID of a line item to refund. + * quantity: The quantity to refund. + * restock_type: How this refund line item affects inventory levels. Valid values: + * + * no_restock: Refunding these items won't affect inventory. + * cancel: The items have not yet been fulfilled. + * The canceled quantity will be added back to the available count. + * The number of fulfillable units for this line item will decrease. + * return: The items were already delivered but will be returned to the merchant. + * The returned quantity will be added back to the available count. The number of fulfillable units for this + * line item will remain unchanged. + * + * + * location_id: The ID of the location where the items should be + * restocked. This is required when the value of restock_type is return or cancel. + * If the item is not already stocked at the location, then + * the item is connected to the location. An error is returned when the item is connected to + * a + * fulfillment service location and a different location is provided. * * `transactions: &str` -- A list of transactions - * to process as refunds. + * to process as refunds. * * `currency: &str` -- The three-letter code (ISO 4217 format) for the currency used for the refund. */ pub async fn deprecated_202001_create_param_refunds( @@ -2782,15 +2782,15 @@ impl Orders { } /** * Caution - For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. + For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. - Calculates refund transactions based on line items and shipping. When you want to create a refund, - you should first use the calculate endpoint to generate accurate refund transactions. Specify the line items - that are being refunded, their quantity and restock instructions, and whether you intend to refund - shipping costs. If the restock instructions can't be met—for example, because you try to return more items than have been - fulfilled—then the endpoint returns modified restock instructions. You can then use the response in the body of the request to create the actual refund. - The response includes a transactions object with "kind": "suggested_refund", - which must to be changed to "kind" : "refund" for the refund to be accepted. + Calculates refund transactions based on line items and shipping. When you want to create a refund, + you should first use the calculate endpoint to generate accurate refund transactions. Specify the line items + that are being refunded, their quantity and restock instructions, and whether you intend to refund + shipping costs. If the restock instructions can't be met—for example, because you try to return more items than have been + fulfilled—then the endpoint returns modified restock instructions. You can then use the response in the body of the request to create the actual refund. + The response includes a transactions object with "kind": "suggested_refund", + which must to be changed to "kind" : "refund" for the refund to be accepted. * * This function performs a `POST` to the `/admin/api/2020-01/orders/{order_id}/refunds/calculate.json` endpoint. * @@ -2800,33 +2800,33 @@ impl Orders { * * * `order_id: &str` -- storefront_access_token_id. * * `shipping: &str` -- Specify how much shipping to refund. It has the following properties: - * - * full_refund: Whether to refund all remaining shipping. - * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. + * + * full_refund: Whether to refund all remaining shipping. + * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. * * `refund_line_items: &str` -- A list of line item IDs, quantities to refund, and restock instructions. Each entry has the following properties: - * - * line_item_id: The ID of a line item to refund. - * quantity: The quantity to refund. - * restock_type: How this refund line item affects inventory levels. Valid values: - * - * no_restock: Refunding these items won't affect inventory. - * cancel: The items have not yet been fulfilled. The canceled quantity will be added - * back to the available count. The number of fulfillable units for this line item will decrease. - * return: The items were already delivered but will be returned to the merchant. - * The returned quantity will be added back to the available count. - * The number of fulfillable units for this line item will remain unchanged. - * - * - * location_id: The ID of the location - * where the items should be restocked. If location_id is not provided and the value of - * restock_type is return or cancel, then the endpoint returns a suitable - * location ID. - * - * already_stocked: Whether the item is already stocked at - * the location. If this is false, then creating the refund will connect the item to the location and start - * stocking it there. + * + * line_item_id: The ID of a line item to refund. + * quantity: The quantity to refund. + * restock_type: How this refund line item affects inventory levels. Valid values: + * + * no_restock: Refunding these items won't affect inventory. + * cancel: The items have not yet been fulfilled. The canceled quantity will be added + * back to the available count. The number of fulfillable units for this line item will decrease. + * return: The items were already delivered but will be returned to the merchant. + * The returned quantity will be added back to the available count. + * The number of fulfillable units for this line item will remain unchanged. + * + * + * location_id: The ID of the location + * where the items should be restocked. If location_id is not provided and the value of + * restock_type is return or cancel, then the endpoint returns a suitable + * location ID. + * + * already_stocked: Whether the item is already stocked at + * the location. If this is false, then creating the refund will connect the item to the location and start + * stocking it there. * * `currency: &str` -- The three-letter code (ISO 4217 format) for the - * currency used for the refund. Note: Required whenever the shipping amount property is provided. + * currency used for the refund. Note: Required whenever the shipping amount property is provided. */ pub async fn deprecated_202001_create_param_refunds_calculate( &self, @@ -2922,13 +2922,13 @@ impl Orders { } /** * Caution - For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. + For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. - Creates a refund. Use the calculate endpoint to produce the transactions to submit. + Creates a refund. Use the calculate endpoint to produce the transactions to submit. - Note - When you use this endpoint with a Partner development store or a trial store, you can create only five refunds per minute. + Note + When you use this endpoint with a Partner development store or a trial store, you can create only five refunds per minute. * * This function performs a `POST` to the `/admin/api/2020-04/orders/{order_id}/refunds.json` endpoint. * @@ -2942,32 +2942,32 @@ impl Orders { * * `note: &str` -- An optional note attached to a refund. * * `discrepancy_reason: &str` -- An optional comment that explains a discrepancy between calculated and actual refund amounts. Used to populate the reason property of the resulting order adjustment object attached to the refund. Valid values: restock, damage, customer, and other. * * `shipping: &str` -- Specify how much shipping to refund. It has the following properties: - * - * full_refund: Whether to refund all remaining shipping. - * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. + * + * full_refund: Whether to refund all remaining shipping. + * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. * * `refund_line_items: &str` -- A list of line item IDs, quantities to refund, and restock instructions. Each entry has the following properties: - * - * line_item_id: The ID of a line item to refund. - * quantity: The quantity to refund. - * restock_type: How this refund line item affects inventory levels. Valid values: - * - * no_restock: Refunding these items won't affect inventory. - * cancel: The items have not yet been fulfilled. - * The canceled quantity will be added back to the available count. - * The number of fulfillable units for this line item will decrease. - * return: The items were already delivered but will be returned to the merchant. - * The returned quantity will be added back to the available count. The number of fulfillable units for this - * line item will remain unchanged. - * - * - * location_id: The ID of the location where the items should be - * restocked. This is required when the value of restock_type is return or cancel. - * If the item is not already stocked at the location, then - * the item is connected to the location. An error is returned when the item is connected to - * a - * fulfillment service location and a different location is provided. + * + * line_item_id: The ID of a line item to refund. + * quantity: The quantity to refund. + * restock_type: How this refund line item affects inventory levels. Valid values: + * + * no_restock: Refunding these items won't affect inventory. + * cancel: The items have not yet been fulfilled. + * The canceled quantity will be added back to the available count. + * The number of fulfillable units for this line item will decrease. + * return: The items were already delivered but will be returned to the merchant. + * The returned quantity will be added back to the available count. The number of fulfillable units for this + * line item will remain unchanged. + * + * + * location_id: The ID of the location where the items should be + * restocked. This is required when the value of restock_type is return or cancel. + * If the item is not already stocked at the location, then + * the item is connected to the location. An error is returned when the item is connected to + * a + * fulfillment service location and a different location is provided. * * `transactions: &str` -- A list of transactions - * to process as refunds. + * to process as refunds. * * `currency: &str` -- The three-letter code (ISO 4217 format) for the currency used for the refund. */ pub async fn deprecated_202004_create_param_refunds( @@ -3089,15 +3089,15 @@ impl Orders { } /** * Caution - For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. + For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. - Calculates refund transactions based on line items and shipping. When you want to create a refund, - you should first use the calculate endpoint to generate accurate refund transactions. Specify the line items - that are being refunded, their quantity and restock instructions, and whether you intend to refund - shipping costs. If the restock instructions can't be met—for example, because you try to return more items than have been - fulfilled—then the endpoint returns modified restock instructions. You can then use the response in the body of the request to create the actual refund. - The response includes a transactions object with "kind": "suggested_refund", - which must to be changed to "kind" : "refund" for the refund to be accepted. + Calculates refund transactions based on line items and shipping. When you want to create a refund, + you should first use the calculate endpoint to generate accurate refund transactions. Specify the line items + that are being refunded, their quantity and restock instructions, and whether you intend to refund + shipping costs. If the restock instructions can't be met—for example, because you try to return more items than have been + fulfilled—then the endpoint returns modified restock instructions. You can then use the response in the body of the request to create the actual refund. + The response includes a transactions object with "kind": "suggested_refund", + which must to be changed to "kind" : "refund" for the refund to be accepted. * * This function performs a `POST` to the `/admin/api/2020-04/orders/{order_id}/refunds/calculate.json` endpoint. * @@ -3107,33 +3107,33 @@ impl Orders { * * * `order_id: &str` -- storefront_access_token_id. * * `shipping: &str` -- Specify how much shipping to refund. It has the following properties: - * - * full_refund: Whether to refund all remaining shipping. - * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. + * + * full_refund: Whether to refund all remaining shipping. + * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. * * `refund_line_items: &str` -- A list of line item IDs, quantities to refund, and restock instructions. Each entry has the following properties: - * - * line_item_id: The ID of a line item to refund. - * quantity: The quantity to refund. - * restock_type: How this refund line item affects inventory levels. Valid values: - * - * no_restock: Refunding these items won't affect inventory. - * cancel: The items have not yet been fulfilled. The canceled quantity will be added - * back to the available count. The number of fulfillable units for this line item will decrease. - * return: The items were already delivered but will be returned to the merchant. - * The returned quantity will be added back to the available count. - * The number of fulfillable units for this line item will remain unchanged. - * - * - * location_id: The ID of the location - * where the items should be restocked. If location_id is not provided and the value of - * restock_type is return or cancel, then the endpoint returns a suitable - * location ID. - * - * already_stocked: Whether the item is already stocked at - * the location. If this is false, then creating the refund will connect the item to the location and start - * stocking it there. + * + * line_item_id: The ID of a line item to refund. + * quantity: The quantity to refund. + * restock_type: How this refund line item affects inventory levels. Valid values: + * + * no_restock: Refunding these items won't affect inventory. + * cancel: The items have not yet been fulfilled. The canceled quantity will be added + * back to the available count. The number of fulfillable units for this line item will decrease. + * return: The items were already delivered but will be returned to the merchant. + * The returned quantity will be added back to the available count. + * The number of fulfillable units for this line item will remain unchanged. + * + * + * location_id: The ID of the location + * where the items should be restocked. If location_id is not provided and the value of + * restock_type is return or cancel, then the endpoint returns a suitable + * location ID. + * + * already_stocked: Whether the item is already stocked at + * the location. If this is false, then creating the refund will connect the item to the location and start + * stocking it there. * * `currency: &str` -- The three-letter code (ISO 4217 format) for the - * currency used for the refund. Note: Required whenever the shipping amount property is provided. + * currency used for the refund. Note: Required whenever the shipping amount property is provided. */ pub async fn deprecated_202004_create_param_refunds_calculate( &self, @@ -3229,13 +3229,13 @@ impl Orders { } /** * Caution - For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. + For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. - Creates a refund. Use the calculate endpoint to produce the transactions to submit. + Creates a refund. Use the calculate endpoint to produce the transactions to submit. - Note - When you use this endpoint with a Partner development store or a trial store, you can create only five refunds per minute. + Note + When you use this endpoint with a Partner development store or a trial store, you can create only five refunds per minute. * * This function performs a `POST` to the `/admin/api/2020-07/orders/{order_id}/refunds.json` endpoint. * @@ -3249,32 +3249,32 @@ impl Orders { * * `note: &str` -- An optional note attached to a refund. * * `discrepancy_reason: &str` -- An optional comment that explains a discrepancy between calculated and actual refund amounts. Used to populate the reason property of the resulting order adjustment object attached to the refund. Valid values: restock, damage, customer, and other. * * `shipping: &str` -- Specify how much shipping to refund. It has the following properties: - * - * full_refund: Whether to refund all remaining shipping. - * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. + * + * full_refund: Whether to refund all remaining shipping. + * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. * * `refund_line_items: &str` -- A list of line item IDs, quantities to refund, and restock instructions. Each entry has the following properties: - * - * line_item_id: The ID of a line item to refund. - * quantity: The quantity to refund. - * restock_type: How this refund line item affects inventory levels. Valid values: - * - * no_restock: Refunding these items won't affect inventory. - * cancel: The items have not yet been fulfilled. - * The canceled quantity will be added back to the available count. - * The number of fulfillable units for this line item will decrease. - * return: The items were already delivered but will be returned to the merchant. - * The returned quantity will be added back to the available count. The number of fulfillable units for this - * line item will remain unchanged. - * - * - * location_id: The ID of the location where the items should be - * restocked. This is required when the value of restock_type is return or cancel. - * If the item is not already stocked at the location, then - * the item is connected to the location. An error is returned when the item is connected to - * a - * fulfillment service location and a different location is provided. + * + * line_item_id: The ID of a line item to refund. + * quantity: The quantity to refund. + * restock_type: How this refund line item affects inventory levels. Valid values: + * + * no_restock: Refunding these items won't affect inventory. + * cancel: The items have not yet been fulfilled. + * The canceled quantity will be added back to the available count. + * The number of fulfillable units for this line item will decrease. + * return: The items were already delivered but will be returned to the merchant. + * The returned quantity will be added back to the available count. The number of fulfillable units for this + * line item will remain unchanged. + * + * + * location_id: The ID of the location where the items should be + * restocked. This is required when the value of restock_type is return or cancel. + * If the item is not already stocked at the location, then + * the item is connected to the location. An error is returned when the item is connected to + * a + * fulfillment service location and a different location is provided. * * `transactions: &str` -- A list of transactions - * to process as refunds. + * to process as refunds. * * `currency: &str` -- The three-letter code (ISO 4217 format) for the currency used for the refund. */ pub async fn deprecated_202007_create_param_refunds( @@ -3396,15 +3396,15 @@ impl Orders { } /** * Caution - For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. + For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. - Calculates refund transactions based on line items and shipping. When you want to create a refund, - you should first use the calculate endpoint to generate accurate refund transactions. Specify the line items - that are being refunded, their quantity and restock instructions, and whether you intend to refund - shipping costs. If the restock instructions can't be met—for example, because you try to return more items than have been - fulfilled—then the endpoint returns modified restock instructions. You can then use the response in the body of the request to create the actual refund. - The response includes a transactions object with "kind": "suggested_refund", - which must to be changed to "kind" : "refund" for the refund to be accepted. + Calculates refund transactions based on line items and shipping. When you want to create a refund, + you should first use the calculate endpoint to generate accurate refund transactions. Specify the line items + that are being refunded, their quantity and restock instructions, and whether you intend to refund + shipping costs. If the restock instructions can't be met—for example, because you try to return more items than have been + fulfilled—then the endpoint returns modified restock instructions. You can then use the response in the body of the request to create the actual refund. + The response includes a transactions object with "kind": "suggested_refund", + which must to be changed to "kind" : "refund" for the refund to be accepted. * * This function performs a `POST` to the `/admin/api/2020-07/orders/{order_id}/refunds/calculate.json` endpoint. * @@ -3414,33 +3414,33 @@ impl Orders { * * * `order_id: &str` -- storefront_access_token_id. * * `shipping: &str` -- Specify how much shipping to refund. It has the following properties: - * - * full_refund: Whether to refund all remaining shipping. - * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. + * + * full_refund: Whether to refund all remaining shipping. + * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. * * `refund_line_items: &str` -- A list of line item IDs, quantities to refund, and restock instructions. Each entry has the following properties: - * - * line_item_id: The ID of a line item to refund. - * quantity: The quantity to refund. - * restock_type: How this refund line item affects inventory levels. Valid values: - * - * no_restock: Refunding these items won't affect inventory. - * cancel: The items have not yet been fulfilled. The canceled quantity will be added - * back to the available count. The number of fulfillable units for this line item will decrease. - * return: The items were already delivered but will be returned to the merchant. - * The returned quantity will be added back to the available count. - * The number of fulfillable units for this line item will remain unchanged. - * - * - * location_id: The ID of the location - * where the items should be restocked. If location_id is not provided and the value of - * restock_type is return or cancel, then the endpoint returns a suitable - * location ID. - * - * already_stocked: Whether the item is already stocked at - * the location. If this is false, then creating the refund will connect the item to the location and start - * stocking it there. + * + * line_item_id: The ID of a line item to refund. + * quantity: The quantity to refund. + * restock_type: How this refund line item affects inventory levels. Valid values: + * + * no_restock: Refunding these items won't affect inventory. + * cancel: The items have not yet been fulfilled. The canceled quantity will be added + * back to the available count. The number of fulfillable units for this line item will decrease. + * return: The items were already delivered but will be returned to the merchant. + * The returned quantity will be added back to the available count. + * The number of fulfillable units for this line item will remain unchanged. + * + * + * location_id: The ID of the location + * where the items should be restocked. If location_id is not provided and the value of + * restock_type is return or cancel, then the endpoint returns a suitable + * location ID. + * + * already_stocked: Whether the item is already stocked at + * the location. If this is false, then creating the refund will connect the item to the location and start + * stocking it there. * * `currency: &str` -- The three-letter code (ISO 4217 format) for the - * currency used for the refund. Note: Required whenever the shipping amount property is provided. + * currency used for the refund. Note: Required whenever the shipping amount property is provided. */ pub async fn deprecated_202007_create_param_refunds_calculate( &self, @@ -3536,13 +3536,13 @@ impl Orders { } /** * Caution - For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. + For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. - Creates a refund. Use the calculate endpoint to produce the transactions to submit. + Creates a refund. Use the calculate endpoint to produce the transactions to submit. - Note - When you use this endpoint with a Partner development store or a trial store, you can create only five refunds per minute. + Note + When you use this endpoint with a Partner development store or a trial store, you can create only five refunds per minute. * * This function performs a `POST` to the `/admin/api/2020-10/orders/{order_id}/refunds.json` endpoint. * @@ -3556,32 +3556,32 @@ impl Orders { * * `note: &str` -- An optional note attached to a refund. * * `discrepancy_reason: &str` -- An optional comment that explains a discrepancy between calculated and actual refund amounts. Used to populate the reason property of the resulting order adjustment object attached to the refund. Valid values: restock, damage, customer, and other. * * `shipping: &str` -- Specify how much shipping to refund. It has the following properties: - * - * full_refund: Whether to refund all remaining shipping. - * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. + * + * full_refund: Whether to refund all remaining shipping. + * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. * * `refund_line_items: &str` -- A list of line item IDs, quantities to refund, and restock instructions. Each entry has the following properties: - * - * line_item_id: The ID of a line item to refund. - * quantity: The quantity to refund. - * restock_type: How this refund line item affects inventory levels. Valid values: - * - * no_restock: Refunding these items won't affect inventory. - * cancel: The items have not yet been fulfilled. - * The canceled quantity will be added back to the available count. - * The number of fulfillable units for this line item will decrease. - * return: The items were already delivered but will be returned to the merchant. - * The returned quantity will be added back to the available count. The number of fulfillable units for this - * line item will remain unchanged. - * - * - * location_id: The ID of the location where the items should be - * restocked. This is required when the value of restock_type is return or cancel. - * If the item is not already stocked at the location, then - * the item is connected to the location. An error is returned when the item is connected to - * a - * fulfillment service location and a different location is provided. + * + * line_item_id: The ID of a line item to refund. + * quantity: The quantity to refund. + * restock_type: How this refund line item affects inventory levels. Valid values: + * + * no_restock: Refunding these items won't affect inventory. + * cancel: The items have not yet been fulfilled. + * The canceled quantity will be added back to the available count. + * The number of fulfillable units for this line item will decrease. + * return: The items were already delivered but will be returned to the merchant. + * The returned quantity will be added back to the available count. The number of fulfillable units for this + * line item will remain unchanged. + * + * + * location_id: The ID of the location where the items should be + * restocked. This is required when the value of restock_type is return or cancel. + * If the item is not already stocked at the location, then + * the item is connected to the location. An error is returned when the item is connected to + * a + * fulfillment service location and a different location is provided. * * `transactions: &str` -- A list of transactions - * to process as refunds. + * to process as refunds. * * `currency: &str` -- The three-letter code (ISO 4217 format) for the currency used for the refund. */ pub async fn create_param_refunds( @@ -3703,15 +3703,15 @@ impl Orders { } /** * Caution - For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. + For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. - Calculates refund transactions based on line items and shipping. When you want to create a refund, - you should first use the calculate endpoint to generate accurate refund transactions. Specify the line items - that are being refunded, their quantity and restock instructions, and whether you intend to refund - shipping costs. If the restock instructions can't be met—for example, because you try to return more items than have been - fulfilled—then the endpoint returns modified restock instructions. You can then use the response in the body of the request to create the actual refund. - The response includes a transactions object with "kind": "suggested_refund", - which must to be changed to "kind" : "refund" for the refund to be accepted. + Calculates refund transactions based on line items and shipping. When you want to create a refund, + you should first use the calculate endpoint to generate accurate refund transactions. Specify the line items + that are being refunded, their quantity and restock instructions, and whether you intend to refund + shipping costs. If the restock instructions can't be met—for example, because you try to return more items than have been + fulfilled—then the endpoint returns modified restock instructions. You can then use the response in the body of the request to create the actual refund. + The response includes a transactions object with "kind": "suggested_refund", + which must to be changed to "kind" : "refund" for the refund to be accepted. * * This function performs a `POST` to the `/admin/api/2020-10/orders/{order_id}/refunds/calculate.json` endpoint. * @@ -3721,33 +3721,33 @@ impl Orders { * * * `order_id: &str` -- storefront_access_token_id. * * `shipping: &str` -- Specify how much shipping to refund. It has the following properties: - * - * full_refund: Whether to refund all remaining shipping. - * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. + * + * full_refund: Whether to refund all remaining shipping. + * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. * * `refund_line_items: &str` -- A list of line item IDs, quantities to refund, and restock instructions. Each entry has the following properties: - * - * line_item_id: The ID of a line item to refund. - * quantity: The quantity to refund. - * restock_type: How this refund line item affects inventory levels. Valid values: - * - * no_restock: Refunding these items won't affect inventory. - * cancel: The items have not yet been fulfilled. The canceled quantity will be added - * back to the available count. The number of fulfillable units for this line item will decrease. - * return: The items were already delivered but will be returned to the merchant. - * The returned quantity will be added back to the available count. - * The number of fulfillable units for this line item will remain unchanged. - * - * - * location_id: The ID of the location - * where the items should be restocked. If location_id is not provided and the value of - * restock_type is return or cancel, then the endpoint returns a suitable - * location ID. - * - * already_stocked: Whether the item is already stocked at - * the location. If this is false, then creating the refund will connect the item to the location and start - * stocking it there. + * + * line_item_id: The ID of a line item to refund. + * quantity: The quantity to refund. + * restock_type: How this refund line item affects inventory levels. Valid values: + * + * no_restock: Refunding these items won't affect inventory. + * cancel: The items have not yet been fulfilled. The canceled quantity will be added + * back to the available count. The number of fulfillable units for this line item will decrease. + * return: The items were already delivered but will be returned to the merchant. + * The returned quantity will be added back to the available count. + * The number of fulfillable units for this line item will remain unchanged. + * + * + * location_id: The ID of the location + * where the items should be restocked. If location_id is not provided and the value of + * restock_type is return or cancel, then the endpoint returns a suitable + * location ID. + * + * already_stocked: Whether the item is already stocked at + * the location. If this is false, then creating the refund will connect the item to the location and start + * stocking it there. * * `currency: &str` -- The three-letter code (ISO 4217 format) for the - * currency used for the refund. Note: Required whenever the shipping amount property is provided. + * currency used for the refund. Note: Required whenever the shipping amount property is provided. */ pub async fn create_param_refunds_calculate( &self, @@ -3843,13 +3843,13 @@ impl Orders { } /** * Caution - For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. + For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. - Creates a refund. Use the calculate endpoint to produce the transactions to submit. + Creates a refund. Use the calculate endpoint to produce the transactions to submit. - Note - When you use this endpoint with a Partner development store or a trial store, you can create only five refunds per minute. + Note + When you use this endpoint with a Partner development store or a trial store, you can create only five refunds per minute. * * This function performs a `POST` to the `/admin/api/2021-01/orders/{order_id}/refunds.json` endpoint. * @@ -3863,32 +3863,32 @@ impl Orders { * * `note: &str` -- An optional note attached to a refund. * * `discrepancy_reason: &str` -- An optional comment that explains a discrepancy between calculated and actual refund amounts. Used to populate the reason property of the resulting order adjustment object attached to the refund. Valid values: restock, damage, customer, and other. * * `shipping: &str` -- Specify how much shipping to refund. It has the following properties: - * - * full_refund: Whether to refund all remaining shipping. - * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. + * + * full_refund: Whether to refund all remaining shipping. + * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. * * `refund_line_items: &str` -- A list of line item IDs, quantities to refund, and restock instructions. Each entry has the following properties: - * - * line_item_id: The ID of a line item to refund. - * quantity: The quantity to refund. - * restock_type: How this refund line item affects inventory levels. Valid values: - * - * no_restock: Refunding these items won't affect inventory. - * cancel: The items have not yet been fulfilled. - * The canceled quantity will be added back to the available count. - * The number of fulfillable units for this line item will decrease. - * return: The items were already delivered but will be returned to the merchant. - * The returned quantity will be added back to the available count. The number of fulfillable units for this - * line item will remain unchanged. - * - * - * location_id: The ID of the location where the items should be - * restocked. This is required when the value of restock_type is return or cancel. - * If the item is not already stocked at the location, then - * the item is connected to the location. An error is returned when the item is connected to - * a - * fulfillment service location and a different location is provided. + * + * line_item_id: The ID of a line item to refund. + * quantity: The quantity to refund. + * restock_type: How this refund line item affects inventory levels. Valid values: + * + * no_restock: Refunding these items won't affect inventory. + * cancel: The items have not yet been fulfilled. + * The canceled quantity will be added back to the available count. + * The number of fulfillable units for this line item will decrease. + * return: The items were already delivered but will be returned to the merchant. + * The returned quantity will be added back to the available count. The number of fulfillable units for this + * line item will remain unchanged. + * + * + * location_id: The ID of the location where the items should be + * restocked. This is required when the value of restock_type is return or cancel. + * If the item is not already stocked at the location, then + * the item is connected to the location. An error is returned when the item is connected to + * a + * fulfillment service location and a different location is provided. * * `transactions: &str` -- A list of transactions - * to process as refunds. + * to process as refunds. * * `currency: &str` -- The three-letter code (ISO 4217 format) for the currency used for the refund. */ pub async fn deprecated_202101_create_param_refunds( @@ -4010,15 +4010,15 @@ impl Orders { } /** * Caution - For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. + For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. - Calculates refund transactions based on line items and shipping. When you want to create a refund, - you should first use the calculate endpoint to generate accurate refund transactions. Specify the line items - that are being refunded, their quantity and restock instructions, and whether you intend to refund - shipping costs. If the restock instructions can't be met—for example, because you try to return more items than have been - fulfilled—then the endpoint returns modified restock instructions. You can then use the response in the body of the request to create the actual refund. - The response includes a transactions object with "kind": "suggested_refund", - which must to be changed to "kind" : "refund" for the refund to be accepted. + Calculates refund transactions based on line items and shipping. When you want to create a refund, + you should first use the calculate endpoint to generate accurate refund transactions. Specify the line items + that are being refunded, their quantity and restock instructions, and whether you intend to refund + shipping costs. If the restock instructions can't be met—for example, because you try to return more items than have been + fulfilled—then the endpoint returns modified restock instructions. You can then use the response in the body of the request to create the actual refund. + The response includes a transactions object with "kind": "suggested_refund", + which must to be changed to "kind" : "refund" for the refund to be accepted. * * This function performs a `POST` to the `/admin/api/2021-01/orders/{order_id}/refunds/calculate.json` endpoint. * @@ -4028,33 +4028,33 @@ impl Orders { * * * `order_id: &str` -- storefront_access_token_id. * * `shipping: &str` -- Specify how much shipping to refund. It has the following properties: - * - * full_refund: Whether to refund all remaining shipping. - * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. + * + * full_refund: Whether to refund all remaining shipping. + * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. * * `refund_line_items: &str` -- A list of line item IDs, quantities to refund, and restock instructions. Each entry has the following properties: - * - * line_item_id: The ID of a line item to refund. - * quantity: The quantity to refund. - * restock_type: How this refund line item affects inventory levels. Valid values: - * - * no_restock: Refunding these items won't affect inventory. - * cancel: The items have not yet been fulfilled. The canceled quantity will be added - * back to the available count. The number of fulfillable units for this line item will decrease. - * return: The items were already delivered but will be returned to the merchant. - * The returned quantity will be added back to the available count. - * The number of fulfillable units for this line item will remain unchanged. - * - * - * location_id: The ID of the location - * where the items should be restocked. If location_id is not provided and the value of - * restock_type is return or cancel, then the endpoint returns a suitable - * location ID. - * - * already_stocked: Whether the item is already stocked at - * the location. If this is false, then creating the refund will connect the item to the location and start - * stocking it there. + * + * line_item_id: The ID of a line item to refund. + * quantity: The quantity to refund. + * restock_type: How this refund line item affects inventory levels. Valid values: + * + * no_restock: Refunding these items won't affect inventory. + * cancel: The items have not yet been fulfilled. The canceled quantity will be added + * back to the available count. The number of fulfillable units for this line item will decrease. + * return: The items were already delivered but will be returned to the merchant. + * The returned quantity will be added back to the available count. + * The number of fulfillable units for this line item will remain unchanged. + * + * + * location_id: The ID of the location + * where the items should be restocked. If location_id is not provided and the value of + * restock_type is return or cancel, then the endpoint returns a suitable + * location ID. + * + * already_stocked: Whether the item is already stocked at + * the location. If this is false, then creating the refund will connect the item to the location and start + * stocking it there. * * `currency: &str` -- The three-letter code (ISO 4217 format) for the - * currency used for the refund. Note: Required whenever the shipping amount property is provided. + * currency used for the refund. Note: Required whenever the shipping amount property is provided. */ pub async fn deprecated_202101_create_param_refunds_calculate( &self, @@ -4150,13 +4150,13 @@ impl Orders { } /** * Caution - For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. + For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. - Creates a refund. Use the calculate endpoint to produce the transactions to submit. + Creates a refund. Use the calculate endpoint to produce the transactions to submit. - Note - When you use this endpoint with a Partner development store or a trial store, you can create only five refunds per minute. + Note + When you use this endpoint with a Partner development store or a trial store, you can create only five refunds per minute. * * This function performs a `POST` to the `/admin/api/unstable/orders/{order_id}/refunds.json` endpoint. * @@ -4170,32 +4170,32 @@ impl Orders { * * `note: &str` -- An optional note attached to a refund. * * `discrepancy_reason: &str` -- An optional comment that explains a discrepancy between calculated and actual refund amounts. Used to populate the reason property of the resulting order adjustment object attached to the refund. Valid values: restock, damage, customer, and other. * * `shipping: &str` -- Specify how much shipping to refund. It has the following properties: - * - * full_refund: Whether to refund all remaining shipping. - * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. + * + * full_refund: Whether to refund all remaining shipping. + * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. * * `refund_line_items: &str` -- A list of line item IDs, quantities to refund, and restock instructions. Each entry has the following properties: - * - * line_item_id: The ID of a line item to refund. - * quantity: The quantity to refund. - * restock_type: How this refund line item affects inventory levels. Valid values: - * - * no_restock: Refunding these items won't affect inventory. - * cancel: The items have not yet been fulfilled. - * The canceled quantity will be added back to the available count. - * The number of fulfillable units for this line item will decrease. - * return: The items were already delivered but will be returned to the merchant. - * The returned quantity will be added back to the available count. The number of fulfillable units for this - * line item will remain unchanged. - * - * - * location_id: The ID of the location where the items should be - * restocked. This is required when the value of restock_type is return or cancel. - * If the item is not already stocked at the location, then - * the item is connected to the location. An error is returned when the item is connected to - * a - * fulfillment service location and a different location is provided. + * + * line_item_id: The ID of a line item to refund. + * quantity: The quantity to refund. + * restock_type: How this refund line item affects inventory levels. Valid values: + * + * no_restock: Refunding these items won't affect inventory. + * cancel: The items have not yet been fulfilled. + * The canceled quantity will be added back to the available count. + * The number of fulfillable units for this line item will decrease. + * return: The items were already delivered but will be returned to the merchant. + * The returned quantity will be added back to the available count. The number of fulfillable units for this + * line item will remain unchanged. + * + * + * location_id: The ID of the location where the items should be + * restocked. This is required when the value of restock_type is return or cancel. + * If the item is not already stocked at the location, then + * the item is connected to the location. An error is returned when the item is connected to + * a + * fulfillment service location and a different location is provided. * * `transactions: &str` -- A list of transactions - * to process as refunds. + * to process as refunds. * * `currency: &str` -- The three-letter code (ISO 4217 format) for the currency used for the refund. */ pub async fn deprecated_unstable_create_param_refunds( @@ -4317,15 +4317,15 @@ impl Orders { } /** * Caution - For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. + For multi-currency orders, the currency property is required whenever the amount property is provided. For more information, see Migrating to support multiple currencies. - Calculates refund transactions based on line items and shipping. When you want to create a refund, - you should first use the calculate endpoint to generate accurate refund transactions. Specify the line items - that are being refunded, their quantity and restock instructions, and whether you intend to refund - shipping costs. If the restock instructions can't be met—for example, because you try to return more items than have been - fulfilled—then the endpoint returns modified restock instructions. You can then use the response in the body of the request to create the actual refund. - The response includes a transactions object with "kind": "suggested_refund", - which must to be changed to "kind" : "refund" for the refund to be accepted. + Calculates refund transactions based on line items and shipping. When you want to create a refund, + you should first use the calculate endpoint to generate accurate refund transactions. Specify the line items + that are being refunded, their quantity and restock instructions, and whether you intend to refund + shipping costs. If the restock instructions can't be met—for example, because you try to return more items than have been + fulfilled—then the endpoint returns modified restock instructions. You can then use the response in the body of the request to create the actual refund. + The response includes a transactions object with "kind": "suggested_refund", + which must to be changed to "kind" : "refund" for the refund to be accepted. * * This function performs a `POST` to the `/admin/api/unstable/orders/{order_id}/refunds/calculate.json` endpoint. * @@ -4335,33 +4335,33 @@ impl Orders { * * * `order_id: &str` -- storefront_access_token_id. * * `shipping: &str` -- Specify how much shipping to refund. It has the following properties: - * - * full_refund: Whether to refund all remaining shipping. - * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. + * + * full_refund: Whether to refund all remaining shipping. + * amount: Set a specific amount to refund for shipping. Takes precedence over full_refund. * * `refund_line_items: &str` -- A list of line item IDs, quantities to refund, and restock instructions. Each entry has the following properties: - * - * line_item_id: The ID of a line item to refund. - * quantity: The quantity to refund. - * restock_type: How this refund line item affects inventory levels. Valid values: - * - * no_restock: Refunding these items won't affect inventory. - * cancel: The items have not yet been fulfilled. The canceled quantity will be added - * back to the available count. The number of fulfillable units for this line item will decrease. - * return: The items were already delivered but will be returned to the merchant. - * The returned quantity will be added back to the available count. - * The number of fulfillable units for this line item will remain unchanged. - * - * - * location_id: The ID of the location - * where the items should be restocked. If location_id is not provided and the value of - * restock_type is return or cancel, then the endpoint returns a suitable - * location ID. - * - * already_stocked: Whether the item is already stocked at - * the location. If this is false, then creating the refund will connect the item to the location and start - * stocking it there. + * + * line_item_id: The ID of a line item to refund. + * quantity: The quantity to refund. + * restock_type: How this refund line item affects inventory levels. Valid values: + * + * no_restock: Refunding these items won't affect inventory. + * cancel: The items have not yet been fulfilled. The canceled quantity will be added + * back to the available count. The number of fulfillable units for this line item will decrease. + * return: The items were already delivered but will be returned to the merchant. + * The returned quantity will be added back to the available count. + * The number of fulfillable units for this line item will remain unchanged. + * + * + * location_id: The ID of the location + * where the items should be restocked. If location_id is not provided and the value of + * restock_type is return or cancel, then the endpoint returns a suitable + * location ID. + * + * already_stocked: Whether the item is already stocked at + * the location. If this is false, then creating the refund will connect the item to the location and start + * stocking it there. * * `currency: &str` -- The three-letter code (ISO 4217 format) for the - * currency used for the refund. Note: Required whenever the shipping amount property is provided. + * currency used for the refund. Note: Required whenever the shipping amount property is provided. */ pub async fn deprecated_unstable_create_param_refunds_calculate( &self, diff --git a/shopify/src/plus.rs b/shopify/src/plus.rs index 5349fb56..698d9444 100644 --- a/shopify/src/plus.rs +++ b/shopify/src/plus.rs @@ -121,7 +121,7 @@ impl Plus { } /** * Updates an existing gift card. - The gift card's balance can't be changed via the API. You can change only the expiry date, note, and template suffix. + The gift card's balance can't be changed via the API. You can change only the expiry date, note, and template suffix. * * This function performs a `PUT` to the `/admin/api/2020-01/gift_cards/{gift_card_id}.json` endpoint. * @@ -223,16 +223,16 @@ impl Plus { /** * Searches for gift cards that match a supplied query. The following fields are indexed by search: - created_at - updated_at - disabled_at - balance - initial_value - amount_spent - email - last_characters + created_at + updated_at + disabled_at + balance + initial_value + amount_spent + email + last_characters - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/2020-01/gift_cards/search.json` endpoint. * @@ -241,10 +241,10 @@ impl Plus { * **Parameters:** * * * `order: &str` -- The field and direction to order results by. - * (default: disabled_at DESC). + * (default: disabled_at DESC). * * `query: &str` -- The text to search for. * * `limit: &str` -- The maximum number of results to retrieve. - * (default: 50, maximum: 250). + * (default: 50, maximum: 250). * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ pub async fn deprecated_202001_get_gift_cards_search( @@ -391,7 +391,7 @@ impl Plus { } /** * Updates an existing gift card. - The gift card's balance can't be changed via the API. You can change only the expiry date, note, and template suffix. + The gift card's balance can't be changed via the API. You can change only the expiry date, note, and template suffix. * * This function performs a `PUT` to the `/admin/api/2020-04/gift_cards/{gift_card_id}.json` endpoint. * @@ -493,16 +493,16 @@ impl Plus { /** * Searches for gift cards that match a supplied query. The following fields are indexed by search: - created_at - updated_at - disabled_at - balance - initial_value - amount_spent - email - last_characters + created_at + updated_at + disabled_at + balance + initial_value + amount_spent + email + last_characters - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/2020-04/gift_cards/search.json` endpoint. * @@ -511,10 +511,10 @@ impl Plus { * **Parameters:** * * * `order: &str` -- The field and direction to order results by. - * (default: disabled_at DESC). + * (default: disabled_at DESC). * * `query: &str` -- The text to search for. * * `limit: &str` -- The maximum number of results to retrieve. - * (default: 50, maximum: 250). + * (default: 50, maximum: 250). * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ pub async fn deprecated_202004_get_gift_cards_search( @@ -661,7 +661,7 @@ impl Plus { } /** * Updates an existing gift card. - The gift card's balance can't be changed via the API. You can change only the expiry date, note, and template suffix. + The gift card's balance can't be changed via the API. You can change only the expiry date, note, and template suffix. * * This function performs a `PUT` to the `/admin/api/2020-07/gift_cards/{gift_card_id}.json` endpoint. * @@ -763,16 +763,16 @@ impl Plus { /** * Searches for gift cards that match a supplied query. The following fields are indexed by search: - created_at - updated_at - disabled_at - balance - initial_value - amount_spent - email - last_characters + created_at + updated_at + disabled_at + balance + initial_value + amount_spent + email + last_characters - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/2020-07/gift_cards/search.json` endpoint. * @@ -781,10 +781,10 @@ impl Plus { * **Parameters:** * * * `order: &str` -- The field and direction to order results by. - * (default: disabled_at DESC). + * (default: disabled_at DESC). * * `query: &str` -- The text to search for. * * `limit: &str` -- The maximum number of results to retrieve. - * (default: 50, maximum: 250). + * (default: 50, maximum: 250). * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ pub async fn deprecated_202007_get_gift_cards_search( @@ -925,7 +925,7 @@ impl Plus { } /** * Updates an existing gift card. - The gift card's balance can't be changed via the API. You can change only the expiry date, note, and template suffix. + The gift card's balance can't be changed via the API. You can change only the expiry date, note, and template suffix. * * This function performs a `PUT` to the `/admin/api/2020-10/gift_cards/{gift_card_id}.json` endpoint. * @@ -1027,16 +1027,16 @@ impl Plus { /** * Searches for gift cards that match a supplied query. The following fields are indexed by search: - created_at - updated_at - disabled_at - balance - initial_value - amount_spent - email - last_characters + created_at + updated_at + disabled_at + balance + initial_value + amount_spent + email + last_characters - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/2020-10/gift_cards/search.json` endpoint. * @@ -1045,10 +1045,10 @@ impl Plus { * **Parameters:** * * * `order: &str` -- The field and direction to order results by. - * (default: disabled_at DESC). + * (default: disabled_at DESC). * * `query: &str` -- The text to search for. * * `limit: &str` -- The maximum number of results to retrieve. - * (default: 50, maximum: 250). + * (default: 50, maximum: 250). * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ pub async fn get_gift_cards_search( @@ -1195,7 +1195,7 @@ impl Plus { } /** * Updates an existing gift card. - The gift card's balance can't be changed via the API. You can change only the expiry date, note, and template suffix. + The gift card's balance can't be changed via the API. You can change only the expiry date, note, and template suffix. * * This function performs a `PUT` to the `/admin/api/2021-01/gift_cards/{gift_card_id}.json` endpoint. * @@ -1297,16 +1297,16 @@ impl Plus { /** * Searches for gift cards that match a supplied query. The following fields are indexed by search: - created_at - updated_at - disabled_at - balance - initial_value - amount_spent - email - last_characters + created_at + updated_at + disabled_at + balance + initial_value + amount_spent + email + last_characters - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/2021-01/gift_cards/search.json` endpoint. * @@ -1315,10 +1315,10 @@ impl Plus { * **Parameters:** * * * `order: &str` -- The field and direction to order results by. - * (default: disabled_at DESC). + * (default: disabled_at DESC). * * `query: &str` -- The text to search for. * * `limit: &str` -- The maximum number of results to retrieve. - * (default: 50, maximum: 250). + * (default: 50, maximum: 250). * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ pub async fn deprecated_202101_get_gift_cards_search( @@ -1465,7 +1465,7 @@ impl Plus { } /** * Updates an existing gift card. - The gift card's balance can't be changed via the API. You can change only the expiry date, note, and template suffix. + The gift card's balance can't be changed via the API. You can change only the expiry date, note, and template suffix. * * This function performs a `PUT` to the `/admin/api/unstable/gift_cards/{gift_card_id}.json` endpoint. * @@ -1567,16 +1567,16 @@ impl Plus { /** * Searches for gift cards that match a supplied query. The following fields are indexed by search: - created_at - updated_at - disabled_at - balance - initial_value - amount_spent - email - last_characters + created_at + updated_at + disabled_at + balance + initial_value + amount_spent + email + last_characters - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/unstable/gift_cards/search.json` endpoint. * @@ -1585,10 +1585,10 @@ impl Plus { * **Parameters:** * * * `order: &str` -- The field and direction to order results by. - * (default: disabled_at DESC). + * (default: disabled_at DESC). * * `query: &str` -- The text to search for. * * `limit: &str` -- The maximum number of results to retrieve. - * (default: 50, maximum: 250). + * (default: 50, maximum: 250). * * `fields: &str` -- Show only certain fields, specified by a comma-separated list of field names. */ pub async fn deprecated_unstable_get_gift_cards_search( diff --git a/shopify/src/products.rs b/shopify/src/products.rs index 2100e9eb..e806fb59 100644 --- a/shopify/src/products.rs +++ b/shopify/src/products.rs @@ -3399,10 +3399,10 @@ impl Products { } /** * Creates a new product. - If you want to set the product's SEO information, then you can use the following properties: + If you want to set the product's SEO information, then you can use the following properties: - metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. - metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. + metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. + metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. * * This function performs a `POST` to the `/admin/api/2020-01/products.json` endpoint. * @@ -3542,10 +3542,10 @@ impl Products { } /** * Updates a product and its variants and images. - If you want to update the product's SEO information, then you can use the following properties: + If you want to update the product's SEO information, then you can use the following properties: - metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. - metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. + metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. + metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. * * This function performs a `PUT` to the `/admin/api/2020-01/products/{product_id}.json` endpoint. * @@ -3741,10 +3741,10 @@ impl Products { } /** * Creates a new product. - If you want to set the product's SEO information, then you can use the following properties: + If you want to set the product's SEO information, then you can use the following properties: - metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. - metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. + metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. + metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. * * This function performs a `POST` to the `/admin/api/2020-04/products.json` endpoint. * @@ -3884,10 +3884,10 @@ impl Products { } /** * Updates a product and its variants and images. - If you want to update the product's SEO information, then you can use the following properties: + If you want to update the product's SEO information, then you can use the following properties: - metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. - metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. + metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. + metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. * * This function performs a `PUT` to the `/admin/api/2020-04/products/{product_id}.json` endpoint. * @@ -4083,10 +4083,10 @@ impl Products { } /** * Creates a new product. - If you want to set the product's SEO information, then you can use the following properties: + If you want to set the product's SEO information, then you can use the following properties: - metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. - metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. + metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. + metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. * * This function performs a `POST` to the `/admin/api/2020-07/products.json` endpoint. * @@ -4226,10 +4226,10 @@ impl Products { } /** * Updates a product and its variants and images. - If you want to update the product's SEO information, then you can use the following properties: + If you want to update the product's SEO information, then you can use the following properties: - metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. - metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. + metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. + metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. * * This function performs a `PUT` to the `/admin/api/2020-07/products/{product_id}.json` endpoint. * @@ -4425,10 +4425,10 @@ impl Products { } /** * Creates a new product. - If you want to set the product's SEO information, then you can use the following properties: + If you want to set the product's SEO information, then you can use the following properties: - metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. - metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. + metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. + metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. * * This function performs a `POST` to the `/admin/api/2020-10/products.json` endpoint. * @@ -4568,10 +4568,10 @@ impl Products { } /** * Updates a product and its variants and images. - If you want to update the product's SEO information, then you can use the following properties: + If you want to update the product's SEO information, then you can use the following properties: - metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. - metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. + metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. + metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. * * This function performs a `PUT` to the `/admin/api/2020-10/products/{product_id}.json` endpoint. * @@ -4763,10 +4763,10 @@ impl Products { } /** * Creates a new product. - If you want to set the product's SEO information, then you can use the following properties: + If you want to set the product's SEO information, then you can use the following properties: - metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. - metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. + metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. + metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. * * This function performs a `POST` to the `/admin/api/2021-01/products.json` endpoint. * @@ -4906,10 +4906,10 @@ impl Products { } /** * Updates a product and its variants and images. - If you want to update the product's SEO information, then you can use the following properties: + If you want to update the product's SEO information, then you can use the following properties: - metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. - metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. + metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. + metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. * * This function performs a `PUT` to the `/admin/api/2021-01/products/{product_id}.json` endpoint. * @@ -5105,10 +5105,10 @@ impl Products { } /** * Creates a new product. - If you want to set the product's SEO information, then you can use the following properties: + If you want to set the product's SEO information, then you can use the following properties: - metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. - metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. + metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. + metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. * * This function performs a `POST` to the `/admin/api/unstable/products.json` endpoint. * @@ -5252,10 +5252,10 @@ impl Products { } /** * Updates a product and its variants and images. - If you want to update the product's SEO information, then you can use the following properties: + If you want to update the product's SEO information, then you can use the following properties: - metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. - metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. + metafields_global_title_tag: The name of the product used for SEO purposes. Generally added to the tag. + metafields_global_description_tag: A description of the product used for SEO purposes. Generally added to the tag. * * This function performs a `PUT` to the `/admin/api/unstable/products/{product_id}.json` endpoint. * diff --git a/shopify/src/sales_channels.rs b/shopify/src/sales_channels.rs index 99c617bf..39f40bbf 100644 --- a/shopify/src/sales_channels.rs +++ b/shopify/src/sales_channels.rs @@ -226,8 +226,8 @@ impl SalesChannels { } /** * Retrieves a list of available shipping rates for the specified checkout. Implementers need to poll this endpoint until rates become available. - Each shipping rate contains the checkout's new subtotal price, total tax, and total price in the event that this shipping rate is selected. This can be used to update the UI without performing further API requests. - To apply a shipping rate, update the checkout's shipping line with the handle of the selected rate. + Each shipping rate contains the checkout's new subtotal price, total tax, and total price in the event that this shipping rate is selected. This can be used to update the UI without performing further API requests. + To apply a shipping rate, update the checkout's shipping line with the handle of the selected rate. * * This function performs a `GET` to the `/admin/api/2020-01/checkouts/{token}/shipping_rates.json` endpoint. * @@ -355,8 +355,8 @@ impl SalesChannels { } /** * Retrieves a list of available shipping rates for the specified checkout. Implementers need to poll this endpoint until rates become available. - Each shipping rate contains the checkout's new subtotal price, total tax, and total price in the event that this shipping rate is selected. This can be used to update the UI without performing further API requests. - To apply a shipping rate, update the checkout's shipping line with the handle of the selected rate. + Each shipping rate contains the checkout's new subtotal price, total tax, and total price in the event that this shipping rate is selected. This can be used to update the UI without performing further API requests. + To apply a shipping rate, update the checkout's shipping line with the handle of the selected rate. * * This function performs a `GET` to the `/admin/api/2020-04/checkouts/{token}/shipping_rates.json` endpoint. * @@ -484,8 +484,8 @@ impl SalesChannels { } /** * Retrieves a list of available shipping rates for the specified checkout. Implementers need to poll this endpoint until rates become available. - Each shipping rate contains the checkout's new subtotal price, total tax, and total price in the event that this shipping rate is selected. This can be used to update the UI without performing further API requests. - To apply a shipping rate, update the checkout's shipping line with the handle of the selected rate. + Each shipping rate contains the checkout's new subtotal price, total tax, and total price in the event that this shipping rate is selected. This can be used to update the UI without performing further API requests. + To apply a shipping rate, update the checkout's shipping line with the handle of the selected rate. * * This function performs a `GET` to the `/admin/api/2020-07/checkouts/{token}/shipping_rates.json` endpoint. * @@ -613,8 +613,8 @@ impl SalesChannels { } /** * Retrieves a list of available shipping rates for the specified checkout. Implementers need to poll this endpoint until rates become available. - Each shipping rate contains the checkout's new subtotal price, total tax, and total price in the event that this shipping rate is selected. This can be used to update the UI without performing further API requests. - To apply a shipping rate, update the checkout's shipping line with the handle of the selected rate. + Each shipping rate contains the checkout's new subtotal price, total tax, and total price in the event that this shipping rate is selected. This can be used to update the UI without performing further API requests. + To apply a shipping rate, update the checkout's shipping line with the handle of the selected rate. * * This function performs a `GET` to the `/admin/api/2020-10/checkouts/{token}/shipping_rates.json` endpoint. * @@ -739,8 +739,8 @@ impl SalesChannels { } /** * Retrieves a list of available shipping rates for the specified checkout. Implementers need to poll this endpoint until rates become available. - Each shipping rate contains the checkout's new subtotal price, total tax, and total price in the event that this shipping rate is selected. This can be used to update the UI without performing further API requests. - To apply a shipping rate, update the checkout's shipping line with the handle of the selected rate. + Each shipping rate contains the checkout's new subtotal price, total tax, and total price in the event that this shipping rate is selected. This can be used to update the UI without performing further API requests. + To apply a shipping rate, update the checkout's shipping line with the handle of the selected rate. * * This function performs a `GET` to the `/admin/api/2021-01/checkouts/{token}/shipping_rates.json` endpoint. * @@ -868,8 +868,8 @@ impl SalesChannels { } /** * Retrieves a list of available shipping rates for the specified checkout. Implementers need to poll this endpoint until rates become available. - Each shipping rate contains the checkout's new subtotal price, total tax, and total price in the event that this shipping rate is selected. This can be used to update the UI without performing further API requests. - To apply a shipping rate, update the checkout's shipping line with the handle of the selected rate. + Each shipping rate contains the checkout's new subtotal price, total tax, and total price in the event that this shipping rate is selected. This can be used to update the UI without performing further API requests. + To apply a shipping rate, update the checkout's shipping line with the handle of the selected rate. * * This function performs a `GET` to the `/admin/api/unstable/checkouts/{token}/shipping_rates.json` endpoint. * diff --git a/shopify/src/shipping_and_fulfillment.rs b/shopify/src/shipping_and_fulfillment.rs index 0c4a274f..7446185b 100644 --- a/shopify/src/shipping_and_fulfillment.rs +++ b/shopify/src/shipping_and_fulfillment.rs @@ -1969,28 +1969,28 @@ impl ShippingAndFulfillment { } /** * Create a fulfillment for the specified order and line items. - The fulfillment's status depends on the line items in the order: + The fulfillment's status depends on the line items in the order: - If the line items in the fulfillment use a manual or custom fulfillment service, then the status of the returned fulfillment will be set immediately. - If the line items use an external fulfillment service, then they will be queued for fulfillment and the status will be set to pending until the external fulfillment service has been invoked. + If the line items in the fulfillment use a manual or custom fulfillment service, then the status of the returned fulfillment will be set immediately. + If the line items use an external fulfillment service, then they will be queued for fulfillment and the status will be set to pending until the external fulfillment service has been invoked. - A fulfillment might then transition to open, which implies it is being processed by the service, before transitioning to success when the items have shipped. - If you don't specify line item IDs, then all unfulfilled and partially fulfilled line items for the order will be fulfilled. - However, if an order is refunded or if any of its individual line items are refunded, then the order can't be fulfilled. + A fulfillment might then transition to open, which implies it is being processed by the service, before transitioning to success when the items have shipped. + If you don't specify line item IDs, then all unfulfilled and partially fulfilled line items for the order will be fulfilled. + However, if an order is refunded or if any of its individual line items are refunded, then the order can't be fulfilled. - All line items being fulfilled must have the same fulfillment service. + All line items being fulfilled must have the same fulfillment service. - Note - If you are using this endpoint with a Partner development store or a trial store, then you can create no more than 5 new fulfillments per minute. + Note + If you are using this endpoint with a Partner development store or a trial store, then you can create no more than 5 new fulfillments per minute. - About tracking urls - If you're creating a fulfillment for a supported carrier, then you can send the tracking_company and tracking_numbers fields, and Shopify will generate the tracking_url for you. If you're creating a fulfillment for an unsupported carrier (not in the tracking_company list), then send the tracking_company, tracking_numbers, and tracking_urls fields. + About tracking urls + If you're creating a fulfillment for a supported carrier, then you can send the tracking_company and tracking_numbers fields, and Shopify will generate the tracking_url for you. If you're creating a fulfillment for an unsupported carrier (not in the tracking_company list), then send the tracking_company, tracking_numbers, and tracking_urls fields. - Note - If you send an unsupported carrier without a tracking URL, then Shopify will still try to generate a valid tracking URL by using pattern matching on the tracking number. However, Shopify does not validate the tracking URL, so you should make sure that your tracking URL is correct for the order and fulfillment. + Note + If you send an unsupported carrier without a tracking URL, then Shopify will still try to generate a valid tracking URL by using pattern matching on the tracking number. However, Shopify does not validate the tracking URL, so you should make sure that your tracking URL is correct for the order and fulfillment. * * This function performs a `POST` to the `/admin/api/2020-01/orders/{order_id}/fulfillments.json` endpoint. * @@ -2460,28 +2460,28 @@ impl ShippingAndFulfillment { } /** * Create a fulfillment for the specified order and line items. - The fulfillment's status depends on the line items in the order: + The fulfillment's status depends on the line items in the order: - If the line items in the fulfillment use a manual or custom fulfillment service, then the status of the returned fulfillment will be set immediately. - If the line items use an external fulfillment service, then they will be queued for fulfillment and the status will be set to pending until the external fulfillment service has been invoked. + If the line items in the fulfillment use a manual or custom fulfillment service, then the status of the returned fulfillment will be set immediately. + If the line items use an external fulfillment service, then they will be queued for fulfillment and the status will be set to pending until the external fulfillment service has been invoked. - A fulfillment might then transition to open, which implies it is being processed by the service, before transitioning to success when the items have shipped. - If you don't specify line item IDs, then all unfulfilled and partially fulfilled line items for the order will be fulfilled. - However, if an order is refunded or if any of its individual line items are refunded, then the order can't be fulfilled. + A fulfillment might then transition to open, which implies it is being processed by the service, before transitioning to success when the items have shipped. + If you don't specify line item IDs, then all unfulfilled and partially fulfilled line items for the order will be fulfilled. + However, if an order is refunded or if any of its individual line items are refunded, then the order can't be fulfilled. - All line items being fulfilled must have the same fulfillment service. + All line items being fulfilled must have the same fulfillment service. - Note - If you are using this endpoint with a Partner development store or a trial store, then you can create no more than 5 new fulfillments per minute. + Note + If you are using this endpoint with a Partner development store or a trial store, then you can create no more than 5 new fulfillments per minute. - About tracking urls - If you're creating a fulfillment for a supported carrier, then you can send the tracking_company and tracking_numbers fields, and Shopify will generate the tracking_url for you. If you're creating a fulfillment for an unsupported carrier (not in the tracking_company list), then send the tracking_company, tracking_numbers, and tracking_urls fields. + About tracking urls + If you're creating a fulfillment for a supported carrier, then you can send the tracking_company and tracking_numbers fields, and Shopify will generate the tracking_url for you. If you're creating a fulfillment for an unsupported carrier (not in the tracking_company list), then send the tracking_company, tracking_numbers, and tracking_urls fields. - Note - If you send an unsupported carrier without a tracking URL, then Shopify will still try to generate a valid tracking URL by using pattern matching on the tracking number. However, Shopify does not validate the tracking URL, so you should make sure that your tracking URL is correct for the order and fulfillment. + Note + If you send an unsupported carrier without a tracking URL, then Shopify will still try to generate a valid tracking URL by using pattern matching on the tracking number. However, Shopify does not validate the tracking URL, so you should make sure that your tracking URL is correct for the order and fulfillment. * * This function performs a `POST` to the `/admin/api/2020-04/orders/{order_id}/fulfillments.json` endpoint. * @@ -2951,28 +2951,28 @@ impl ShippingAndFulfillment { } /** * Create a fulfillment for the specified order and line items. - The fulfillment's status depends on the line items in the order: + The fulfillment's status depends on the line items in the order: - If the line items in the fulfillment use a manual or custom fulfillment service, then the status of the returned fulfillment will be set immediately. - If the line items use an external fulfillment service, then they will be queued for fulfillment and the status will be set to pending until the external fulfillment service has been invoked. + If the line items in the fulfillment use a manual or custom fulfillment service, then the status of the returned fulfillment will be set immediately. + If the line items use an external fulfillment service, then they will be queued for fulfillment and the status will be set to pending until the external fulfillment service has been invoked. - A fulfillment might then transition to open, which implies it is being processed by the service, before transitioning to success when the items have shipped. - If you don't specify line item IDs, then all unfulfilled and partially fulfilled line items for the order will be fulfilled. - However, if an order is refunded or if any of its individual line items are refunded, then the order can't be fulfilled. + A fulfillment might then transition to open, which implies it is being processed by the service, before transitioning to success when the items have shipped. + If you don't specify line item IDs, then all unfulfilled and partially fulfilled line items for the order will be fulfilled. + However, if an order is refunded or if any of its individual line items are refunded, then the order can't be fulfilled. - All line items being fulfilled must have the same fulfillment service. + All line items being fulfilled must have the same fulfillment service. - Note - If you are using this endpoint with a Partner development store or a trial store, then you can create no more than 5 new fulfillments per minute. + Note + If you are using this endpoint with a Partner development store or a trial store, then you can create no more than 5 new fulfillments per minute. - About tracking urls - If you're creating a fulfillment for a supported carrier, then you can send the tracking_company and tracking_numbers fields, and Shopify will generate the tracking_url for you. If you're creating a fulfillment for an unsupported carrier (not in the tracking_company list), then send the tracking_company, tracking_numbers, and tracking_urls fields. + About tracking urls + If you're creating a fulfillment for a supported carrier, then you can send the tracking_company and tracking_numbers fields, and Shopify will generate the tracking_url for you. If you're creating a fulfillment for an unsupported carrier (not in the tracking_company list), then send the tracking_company, tracking_numbers, and tracking_urls fields. - Note - If you send an unsupported carrier without a tracking URL, then Shopify will still try to generate a valid tracking URL by using pattern matching on the tracking number. However, Shopify does not validate the tracking URL, so you should make sure that your tracking URL is correct for the order and fulfillment. + Note + If you send an unsupported carrier without a tracking URL, then Shopify will still try to generate a valid tracking URL by using pattern matching on the tracking number. However, Shopify does not validate the tracking URL, so you should make sure that your tracking URL is correct for the order and fulfillment. * * This function performs a `POST` to the `/admin/api/2020-07/orders/{order_id}/fulfillments.json` endpoint. * @@ -3442,28 +3442,28 @@ impl ShippingAndFulfillment { } /** * Create a fulfillment for the specified order and line items. - The fulfillment's status depends on the line items in the order: + The fulfillment's status depends on the line items in the order: - If the line items in the fulfillment use a manual or custom fulfillment service, then the status of the returned fulfillment will be set immediately. - If the line items use an external fulfillment service, then they will be queued for fulfillment and the status will be set to pending until the external fulfillment service has been invoked. + If the line items in the fulfillment use a manual or custom fulfillment service, then the status of the returned fulfillment will be set immediately. + If the line items use an external fulfillment service, then they will be queued for fulfillment and the status will be set to pending until the external fulfillment service has been invoked. - A fulfillment might then transition to open, which implies it is being processed by the service, before transitioning to success when the items have shipped. - If you don't specify line item IDs, then all unfulfilled and partially fulfilled line items for the order will be fulfilled. - However, if an order is refunded or if any of its individual line items are refunded, then the order can't be fulfilled. + A fulfillment might then transition to open, which implies it is being processed by the service, before transitioning to success when the items have shipped. + If you don't specify line item IDs, then all unfulfilled and partially fulfilled line items for the order will be fulfilled. + However, if an order is refunded or if any of its individual line items are refunded, then the order can't be fulfilled. - All line items being fulfilled must have the same fulfillment service. + All line items being fulfilled must have the same fulfillment service. - Note - If you are using this endpoint with a Partner development store or a trial store, then you can create no more than 5 new fulfillments per minute. + Note + If you are using this endpoint with a Partner development store or a trial store, then you can create no more than 5 new fulfillments per minute. - About tracking urls - If you're creating a fulfillment for a supported carrier, then you can send the tracking_company and tracking_numbers fields, and Shopify will generate the tracking_url for you. If you're creating a fulfillment for an unsupported carrier (not in the tracking_company list), then send the tracking_company, tracking_numbers, and tracking_urls fields. + About tracking urls + If you're creating a fulfillment for a supported carrier, then you can send the tracking_company and tracking_numbers fields, and Shopify will generate the tracking_url for you. If you're creating a fulfillment for an unsupported carrier (not in the tracking_company list), then send the tracking_company, tracking_numbers, and tracking_urls fields. - Note - If you send an unsupported carrier without a tracking URL, then Shopify will still try to generate a valid tracking URL by using pattern matching on the tracking number. However, Shopify does not validate the tracking URL, so you should make sure that your tracking URL is correct for the order and fulfillment. + Note + If you send an unsupported carrier without a tracking URL, then Shopify will still try to generate a valid tracking URL by using pattern matching on the tracking number. However, Shopify does not validate the tracking URL, so you should make sure that your tracking URL is correct for the order and fulfillment. * * This function performs a `POST` to the `/admin/api/2020-10/orders/{order_id}/fulfillments.json` endpoint. * @@ -3930,28 +3930,28 @@ impl ShippingAndFulfillment { } /** * Create a fulfillment for the specified order and line items. - The fulfillment's status depends on the line items in the order: + The fulfillment's status depends on the line items in the order: - If the line items in the fulfillment use a manual or custom fulfillment service, then the status of the returned fulfillment will be set immediately. - If the line items use an external fulfillment service, then they will be queued for fulfillment and the status will be set to pending until the external fulfillment service has been invoked. + If the line items in the fulfillment use a manual or custom fulfillment service, then the status of the returned fulfillment will be set immediately. + If the line items use an external fulfillment service, then they will be queued for fulfillment and the status will be set to pending until the external fulfillment service has been invoked. - A fulfillment might then transition to open, which implies it is being processed by the service, before transitioning to success when the items have shipped. - If you don't specify line item IDs, then all unfulfilled and partially fulfilled line items for the order will be fulfilled. - However, if an order is refunded or if any of its individual line items are refunded, then the order can't be fulfilled. + A fulfillment might then transition to open, which implies it is being processed by the service, before transitioning to success when the items have shipped. + If you don't specify line item IDs, then all unfulfilled and partially fulfilled line items for the order will be fulfilled. + However, if an order is refunded or if any of its individual line items are refunded, then the order can't be fulfilled. - All line items being fulfilled must have the same fulfillment service. + All line items being fulfilled must have the same fulfillment service. - Note - If you are using this endpoint with a Partner development store or a trial store, then you can create no more than 5 new fulfillments per minute. + Note + If you are using this endpoint with a Partner development store or a trial store, then you can create no more than 5 new fulfillments per minute. - About tracking urls - If you're creating a fulfillment for a supported carrier, then you can send the tracking_company and tracking_numbers fields, and Shopify will generate the tracking_url for you. If you're creating a fulfillment for an unsupported carrier (not in the tracking_company list), then send the tracking_company, tracking_numbers, and tracking_urls fields. + About tracking urls + If you're creating a fulfillment for a supported carrier, then you can send the tracking_company and tracking_numbers fields, and Shopify will generate the tracking_url for you. If you're creating a fulfillment for an unsupported carrier (not in the tracking_company list), then send the tracking_company, tracking_numbers, and tracking_urls fields. - Note - If you send an unsupported carrier without a tracking URL, then Shopify will still try to generate a valid tracking URL by using pattern matching on the tracking number. However, Shopify does not validate the tracking URL, so you should make sure that your tracking URL is correct for the order and fulfillment. + Note + If you send an unsupported carrier without a tracking URL, then Shopify will still try to generate a valid tracking URL by using pattern matching on the tracking number. However, Shopify does not validate the tracking URL, so you should make sure that your tracking URL is correct for the order and fulfillment. * * This function performs a `POST` to the `/admin/api/2021-01/orders/{order_id}/fulfillments.json` endpoint. * @@ -4421,28 +4421,28 @@ impl ShippingAndFulfillment { } /** * Create a fulfillment for the specified order and line items. - The fulfillment's status depends on the line items in the order: + The fulfillment's status depends on the line items in the order: - If the line items in the fulfillment use a manual or custom fulfillment service, then the status of the returned fulfillment will be set immediately. - If the line items use an external fulfillment service, then they will be queued for fulfillment and the status will be set to pending until the external fulfillment service has been invoked. + If the line items in the fulfillment use a manual or custom fulfillment service, then the status of the returned fulfillment will be set immediately. + If the line items use an external fulfillment service, then they will be queued for fulfillment and the status will be set to pending until the external fulfillment service has been invoked. - A fulfillment might then transition to open, which implies it is being processed by the service, before transitioning to success when the items have shipped. - If you don't specify line item IDs, then all unfulfilled and partially fulfilled line items for the order will be fulfilled. - However, if an order is refunded or if any of its individual line items are refunded, then the order can't be fulfilled. + A fulfillment might then transition to open, which implies it is being processed by the service, before transitioning to success when the items have shipped. + If you don't specify line item IDs, then all unfulfilled and partially fulfilled line items for the order will be fulfilled. + However, if an order is refunded or if any of its individual line items are refunded, then the order can't be fulfilled. - All line items being fulfilled must have the same fulfillment service. + All line items being fulfilled must have the same fulfillment service. - Note - If you are using this endpoint with a Partner development store or a trial store, then you can create no more than 5 new fulfillments per minute. + Note + If you are using this endpoint with a Partner development store or a trial store, then you can create no more than 5 new fulfillments per minute. - About tracking urls - If you're creating a fulfillment for a supported carrier, then you can send the tracking_company and tracking_numbers fields, and Shopify will generate the tracking_url for you. If you're creating a fulfillment for an unsupported carrier (not in the tracking_company list), then send the tracking_company, tracking_numbers, and tracking_urls fields. + About tracking urls + If you're creating a fulfillment for a supported carrier, then you can send the tracking_company and tracking_numbers fields, and Shopify will generate the tracking_url for you. If you're creating a fulfillment for an unsupported carrier (not in the tracking_company list), then send the tracking_company, tracking_numbers, and tracking_urls fields. - Note - If you send an unsupported carrier without a tracking URL, then Shopify will still try to generate a valid tracking URL by using pattern matching on the tracking number. However, Shopify does not validate the tracking URL, so you should make sure that your tracking URL is correct for the order and fulfillment. + Note + If you send an unsupported carrier without a tracking URL, then Shopify will still try to generate a valid tracking URL by using pattern matching on the tracking number. However, Shopify does not validate the tracking URL, so you should make sure that your tracking URL is correct for the order and fulfillment. * * This function performs a `POST` to the `/admin/api/unstable/orders/{order_id}/fulfillments.json` endpoint. * @@ -5839,7 +5839,7 @@ impl ShippingAndFulfillment { } /** * Marks an in progress fulfillment order as incomplete, indicating the fulfillment service - is unable to ship any remaining items and intends to close the fulfillment order. + is unable to ship any remaining items and intends to close the fulfillment order. * * This function performs a `POST` to the `/admin/api/2020-01/fulfillment_orders/{fulfillment_order_id}/close.json` endpoint. * @@ -6020,7 +6020,7 @@ impl ShippingAndFulfillment { } /** * Marks an in progress fulfillment order as incomplete, indicating the fulfillment service - is unable to ship any remaining items and intends to close the fulfillment order. + is unable to ship any remaining items and intends to close the fulfillment order. * * This function performs a `POST` to the `/admin/api/2020-04/fulfillment_orders/{fulfillment_order_id}/close.json` endpoint. * @@ -6201,7 +6201,7 @@ impl ShippingAndFulfillment { } /** * Marks an in progress fulfillment order as incomplete, indicating the fulfillment service - is unable to ship any remaining items and intends to close the fulfillment order. + is unable to ship any remaining items and intends to close the fulfillment order. * * This function performs a `POST` to the `/admin/api/2020-07/fulfillment_orders/{fulfillment_order_id}/close.json` endpoint. * @@ -6382,7 +6382,7 @@ impl ShippingAndFulfillment { } /** * Marks an in progress fulfillment order as incomplete, indicating the fulfillment service - is unable to ship any remaining items and intends to close the fulfillment order. + is unable to ship any remaining items and intends to close the fulfillment order. * * This function performs a `POST` to the `/admin/api/2020-10/fulfillment_orders/{fulfillment_order_id}/close.json` endpoint. * @@ -6563,7 +6563,7 @@ impl ShippingAndFulfillment { } /** * Marks an in progress fulfillment order as incomplete, indicating the fulfillment service - is unable to ship any remaining items and intends to close the fulfillment order. + is unable to ship any remaining items and intends to close the fulfillment order. * * This function performs a `POST` to the `/admin/api/2021-01/fulfillment_orders/{fulfillment_order_id}/close.json` endpoint. * @@ -6646,7 +6646,7 @@ impl ShippingAndFulfillment { } /** * Marks a scheduled fulfillment order as ready for fulfillment. - This endpoint allows merchants to work on a scheduled fulfillment order before its expected fulfill_at datetime. + This endpoint allows merchants to work on a scheduled fulfillment order before its expected fulfill_at datetime. * * This function performs a `POST` to the `/admin/api/2021-01/fulfillment_orders/{fulfillment_order_id}/open.json` endpoint. * @@ -6680,7 +6680,7 @@ impl ShippingAndFulfillment { } /** * Updates the fulfill_at time of a scheduled fulfillment order. - This endpoint is used to manage the time a scheduled fulfillment order will be marked as ready for fulfillment. + This endpoint is used to manage the time a scheduled fulfillment order will be marked as ready for fulfillment. * * This function performs a `POST` to the `/admin/api/2021-01/fulfillment_orders/{fulfillment_order_id}/reschedule.json` endpoint. * @@ -6812,7 +6812,7 @@ impl ShippingAndFulfillment { } /** * Releases the fulfillment order holds for a specific order. Fulfillment orders are created - with an ON_HOLD status if the channel that created the order has a fulfillment hold policy. + with an ON_HOLD status if the channel that created the order has a fulfillment hold policy. * * This function performs a `POST` to the `/admin/api/unstable/fulfillment_orders/release_hold.json` endpoint. * @@ -6851,7 +6851,7 @@ impl ShippingAndFulfillment { } /** * Marks an in progress fulfillment order as incomplete, indicating the fulfillment service - is unable to ship any remaining items and intends to close the fulfillment order. + is unable to ship any remaining items and intends to close the fulfillment order. * * This function performs a `POST` to the `/admin/api/unstable/fulfillment_orders/{fulfillment_order_id}/close.json` endpoint. * @@ -6934,7 +6934,7 @@ impl ShippingAndFulfillment { } /** * Marks a scheduled fulfillment order as ready for fulfillment. - This endpoint allows merchants to work on a scheduled fulfillment order before its expected fulfill_at datetime. + This endpoint allows merchants to work on a scheduled fulfillment order before its expected fulfill_at datetime. * * This function performs a `POST` to the `/admin/api/unstable/fulfillment_orders/{fulfillment_order_id}/open.json` endpoint. * @@ -6968,7 +6968,7 @@ impl ShippingAndFulfillment { } /** * Updates the fulfill_at time of a scheduled fulfillment order. - This endpoint is used to manage the time a scheduled fulfillment order will be marked as ready for fulfillment. + This endpoint is used to manage the time a scheduled fulfillment order will be marked as ready for fulfillment. * * This function performs a `POST` to the `/admin/api/unstable/fulfillment_orders/{fulfillment_order_id}/reschedule.json` endpoint. * @@ -7904,9 +7904,9 @@ impl ShippingAndFulfillment { } /** * To create a fulfillment service, you can also use a cURL request that uses that fulfillment_service.json payload: - Copy curl -X POST -d @fulfillment_service.json -H"Accept:application/json" -H"Content-Type:application/json" -H"X-Shopify-Access-Token:THE_TOKEN_GOES_HERE" https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services + Copy curl -X POST -d @fulfillment_service.json -H"Accept:application/json" -H"Content-Type:application/json" -H"X-Shopify-Access-Token:THE_TOKEN_GOES_HERE" https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services - Where THE_TOKEN_GOES_HERE is replaced by the OAuth token given to you by Shopify and https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services is replaced by the authorized shop's URL. + Where THE_TOKEN_GOES_HERE is replaced by the OAuth token given to you by Shopify and https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services is replaced by the authorized shop's URL. * * This function performs a `POST` to the `/admin/api/2020-01/fulfillment_services.json` endpoint. * @@ -8060,9 +8060,9 @@ impl ShippingAndFulfillment { } /** * To create a fulfillment service, you can also use a cURL request that uses that fulfillment_service.json payload: - Copy curl -X POST -d @fulfillment_service.json -H"Accept:application/json" -H"Content-Type:application/json" -H"X-Shopify-Access-Token:THE_TOKEN_GOES_HERE" https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services + Copy curl -X POST -d @fulfillment_service.json -H"Accept:application/json" -H"Content-Type:application/json" -H"X-Shopify-Access-Token:THE_TOKEN_GOES_HERE" https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services - Where THE_TOKEN_GOES_HERE is replaced by the OAuth token given to you by Shopify and https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services is replaced by the authorized shop's URL. + Where THE_TOKEN_GOES_HERE is replaced by the OAuth token given to you by Shopify and https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services is replaced by the authorized shop's URL. * * This function performs a `POST` to the `/admin/api/2020-04/fulfillment_services.json` endpoint. * @@ -8216,9 +8216,9 @@ impl ShippingAndFulfillment { } /** * To create a fulfillment service, you can also use a cURL request that uses that fulfillment_service.json payload: - Copy curl -X POST -d @fulfillment_service.json -H"Accept:application/json" -H"Content-Type:application/json" -H"X-Shopify-Access-Token:THE_TOKEN_GOES_HERE" https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services + Copy curl -X POST -d @fulfillment_service.json -H"Accept:application/json" -H"Content-Type:application/json" -H"X-Shopify-Access-Token:THE_TOKEN_GOES_HERE" https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services - Where THE_TOKEN_GOES_HERE is replaced by the OAuth token given to you by Shopify and https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services is replaced by the authorized shop's URL. + Where THE_TOKEN_GOES_HERE is replaced by the OAuth token given to you by Shopify and https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services is replaced by the authorized shop's URL. * * This function performs a `POST` to the `/admin/api/2020-07/fulfillment_services.json` endpoint. * @@ -8372,9 +8372,9 @@ impl ShippingAndFulfillment { } /** * To create a fulfillment service, you can also use a cURL request that uses that fulfillment_service.json payload: - Copy curl -X POST -d @fulfillment_service.json -H"Accept:application/json" -H"Content-Type:application/json" -H"X-Shopify-Access-Token:THE_TOKEN_GOES_HERE" https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services + Copy curl -X POST -d @fulfillment_service.json -H"Accept:application/json" -H"Content-Type:application/json" -H"X-Shopify-Access-Token:THE_TOKEN_GOES_HERE" https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services - Where THE_TOKEN_GOES_HERE is replaced by the OAuth token given to you by Shopify and https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services is replaced by the authorized shop's URL. + Where THE_TOKEN_GOES_HERE is replaced by the OAuth token given to you by Shopify and https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services is replaced by the authorized shop's URL. * * This function performs a `POST` to the `/admin/api/2020-10/fulfillment_services.json` endpoint. * @@ -8525,9 +8525,9 @@ impl ShippingAndFulfillment { } /** * To create a fulfillment service, you can also use a cURL request that uses that fulfillment_service.json payload: - Copy curl -X POST -d @fulfillment_service.json -H"Accept:application/json" -H"Content-Type:application/json" -H"X-Shopify-Access-Token:THE_TOKEN_GOES_HERE" https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services + Copy curl -X POST -d @fulfillment_service.json -H"Accept:application/json" -H"Content-Type:application/json" -H"X-Shopify-Access-Token:THE_TOKEN_GOES_HERE" https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services - Where THE_TOKEN_GOES_HERE is replaced by the OAuth token given to you by Shopify and https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services is replaced by the authorized shop's URL. + Where THE_TOKEN_GOES_HERE is replaced by the OAuth token given to you by Shopify and https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services is replaced by the authorized shop's URL. * * This function performs a `POST` to the `/admin/api/2021-01/fulfillment_services.json` endpoint. * @@ -8681,9 +8681,9 @@ impl ShippingAndFulfillment { } /** * To create a fulfillment service, you can also use a cURL request that uses that fulfillment_service.json payload: - Copy curl -X POST -d @fulfillment_service.json -H"Accept:application/json" -H"Content-Type:application/json" -H"X-Shopify-Access-Token:THE_TOKEN_GOES_HERE" https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services + Copy curl -X POST -d @fulfillment_service.json -H"Accept:application/json" -H"Content-Type:application/json" -H"X-Shopify-Access-Token:THE_TOKEN_GOES_HERE" https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services - Where THE_TOKEN_GOES_HERE is replaced by the OAuth token given to you by Shopify and https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services is replaced by the authorized shop's URL. + Where THE_TOKEN_GOES_HERE is replaced by the OAuth token given to you by Shopify and https://AUTHORIZED_SHOP.myshopify.com/admin/fulfillment_services is replaced by the authorized shop's URL. * * This function performs a `POST` to the `/admin/api/unstable/fulfillment_services.json` endpoint. * @@ -8805,7 +8805,7 @@ impl ShippingAndFulfillment { } /** * Retrieves a list of locations that a fulfillment order can potentially move to. - The resulting list is sorted alphabetically in ascending order by location name. + The resulting list is sorted alphabetically in ascending order by location name. * * This function performs a `GET` to the `/admin/api/2020-01/fulfillment_orders/{fulfillment_order_id}/locations_for_move.json` endpoint. * @@ -8839,7 +8839,7 @@ impl ShippingAndFulfillment { } /** * Retrieves a list of locations that a fulfillment order can potentially move to. - The resulting list is sorted alphabetically in ascending order by location name. + The resulting list is sorted alphabetically in ascending order by location name. * * This function performs a `GET` to the `/admin/api/2020-04/fulfillment_orders/{fulfillment_order_id}/locations_for_move.json` endpoint. * @@ -8873,7 +8873,7 @@ impl ShippingAndFulfillment { } /** * Retrieves a list of locations that a fulfillment order can potentially move to. - The resulting list is sorted alphabetically in ascending order by location name. + The resulting list is sorted alphabetically in ascending order by location name. * * This function performs a `GET` to the `/admin/api/2020-07/fulfillment_orders/{fulfillment_order_id}/locations_for_move.json` endpoint. * @@ -8907,7 +8907,7 @@ impl ShippingAndFulfillment { } /** * Retrieves a list of locations that a fulfillment order can potentially move to. - The resulting list is sorted alphabetically in ascending order by location name. + The resulting list is sorted alphabetically in ascending order by location name. * * This function performs a `GET` to the `/admin/api/2020-10/fulfillment_orders/{fulfillment_order_id}/locations_for_move.json` endpoint. * @@ -8941,7 +8941,7 @@ impl ShippingAndFulfillment { } /** * Retrieves a list of locations that a fulfillment order can potentially move to. - The resulting list is sorted alphabetically in ascending order by location name. + The resulting list is sorted alphabetically in ascending order by location name. * * This function performs a `GET` to the `/admin/api/2021-01/fulfillment_orders/{fulfillment_order_id}/locations_for_move.json` endpoint. * @@ -8975,7 +8975,7 @@ impl ShippingAndFulfillment { } /** * Retrieves a list of locations that a fulfillment order can potentially move to. - The resulting list is sorted alphabetically in ascending order by location name. + The resulting list is sorted alphabetically in ascending order by location name. * * This function performs a `GET` to the `/admin/api/unstable/fulfillment_orders/{fulfillment_order_id}/locations_for_move.json` endpoint. * diff --git a/shopify/src/shopify_payments.rs b/shopify/src/shopify_payments.rs index 3b38bc3e..fae17b6e 100644 --- a/shopify/src/shopify_payments.rs +++ b/shopify/src/shopify_payments.rs @@ -140,7 +140,7 @@ impl ShopifyPayments { } /** * Retrieve all disputes ordered by initiated_at date and time (ISO 8601 format), with the most recent being first. - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/2020-01/shopify_payments/disputes.json` endpoint. * @@ -225,7 +225,7 @@ impl ShopifyPayments { } /** * Retrieve all disputes ordered by initiated_at date and time (ISO 8601 format), with the most recent being first. - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/2020-04/shopify_payments/disputes.json` endpoint. * @@ -278,7 +278,7 @@ impl ShopifyPayments { } /** * Retrieves a list of all payouts ordered by payout date, with the most recent being first. - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/2020-01/shopify_payments/payouts.json` endpoint. * @@ -370,7 +370,7 @@ impl ShopifyPayments { } /** * Retrieves a list of all payouts ordered by payout date, with the most recent being first. - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/2020-04/shopify_payments/payouts.json` endpoint. * @@ -462,7 +462,7 @@ impl ShopifyPayments { } /** * Retrieves a list of all payouts ordered by payout date, with the most recent being first. - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/2020-07/shopify_payments/payouts.json` endpoint. * @@ -554,7 +554,7 @@ impl ShopifyPayments { } /** * Retrieves a list of all payouts ordered by payout date, with the most recent being first. - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/2020-10/shopify_payments/payouts.json` endpoint. * @@ -646,7 +646,7 @@ impl ShopifyPayments { } /** * Retrieves a list of all payouts ordered by payout date, with the most recent being first. - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/2021-01/shopify_payments/payouts.json` endpoint. * @@ -738,7 +738,7 @@ impl ShopifyPayments { } /** * Retrieves a list of all payouts ordered by payout date, with the most recent being first. - Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. + Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. * * This function performs a `GET` to the `/admin/api/unstable/shopify_payments/payouts.json` endpoint. * @@ -832,22 +832,22 @@ impl ShopifyPayments { .await } /** - * Retrieves a list of all balance transactions ordered by processing + * Retrieves a list of all balance transactions ordered by processing time, with the most recent being first. Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the page parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints. - * - * This function performs a `GET` to the `/admin/api/2020-01/shopify_payments/balance/transactions.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/shopify_payments/transaction#index-2020-01 - * - * **Parameters:** - * - * * `since_id: &str` -- Filter response to transactions exclusively after the specified ID. - * * `last_id: &str` -- Filter response to transactions exclusively before the specified ID. - * * `test: &str` -- Filter response to transactions placed in test mode. - * * `payout_id: &str` -- Filter response to transactions paid out in the specified payout. - * * `payout_status: &str` -- Filter response to transactions with the specified payout status. - */ + * + * This function performs a `GET` to the `/admin/api/2020-01/shopify_payments/balance/transactions.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/shopify_payments/transaction#index-2020-01 + * + * **Parameters:** + * + * * `since_id: &str` -- Filter response to transactions exclusively after the specified ID. + * * `last_id: &str` -- Filter response to transactions exclusively before the specified ID. + * * `test: &str` -- Filter response to transactions placed in test mode. + * * `payout_id: &str` -- Filter response to transactions paid out in the specified payout. + * * `payout_status: &str` -- Filter response to transactions with the specified payout status. + */ pub async fn deprecated_202001_get_balance_transaction( &self, since_id: &str, diff --git a/shopify/src/store_properties.rs b/shopify/src/store_properties.rs index c1f1f52b..80fd3d2a 100644 --- a/shopify/src/store_properties.rs +++ b/shopify/src/store_properties.rs @@ -48,15 +48,15 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Creates a country. - * - * This function performs a `POST` to the `/admin/api/2020-01/countries.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#create-2020-01 - */ + * + * This function performs a `POST` to the `/admin/api/2020-01/countries.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#create-2020-01 + */ pub async fn deprecated_202001_create_countries(&self, body: &serde_json::Value) -> Result<()> { let url = self.client.url("/admin/api/2020-01/countries.json", None); self.client @@ -131,19 +131,19 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Updates an existing country. - * - * This function performs a `PUT` to the `/admin/api/2020-01/countries/{country_id}.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#update-2020-01 - * - * **Parameters:** - * - * * `country_id: &str` -- storefront_access_token_id. - */ + * + * This function performs a `PUT` to the `/admin/api/2020-01/countries/{country_id}.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#update-2020-01 + * + * **Parameters:** + * + * * `country_id: &str` -- storefront_access_token_id. + */ pub async fn deprecated_202001_update_countries_param_country( &self, country_id: &str, @@ -234,15 +234,15 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Creates a country. - * - * This function performs a `POST` to the `/admin/api/2020-04/countries.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#create-2020-04 - */ + * + * This function performs a `POST` to the `/admin/api/2020-04/countries.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#create-2020-04 + */ pub async fn deprecated_202004_create_countries(&self, body: &serde_json::Value) -> Result<()> { let url = self.client.url("/admin/api/2020-04/countries.json", None); self.client @@ -317,19 +317,19 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Updates an existing country. - * - * This function performs a `PUT` to the `/admin/api/2020-04/countries/{country_id}.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#update-2020-04 - * - * **Parameters:** - * - * * `country_id: &str` -- storefront_access_token_id. - */ + * + * This function performs a `PUT` to the `/admin/api/2020-04/countries/{country_id}.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#update-2020-04 + * + * **Parameters:** + * + * * `country_id: &str` -- storefront_access_token_id. + */ pub async fn deprecated_202004_update_countries_param_country( &self, country_id: &str, @@ -420,15 +420,15 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Creates a country. - * - * This function performs a `POST` to the `/admin/api/2020-07/countries.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#create-2020-07 - */ + * + * This function performs a `POST` to the `/admin/api/2020-07/countries.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#create-2020-07 + */ pub async fn deprecated_202007_create_countries(&self, body: &serde_json::Value) -> Result<()> { let url = self.client.url("/admin/api/2020-07/countries.json", None); self.client @@ -503,19 +503,19 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Updates an existing country. - * - * This function performs a `PUT` to the `/admin/api/2020-07/countries/{country_id}.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#update-2020-07 - * - * **Parameters:** - * - * * `country_id: &str` -- storefront_access_token_id. - */ + * + * This function performs a `PUT` to the `/admin/api/2020-07/countries/{country_id}.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#update-2020-07 + * + * **Parameters:** + * + * * `country_id: &str` -- storefront_access_token_id. + */ pub async fn deprecated_202007_update_countries_param_country( &self, country_id: &str, @@ -606,15 +606,15 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Creates a country. - * - * This function performs a `POST` to the `/admin/api/2020-10/countries.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#create-2020-10 - */ + * + * This function performs a `POST` to the `/admin/api/2020-10/countries.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#create-2020-10 + */ pub async fn create_countries(&self, body: &serde_json::Value) -> Result<()> { let url = self.client.url("/admin/api/2020-10/countries.json", None); self.client @@ -685,19 +685,19 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Updates an existing country. - * - * This function performs a `PUT` to the `/admin/api/2020-10/countries/{country_id}.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#update-2020-10 - * - * **Parameters:** - * - * * `country_id: &str` -- storefront_access_token_id. - */ + * + * This function performs a `PUT` to the `/admin/api/2020-10/countries/{country_id}.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#update-2020-10 + * + * **Parameters:** + * + * * `country_id: &str` -- storefront_access_token_id. + */ pub async fn update_countries_param_country( &self, country_id: &str, @@ -785,15 +785,15 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Creates a country. - * - * This function performs a `POST` to the `/admin/api/2021-01/countries.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#create-2021-01 - */ + * + * This function performs a `POST` to the `/admin/api/2021-01/countries.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#create-2021-01 + */ pub async fn deprecated_202101_create_countries(&self, body: &serde_json::Value) -> Result<()> { let url = self.client.url("/admin/api/2021-01/countries.json", None); self.client @@ -868,19 +868,19 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Updates an existing country. - * - * This function performs a `PUT` to the `/admin/api/2021-01/countries/{country_id}.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#update-2021-01 - * - * **Parameters:** - * - * * `country_id: &str` -- storefront_access_token_id. - */ + * + * This function performs a `PUT` to the `/admin/api/2021-01/countries/{country_id}.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#update-2021-01 + * + * **Parameters:** + * + * * `country_id: &str` -- storefront_access_token_id. + */ pub async fn deprecated_202101_update_countries_param_country( &self, country_id: &str, @@ -975,15 +975,15 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Creates a country. - * - * This function performs a `POST` to the `/admin/api/unstable/countries.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#create-unstable - */ + * + * This function performs a `POST` to the `/admin/api/unstable/countries.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#create-unstable + */ pub async fn deprecated_unstable_create_countries( &self, body: &serde_json::Value, @@ -1061,19 +1061,19 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Updates an existing country. - * - * This function performs a `PUT` to the `/admin/api/unstable/countries/{country_id}.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#update-unstable - * - * **Parameters:** - * - * * `country_id: &str` -- storefront_access_token_id. - */ + * + * This function performs a `PUT` to the `/admin/api/unstable/countries/{country_id}.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/country#update-unstable + * + * **Parameters:** + * + * * `country_id: &str` -- storefront_access_token_id. + */ pub async fn deprecated_unstable_update_countries_param_country( &self, country_id: &str, @@ -1477,20 +1477,20 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Updates an existing province for a country. - * - * This function performs a `PUT` to the `/admin/api/2020-01/countries/{country_id}/provinces/{province_id}.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/province#update-2020-01 - * - * **Parameters:** - * - * * `country_id: &str` -- storefront_access_token_id. - * * `province_id: &str` -- storefront_access_token_id. - */ + * + * This function performs a `PUT` to the `/admin/api/2020-01/countries/{country_id}/provinces/{province_id}.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/province#update-2020-01 + * + * **Parameters:** + * + * * `country_id: &str` -- storefront_access_token_id. + * * `province_id: &str` -- storefront_access_token_id. + */ pub async fn deprecated_202001_update_countries_param_country_provinces_province( &self, country_id: &str, @@ -1636,20 +1636,20 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Updates an existing province for a country. - * - * This function performs a `PUT` to the `/admin/api/2020-04/countries/{country_id}/provinces/{province_id}.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/province#update-2020-04 - * - * **Parameters:** - * - * * `country_id: &str` -- storefront_access_token_id. - * * `province_id: &str` -- storefront_access_token_id. - */ + * + * This function performs a `PUT` to the `/admin/api/2020-04/countries/{country_id}/provinces/{province_id}.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/province#update-2020-04 + * + * **Parameters:** + * + * * `country_id: &str` -- storefront_access_token_id. + * * `province_id: &str` -- storefront_access_token_id. + */ pub async fn deprecated_202004_update_countries_param_country_provinces_province( &self, country_id: &str, @@ -1795,20 +1795,20 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Updates an existing province for a country. - * - * This function performs a `PUT` to the `/admin/api/2020-07/countries/{country_id}/provinces/{province_id}.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/province#update-2020-07 - * - * **Parameters:** - * - * * `country_id: &str` -- storefront_access_token_id. - * * `province_id: &str` -- storefront_access_token_id. - */ + * + * This function performs a `PUT` to the `/admin/api/2020-07/countries/{country_id}/provinces/{province_id}.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/province#update-2020-07 + * + * **Parameters:** + * + * * `country_id: &str` -- storefront_access_token_id. + * * `province_id: &str` -- storefront_access_token_id. + */ pub async fn deprecated_202007_update_countries_param_country_provinces_province( &self, country_id: &str, @@ -1954,20 +1954,20 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Updates an existing province for a country. - * - * This function performs a `PUT` to the `/admin/api/2020-10/countries/{country_id}/provinces/{province_id}.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/province#update-2020-10 - * - * **Parameters:** - * - * * `country_id: &str` -- storefront_access_token_id. - * * `province_id: &str` -- storefront_access_token_id. - */ + * + * This function performs a `PUT` to the `/admin/api/2020-10/countries/{country_id}/provinces/{province_id}.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/province#update-2020-10 + * + * **Parameters:** + * + * * `country_id: &str` -- storefront_access_token_id. + * * `province_id: &str` -- storefront_access_token_id. + */ pub async fn update_countries_param_country_provinces_province( &self, country_id: &str, @@ -2113,20 +2113,20 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Updates an existing province for a country. - * - * This function performs a `PUT` to the `/admin/api/2021-01/countries/{country_id}/provinces/{province_id}.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/province#update-2021-01 - * - * **Parameters:** - * - * * `country_id: &str` -- storefront_access_token_id. - * * `province_id: &str` -- storefront_access_token_id. - */ + * + * This function performs a `PUT` to the `/admin/api/2021-01/countries/{country_id}/provinces/{province_id}.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/province#update-2021-01 + * + * **Parameters:** + * + * * `country_id: &str` -- storefront_access_token_id. + * * `province_id: &str` -- storefront_access_token_id. + */ pub async fn deprecated_202101_update_countries_param_country_provinces_province( &self, country_id: &str, @@ -2272,20 +2272,20 @@ impl StoreProperties { .await } /** - * Caution + * Caution As of version 2020-10, the tax field is deprecated. Updates an existing province for a country. - * - * This function performs a `PUT` to the `/admin/api/unstable/countries/{country_id}/provinces/{province_id}.json` endpoint. - * - * https://shopify.dev/docs/admin-api/rest/reference/store-properties/province#update-unstable - * - * **Parameters:** - * - * * `country_id: &str` -- storefront_access_token_id. - * * `province_id: &str` -- storefront_access_token_id. - */ + * + * This function performs a `PUT` to the `/admin/api/unstable/countries/{country_id}/provinces/{province_id}.json` endpoint. + * + * https://shopify.dev/docs/admin-api/rest/reference/store-properties/province#update-unstable + * + * **Parameters:** + * + * * `country_id: &str` -- storefront_access_token_id. + * * `province_id: &str` -- storefront_access_token_id. + */ pub async fn deprecated_unstable_update_countries_param_country_provinces_province( &self, country_id: &str, diff --git a/slack/src/types.rs b/slack/src/types.rs index 7c1c2865..73d8dd6d 100644 --- a/slack/src/types.rs +++ b/slack/src/types.rs @@ -2120,11 +2120,12 @@ pub struct NewPagingStyle { pub next_cursor: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Warnings { #[serde(rename = "method_deprecated")] MethodDeprecated, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2141,11 +2142,6 @@ impl std::fmt::Display for Warnings { } } -impl Default for Warnings { - fn default() -> Warnings { - Warnings::Noop - } -} impl Warnings { pub fn is_noop(&self) -> bool { matches!(self, Warnings::Noop) @@ -2206,13 +2202,14 @@ pub struct ObjsResponseMetadataAnyOf { pub objs_response_metadata: ObjsResponseMetadata, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AutoType { #[serde(rename = "admin")] Admin, #[serde(rename = "owner")] Owner, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2230,11 +2227,6 @@ impl std::fmt::Display for AutoType { } } -impl Default for AutoType { - fn default() -> AutoType { - AutoType::Noop - } -} impl AutoType { pub fn is_noop(&self) -> bool { matches!(self, AutoType::Noop) @@ -2417,7 +2409,7 @@ pub struct TzAnyOf { pub value: serde_json::Value, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Plan { #[serde(rename = "compliance")] Compliance, @@ -2428,6 +2420,7 @@ pub enum Plan { #[serde(rename = "std")] Std, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2447,11 +2440,6 @@ impl std::fmt::Display for Plan { } } -impl Default for Plan { - fn default() -> Plan { - Plan::Noop - } -} impl Plan { pub fn is_noop(&self) -> bool { matches!(self, Plan::Noop) @@ -2644,7 +2632,7 @@ pub struct OptionsAnyOf { pub objs_team_profile_field_option: ObjsTeamProfileFieldOption, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Type { #[serde(rename = "date")] Date, @@ -2659,6 +2647,7 @@ pub enum Type { #[serde(rename = "user")] User, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2680,11 +2669,6 @@ impl std::fmt::Display for Type { } } -impl Default for Type { - fn default() -> Type { - Type::Noop - } -} impl Type { pub fn is_noop(&self) -> bool { matches!(self, Type::Noop) @@ -4796,11 +4780,12 @@ pub struct MigrationExchangeSuccessSchema { pub user_id_map: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ItemsType { #[serde(rename = "file")] File, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4817,11 +4802,6 @@ impl std::fmt::Display for ItemsType { } } -impl Default for ItemsType { - fn default() -> ItemsType { - ItemsType::Noop - } -} impl ItemsType { pub fn is_noop(&self) -> bool { matches!(self, ItemsType::Noop) @@ -4848,11 +4828,12 @@ pub struct Items { pub type_: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MessagePinType { #[serde(rename = "message")] Message, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4869,11 +4850,6 @@ impl std::fmt::Display for MessagePinType { } } -impl Default for MessagePinType { - fn default() -> MessagePinType { - MessagePinType::Noop - } -} impl MessagePinType { pub fn is_noop(&self) -> bool { matches!(self, MessagePinType::Noop) diff --git a/stripe/src/types.rs b/stripe/src/types.rs index 9455c75e..adcc1b64 100644 --- a/stripe/src/types.rs +++ b/stripe/src/types.rs @@ -3,9 +3,9 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; /** -* The business type. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The business type. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BusinessType { #[serde(rename = "company")] Company, @@ -16,6 +16,7 @@ pub enum BusinessType { #[serde(rename = "non_profit")] NonProfit, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -35,11 +36,6 @@ impl std::fmt::Display for BusinessType { } } -impl Default for BusinessType { - fn default() -> BusinessType { - BusinessType::Noop - } -} impl BusinessType { pub fn is_noop(&self) -> bool { matches!(self, BusinessType::Noop) @@ -93,13 +89,14 @@ impl DataAnyOf { } /** -* String representing the object's type. Objects of the same type share the same value. Always has the value `list`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. Always has the value `list`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Object { #[serde(rename = "list")] List, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -116,11 +113,6 @@ impl std::fmt::Display for Object { } } -impl Default for Object { - fn default() -> Object { - Object::Noop - } -} impl Object { pub fn is_noop(&self) -> bool { matches!(self, Object::Noop) @@ -159,13 +151,14 @@ pub struct ExternalAccounts { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AccountObject { #[serde(rename = "account")] Account, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -182,11 +175,6 @@ impl std::fmt::Display for AccountObject { } } -impl Default for AccountObject { - fn default() -> AccountObject { - AccountObject::Noop - } -} impl AccountObject { pub fn is_noop(&self) -> bool { matches!(self, AccountObject::Noop) @@ -194,9 +182,9 @@ impl AccountObject { } /** -* The Stripe account type. Can be `standard`, `express`, or `custom`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The Stripe account type. Can be `standard`, `express`, or `custom`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Type { #[serde(rename = "custom")] Custom, @@ -205,6 +193,7 @@ pub enum Type { #[serde(rename = "standard")] Standard, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -223,11 +212,6 @@ impl std::fmt::Display for Type { } } -impl Default for Type { - fn default() -> Type { - Type::Noop - } -} impl Type { pub fn is_noop(&self) -> bool { matches!(self, Type::Noop) @@ -645,9 +629,9 @@ pub struct AccountBusinessProfile { } /** -* The status of the transfers capability of the account, or whether your platform can transfer funds to the account. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the transfers capability of the account, or whether your platform can transfer funds to the account. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Transfers { #[serde(rename = "active")] Active, @@ -656,6 +640,7 @@ pub enum Transfers { #[serde(rename = "pending")] Pending, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -674,11 +659,6 @@ impl std::fmt::Display for Transfers { } } -impl Default for Transfers { - fn default() -> Transfers { - Transfers::Noop - } -} impl Transfers { pub fn is_noop(&self) -> bool { matches!(self, Transfers::Noop) @@ -1139,13 +1119,14 @@ pub struct AccountFutureRequirements { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AccountLinkObject { #[serde(rename = "account_link")] AccountLink, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1162,11 +1143,6 @@ impl std::fmt::Display for AccountLinkObject { } } -impl Default for AccountLinkObject { - fn default() -> AccountLinkObject { - AccountLinkObject::Noop - } -} impl AccountLinkObject { pub fn is_noop(&self) -> bool { matches!(self, AccountLinkObject::Noop) @@ -1372,9 +1348,9 @@ pub struct AccountRequirementsAlternative { } /** -* The code for the type of error. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The code for the type of error. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Code { #[serde(rename = "invalid_address_city_state_postal_code")] InvalidAddressCityStatePostalCode, @@ -1467,6 +1443,7 @@ pub enum Code { #[serde(rename = "verification_requires_additional_memorandum_of_associations")] VerificationRequiresAdditionalMemorandumOfAssociations, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1537,11 +1514,6 @@ impl std::fmt::Display for Code { } } -impl Default for Code { - fn default() -> Code { - Code::Noop - } -} impl Code { pub fn is_noop(&self) -> bool { matches!(self, Code::Noop) @@ -1673,15 +1645,16 @@ pub struct AccountTosAcceptance { } /** -* The controller type. Can be `application`, if a Connect application controls the account, or `account`, if the account controls itself. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The controller type. Can be `application`, if a Connect application controls the account, or `account`, if the account controls itself. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AccountUnificationControllerType { #[serde(rename = "account")] Account, #[serde(rename = "application")] Application, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1699,11 +1672,6 @@ impl std::fmt::Display for AccountUnificationControllerType { } } -impl Default for AccountUnificationControllerType { - fn default() -> AccountUnificationControllerType { - AccountUnificationControllerType::Noop - } -} impl AccountUnificationControllerType { pub fn is_noop(&self) -> bool { matches!(self, AccountUnificationControllerType::Noop) @@ -1856,13 +1824,14 @@ impl std::convert::From for String { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AlipayAccountObject { #[serde(rename = "alipay_account")] AlipayAccount, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1879,11 +1848,6 @@ impl std::fmt::Display for AlipayAccountObject { } } -impl Default for AlipayAccountObject { - fn default() -> AlipayAccountObject { - AlipayAccountObject::Noop - } -} impl AlipayAccountObject { pub fn is_noop(&self) -> bool { matches!(self, AlipayAccountObject::Noop) @@ -2055,9 +2019,9 @@ impl SourceAnyOf { } /** -* The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ApiErrorsType { #[serde(rename = "api_error")] ApiError, @@ -2068,6 +2032,7 @@ pub enum ApiErrorsType { #[serde(rename = "invalid_request_error")] InvalidRequestError, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2087,11 +2052,6 @@ impl std::fmt::Display for ApiErrorsType { } } -impl Default for ApiErrorsType { - fn default() -> ApiErrorsType { - ApiErrorsType::Noop - } -} impl ApiErrorsType { pub fn is_noop(&self) -> bool { matches!(self, ApiErrorsType::Noop) @@ -2194,13 +2154,14 @@ pub struct ApiErrors { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ApplePayDomainObject { #[serde(rename = "apple_pay_domain")] ApplePayDomain, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2217,11 +2178,6 @@ impl std::fmt::Display for ApplePayDomainObject { } } -impl Default for ApplePayDomainObject { - fn default() -> ApplePayDomainObject { - ApplePayDomainObject::Noop - } -} impl ApplePayDomainObject { pub fn is_noop(&self) -> bool { matches!(self, ApplePayDomainObject::Noop) @@ -2274,13 +2230,14 @@ pub struct ApplePayDomain { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ApplicationObject { #[serde(rename = "application")] Application, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2297,11 +2254,6 @@ impl std::fmt::Display for ApplicationObject { } } -impl Default for ApplicationObject { - fn default() -> ApplicationObject { - ApplicationObject::Noop - } -} impl ApplicationObject { pub fn is_noop(&self) -> bool { matches!(self, ApplicationObject::Noop) @@ -2541,13 +2493,14 @@ impl std::convert::From for String { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PlatformFeeObject { #[serde(rename = "application_fee")] ApplicationFee, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2564,11 +2517,6 @@ impl std::fmt::Display for PlatformFeeObject { } } -impl Default for PlatformFeeObject { - fn default() -> PlatformFeeObject { - PlatformFeeObject::Noop - } -} impl PlatformFeeObject { pub fn is_noop(&self) -> bool { matches!(self, PlatformFeeObject::Noop) @@ -2698,9 +2646,9 @@ pub struct PlatformFee { } /** -* The status of the most recent automated tax calculation for this invoice. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the most recent automated tax calculation for this invoice. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Status { #[serde(rename = "complete")] Complete, @@ -2709,6 +2657,7 @@ pub enum Status { #[serde(rename = "requires_location_inputs")] RequiresLocationInputs, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2727,11 +2676,6 @@ impl std::fmt::Display for Status { } } -impl Default for Status { - fn default() -> Status { - Status::Noop - } -} impl Status { pub fn is_noop(&self) -> bool { matches!(self, Status::Noop) @@ -2757,13 +2701,14 @@ pub struct AutomaticTax { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BalanceObject { #[serde(rename = "balance")] Balance, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2780,11 +2725,6 @@ impl std::fmt::Display for BalanceObject { } } -impl Default for BalanceObject { - fn default() -> BalanceObject { - BalanceObject::Noop - } -} impl BalanceObject { pub fn is_noop(&self) -> bool { matches!(self, BalanceObject::Noop) @@ -2965,13 +2905,14 @@ pub struct BalanceDetail { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BalanceTransactionObject { #[serde(rename = "balance_transaction")] BalanceTransaction, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2988,11 +2929,6 @@ impl std::fmt::Display for BalanceTransactionObject { } } -impl Default for BalanceTransactionObject { - fn default() -> BalanceTransactionObject { - BalanceTransactionObject::Noop - } -} impl BalanceTransactionObject { pub fn is_noop(&self) -> bool { matches!(self, BalanceTransactionObject::Noop) @@ -3288,9 +3224,9 @@ impl std::convert::From for String { } /** -* Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BalanceTransactionType { #[serde(rename = "adjustment")] Adjustment, @@ -3357,6 +3293,7 @@ pub enum BalanceTransactionType { #[serde(rename = "transfer_refund")] TransferRefund, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3404,11 +3341,6 @@ impl std::fmt::Display for BalanceTransactionType { } } -impl Default for BalanceTransactionType { - fn default() -> BalanceTransactionType { - BalanceTransactionType::Noop - } -} impl BalanceTransactionType { pub fn is_noop(&self) -> bool { matches!(self, BalanceTransactionType::Noop) @@ -3555,13 +3487,14 @@ pub struct BalanceTransaction { pub type_: BalanceTransactionType, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AvailablePayoutMethods { #[serde(rename = "instant")] Instant, #[serde(rename = "standard")] Standard, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3579,11 +3512,6 @@ impl std::fmt::Display for AvailablePayoutMethods { } } -impl Default for AvailablePayoutMethods { - fn default() -> AvailablePayoutMethods { - AvailablePayoutMethods::Noop - } -} impl AvailablePayoutMethods { pub fn is_noop(&self) -> bool { matches!(self, AvailablePayoutMethods::Noop) @@ -3591,13 +3519,14 @@ impl AvailablePayoutMethods { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BankAccountObject { #[serde(rename = "bank_account")] BankAccount, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3614,11 +3543,6 @@ impl std::fmt::Display for BankAccountObject { } } -impl Default for BankAccountObject { - fn default() -> BankAccountObject { - BankAccountObject::Noop - } -} impl BankAccountObject { pub fn is_noop(&self) -> bool { matches!(self, BankAccountObject::Noop) @@ -3873,13 +3797,14 @@ pub struct BillingDetails { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PortalConfigurationObject { #[serde(rename = "billing_portal.configuration")] BillingPortalConfiguration, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3896,11 +3821,6 @@ impl std::fmt::Display for PortalConfigurationObject { } } -impl Default for PortalConfigurationObject { - fn default() -> PortalConfigurationObject { - PortalConfigurationObject::Noop - } -} impl PortalConfigurationObject { pub fn is_noop(&self) -> bool { matches!(self, PortalConfigurationObject::Noop) @@ -4052,9 +3972,9 @@ impl std::convert::From for String { } /** -* The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer’s `preferred_locales` or browser’s locale is used. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer’s `preferred_locales` or browser’s locale is used. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Locale { #[serde(rename = "auto")] Auto, @@ -4151,6 +4071,7 @@ pub enum Locale { #[serde(rename = "zh-TW")] ZhTw, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4213,11 +4134,6 @@ impl std::fmt::Display for Locale { } } -impl Default for Locale { - fn default() -> Locale { - Locale::Noop - } -} impl Locale { pub fn is_noop(&self) -> bool { matches!(self, Locale::Noop) @@ -4225,13 +4141,14 @@ impl Locale { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PortalSessionObject { #[serde(rename = "billing_portal.session")] BillingPortalSession, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4248,11 +4165,6 @@ impl std::fmt::Display for PortalSessionObject { } } -impl Default for PortalSessionObject { - fn default() -> PortalSessionObject { - PortalSessionObject::Noop - } -} impl PortalSessionObject { pub fn is_noop(&self) -> bool { matches!(self, PortalSessionObject::Noop) @@ -4364,13 +4276,14 @@ pub struct PortalSession { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BitcoinReceiverObject { #[serde(rename = "bitcoin_receiver")] BitcoinReceiver, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4387,11 +4300,6 @@ impl std::fmt::Display for BitcoinReceiverObject { } } -impl Default for BitcoinReceiverObject { - fn default() -> BitcoinReceiverObject { - BitcoinReceiverObject::Noop - } -} impl BitcoinReceiverObject { pub fn is_noop(&self) -> bool { matches!(self, BitcoinReceiverObject::Noop) @@ -4625,13 +4533,14 @@ pub struct BitcoinReceiver { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BitcoinTransactionObject { #[serde(rename = "bitcoin_transaction")] BitcoinTransaction, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4648,11 +4557,6 @@ impl std::fmt::Display for BitcoinTransactionObject { } } -impl Default for BitcoinTransactionObject { - fn default() -> BitcoinTransactionObject { - BitcoinTransactionObject::Noop - } -} impl BitcoinTransactionObject { pub fn is_noop(&self) -> bool { matches!(self, BitcoinTransactionObject::Noop) @@ -4724,13 +4628,14 @@ pub struct BitcoinTransaction { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CapabilityObject { #[serde(rename = "capability")] Capability, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4747,11 +4652,6 @@ impl std::fmt::Display for CapabilityObject { } } -impl Default for CapabilityObject { - fn default() -> CapabilityObject { - CapabilityObject::Noop - } -} impl CapabilityObject { pub fn is_noop(&self) -> bool { matches!(self, CapabilityObject::Noop) @@ -4759,9 +4659,9 @@ impl CapabilityObject { } /** -* The status of the capability. Can be `active`, `inactive`, `pending`, or `unrequested`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the capability. Can be `active`, `inactive`, `pending`, or `unrequested`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CapabilityStatus { #[serde(rename = "active")] Active, @@ -4774,6 +4674,7 @@ pub enum CapabilityStatus { #[serde(rename = "unrequested")] Unrequested, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4794,11 +4695,6 @@ impl std::fmt::Display for CapabilityStatus { } } -impl Default for CapabilityStatus { - fn default() -> CapabilityStatus { - CapabilityStatus::Noop - } -} impl CapabilityStatus { pub fn is_noop(&self) -> bool { matches!(self, CapabilityStatus::Noop) @@ -4866,13 +4762,14 @@ pub struct Capability { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CardObject { #[serde(rename = "card")] Card, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4889,11 +4786,6 @@ impl std::fmt::Display for CardObject { } } -impl Default for CardObject { - fn default() -> CardObject { - CardObject::Noop - } -} impl CardObject { pub fn is_noop(&self) -> bool { matches!(self, CardObject::Noop) @@ -5480,13 +5372,14 @@ impl std::convert::From for String { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ChargeObject { #[serde(rename = "charge")] Charge, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5503,11 +5396,6 @@ impl std::fmt::Display for ChargeObject { } } -impl Default for ChargeObject { - fn default() -> ChargeObject { - ChargeObject::Noop - } -} impl ChargeObject { pub fn is_noop(&self) -> bool { matches!(self, ChargeObject::Noop) @@ -5769,9 +5657,9 @@ impl std::convert::From for String { } /** -* The status of the payment is either `succeeded`, `pending`, or `failed`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the payment is either `succeeded`, `pending`, or `failed`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ChargeStatus { #[serde(rename = "failed")] Failed, @@ -5780,6 +5668,7 @@ pub enum ChargeStatus { #[serde(rename = "succeeded")] Succeeded, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5798,11 +5687,6 @@ impl std::fmt::Display for ChargeStatus { } } -impl Default for ChargeStatus { - fn default() -> ChargeStatus { - ChargeStatus::Noop - } -} impl ChargeStatus { pub fn is_noop(&self) -> bool { matches!(self, ChargeStatus::Noop) @@ -6367,15 +6251,16 @@ pub struct ChargeTransferData { } /** -* Describes whether Checkout should collect the customer's billing address. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Describes whether Checkout should collect the customer's billing address. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BillingAddressCollection { #[serde(rename = "auto")] Auto, #[serde(rename = "required")] Required, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6393,11 +6278,6 @@ impl std::fmt::Display for BillingAddressCollection { } } -impl Default for BillingAddressCollection { - fn default() -> BillingAddressCollection { - BillingAddressCollection::Noop - } -} impl BillingAddressCollection { pub fn is_noop(&self) -> bool { matches!(self, BillingAddressCollection::Noop) @@ -6405,15 +6285,16 @@ impl BillingAddressCollection { } /** -* Configure whether a Checkout Session creates a Customer when the Checkout Session completes. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Configure whether a Checkout Session creates a Customer when the Checkout Session completes. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CustomerCreation { #[serde(rename = "always")] Always, #[serde(rename = "if_required")] IfRequired, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6431,11 +6312,6 @@ impl std::fmt::Display for CustomerCreation { } } -impl Default for CustomerCreation { - fn default() -> CustomerCreation { - CustomerCreation::Noop - } -} impl CustomerCreation { pub fn is_noop(&self) -> bool { matches!(self, CustomerCreation::Noop) @@ -6479,9 +6355,9 @@ pub struct LineItems { } /** -* The IETF language tag of the locale Checkout is displayed in. If blank or `auto`, the browser's locale is used. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The IETF language tag of the locale Checkout is displayed in. If blank or `auto`, the browser's locale is used. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SessionLocale { #[serde(rename = "auto")] Auto, @@ -6566,6 +6442,7 @@ pub enum SessionLocale { #[serde(rename = "zh-TW")] ZhTw, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6622,11 +6499,6 @@ impl std::fmt::Display for SessionLocale { } } -impl Default for SessionLocale { - fn default() -> SessionLocale { - SessionLocale::Noop - } -} impl SessionLocale { pub fn is_noop(&self) -> bool { matches!(self, SessionLocale::Noop) @@ -6634,9 +6506,9 @@ impl SessionLocale { } /** -* The mode of the Checkout Session. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The mode of the Checkout Session. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Mode { #[serde(rename = "payment")] Payment, @@ -6645,6 +6517,7 @@ pub enum Mode { #[serde(rename = "subscription")] Subscription, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6663,11 +6536,6 @@ impl std::fmt::Display for Mode { } } -impl Default for Mode { - fn default() -> Mode { - Mode::Noop - } -} impl Mode { pub fn is_noop(&self) -> bool { matches!(self, Mode::Noop) @@ -6675,13 +6543,14 @@ impl Mode { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SessionObject { #[serde(rename = "checkout.session")] CheckoutSession, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6698,11 +6567,6 @@ impl std::fmt::Display for SessionObject { } } -impl Default for SessionObject { - fn default() -> SessionObject { - SessionObject::Noop - } -} impl SessionObject { pub fn is_noop(&self) -> bool { matches!(self, SessionObject::Noop) @@ -6762,10 +6626,10 @@ impl std::convert::From for String { } /** -* The payment status of the Checkout Session, one of `paid`, `unpaid`, or `no_payment_required`. -* You can use this value to decide when to fulfill your customer's order. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The payment status of the Checkout Session, one of `paid`, `unpaid`, or `no_payment_required`. + * You can use this value to decide when to fulfill your customer's order. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentStatus { #[serde(rename = "no_payment_required")] NoPaymentRequired, @@ -6774,6 +6638,7 @@ pub enum PaymentStatus { #[serde(rename = "unpaid")] Unpaid, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6792,11 +6657,6 @@ impl std::fmt::Display for PaymentStatus { } } -impl Default for PaymentStatus { - fn default() -> PaymentStatus { - PaymentStatus::Noop - } -} impl PaymentStatus { pub fn is_noop(&self) -> bool { matches!(self, PaymentStatus::Noop) @@ -6922,9 +6782,9 @@ impl std::convert::From for String { } /** -* The status of the Checkout Session, one of `open`, `complete`, or `expired`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the Checkout Session, one of `open`, `complete`, or `expired`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SessionStatus { #[serde(rename = "complete")] Complete, @@ -6933,6 +6793,7 @@ pub enum SessionStatus { #[serde(rename = "open")] Open, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6951,11 +6812,6 @@ impl std::fmt::Display for SessionStatus { } } -impl Default for SessionStatus { - fn default() -> SessionStatus { - SessionStatus::Noop - } -} impl SessionStatus { pub fn is_noop(&self) -> bool { matches!(self, SessionStatus::Noop) @@ -6963,12 +6819,12 @@ impl SessionStatus { } /** -* Describes the type of transaction being performed by Checkout in order to customize -* relevant text on the page, such as the submit button. `submit_type` can only be -* specified on Checkout Sessions in `payment` mode, but not Checkout Sessions -* in `subscription` or `setup` mode. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Describes the type of transaction being performed by Checkout in order to customize + * relevant text on the page, such as the submit button. `submit_type` can only be + * specified on Checkout Sessions in `payment` mode, but not Checkout Sessions + * in `subscription` or `setup` mode. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SubmitType { #[serde(rename = "auto")] Auto, @@ -6979,6 +6835,7 @@ pub enum SubmitType { #[serde(rename = "pay")] Pay, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6998,11 +6855,6 @@ impl std::fmt::Display for SubmitType { } } -impl Default for SubmitType { - fn default() -> SubmitType { - SubmitType::Noop - } -} impl SubmitType { pub fn is_noop(&self) -> bool { matches!(self, SubmitType::Noop) @@ -7580,13 +7432,14 @@ pub struct Session { pub url: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DefaultFor { #[serde(rename = "invoice")] Invoice, #[serde(rename = "subscription")] Subscription, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7604,11 +7457,6 @@ impl std::fmt::Display for DefaultFor { } } -impl Default for DefaultFor { - fn default() -> DefaultFor { - DefaultFor::Noop - } -} impl DefaultFor { pub fn is_noop(&self) -> bool { matches!(self, DefaultFor::Noop) @@ -7616,9 +7464,9 @@ impl DefaultFor { } /** -* Payment schedule for the mandate. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Payment schedule for the mandate. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentSchedule { #[serde(rename = "combined")] Combined, @@ -7627,6 +7475,7 @@ pub enum PaymentSchedule { #[serde(rename = "sporadic")] Sporadic, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7645,11 +7494,6 @@ impl std::fmt::Display for PaymentSchedule { } } -impl Default for PaymentSchedule { - fn default() -> PaymentSchedule { - PaymentSchedule::Noop - } -} impl PaymentSchedule { pub fn is_noop(&self) -> bool { matches!(self, PaymentSchedule::Noop) @@ -7657,15 +7501,16 @@ impl PaymentSchedule { } /** -* Transaction type of the mandate. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Transaction type of the mandate. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TransactionType { #[serde(rename = "business")] Business, #[serde(rename = "personal")] Personal, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7683,11 +7528,6 @@ impl std::fmt::Display for TransactionType { } } -impl Default for TransactionType { - fn default() -> TransactionType { - TransactionType::Noop - } -} impl TransactionType { pub fn is_noop(&self) -> bool { matches!(self, TransactionType::Noop) @@ -7737,15 +7577,16 @@ pub struct CheckoutAcssDebitMandateOptions { } /** -* Currency supported by the bank account. Returned when the Session is in `setup` mode. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Currency supported by the bank account. Returned when the Session is in `setup` mode. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Currency { #[serde(rename = "cad")] Cad, #[serde(rename = "usd")] Usd, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7763,11 +7604,6 @@ impl std::fmt::Display for Currency { } } -impl Default for Currency { - fn default() -> Currency { - Currency::Noop - } -} impl Currency { pub fn is_noop(&self) -> bool { matches!(self, Currency::Noop) @@ -7775,9 +7611,9 @@ impl Currency { } /** -* Bank account verification method. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Bank account verification method. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum VerificationMethod { #[serde(rename = "automatic")] Automatic, @@ -7786,6 +7622,7 @@ pub enum VerificationMethod { #[serde(rename = "microdeposits")] Microdeposits, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7804,11 +7641,6 @@ impl std::fmt::Display for VerificationMethod { } } -impl Default for VerificationMethod { - fn default() -> VerificationMethod { - VerificationMethod::Noop - } -} impl VerificationMethod { pub fn is_noop(&self) -> bool { matches!(self, VerificationMethod::Noop) @@ -7894,15 +7726,16 @@ pub struct CheckoutSessionPaymentMethodOptions { } /** -* Bank account verification method. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Bank account verification method. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CheckoutUsBankAccountPaymentMethodOptionsVerification { #[serde(rename = "automatic")] Automatic, #[serde(rename = "instant")] Instant, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7920,11 +7753,6 @@ impl std::fmt::Display for CheckoutUsBankAccountPaymentMethodOptionsVerification } } -impl Default for CheckoutUsBankAccountPaymentMethodOptionsVerification { - fn default() -> CheckoutUsBankAccountPaymentMethodOptionsVerification { - CheckoutUsBankAccountPaymentMethodOptionsVerification::Noop - } -} impl CheckoutUsBankAccountPaymentMethodOptionsVerification { pub fn is_noop(&self) -> bool { matches!( @@ -7945,13 +7773,14 @@ pub struct CheckoutUsBankAccountPaymentMethodOptions { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ConnectCollectionTransferObject { #[serde(rename = "connect_collection_transfer")] ConnectCollectionTransfer, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -7970,11 +7799,6 @@ impl std::fmt::Display for ConnectCollectionTransferObject { } } -impl Default for ConnectCollectionTransferObject { - fn default() -> ConnectCollectionTransferObject { - ConnectCollectionTransferObject::Noop - } -} impl ConnectCollectionTransferObject { pub fn is_noop(&self) -> bool { matches!(self, ConnectCollectionTransferObject::Noop) @@ -8031,13 +7855,14 @@ pub struct ConnectCollectionTransfer { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CountrySpecObject { #[serde(rename = "country_spec")] CountrySpec, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8054,11 +7879,6 @@ impl std::fmt::Display for CountrySpecObject { } } -impl Default for CountrySpecObject { - fn default() -> CountrySpecObject { - CountrySpecObject::Noop - } -} impl CountrySpecObject { pub fn is_noop(&self) -> bool { matches!(self, CountrySpecObject::Noop) @@ -8175,9 +7995,9 @@ pub struct CountrySpecVerificationFields { } /** -* One of `forever`, `once`, and `repeating`. Describes how long a customer who applies this coupon will get the discount. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * One of `forever`, `once`, and `repeating`. Describes how long a customer who applies this coupon will get the discount. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Duration { #[serde(rename = "forever")] Forever, @@ -8186,6 +8006,7 @@ pub enum Duration { #[serde(rename = "repeating")] Repeating, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8204,11 +8025,6 @@ impl std::fmt::Display for Duration { } } -impl Default for Duration { - fn default() -> Duration { - Duration::Noop - } -} impl Duration { pub fn is_noop(&self) -> bool { matches!(self, Duration::Noop) @@ -8216,13 +8032,14 @@ impl Duration { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CouponObject { #[serde(rename = "coupon")] Coupon, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8239,11 +8056,6 @@ impl std::fmt::Display for CouponObject { } } -impl Default for CouponObject { - fn default() -> CouponObject { - CouponObject::Noop - } -} impl CouponObject { pub fn is_noop(&self) -> bool { matches!(self, CouponObject::Noop) @@ -8507,13 +8319,14 @@ pub struct Lines { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CreditNoteObject { #[serde(rename = "credit_note")] CreditNote, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8530,11 +8343,6 @@ impl std::fmt::Display for CreditNoteObject { } } -impl Default for CreditNoteObject { - fn default() -> CreditNoteObject { - CreditNoteObject::Noop - } -} impl CreditNoteObject { pub fn is_noop(&self) -> bool { matches!(self, CreditNoteObject::Noop) @@ -8542,9 +8350,9 @@ impl CreditNoteObject { } /** -* Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Reason { #[serde(rename = "duplicate")] Duplicate, @@ -8555,6 +8363,7 @@ pub enum Reason { #[serde(rename = "product_unsatisfactory")] ProductUnsatisfactory, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8574,11 +8383,6 @@ impl std::fmt::Display for Reason { } } -impl Default for Reason { - fn default() -> Reason { - Reason::Noop - } -} impl Reason { pub fn is_noop(&self) -> bool { matches!(self, Reason::Noop) @@ -8638,15 +8442,16 @@ impl std::convert::From for String { } /** -* Status of this credit note, one of `issued` or `void`. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Status of this credit note, one of `issued` or `void`. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CreditNoteStatus { #[serde(rename = "issued")] Issued, #[serde(rename = "void")] Void, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8664,11 +8469,6 @@ impl std::fmt::Display for CreditNoteStatus { } } -impl Default for CreditNoteStatus { - fn default() -> CreditNoteStatus { - CreditNoteStatus::Noop - } -} impl CreditNoteStatus { pub fn is_noop(&self) -> bool { matches!(self, CreditNoteStatus::Noop) @@ -8676,15 +8476,16 @@ impl CreditNoteStatus { } /** -* Type of this credit note, one of `pre_payment` or `post_payment`. A `pre_payment` credit note means it was issued when the invoice was open. A `post_payment` credit note means it was issued when the invoice was paid. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Type of this credit note, one of `pre_payment` or `post_payment`. A `pre_payment` credit note means it was issued when the invoice was open. A `post_payment` credit note means it was issued when the invoice was paid. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CreditNoteType { #[serde(rename = "post_payment")] PostPayment, #[serde(rename = "pre_payment")] PrePayment, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8702,11 +8503,6 @@ impl std::fmt::Display for CreditNoteType { } } -impl Default for CreditNoteType { - fn default() -> CreditNoteType { - CreditNoteType::Noop - } -} impl CreditNoteType { pub fn is_noop(&self) -> bool { matches!(self, CreditNoteType::Noop) @@ -8914,13 +8710,14 @@ pub struct CreditNote { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CreditNoteLineItemObject { #[serde(rename = "credit_note_line_item")] CreditNoteLineItem, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8937,11 +8734,6 @@ impl std::fmt::Display for CreditNoteLineItemObject { } } -impl Default for CreditNoteLineItemObject { - fn default() -> CreditNoteLineItemObject { - CreditNoteLineItemObject::Noop - } -} impl CreditNoteLineItemObject { pub fn is_noop(&self) -> bool { matches!(self, CreditNoteLineItemObject::Noop) @@ -8949,15 +8741,16 @@ impl CreditNoteLineItemObject { } /** -* The type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. When the type is `invoice_line_item` there is an additional `invoice_line_item` property on the resource the value of which is the id of the credited line item on the invoice. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. When the type is `invoice_line_item` there is an additional `invoice_line_item` property on the resource the value of which is the id of the credited line item on the invoice. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CreditNoteLineItemType { #[serde(rename = "custom_line_item")] CustomLineItem, #[serde(rename = "invoice_line_item")] InvoiceLineItem, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8975,11 +8768,6 @@ impl std::fmt::Display for CreditNoteLineItemType { } } -impl Default for CreditNoteLineItemType { - fn default() -> CreditNoteLineItemType { - CreditNoteLineItemType::Noop - } -} impl CreditNoteLineItemType { pub fn is_noop(&self) -> bool { matches!(self, CreditNoteLineItemType::Noop) @@ -9297,13 +9085,14 @@ impl std::convert::From for String { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CustomerObject { #[serde(rename = "customer")] Customer, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9320,11 +9109,6 @@ impl std::fmt::Display for CustomerObject { } } -impl Default for CustomerObject { - fn default() -> CustomerObject { - CustomerObject::Noop - } -} impl CustomerObject { pub fn is_noop(&self) -> bool { matches!(self, CustomerObject::Noop) @@ -9486,9 +9270,9 @@ pub struct Subscriptions { } /** -* Describes the customer's tax exemption status. One of `none`, `exempt`, or `reverse`. When set to `reverse`, invoice and receipt PDFs include the text **"Reverse charge"**. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Describes the customer's tax exemption status. One of `none`, `exempt`, or `reverse`. When set to `reverse`, invoice and receipt PDFs include the text **"Reverse charge"**. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TaxExempt { #[serde(rename = "exempt")] Exempt, @@ -9497,6 +9281,7 @@ pub enum TaxExempt { #[serde(rename = "reverse")] Reverse, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9515,11 +9300,6 @@ impl std::fmt::Display for TaxExempt { } } -impl Default for TaxExempt { - fn default() -> TaxExempt { - TaxExempt::Noop - } -} impl TaxExempt { pub fn is_noop(&self) -> bool { matches!(self, TaxExempt::Noop) @@ -9838,15 +9618,16 @@ pub struct Customer { } /** -* The type of customer acceptance information included with the Mandate. One of `online` or `offline`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of customer acceptance information included with the Mandate. One of `online` or `offline`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CustomerAcceptanceType { #[serde(rename = "offline")] Offline, #[serde(rename = "online")] Online, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -9864,11 +9645,6 @@ impl std::fmt::Display for CustomerAcceptanceType { } } -impl Default for CustomerAcceptanceType { - fn default() -> CustomerAcceptanceType { - CustomerAcceptanceType::Noop - } -} impl CustomerAcceptanceType { pub fn is_noop(&self) -> bool { matches!(self, CustomerAcceptanceType::Noop) @@ -10009,13 +9785,14 @@ impl std::convert::From for String { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CustomerBalanceTransactionObject { #[serde(rename = "customer_balance_transaction")] CustomerBalanceTransaction, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10034,11 +9811,6 @@ impl std::fmt::Display for CustomerBalanceTransactionObject { } } -impl Default for CustomerBalanceTransactionObject { - fn default() -> CustomerBalanceTransactionObject { - CustomerBalanceTransactionObject::Noop - } -} impl CustomerBalanceTransactionObject { pub fn is_noop(&self) -> bool { matches!(self, CustomerBalanceTransactionObject::Noop) @@ -10046,9 +9818,9 @@ impl CustomerBalanceTransactionObject { } /** -* Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, or `unapplied_from_invoice`. See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, or `unapplied_from_invoice`. See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CustomerBalanceTransactionType { #[serde(rename = "adjustment")] Adjustment, @@ -10069,6 +9841,7 @@ pub enum CustomerBalanceTransactionType { #[serde(rename = "unspent_receiver_credit")] UnspentReceiverCredit, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10093,11 +9866,6 @@ impl std::fmt::Display for CustomerBalanceTransactionType { } } -impl Default for CustomerBalanceTransactionType { - fn default() -> CustomerBalanceTransactionType { - CustomerBalanceTransactionType::Noop - } -} impl CustomerBalanceTransactionType { pub fn is_noop(&self) -> bool { matches!(self, CustomerBalanceTransactionType::Noop) @@ -10232,9 +10000,9 @@ pub struct CustomerBalanceTransaction { } /** -* Surfaces if automatic tax computation is possible given the current customer location information. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Surfaces if automatic tax computation is possible given the current customer location information. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CustomerTaxAutomatic { #[serde(rename = "failed")] Failed, @@ -10245,6 +10013,7 @@ pub enum CustomerTaxAutomatic { #[serde(rename = "unrecognized_location")] UnrecognizedLocation, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10264,11 +10033,6 @@ impl std::fmt::Display for CustomerTaxAutomatic { } } -impl Default for CustomerTaxAutomatic { - fn default() -> CustomerTaxAutomatic { - CustomerTaxAutomatic::Noop - } -} impl CustomerTaxAutomatic { pub fn is_noop(&self) -> bool { matches!(self, CustomerTaxAutomatic::Noop) @@ -10300,9 +10064,9 @@ pub struct CustomerTax { } /** -* The data source used to infer the customer's location. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The data source used to infer the customer's location. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Source { #[serde(rename = "billing_address")] BillingAddress, @@ -10313,6 +10077,7 @@ pub enum Source { #[serde(rename = "shipping_destination")] ShippingDestination, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10332,11 +10097,6 @@ impl std::fmt::Display for Source { } } -impl Default for Source { - fn default() -> Source { - Source::Noop - } -} impl Source { pub fn is_noop(&self) -> bool { matches!(self, Source::Noop) @@ -10606,13 +10366,14 @@ pub struct DeletedCustomer { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeletedDiscountObject { #[serde(rename = "discount")] Discount, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10629,11 +10390,6 @@ impl std::fmt::Display for DeletedDiscountObject { } } -impl Default for DeletedDiscountObject { - fn default() -> DeletedDiscountObject { - DeletedDiscountObject::Noop - } -} impl DeletedDiscountObject { pub fn is_noop(&self) -> bool { matches!(self, DeletedDiscountObject::Noop) @@ -10812,13 +10568,14 @@ impl DeletedExternalAccountAnyOf { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeletedInvoiceObject { #[serde(rename = "invoice")] Invoice, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10835,11 +10592,6 @@ impl std::fmt::Display for DeletedInvoiceObject { } } -impl Default for DeletedInvoiceObject { - fn default() -> DeletedInvoiceObject { - DeletedInvoiceObject::Noop - } -} impl DeletedInvoiceObject { pub fn is_noop(&self) -> bool { matches!(self, DeletedInvoiceObject::Noop) @@ -10874,13 +10626,14 @@ pub struct DeletedInvoice { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeletedInvoiceItemObject { #[serde(rename = "invoiceitem")] Invoiceitem, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10897,11 +10650,6 @@ impl std::fmt::Display for DeletedInvoiceItemObject { } } -impl Default for DeletedInvoiceItemObject { - fn default() -> DeletedInvoiceItemObject { - DeletedInvoiceItemObject::Noop - } -} impl DeletedInvoiceItemObject { pub fn is_noop(&self) -> bool { matches!(self, DeletedInvoiceItemObject::Noop) @@ -10996,13 +10744,14 @@ impl DeletedPaymentSourceAnyOf { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeletedPersonObject { #[serde(rename = "person")] Person, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11019,11 +10768,6 @@ impl std::fmt::Display for DeletedPersonObject { } } -impl Default for DeletedPersonObject { - fn default() -> DeletedPersonObject { - DeletedPersonObject::Noop - } -} impl DeletedPersonObject { pub fn is_noop(&self) -> bool { matches!(self, DeletedPersonObject::Noop) @@ -11058,13 +10802,14 @@ pub struct DeletedPerson { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeletedPlanObject { #[serde(rename = "plan")] Plan, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11081,11 +10826,6 @@ impl std::fmt::Display for DeletedPlanObject { } } -impl Default for DeletedPlanObject { - fn default() -> DeletedPlanObject { - DeletedPlanObject::Noop - } -} impl DeletedPlanObject { pub fn is_noop(&self) -> bool { matches!(self, DeletedPlanObject::Noop) @@ -11120,13 +10860,14 @@ pub struct DeletedPlan { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeletedPriceObject { #[serde(rename = "price")] Price, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11143,11 +10884,6 @@ impl std::fmt::Display for DeletedPriceObject { } } -impl Default for DeletedPriceObject { - fn default() -> DeletedPriceObject { - DeletedPriceObject::Noop - } -} impl DeletedPriceObject { pub fn is_noop(&self) -> bool { matches!(self, DeletedPriceObject::Noop) @@ -11182,13 +10918,14 @@ pub struct DeletedPrice { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeletedProductObject { #[serde(rename = "product")] Product, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11205,11 +10942,6 @@ impl std::fmt::Display for DeletedProductObject { } } -impl Default for DeletedProductObject { - fn default() -> DeletedProductObject { - DeletedProductObject::Noop - } -} impl DeletedProductObject { pub fn is_noop(&self) -> bool { matches!(self, DeletedProductObject::Noop) @@ -11244,13 +10976,14 @@ pub struct DeletedProduct { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RadarListDeletedObject { #[serde(rename = "radar.value_list")] RadarValueList, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11267,11 +11000,6 @@ impl std::fmt::Display for RadarListDeletedObject { } } -impl Default for RadarListDeletedObject { - fn default() -> RadarListDeletedObject { - RadarListDeletedObject::Noop - } -} impl RadarListDeletedObject { pub fn is_noop(&self) -> bool { matches!(self, RadarListDeletedObject::Noop) @@ -11306,13 +11034,14 @@ pub struct RadarListDeleted { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RadarListDeletedItemObject { #[serde(rename = "radar.value_list_item")] RadarValueListItem, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11329,11 +11058,6 @@ impl std::fmt::Display for RadarListDeletedItemObject { } } -impl Default for RadarListDeletedItemObject { - fn default() -> RadarListDeletedItemObject { - RadarListDeletedItemObject::Noop - } -} impl RadarListDeletedItemObject { pub fn is_noop(&self) -> bool { matches!(self, RadarListDeletedItemObject::Noop) @@ -11368,13 +11092,14 @@ pub struct RadarListDeletedItem { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeletedRecipientObject { #[serde(rename = "recipient")] Recipient, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11391,11 +11116,6 @@ impl std::fmt::Display for DeletedRecipientObject { } } -impl Default for DeletedRecipientObject { - fn default() -> DeletedRecipientObject { - DeletedRecipientObject::Noop - } -} impl DeletedRecipientObject { pub fn is_noop(&self) -> bool { matches!(self, DeletedRecipientObject::Noop) @@ -11430,13 +11150,14 @@ pub struct DeletedRecipient { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeletedSkuObject { #[serde(rename = "sku")] Sku, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11453,11 +11174,6 @@ impl std::fmt::Display for DeletedSkuObject { } } -impl Default for DeletedSkuObject { - fn default() -> DeletedSkuObject { - DeletedSkuObject::Noop - } -} impl DeletedSkuObject { pub fn is_noop(&self) -> bool { matches!(self, DeletedSkuObject::Noop) @@ -11492,13 +11208,14 @@ pub struct DeletedSku { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeletedSubscriptionItemObject { #[serde(rename = "subscription_item")] SubscriptionItem, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11515,11 +11232,6 @@ impl std::fmt::Display for DeletedSubscriptionItemObject { } } -impl Default for DeletedSubscriptionItemObject { - fn default() -> DeletedSubscriptionItemObject { - DeletedSubscriptionItemObject::Noop - } -} impl DeletedSubscriptionItemObject { pub fn is_noop(&self) -> bool { matches!(self, DeletedSubscriptionItemObject::Noop) @@ -11557,13 +11269,14 @@ pub struct DeletedSubscriptionItem { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeletedTaxObject { #[serde(rename = "tax_id")] TaxId, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11580,11 +11293,6 @@ impl std::fmt::Display for DeletedTaxObject { } } -impl Default for DeletedTaxObject { - fn default() -> DeletedTaxObject { - DeletedTaxObject::Noop - } -} impl DeletedTaxObject { pub fn is_noop(&self) -> bool { matches!(self, DeletedTaxObject::Noop) @@ -11619,13 +11327,14 @@ pub struct DeletedTaxId { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeletedTerminalLocationObject { #[serde(rename = "terminal.location")] TerminalLocation, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11642,11 +11351,6 @@ impl std::fmt::Display for DeletedTerminalLocationObject { } } -impl Default for DeletedTerminalLocationObject { - fn default() -> DeletedTerminalLocationObject { - DeletedTerminalLocationObject::Noop - } -} impl DeletedTerminalLocationObject { pub fn is_noop(&self) -> bool { matches!(self, DeletedTerminalLocationObject::Noop) @@ -11684,13 +11388,14 @@ pub struct DeletedTerminalLocation { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeletedTerminalReaderObject { #[serde(rename = "terminal.reader")] TerminalReader, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11707,11 +11412,6 @@ impl std::fmt::Display for DeletedTerminalReaderObject { } } -impl Default for DeletedTerminalReaderObject { - fn default() -> DeletedTerminalReaderObject { - DeletedTerminalReaderObject::Noop - } -} impl DeletedTerminalReaderObject { pub fn is_noop(&self) -> bool { matches!(self, DeletedTerminalReaderObject::Noop) @@ -11746,13 +11446,14 @@ pub struct DeletedTerminalReader { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeletedTestClockObject { #[serde(rename = "test_helpers.test_clock")] TestHelpersClock, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11769,11 +11470,6 @@ impl std::fmt::Display for DeletedTestClockObject { } } -impl Default for DeletedTestClockObject { - fn default() -> DeletedTestClockObject { - DeletedTestClockObject::Noop - } -} impl DeletedTestClockObject { pub fn is_noop(&self) -> bool { matches!(self, DeletedTestClockObject::Noop) @@ -11808,13 +11504,14 @@ pub struct DeletedTestClock { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeletedWebhookEndpointObject { #[serde(rename = "webhook_endpoint")] WebhookEndpoint, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11831,11 +11528,6 @@ impl std::fmt::Display for DeletedWebhookEndpointObject { } } -impl Default for DeletedWebhookEndpointObject { - fn default() -> DeletedWebhookEndpointObject { - DeletedWebhookEndpointObject::Noop - } -} impl DeletedWebhookEndpointObject { pub fn is_noop(&self) -> bool { matches!(self, DeletedWebhookEndpointObject::Noop) @@ -12110,13 +11802,14 @@ pub struct DiscountsResourceDiscountAmount { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DisputeObject { #[serde(rename = "dispute")] Dispute, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -12133,11 +11826,6 @@ impl std::fmt::Display for DisputeObject { } } -impl Default for DisputeObject { - fn default() -> DisputeObject { - DisputeObject::Noop - } -} impl DisputeObject { pub fn is_noop(&self) -> bool { matches!(self, DisputeObject::Noop) @@ -12145,9 +11833,9 @@ impl DisputeObject { } /** -* Current status of dispute. Possible values are `warning_needs_response`, `warning_under_review`, `warning_closed`, `needs_response`, `under_review`, `charge_refunded`, `won`, or `lost`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Current status of dispute. Possible values are `warning_needs_response`, `warning_under_review`, `warning_closed`, `needs_response`, `under_review`, `charge_refunded`, `won`, or `lost`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DisputeStatus { #[serde(rename = "charge_refunded")] ChargeRefunded, @@ -12166,6 +11854,7 @@ pub enum DisputeStatus { #[serde(rename = "won")] Won, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -12189,11 +11878,6 @@ impl std::fmt::Display for DisputeStatus { } } -impl Default for DisputeStatus { - fn default() -> DisputeStatus { - DisputeStatus::Noop - } -} impl DisputeStatus { pub fn is_noop(&self) -> bool { matches!(self, DisputeStatus::Noop) @@ -12585,13 +12269,14 @@ pub struct EmailSent { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EphemeralKeyObject { #[serde(rename = "ephemeral_key")] EphemeralKey, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -12608,11 +12293,6 @@ impl std::fmt::Display for EphemeralKeyObject { } } -impl Default for EphemeralKeyObject { - fn default() -> EphemeralKeyObject { - EphemeralKeyObject::Noop - } -} impl EphemeralKeyObject { pub fn is_noop(&self) -> bool { matches!(self, EphemeralKeyObject::Noop) @@ -12683,13 +12363,14 @@ pub struct Error { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EventObject { #[serde(rename = "event")] Event, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -12706,11 +12387,6 @@ impl std::fmt::Display for EventObject { } } -impl Default for EventObject { - fn default() -> EventObject { - EventObject::Noop - } -} impl EventObject { pub fn is_noop(&self) -> bool { matches!(self, EventObject::Noop) @@ -12884,13 +12560,14 @@ pub struct Event { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ExchangeRateObject { #[serde(rename = "exchange_rate")] ExchangeRate, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -12907,11 +12584,6 @@ impl std::fmt::Display for ExchangeRateObject { } } -impl Default for ExchangeRateObject { - fn default() -> ExchangeRateObject { - ExchangeRateObject::Noop - } -} impl ExchangeRateObject { pub fn is_noop(&self) -> bool { matches!(self, ExchangeRateObject::Noop) @@ -13008,13 +12680,14 @@ pub struct Fee { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FeeRefundObject { #[serde(rename = "fee_refund")] FeeRefund, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13031,11 +12704,6 @@ impl std::fmt::Display for FeeRefundObject { } } -impl Default for FeeRefundObject { - fn default() -> FeeRefundObject { - FeeRefundObject::Noop - } -} impl FeeRefundObject { pub fn is_noop(&self) -> bool { matches!(self, FeeRefundObject::Noop) @@ -13151,13 +12819,14 @@ pub struct Links { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FileObject { #[serde(rename = "file")] File, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13174,11 +12843,6 @@ impl std::fmt::Display for FileObject { } } -impl Default for FileObject { - fn default() -> FileObject { - FileObject::Noop - } -} impl FileObject { pub fn is_noop(&self) -> bool { matches!(self, FileObject::Noop) @@ -13186,9 +12850,9 @@ impl FileObject { } /** -* The [purpose](https://stripe.com/docs/file-upload#uploading-a-file) of the uploaded file. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The [purpose](https://stripe.com/docs/file-upload#uploading-a-file) of the uploaded file. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Purpose { #[serde(rename = "account_requirement")] AccountRequirement, @@ -13219,6 +12883,7 @@ pub enum Purpose { #[serde(rename = "tax_document_user_upload")] TaxDocumentUserUpload, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13248,11 +12913,6 @@ impl std::fmt::Display for Purpose { } } -impl Default for Purpose { - fn default() -> Purpose { - Purpose::Noop - } -} impl Purpose { pub fn is_noop(&self) -> bool { matches!(self, Purpose::Noop) @@ -13389,13 +13049,14 @@ pub struct File { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FileLinkObject { #[serde(rename = "file_link")] FileLink, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13412,11 +13073,6 @@ impl std::fmt::Display for FileLinkObject { } } -impl Default for FileLinkObject { - fn default() -> FileLinkObject { - FileLinkObject::Noop - } -} impl FileLinkObject { pub fn is_noop(&self) -> bool { matches!(self, FileLinkObject::Noop) @@ -13739,15 +13395,16 @@ pub struct GelatoDataVerifiedOutputsDate { } /** -* Status of this `document` check. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Status of this `document` check. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GelatoDocumentReportStatus { #[serde(rename = "unverified")] Unverified, #[serde(rename = "verified")] Verified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13765,18 +13422,13 @@ impl std::fmt::Display for GelatoDocumentReportStatus { } } -impl Default for GelatoDocumentReportStatus { - fn default() -> GelatoDocumentReportStatus { - GelatoDocumentReportStatus::Noop - } -} impl GelatoDocumentReportStatus { pub fn is_noop(&self) -> bool { matches!(self, GelatoDocumentReportStatus::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AllowedTypes { #[serde(rename = "driving_license")] DrivingLicense, @@ -13785,6 +13437,7 @@ pub enum AllowedTypes { #[serde(rename = "passport")] Passport, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13803,11 +13456,6 @@ impl std::fmt::Display for AllowedTypes { } } -impl Default for AllowedTypes { - fn default() -> AllowedTypes { - AllowedTypes::Noop - } -} impl AllowedTypes { pub fn is_noop(&self) -> bool { matches!(self, AllowedTypes::Noop) @@ -13900,9 +13548,9 @@ pub struct GelatoDocumentReport { } /** -* A short machine-readable string giving the reason for the verification failure. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * A short machine-readable string giving the reason for the verification failure. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GelatoDocumentReportErrorCode { #[serde(rename = "document_expired")] DocumentExpired, @@ -13911,6 +13559,7 @@ pub enum GelatoDocumentReportErrorCode { #[serde(rename = "document_unverified_other")] DocumentUnverifiedOther, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13931,11 +13580,6 @@ impl std::fmt::Display for GelatoDocumentReportErrorCode { } } -impl Default for GelatoDocumentReportErrorCode { - fn default() -> GelatoDocumentReportErrorCode { - GelatoDocumentReportErrorCode::Noop - } -} impl GelatoDocumentReportErrorCode { pub fn is_noop(&self) -> bool { matches!(self, GelatoDocumentReportErrorCode::Noop) @@ -13962,9 +13606,9 @@ pub struct GelatoDocumentReportErrorData { } /** -* Type of ID number. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Type of ID number. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IdNumberType { #[serde(rename = "br_cpf")] BrCpf, @@ -13973,6 +13617,7 @@ pub enum IdNumberType { #[serde(rename = "us_ssn")] UsSsn, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13991,11 +13636,6 @@ impl std::fmt::Display for IdNumberType { } } -impl Default for IdNumberType { - fn default() -> IdNumberType { - IdNumberType::Noop - } -} impl IdNumberType { pub fn is_noop(&self) -> bool { matches!(self, IdNumberType::Noop) @@ -14055,9 +13695,9 @@ pub struct GelatoNumberReport { } /** -* A short machine-readable string giving the reason for the verification failure. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * A short machine-readable string giving the reason for the verification failure. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GelatoNumberReportErrorCode { #[serde(rename = "id_number_insufficient_document_data")] IdNumberInsufficientDocumentData, @@ -14066,6 +13706,7 @@ pub enum GelatoNumberReportErrorCode { #[serde(rename = "id_number_unverified_other")] IdNumberUnverifiedOther, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14086,11 +13727,6 @@ impl std::fmt::Display for GelatoNumberReportErrorCode { } } -impl Default for GelatoNumberReportErrorCode { - fn default() -> GelatoNumberReportErrorCode { - GelatoNumberReportErrorCode::Noop - } -} impl GelatoNumberReportErrorCode { pub fn is_noop(&self) -> bool { matches!(self, GelatoNumberReportErrorCode::Noop) @@ -14188,9 +13824,9 @@ pub struct GelatoSelfieReport { } /** -* A short machine-readable string giving the reason for the verification failure. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * A short machine-readable string giving the reason for the verification failure. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GelatoSelfieReportErrorCode { #[serde(rename = "selfie_document_missing_photo")] SelfieDocumentMissingPhoto, @@ -14201,6 +13837,7 @@ pub enum GelatoSelfieReportErrorCode { #[serde(rename = "selfie_unverified_other")] SelfieUnverifiedOther, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14222,11 +13859,6 @@ impl std::fmt::Display for GelatoSelfieReportErrorCode { } } -impl Default for GelatoSelfieReportErrorCode { - fn default() -> GelatoSelfieReportErrorCode { - GelatoSelfieReportErrorCode::Noop - } -} impl GelatoSelfieReportErrorCode { pub fn is_noop(&self) -> bool { matches!(self, GelatoSelfieReportErrorCode::Noop) @@ -14291,9 +13923,9 @@ pub struct GelatoSessionDocumentOptions { } /** -* A short machine-readable string giving the reason for the verification or user-session failure. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * A short machine-readable string giving the reason for the verification or user-session failure. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GelatoSessionLastErrorCode { #[serde(rename = "abandoned")] Abandoned, @@ -14326,6 +13958,7 @@ pub enum GelatoSessionLastErrorCode { #[serde(rename = "under_supported_age")] UnderSupportedAge, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14360,11 +13993,6 @@ impl std::fmt::Display for GelatoSessionLastErrorCode { } } -impl Default for GelatoSessionLastErrorCode { - fn default() -> GelatoSessionLastErrorCode { - GelatoSessionLastErrorCode::Noop - } -} impl GelatoSessionLastErrorCode { pub fn is_noop(&self) -> bool { matches!(self, GelatoSessionLastErrorCode::Noop) @@ -14468,13 +14096,14 @@ pub struct GelatoVerifiedOutputs { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GelatoVerificationReportObject { #[serde(rename = "identity.verification_report")] IdentityVerificationReport, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14493,11 +14122,6 @@ impl std::fmt::Display for GelatoVerificationReportObject { } } -impl Default for GelatoVerificationReportObject { - fn default() -> GelatoVerificationReportObject { - GelatoVerificationReportObject::Noop - } -} impl GelatoVerificationReportObject { pub fn is_noop(&self) -> bool { matches!(self, GelatoVerificationReportObject::Noop) @@ -14505,15 +14129,16 @@ impl GelatoVerificationReportObject { } /** -* Type of report. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Type of report. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GelatoVerificationReportType { #[serde(rename = "document")] Document, #[serde(rename = "id_number")] IdNumber, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14531,11 +14156,6 @@ impl std::fmt::Display for GelatoVerificationReportType { } } -impl Default for GelatoVerificationReportType { - fn default() -> GelatoVerificationReportType { - GelatoVerificationReportType::Noop - } -} impl GelatoVerificationReportType { pub fn is_noop(&self) -> bool { matches!(self, GelatoVerificationReportType::Noop) @@ -14727,13 +14347,14 @@ impl std::convert::From for String { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GelatoVerificationSessionObject { #[serde(rename = "identity.verification_session")] IdentityVerificationSession, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14752,11 +14373,6 @@ impl std::fmt::Display for GelatoVerificationSessionObject { } } -impl Default for GelatoVerificationSessionObject { - fn default() -> GelatoVerificationSessionObject { - GelatoVerificationSessionObject::Noop - } -} impl GelatoVerificationSessionObject { pub fn is_noop(&self) -> bool { matches!(self, GelatoVerificationSessionObject::Noop) @@ -14764,9 +14380,9 @@ impl GelatoVerificationSessionObject { } /** -* Status of this VerificationSession. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Status of this VerificationSession. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GelatoVerificationSessionStatus { #[serde(rename = "canceled")] Canceled, @@ -14777,6 +14393,7 @@ pub enum GelatoVerificationSessionStatus { #[serde(rename = "verified")] Verified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14796,11 +14413,6 @@ impl std::fmt::Display for GelatoVerificationSessionStatus { } } -impl Default for GelatoVerificationSessionStatus { - fn default() -> GelatoVerificationSessionStatus { - GelatoVerificationSessionStatus::Noop - } -} impl GelatoVerificationSessionStatus { pub fn is_noop(&self) -> bool { matches!(self, GelatoVerificationSessionStatus::Noop) @@ -15017,9 +14629,9 @@ impl std::convert::From for String { } /** -* Indicates the reason why the invoice was created. `subscription_cycle` indicates an invoice created by a subscription advancing into a new period. `subscription_create` indicates an invoice created due to creating a subscription. `subscription_update` indicates an invoice created due to updating a subscription. `subscription` is set for all old invoices to indicate either a change to a subscription or a period advancement. `manual` is set for all invoices unrelated to a subscription (for example: created via the invoice editor). The `upcoming` value is reserved for simulated invoices per the upcoming invoice endpoint. `subscription_threshold` indicates an invoice created due to a billing threshold being reached. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Indicates the reason why the invoice was created. `subscription_cycle` indicates an invoice created by a subscription advancing into a new period. `subscription_create` indicates an invoice created due to creating a subscription. `subscription_update` indicates an invoice created due to updating a subscription. `subscription` is set for all old invoices to indicate either a change to a subscription or a period advancement. `manual` is set for all invoices unrelated to a subscription (for example: created via the invoice editor). The `upcoming` value is reserved for simulated invoices per the upcoming invoice endpoint. `subscription_threshold` indicates an invoice created due to a billing threshold being reached. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BillingReason { #[serde(rename = "automatic_pending_invoice_item_invoice")] AutomaticPendingInvoiceItem, @@ -15040,6 +14652,7 @@ pub enum BillingReason { #[serde(rename = "upcoming")] Upcoming, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -15064,11 +14677,6 @@ impl std::fmt::Display for BillingReason { } } -impl Default for BillingReason { - fn default() -> BillingReason { - BillingReason::Noop - } -} impl BillingReason { pub fn is_noop(&self) -> bool { matches!(self, BillingReason::Noop) @@ -15076,15 +14684,16 @@ impl BillingReason { } /** -* Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CollectionMethod { #[serde(rename = "charge_automatically")] ChargeAutomatically, #[serde(rename = "send_invoice")] SendInvoice, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -15102,11 +14711,6 @@ impl std::fmt::Display for CollectionMethod { } } -impl Default for CollectionMethod { - fn default() -> CollectionMethod { - CollectionMethod::Noop - } -} impl CollectionMethod { pub fn is_noop(&self) -> bool { matches!(self, CollectionMethod::Noop) @@ -15251,9 +14855,9 @@ impl std::convert::From for String { } /** -* The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum InvoiceStatus { #[serde(rename = "deleted")] Deleted, @@ -15268,6 +14872,7 @@ pub enum InvoiceStatus { #[serde(rename = "void")] Void, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -15289,11 +14894,6 @@ impl std::fmt::Display for InvoiceStatus { } } -impl Default for InvoiceStatus { - fn default() -> InvoiceStatus { - InvoiceStatus::Noop - } -} impl InvoiceStatus { pub fn is_noop(&self) -> bool { matches!(self, InvoiceStatus::Noop) @@ -16911,15 +16511,16 @@ pub struct InvoiceLineItemPeriod { } /** -* One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AmountType { #[serde(rename = "fixed")] Fixed, #[serde(rename = "maximum")] Maximum, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -16937,11 +16538,6 @@ impl std::fmt::Display for AmountType { } } -impl Default for AmountType { - fn default() -> AmountType { - AmountType::Noop - } -} impl AmountType { pub fn is_noop(&self) -> bool { matches!(self, AmountType::Noop) @@ -17002,9 +16598,9 @@ pub struct InvoicePaymentMethodOptionsAcssDebitMandate { } /** -* Preferred language of the Bancontact authorization page that the customer is redirected to. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PreferredLanguage { #[serde(rename = "de")] De, @@ -17015,6 +16611,7 @@ pub enum PreferredLanguage { #[serde(rename = "nl")] Nl, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -17034,11 +16631,6 @@ impl std::fmt::Display for PreferredLanguage { } } -impl Default for PreferredLanguage { - fn default() -> PreferredLanguage { - PreferredLanguage::Noop - } -} impl PreferredLanguage { pub fn is_noop(&self) -> bool { matches!(self, PreferredLanguage::Noop) @@ -17056,15 +16648,16 @@ pub struct InvoicePaymentMethodOptionsBancontact { } /** -* We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RequestThreeDSecure { #[serde(rename = "any")] Any, #[serde(rename = "automatic")] Automatic, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -17082,11 +16675,6 @@ impl std::fmt::Display for RequestThreeDSecure { } } -impl Default for RequestThreeDSecure { - fn default() -> RequestThreeDSecure { - RequestThreeDSecure::Noop - } -} impl RequestThreeDSecure { pub fn is_noop(&self) -> bool { matches!(self, RequestThreeDSecure::Noop) @@ -17104,13 +16692,14 @@ pub struct InvoicePaymentMethodOptionsCard { } /** -* The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FundingType { #[serde(rename = "bank_transfer")] BankTransfer, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -17127,11 +16716,6 @@ impl std::fmt::Display for FundingType { } } -impl Default for FundingType { - fn default() -> FundingType { - FundingType::Noop - } -} impl FundingType { pub fn is_noop(&self) -> bool { matches!(self, FundingType::Noop) @@ -17627,7 +17211,7 @@ pub struct InvoicesPaymentMethodOptions { pub us_bank_account: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentMethodTypes { #[serde(rename = "ach_credit_transfer")] AchCreditTransfer, @@ -17668,6 +17252,7 @@ pub enum PaymentMethodTypes { #[serde(rename = "wechat_pay")] WechatPay, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -17702,11 +17287,6 @@ impl std::fmt::Display for PaymentMethodTypes { } } -impl Default for PaymentMethodTypes { - fn default() -> PaymentMethodTypes { - PaymentMethodTypes::Noop - } -} impl PaymentMethodTypes { pub fn is_noop(&self) -> bool { matches!(self, PaymentMethodTypes::Noop) @@ -17733,9 +17313,9 @@ pub struct InvoicesPaymentSettings { } /** -* The type of the tax ID, one of `eu_vat`, `br_cnpj`, `br_cpf`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, or `unknown` -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of the tax ID, one of `eu_vat`, `br_cnpj`, `br_cpf`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, or `unknown` + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum InvoicesResourceInvoiceTaxType { #[serde(rename = "ae_trn")] AeTrn, @@ -17830,6 +17410,7 @@ pub enum InvoicesResourceInvoiceTaxType { #[serde(rename = "za_vat")] ZaVat, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -17891,11 +17472,6 @@ impl std::fmt::Display for InvoicesResourceInvoiceTaxType { } } -impl Default for InvoicesResourceInvoiceTaxType { - fn default() -> InvoicesResourceInvoiceTaxType { - InvoicesResourceInvoiceTaxType::Noop - } -} impl InvoicesResourceInvoiceTaxType { pub fn is_noop(&self) -> bool { matches!(self, InvoicesResourceInvoiceTaxType::Noop) @@ -17967,13 +17543,14 @@ pub struct InvoicesStatusTransitions { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuerFraudRecordObject { #[serde(rename = "issuer_fraud_record")] IssuerFraudRecord, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -17990,11 +17567,6 @@ impl std::fmt::Display for IssuerFraudRecordObject { } } -impl Default for IssuerFraudRecordObject { - fn default() -> IssuerFraudRecordObject { - IssuerFraudRecordObject::Noop - } -} impl IssuerFraudRecordObject { pub fn is_noop(&self) -> bool { matches!(self, IssuerFraudRecordObject::Noop) @@ -18075,9 +17647,9 @@ pub struct IssuerFraudRecord { } /** -* How the card details were provided. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * How the card details were provided. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AuthorizationMethod { #[serde(rename = "chip")] Chip, @@ -18090,6 +17662,7 @@ pub enum AuthorizationMethod { #[serde(rename = "swipe")] Swipe, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18110,11 +17683,6 @@ impl std::fmt::Display for AuthorizationMethod { } } -impl Default for AuthorizationMethod { - fn default() -> AuthorizationMethod { - AuthorizationMethod::Noop - } -} impl AuthorizationMethod { pub fn is_noop(&self) -> bool { matches!(self, AuthorizationMethod::Noop) @@ -18172,13 +17740,14 @@ impl std::convert::From for String { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuingAuthorizationObject { #[serde(rename = "issuing.authorization")] IssuingAuthorization, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18195,11 +17764,6 @@ impl std::fmt::Display for IssuingAuthorizationObject { } } -impl Default for IssuingAuthorizationObject { - fn default() -> IssuingAuthorizationObject { - IssuingAuthorizationObject::Noop - } -} impl IssuingAuthorizationObject { pub fn is_noop(&self) -> bool { matches!(self, IssuingAuthorizationObject::Noop) @@ -18207,9 +17771,9 @@ impl IssuingAuthorizationObject { } /** -* The current status of the authorization in its lifecycle. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The current status of the authorization in its lifecycle. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuingAuthorizationStatus { #[serde(rename = "closed")] Closed, @@ -18218,6 +17782,7 @@ pub enum IssuingAuthorizationStatus { #[serde(rename = "reversed")] Reversed, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18236,11 +17801,6 @@ impl std::fmt::Display for IssuingAuthorizationStatus { } } -impl Default for IssuingAuthorizationStatus { - fn default() -> IssuingAuthorizationStatus { - IssuingAuthorizationStatus::Noop - } -} impl IssuingAuthorizationStatus { pub fn is_noop(&self) -> bool { matches!(self, IssuingAuthorizationStatus::Noop) @@ -18421,15 +17981,16 @@ pub struct IssuingAuthorization { } /** -* The reason why the card was canceled. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The reason why the card was canceled. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CancellationReason { #[serde(rename = "lost")] Lost, #[serde(rename = "stolen")] Stolen, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18447,11 +18008,6 @@ impl std::fmt::Display for CancellationReason { } } -impl Default for CancellationReason { - fn default() -> CancellationReason { - CancellationReason::Noop - } -} impl CancellationReason { pub fn is_noop(&self) -> bool { matches!(self, CancellationReason::Noop) @@ -18459,13 +18015,14 @@ impl CancellationReason { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuingCardObject { #[serde(rename = "issuing.card")] IssuingCard, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18482,11 +18039,6 @@ impl std::fmt::Display for IssuingCardObject { } } -impl Default for IssuingCardObject { - fn default() -> IssuingCardObject { - IssuingCardObject::Noop - } -} impl IssuingCardObject { pub fn is_noop(&self) -> bool { matches!(self, IssuingCardObject::Noop) @@ -18542,9 +18094,9 @@ impl std::convert::From for String { } /** -* The reason why the previous card needed to be replaced. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The reason why the previous card needed to be replaced. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReplacementReason { #[serde(rename = "damaged")] Damaged, @@ -18555,6 +18107,7 @@ pub enum ReplacementReason { #[serde(rename = "stolen")] Stolen, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18574,11 +18127,6 @@ impl std::fmt::Display for ReplacementReason { } } -impl Default for ReplacementReason { - fn default() -> ReplacementReason { - ReplacementReason::Noop - } -} impl ReplacementReason { pub fn is_noop(&self) -> bool { matches!(self, ReplacementReason::Noop) @@ -18586,9 +18134,9 @@ impl ReplacementReason { } /** -* Whether authorizations can be approved on this card. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether authorizations can be approved on this card. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuingCardStatus { #[serde(rename = "active")] Active, @@ -18597,6 +18145,7 @@ pub enum IssuingCardStatus { #[serde(rename = "inactive")] Inactive, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18615,11 +18164,6 @@ impl std::fmt::Display for IssuingCardStatus { } } -impl Default for IssuingCardStatus { - fn default() -> IssuingCardStatus { - IssuingCardStatus::Noop - } -} impl IssuingCardStatus { pub fn is_noop(&self) -> bool { matches!(self, IssuingCardStatus::Noop) @@ -18627,15 +18171,16 @@ impl IssuingCardStatus { } /** -* The type of the card. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of the card. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuingCardType { #[serde(rename = "physical")] Physical, #[serde(rename = "virtual")] Virtual, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18653,11 +18198,6 @@ impl std::fmt::Display for IssuingCardType { } } -impl Default for IssuingCardType { - fn default() -> IssuingCardType { - IssuingCardType::Noop - } -} impl IssuingCardType { pub fn is_noop(&self) -> bool { matches!(self, IssuingCardType::Noop) @@ -18826,13 +18366,14 @@ pub struct IssuingCard { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuingCardholderObject { #[serde(rename = "issuing.cardholder")] IssuingCardholder, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18849,11 +18390,6 @@ impl std::fmt::Display for IssuingCardholderObject { } } -impl Default for IssuingCardholderObject { - fn default() -> IssuingCardholderObject { - IssuingCardholderObject::Noop - } -} impl IssuingCardholderObject { pub fn is_noop(&self) -> bool { matches!(self, IssuingCardholderObject::Noop) @@ -18861,9 +18397,9 @@ impl IssuingCardholderObject { } /** -* Specifies whether to permit authorizations on this cardholder's cards. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Specifies whether to permit authorizations on this cardholder's cards. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuingCardholderStatus { #[serde(rename = "active")] Active, @@ -18872,6 +18408,7 @@ pub enum IssuingCardholderStatus { #[serde(rename = "inactive")] Inactive, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18890,11 +18427,6 @@ impl std::fmt::Display for IssuingCardholderStatus { } } -impl Default for IssuingCardholderStatus { - fn default() -> IssuingCardholderStatus { - IssuingCardholderStatus::Noop - } -} impl IssuingCardholderStatus { pub fn is_noop(&self) -> bool { matches!(self, IssuingCardholderStatus::Noop) @@ -18902,15 +18434,16 @@ impl IssuingCardholderStatus { } /** -* Type of entity that holds the account. This can be either `individual` or `company`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Type of entity that holds the account. This can be either `individual` or `company`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AccountHolderType { #[serde(rename = "company")] Company, #[serde(rename = "individual")] Individual, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18928,11 +18461,6 @@ impl std::fmt::Display for AccountHolderType { } } -impl Default for AccountHolderType { - fn default() -> AccountHolderType { - AccountHolderType::Noop - } -} impl AccountHolderType { pub fn is_noop(&self) -> bool { matches!(self, AccountHolderType::Noop) @@ -19055,13 +18583,14 @@ pub struct IssuingCardholder { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuingDisputeObject { #[serde(rename = "issuing.dispute")] IssuingDispute, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -19078,11 +18607,6 @@ impl std::fmt::Display for IssuingDisputeObject { } } -impl Default for IssuingDisputeObject { - fn default() -> IssuingDisputeObject { - IssuingDisputeObject::Noop - } -} impl IssuingDisputeObject { pub fn is_noop(&self) -> bool { matches!(self, IssuingDisputeObject::Noop) @@ -19090,9 +18614,9 @@ impl IssuingDisputeObject { } /** -* Current status of the dispute. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Current status of the dispute. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuingDisputeStatus { #[serde(rename = "expired")] Expired, @@ -19105,6 +18629,7 @@ pub enum IssuingDisputeStatus { #[serde(rename = "won")] Won, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -19125,11 +18650,6 @@ impl std::fmt::Display for IssuingDisputeStatus { } } -impl Default for IssuingDisputeStatus { - fn default() -> IssuingDisputeStatus { - IssuingDisputeStatus::Noop - } -} impl IssuingDisputeStatus { pub fn is_noop(&self) -> bool { matches!(self, IssuingDisputeStatus::Noop) @@ -19275,13 +18795,14 @@ pub struct IssuingDispute { } /** -* The card network for this settlement report. One of ["visa"] -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The card network for this settlement report. One of ["visa"] + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Network { #[serde(rename = "visa")] Visa, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -19298,11 +18819,6 @@ impl std::fmt::Display for Network { } } -impl Default for Network { - fn default() -> Network { - Network::Noop - } -} impl Network { pub fn is_noop(&self) -> bool { matches!(self, Network::Noop) @@ -19310,13 +18826,14 @@ impl Network { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuingSettlementObject { #[serde(rename = "issuing.settlement")] IssuingSettlement, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -19333,11 +18850,6 @@ impl std::fmt::Display for IssuingSettlementObject { } } -impl Default for IssuingSettlementObject { - fn default() -> IssuingSettlementObject { - IssuingSettlementObject::Noop - } -} impl IssuingSettlementObject { pub fn is_noop(&self) -> bool { matches!(self, IssuingSettlementObject::Noop) @@ -19587,13 +19099,14 @@ impl std::convert::From for String { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuingTransactionObject { #[serde(rename = "issuing.transaction")] IssuingTransaction, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -19610,11 +19123,6 @@ impl std::fmt::Display for IssuingTransactionObject { } } -impl Default for IssuingTransactionObject { - fn default() -> IssuingTransactionObject { - IssuingTransactionObject::Noop - } -} impl IssuingTransactionObject { pub fn is_noop(&self) -> bool { matches!(self, IssuingTransactionObject::Noop) @@ -19622,15 +19130,16 @@ impl IssuingTransactionObject { } /** -* The nature of the transaction. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The nature of the transaction. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuingTransactionType { #[serde(rename = "capture")] Capture, #[serde(rename = "refund")] Refund, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -19648,11 +19157,6 @@ impl std::fmt::Display for IssuingTransactionType { } } -impl Default for IssuingTransactionType { - fn default() -> IssuingTransactionType { - IssuingTransactionType::Noop - } -} impl IssuingTransactionType { pub fn is_noop(&self) -> bool { matches!(self, IssuingTransactionType::Noop) @@ -19660,9 +19164,9 @@ impl IssuingTransactionType { } /** -* The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Wallet { #[serde(rename = "apple_pay")] ApplePay, @@ -19671,6 +19175,7 @@ pub enum Wallet { #[serde(rename = "samsung_pay")] SamsungPay, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -19689,11 +19194,6 @@ impl std::fmt::Display for Wallet { } } -impl Default for Wallet { - fn default() -> Wallet { - Wallet::Noop - } -} impl Wallet { pub fn is_noop(&self) -> bool { matches!(self, Wallet::Noop) @@ -19989,9 +19489,9 @@ pub struct IssuingAuthorizationPendingRequest { } /** -* The reason for the approval or decline. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The reason for the approval or decline. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuingAuthorizationRequestReason { #[serde(rename = "account_disabled")] AccountDisabled, @@ -20020,6 +19520,7 @@ pub enum IssuingAuthorizationRequestReason { #[serde(rename = "webhook_timeout")] WebhookTimeout, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -20050,11 +19551,6 @@ impl std::fmt::Display for IssuingAuthorizationRequestReason { } } -impl Default for IssuingAuthorizationRequestReason { - fn default() -> IssuingAuthorizationRequestReason { - IssuingAuthorizationRequestReason::Noop - } -} impl IssuingAuthorizationRequestReason { pub fn is_noop(&self) -> bool { matches!(self, IssuingAuthorizationRequestReason::Noop) @@ -20130,9 +19626,9 @@ pub struct IssuingAuthorizationRequest { } /** -* Whether the cardholder provided a CVC and if it matched Stripe’s record. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether the cardholder provided a CVC and if it matched Stripe’s record. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CvcCheck { #[serde(rename = "match")] Match, @@ -20141,6 +19637,7 @@ pub enum CvcCheck { #[serde(rename = "not_provided")] NotProvided, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -20159,11 +19656,6 @@ impl std::fmt::Display for CvcCheck { } } -impl Default for CvcCheck { - fn default() -> CvcCheck { - CvcCheck::Noop - } -} impl CvcCheck { pub fn is_noop(&self) -> bool { matches!(self, CvcCheck::Noop) @@ -20200,9 +19692,9 @@ pub struct IssuingAuthorizationVerificationData { } /** -* Reason the card is ineligible for Apple Pay -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Reason the card is ineligible for Apple Pay + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IneligibleReason { #[serde(rename = "missing_agreement")] MissingAgreement, @@ -20211,6 +19703,7 @@ pub enum IneligibleReason { #[serde(rename = "unsupported_region")] UnsupportedRegion, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -20229,11 +19722,6 @@ impl std::fmt::Display for IneligibleReason { } } -impl Default for IneligibleReason { - fn default() -> IneligibleReason { - IneligibleReason::Noop - } -} impl IneligibleReason { pub fn is_noop(&self) -> bool { matches!(self, IneligibleReason::Noop) @@ -20258,7 +19746,7 @@ pub struct IssuingCardApplePay { pub ineligible_reason: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Categories { #[serde(rename = "ac_refrigeration_repair")] AcRefrigerationRepair, @@ -20837,6 +20325,7 @@ pub enum Categories { #[serde(rename = "wrecking_and_salvage_yards")] WreckingAndSalvageYards, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -21208,11 +20697,6 @@ impl std::fmt::Display for Categories { } } -impl Default for Categories { - fn default() -> Categories { - Categories::Noop - } -} impl Categories { pub fn is_noop(&self) -> bool { matches!(self, Categories::Noop) @@ -21261,9 +20745,9 @@ pub struct IssuingCardAuthorizationControls { } /** -* The delivery company that shipped a card. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The delivery company that shipped a card. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Carrier { #[serde(rename = "dhl")] Dhl, @@ -21274,6 +20758,7 @@ pub enum Carrier { #[serde(rename = "usps")] Usps, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -21293,11 +20778,6 @@ impl std::fmt::Display for Carrier { } } -impl Default for Carrier { - fn default() -> Carrier { - Carrier::Noop - } -} impl Carrier { pub fn is_noop(&self) -> bool { matches!(self, Carrier::Noop) @@ -21305,9 +20785,9 @@ impl Carrier { } /** -* Shipment service, such as `standard` or `express`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Shipment service, such as `standard` or `express`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Service { #[serde(rename = "express")] Express, @@ -21316,6 +20796,7 @@ pub enum Service { #[serde(rename = "standard")] Standard, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -21334,11 +20815,6 @@ impl std::fmt::Display for Service { } } -impl Default for Service { - fn default() -> Service { - Service::Noop - } -} impl Service { pub fn is_noop(&self) -> bool { matches!(self, Service::Noop) @@ -21346,9 +20822,9 @@ impl Service { } /** -* The delivery status of the card. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The delivery status of the card. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuingCardShippingStatus { #[serde(rename = "canceled")] Canceled, @@ -21363,6 +20839,7 @@ pub enum IssuingCardShippingStatus { #[serde(rename = "shipped")] Shipped, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -21384,11 +20861,6 @@ impl std::fmt::Display for IssuingCardShippingStatus { } } -impl Default for IssuingCardShippingStatus { - fn default() -> IssuingCardShippingStatus { - IssuingCardShippingStatus::Noop - } -} impl IssuingCardShippingStatus { pub fn is_noop(&self) -> bool { matches!(self, IssuingCardShippingStatus::Noop) @@ -21396,15 +20868,16 @@ impl IssuingCardShippingStatus { } /** -* Packaging options. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Packaging options. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuingCardShippingType { #[serde(rename = "bulk")] Bulk, #[serde(rename = "individual")] Individual, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -21422,11 +20895,6 @@ impl std::fmt::Display for IssuingCardShippingType { } } -impl Default for IssuingCardShippingType { - fn default() -> IssuingCardShippingType { - IssuingCardShippingType::Noop - } -} impl IssuingCardShippingType { pub fn is_noop(&self) -> bool { matches!(self, IssuingCardShippingType::Noop) @@ -21503,9 +20971,9 @@ pub struct IssuingCardShippingData { } /** -* Interval (or event) to which the amount applies. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Interval (or event) to which the amount applies. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Interval { #[serde(rename = "all_time")] AllTime, @@ -21520,6 +20988,7 @@ pub enum Interval { #[serde(rename = "yearly")] Yearly, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -21541,11 +21010,6 @@ impl std::fmt::Display for Interval { } } -impl Default for Interval { - fn default() -> Interval { - Interval::Noop - } -} impl Interval { pub fn is_noop(&self) -> bool { matches!(self, Interval::Noop) @@ -21744,9 +21208,9 @@ pub struct IssuingCardholderIndividualDobData { } /** -* If `disabled_reason` is present, all cards will decline authorizations with `cardholder_verification_required` reason. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * If `disabled_reason` is present, all cards will decline authorizations with `cardholder_verification_required` reason. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DisabledReason { #[serde(rename = "listed")] Listed, @@ -21755,6 +21219,7 @@ pub enum DisabledReason { #[serde(rename = "under_review")] UnderReview, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -21773,18 +21238,13 @@ impl std::fmt::Display for DisabledReason { } } -impl Default for DisabledReason { - fn default() -> DisabledReason { - DisabledReason::Noop - } -} impl DisabledReason { pub fn is_noop(&self) -> bool { matches!(self, DisabledReason::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PastDue { #[serde(rename = "company.tax_id")] CompanyTaxId, @@ -21801,6 +21261,7 @@ pub enum PastDue { #[serde(rename = "individual.verification.document")] IndividualVerificationDocument, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -21823,11 +21284,6 @@ impl std::fmt::Display for PastDue { } } -impl Default for PastDue { - fn default() -> PastDue { - PastDue::Noop - } -} impl PastDue { pub fn is_noop(&self) -> bool { matches!(self, PastDue::Noop) @@ -21864,15 +21320,16 @@ pub struct IssuingCardholderVerification { } /** -* Whether the product was a merchandise or service. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether the product was a merchandise or service. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ProductType { #[serde(rename = "merchandise")] Merchandise, #[serde(rename = "service")] Service, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -21890,11 +21347,6 @@ impl std::fmt::Display for ProductType { } } -impl Default for ProductType { - fn default() -> ProductType { - ProductType::Noop - } -} impl ProductType { pub fn is_noop(&self) -> bool { matches!(self, ProductType::Noop) @@ -21902,15 +21354,16 @@ impl ProductType { } /** -* Result of cardholder's attempt to return the product. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Result of cardholder's attempt to return the product. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReturnStatus { #[serde(rename = "merchant_rejected")] MerchantRejected, #[serde(rename = "successful")] Successful, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -21928,11 +21381,6 @@ impl std::fmt::Display for ReturnStatus { } } -impl Default for ReturnStatus { - fn default() -> ReturnStatus { - ReturnStatus::Noop - } -} impl ReturnStatus { pub fn is_noop(&self) -> bool { matches!(self, ReturnStatus::Noop) @@ -22060,9 +21508,9 @@ pub struct IssuingDisputeDuplicateEvidence { } /** -* The reason for filing the dispute. Its value will match the field containing the evidence. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The reason for filing the dispute. Its value will match the field containing the evidence. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IssuingDisputeEvidenceReason { #[serde(rename = "canceled")] Canceled, @@ -22079,6 +21527,7 @@ pub enum IssuingDisputeEvidenceReason { #[serde(rename = "service_not_as_described")] ServiceNotAsDescribed, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -22103,11 +21552,6 @@ impl std::fmt::Display for IssuingDisputeEvidenceReason { } } -impl Default for IssuingDisputeEvidenceReason { - fn default() -> IssuingDisputeEvidenceReason { - IssuingDisputeEvidenceReason::Noop - } -} impl IssuingDisputeEvidenceReason { pub fn is_noop(&self) -> bool { matches!(self, IssuingDisputeEvidenceReason::Noop) @@ -22611,13 +22055,14 @@ pub struct IssuingTransactionReceiptData { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ItemObject { #[serde(rename = "item")] Item, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -22634,11 +22079,6 @@ impl std::fmt::Display for ItemObject { } } -impl Default for ItemObject { - fn default() -> ItemObject { - ItemObject::Noop - } -} impl ItemObject { pub fn is_noop(&self) -> bool { matches!(self, ItemObject::Noop) @@ -22733,9 +22173,9 @@ pub struct Item { } /** -* The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Structure { #[serde(rename = "free_zone_establishment")] FreeZoneEstablishment, @@ -22778,6 +22218,7 @@ pub enum Structure { #[serde(rename = "unincorporated_non_profit")] UnincorporatedNonProfit, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -22815,11 +22256,6 @@ impl std::fmt::Display for Structure { } } -impl Default for Structure { - fn default() -> Structure { - Structure::Noop - } -} impl Structure { pub fn is_noop(&self) -> bool { matches!(self, Structure::Noop) @@ -23194,13 +22630,14 @@ pub struct LegalEntityUboDeclaration { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LineItemObject { #[serde(rename = "line_item")] LineItem, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -23217,11 +22654,6 @@ impl std::fmt::Display for LineItemObject { } } -impl Default for LineItemObject { - fn default() -> LineItemObject { - LineItemObject::Noop - } -} impl LineItemObject { pub fn is_noop(&self) -> bool { matches!(self, LineItemObject::Noop) @@ -23229,15 +22661,16 @@ impl LineItemObject { } /** -* A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LineItemType { #[serde(rename = "invoiceitem")] Invoiceitem, #[serde(rename = "subscription")] Subscription, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -23255,11 +22688,6 @@ impl std::fmt::Display for LineItemType { } } -impl Default for LineItemType { - fn default() -> LineItemType { - LineItemType::Noop - } -} impl LineItemType { pub fn is_noop(&self) -> bool { matches!(self, LineItemType::Noop) @@ -23478,13 +22906,14 @@ pub struct LineItemsTaxAmount { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LoginLinkObject { #[serde(rename = "login_link")] LoginLink, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -23501,11 +22930,6 @@ impl std::fmt::Display for LoginLinkObject { } } -impl Default for LoginLinkObject { - fn default() -> LoginLinkObject { - LoginLinkObject::Noop - } -} impl LoginLinkObject { pub fn is_noop(&self) -> bool { matches!(self, LoginLinkObject::Noop) @@ -23541,13 +22965,14 @@ pub struct LoginLink { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MandateObject { #[serde(rename = "mandate")] Mandate, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -23564,11 +22989,6 @@ impl std::fmt::Display for MandateObject { } } -impl Default for MandateObject { - fn default() -> MandateObject { - MandateObject::Noop - } -} impl MandateObject { pub fn is_noop(&self) -> bool { matches!(self, MandateObject::Noop) @@ -23576,15 +22996,16 @@ impl MandateObject { } /** -* The type of the mandate. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of the mandate. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MandateType { #[serde(rename = "multi_use")] MultiUse, #[serde(rename = "single_use")] SingleUse, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -23602,11 +23023,6 @@ impl std::fmt::Display for MandateType { } } -impl Default for MandateType { - fn default() -> MandateType { - MandateType::Noop - } -} impl MandateType { pub fn is_noop(&self) -> bool { matches!(self, MandateType::Noop) @@ -23717,9 +23133,9 @@ pub struct MandateAuBecsDebit { } /** -* The status of the mandate on the Bacs network. Can be one of `pending`, `revoked`, `refused`, or `accepted`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the mandate on the Bacs network. Can be one of `pending`, `revoked`, `refused`, or `accepted`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum NetworkStatus { #[serde(rename = "accepted")] Accepted, @@ -23730,6 +23146,7 @@ pub enum NetworkStatus { #[serde(rename = "revoked")] Revoked, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -23749,11 +23166,6 @@ impl std::fmt::Display for NetworkStatus { } } -impl Default for NetworkStatus { - fn default() -> NetworkStatus { - NetworkStatus::Noop - } -} impl NetworkStatus { pub fn is_noop(&self) -> bool { matches!(self, NetworkStatus::Noop) @@ -23963,13 +23375,14 @@ pub struct OnlineAcceptance { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OrderObject { #[serde(rename = "order")] Order, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -23986,11 +23399,6 @@ impl std::fmt::Display for OrderObject { } } -impl Default for OrderObject { - fn default() -> OrderObject { - OrderObject::Noop - } -} impl OrderObject { pub fn is_noop(&self) -> bool { matches!(self, OrderObject::Noop) @@ -24267,13 +23675,14 @@ pub struct Order { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OrderItemObject { #[serde(rename = "order_item")] OrderItem, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -24290,11 +23699,6 @@ impl std::fmt::Display for OrderItemObject { } } -impl Default for OrderItemObject { - fn default() -> OrderItemObject { - OrderItemObject::Noop - } -} impl OrderItemObject { pub fn is_noop(&self) -> bool { matches!(self, OrderItemObject::Noop) @@ -24424,13 +23828,14 @@ pub struct OrderItem { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OrderReturnObject { #[serde(rename = "order_return")] OrderReturn, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -24447,11 +23852,6 @@ impl std::fmt::Display for OrderReturnObject { } } -impl Default for OrderReturnObject { - fn default() -> OrderReturnObject { - OrderReturnObject::Noop - } -} impl OrderReturnObject { pub fn is_noop(&self) -> bool { matches!(self, OrderReturnObject::Noop) @@ -24657,9 +24057,9 @@ pub struct PaymentFlowsPrivateMethodsKlarnaDob { } /** -* Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentIntentCancellationReason { #[serde(rename = "abandoned")] Abandoned, @@ -24676,6 +24076,7 @@ pub enum PaymentIntentCancellationReason { #[serde(rename = "void_invoice")] VoidInvoice, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -24698,11 +24099,6 @@ impl std::fmt::Display for PaymentIntentCancellationReason { } } -impl Default for PaymentIntentCancellationReason { - fn default() -> PaymentIntentCancellationReason { - PaymentIntentCancellationReason::Noop - } -} impl PaymentIntentCancellationReason { pub fn is_noop(&self) -> bool { matches!(self, PaymentIntentCancellationReason::Noop) @@ -24710,15 +24106,16 @@ impl PaymentIntentCancellationReason { } /** -* Controls when the funds will be captured from the customer's account. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Controls when the funds will be captured from the customer's account. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CaptureMethod { #[serde(rename = "automatic")] Automatic, #[serde(rename = "manual")] Manual, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -24736,11 +24133,6 @@ impl std::fmt::Display for CaptureMethod { } } -impl Default for CaptureMethod { - fn default() -> CaptureMethod { - CaptureMethod::Noop - } -} impl CaptureMethod { pub fn is_noop(&self) -> bool { matches!(self, CaptureMethod::Noop) @@ -24784,13 +24176,14 @@ pub struct Charges { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentIntentObject { #[serde(rename = "payment_intent")] PaymentIntent, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -24807,11 +24200,6 @@ impl std::fmt::Display for PaymentIntentObject { } } -impl Default for PaymentIntentObject { - fn default() -> PaymentIntentObject { - PaymentIntentObject::Noop - } -} impl PaymentIntentObject { pub fn is_noop(&self) -> bool { matches!(self, PaymentIntentObject::Noop) @@ -24819,19 +24207,20 @@ impl PaymentIntentObject { } /** -* Indicates that you intend to make future payments with this PaymentIntent's payment method. -* -* Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. -* -* When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SetupFutureUsage { #[serde(rename = "off_session")] OffSession, #[serde(rename = "on_session")] OnSession, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -24849,11 +24238,6 @@ impl std::fmt::Display for SetupFutureUsage { } } -impl Default for SetupFutureUsage { - fn default() -> SetupFutureUsage { - SetupFutureUsage::Noop - } -} impl SetupFutureUsage { pub fn is_noop(&self) -> bool { matches!(self, SetupFutureUsage::Noop) @@ -24861,9 +24245,9 @@ impl SetupFutureUsage { } /** -* Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentIntentStatus { #[serde(rename = "canceled")] Canceled, @@ -24880,6 +24264,7 @@ pub enum PaymentIntentStatus { #[serde(rename = "succeeded")] Succeeded, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -24902,11 +24287,6 @@ impl std::fmt::Display for PaymentIntentStatus { } } -impl Default for PaymentIntentStatus { - fn default() -> PaymentIntentStatus { - PaymentIntentStatus::Noop - } -} impl PaymentIntentStatus { pub fn is_noop(&self) -> bool { matches!(self, PaymentIntentStatus::Noop) @@ -25779,15 +25159,16 @@ pub struct PaymentIntentNextActionRedirectUrl { } /** -* The type of the microdeposit sent to the customer. Used to distinguish between different verification methods. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of the microdeposit sent to the customer. Used to distinguish between different verification methods. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MicrodepositType { #[serde(rename = "amounts")] Amounts, #[serde(rename = "descriptor_code")] DescriptorCode, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -25805,11 +25186,6 @@ impl std::fmt::Display for MicrodepositType { } } -impl Default for MicrodepositType { - fn default() -> MicrodepositType { - MicrodepositType::Noop - } -} impl MicrodepositType { pub fn is_noop(&self) -> bool { matches!(self, MicrodepositType::Noop) @@ -26995,13 +26371,13 @@ pub struct PaymentIntentMethodOptionsData { } /** -* Indicates that you intend to make future payments with this PaymentIntent's payment method. -* -* Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. -* -* When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentIntentMethodOptionsAcssDebitSetupFutureUsage { #[serde(rename = "none")] None, @@ -27010,6 +26386,7 @@ pub enum PaymentIntentMethodOptionsAcssDebitSetupFutureUsage { #[serde(rename = "on_session")] OnSession, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -27028,11 +26405,6 @@ impl std::fmt::Display for PaymentIntentMethodOptionsAcssDebitSetupFutureUsage { } } -impl Default for PaymentIntentMethodOptionsAcssDebitSetupFutureUsage { - fn default() -> PaymentIntentMethodOptionsAcssDebitSetupFutureUsage { - PaymentIntentMethodOptionsAcssDebitSetupFutureUsage::Noop - } -} impl PaymentIntentMethodOptionsAcssDebitSetupFutureUsage { pub fn is_noop(&self) -> bool { matches!( @@ -27073,13 +26445,14 @@ pub struct PaymentIntentMethodOptionsAuBecsDebit { } /** -* Controls when the funds will be captured from the customer's account. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Controls when the funds will be captured from the customer's account. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentIntentMethodOptionsCardCapture { #[serde(rename = "manual")] Manual, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -27096,11 +26469,6 @@ impl std::fmt::Display for PaymentIntentMethodOptionsCardCapture { } } -impl Default for PaymentIntentMethodOptionsCardCapture { - fn default() -> PaymentIntentMethodOptionsCardCapture { - PaymentIntentMethodOptionsCardCapture::Noop - } -} impl PaymentIntentMethodOptionsCardCapture { pub fn is_noop(&self) -> bool { matches!(self, PaymentIntentMethodOptionsCardCapture::Noop) @@ -27108,9 +26476,9 @@ impl PaymentIntentMethodOptionsCardCapture { } /** -* Selected network to process this payment intent on. Depends on the available networks of the card attached to the payment intent. Can be only set confirm-time. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Selected network to process this payment intent on. Depends on the available networks of the card attached to the payment intent. Can be only set confirm-time. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentIntentMethodOptionsCardNetwork { #[serde(rename = "amex")] Amex, @@ -27133,6 +26501,7 @@ pub enum PaymentIntentMethodOptionsCardNetwork { #[serde(rename = "visa")] Visa, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -27158,11 +26527,6 @@ impl std::fmt::Display for PaymentIntentMethodOptionsCardNetwork { } } -impl Default for PaymentIntentMethodOptionsCardNetwork { - fn default() -> PaymentIntentMethodOptionsCardNetwork { - PaymentIntentMethodOptionsCardNetwork::Noop - } -} impl PaymentIntentMethodOptionsCardNetwork { pub fn is_noop(&self) -> bool { matches!(self, PaymentIntentMethodOptionsCardNetwork::Noop) @@ -27170,9 +26534,9 @@ impl PaymentIntentMethodOptionsCardNetwork { } /** -* We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentIntentMethodOptionsCardRequestThreeDSecure { #[serde(rename = "any")] Any, @@ -27181,6 +26545,7 @@ pub enum PaymentIntentMethodOptionsCardRequestThreeDSecure { #[serde(rename = "challenge_only")] ChallengeOnly, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -27199,11 +26564,6 @@ impl std::fmt::Display for PaymentIntentMethodOptionsCardRequestThreeDSecure { } } -impl Default for PaymentIntentMethodOptionsCardRequestThreeDSecure { - fn default() -> PaymentIntentMethodOptionsCardRequestThreeDSecure { - PaymentIntentMethodOptionsCardRequestThreeDSecure::Noop - } -} impl PaymentIntentMethodOptionsCardRequestThreeDSecure { pub fn is_noop(&self) -> bool { matches!( @@ -27251,17 +26611,18 @@ pub struct PaymentIntentMethodOptionsCard { } /** -* Indicates that you intend to make future payments with this PaymentIntent's payment method. -* -* Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. -* -* When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentIntentMethodOptionsEpsSetupFutureUsage { #[serde(rename = "none")] None, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -27278,11 +26639,6 @@ impl std::fmt::Display for PaymentIntentMethodOptionsEpsSetupFutureUsage { } } -impl Default for PaymentIntentMethodOptionsEpsSetupFutureUsage { - fn default() -> PaymentIntentMethodOptionsEpsSetupFutureUsage { - PaymentIntentMethodOptionsEpsSetupFutureUsage::Noop - } -} impl PaymentIntentMethodOptionsEpsSetupFutureUsage { pub fn is_noop(&self) -> bool { matches!(self, PaymentIntentMethodOptionsEpsSetupFutureUsage::Noop) @@ -27420,13 +26776,14 @@ pub struct PaymentIntentTypeSpecificMethodOptionsClient { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentLinkObject { #[serde(rename = "payment_link")] PaymentLink, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -27443,11 +26800,6 @@ impl std::fmt::Display for PaymentLinkObject { } } -impl Default for PaymentLinkObject { - fn default() -> PaymentLinkObject { - PaymentLinkObject::Noop - } -} impl PaymentLinkObject { pub fn is_noop(&self) -> bool { matches!(self, PaymentLinkObject::Noop) @@ -27600,15 +26952,16 @@ pub struct PaymentLink { } /** -* The specified behavior after the purchase is complete. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The specified behavior after the purchase is complete. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentLinksResourceAfterCompletionType { #[serde(rename = "hosted_confirmation")] HostedConfirmation, #[serde(rename = "redirect")] Redirect, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -27626,11 +26979,6 @@ impl std::fmt::Display for PaymentLinksResourceAfterCompletionType { } } -impl Default for PaymentLinksResourceAfterCompletionType { - fn default() -> PaymentLinksResourceAfterCompletionType { - PaymentLinksResourceAfterCompletionType::Noop - } -} impl PaymentLinksResourceAfterCompletionType { pub fn is_noop(&self) -> bool { matches!(self, PaymentLinksResourceAfterCompletionType::Noop) @@ -27675,7 +27023,7 @@ pub struct PaymentLinksResourceCompletionBehaviorConfirmationPage { pub custom_message: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AllowedCountries { #[serde(rename = "AC")] Ac, @@ -28152,6 +27500,7 @@ pub enum AllowedCountries { #[serde(rename = "ZZ")] Zz, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -28404,11 +27753,6 @@ impl std::fmt::Display for AllowedCountries { } } -impl Default for AllowedCountries { - fn default() -> AllowedCountries { - AllowedCountries::Noop - } -} impl AllowedCountries { pub fn is_noop(&self) -> bool { matches!(self, AllowedCountries::Noop) @@ -28459,13 +27803,14 @@ pub struct PaymentLinksResourceTransferData { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentMethodObject { #[serde(rename = "payment_method")] PaymentMethod, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -28482,11 +27827,6 @@ impl std::fmt::Display for PaymentMethodObject { } } -impl Default for PaymentMethodObject { - fn default() -> PaymentMethodObject { - PaymentMethodObject::Noop - } -} impl PaymentMethodObject { pub fn is_noop(&self) -> bool { matches!(self, PaymentMethodObject::Noop) @@ -28494,9 +27834,9 @@ impl PaymentMethodObject { } /** -* The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentMethodType { #[serde(rename = "acss_debit")] AcssDebit, @@ -28547,6 +27887,7 @@ pub enum PaymentMethodType { #[serde(rename = "wechat_pay")] WechatPay, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -28586,11 +27927,6 @@ impl std::fmt::Display for PaymentMethodType { } } -impl Default for PaymentMethodType { - fn default() -> PaymentMethodType { - PaymentMethodType::Noop - } -} impl PaymentMethodType { pub fn is_noop(&self) -> bool { matches!(self, PaymentMethodType::Noop) @@ -29221,9 +28557,9 @@ pub struct PaymentMethodCardGenerated { } /** -* The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, or `visa_checkout`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, or `visa_checkout`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentMethodCardWalletType { #[serde(rename = "amex_express_checkout")] AmexExpressCheckout, @@ -29238,6 +28574,7 @@ pub enum PaymentMethodCardWalletType { #[serde(rename = "visa_checkout")] VisaCheckout, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -29259,11 +28596,6 @@ impl std::fmt::Display for PaymentMethodCardWalletType { } } -impl Default for PaymentMethodCardWalletType { - fn default() -> PaymentMethodCardWalletType { - PaymentMethodCardWalletType::Noop - } -} impl PaymentMethodCardWalletType { pub fn is_noop(&self) -> bool { matches!(self, PaymentMethodCardWalletType::Noop) @@ -30070,14 +29402,15 @@ pub struct PaymentMethodDetailsCardInstallmentsData { } /** -* For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. -* One of `month`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + * One of `month`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentMethodDetailsCardInstallmentsPlanInterval { #[serde(rename = "month")] Month, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -30094,11 +29427,6 @@ impl std::fmt::Display for PaymentMethodDetailsCardInstallmentsPlanInterval { } } -impl Default for PaymentMethodDetailsCardInstallmentsPlanInterval { - fn default() -> PaymentMethodDetailsCardInstallmentsPlanInterval { - PaymentMethodDetailsCardInstallmentsPlanInterval::Noop - } -} impl PaymentMethodDetailsCardInstallmentsPlanInterval { pub fn is_noop(&self) -> bool { matches!(self, PaymentMethodDetailsCardInstallmentsPlanInterval::Noop) @@ -30106,13 +29434,14 @@ impl PaymentMethodDetailsCardInstallmentsPlanInterval { } /** -* Type of installment plan, one of `fixed_count`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Type of installment plan, one of `fixed_count`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentMethodDetailsCardInstallmentsPlanType { #[serde(rename = "fixed_count")] FixedCount, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -30129,11 +29458,6 @@ impl std::fmt::Display for PaymentMethodDetailsCardInstallmentsPlanType { } } -impl Default for PaymentMethodDetailsCardInstallmentsPlanType { - fn default() -> PaymentMethodDetailsCardInstallmentsPlanType { - PaymentMethodDetailsCardInstallmentsPlanType::Noop - } -} impl PaymentMethodDetailsCardInstallmentsPlanType { pub fn is_noop(&self) -> bool { matches!(self, PaymentMethodDetailsCardInstallmentsPlanType::Noop) @@ -30170,9 +29494,9 @@ pub struct PaymentMethodDetailsCardInstallmentsPlan { } /** -* How card details were read in this transaction. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * How card details were read in this transaction. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReadMethod { #[serde(rename = "contact_emv")] ContactEmv, @@ -30185,6 +29509,7 @@ pub enum ReadMethod { #[serde(rename = "magnetic_stripe_track2")] MagneticStripeTrack2, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -30205,11 +29530,6 @@ impl std::fmt::Display for ReadMethod { } } -impl Default for ReadMethod { - fn default() -> ReadMethod { - ReadMethod::Noop - } -} impl ReadMethod { pub fn is_noop(&self) -> bool { matches!(self, ReadMethod::Noop) @@ -30358,9 +29678,9 @@ pub struct PaymentMethodDetailsCardPresent { } /** -* The type of account being debited or credited -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of account being debited or credited + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AccountType { #[serde(rename = "checking")] Checking, @@ -30371,6 +29691,7 @@ pub enum AccountType { #[serde(rename = "unknown")] Unknown, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -30390,11 +29711,6 @@ impl std::fmt::Display for AccountType { } } -impl Default for AccountType { - fn default() -> AccountType { - AccountType::Noop - } -} impl AccountType { pub fn is_noop(&self) -> bool { matches!(self, AccountType::Noop) @@ -30604,9 +29920,9 @@ pub struct PaymentMethodDetailsCardWalletVisaCheckout { } /** -* The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Bank { #[serde(rename = "arzte_und_apotheker_bank")] ArzteUndApothekerBank, @@ -30663,6 +29979,7 @@ pub enum Bank { #[serde(rename = "vr_bank_braunau")] VrBankBraunau, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -30705,11 +30022,6 @@ impl std::fmt::Display for Bank { } } -impl Default for Bank { - fn default() -> Bank { - Bank::Noop - } -} impl Bank { pub fn is_noop(&self) -> bool { matches!(self, Bank::Noop) @@ -30736,9 +30048,9 @@ pub struct PaymentMethodDetailsEps { } /** -* The customer's bank. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, or `pb_enterprise`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The customer's bank. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, or `pb_enterprise`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentMethodDetailsFpxBank { #[serde(rename = "affin_bank")] AffinBank, @@ -30783,6 +30095,7 @@ pub enum PaymentMethodDetailsFpxBank { #[serde(rename = "uob")] Uob, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -30819,11 +30132,6 @@ impl std::fmt::Display for PaymentMethodDetailsFpxBank { } } -impl Default for PaymentMethodDetailsFpxBank { - fn default() -> PaymentMethodDetailsFpxBank { - PaymentMethodDetailsFpxBank::Noop - } -} impl PaymentMethodDetailsFpxBank { pub fn is_noop(&self) -> bool { matches!(self, PaymentMethodDetailsFpxBank::Noop) @@ -30905,9 +30213,9 @@ pub struct PaymentMethodDetailsGrabpay { } /** -* The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, or `van_lanschot`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, or `van_lanschot`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentMethodDetailsIdealBank { #[serde(rename = "abn_amro")] AbnAmro, @@ -30936,6 +30244,7 @@ pub enum PaymentMethodDetailsIdealBank { #[serde(rename = "van_lanschot")] VanLanschot, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -30964,11 +30273,6 @@ impl std::fmt::Display for PaymentMethodDetailsIdealBank { } } -impl Default for PaymentMethodDetailsIdealBank { - fn default() -> PaymentMethodDetailsIdealBank { - PaymentMethodDetailsIdealBank::Noop - } -} impl PaymentMethodDetailsIdealBank { pub fn is_noop(&self) -> bool { matches!(self, PaymentMethodDetailsIdealBank::Noop) @@ -30976,9 +30280,9 @@ impl PaymentMethodDetailsIdealBank { } /** -* The Bank Identifier Code of the customer's bank. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The Bank Identifier Code of the customer's bank. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Bic { #[serde(rename = "ABNANL2A")] Abnanl2A, @@ -31007,6 +30311,7 @@ pub enum Bic { #[serde(rename = "TRIONL2U")] Trionl2U, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -31035,11 +30340,6 @@ impl std::fmt::Display for Bic { } } -impl Default for Bic { - fn default() -> Bic { - Bic::Noop - } -} impl Bic { pub fn is_noop(&self) -> bool { matches!(self, Bic::Noop) @@ -31213,9 +30513,9 @@ pub struct PaymentMethodDetailsInteracPresent { } /** -* The type of account being debited or credited -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of account being debited or credited + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentMethodDetailsInteracPresentReceiptAccountType { #[serde(rename = "checking")] Checking, @@ -31224,6 +30524,7 @@ pub enum PaymentMethodDetailsInteracPresentReceiptAccountType { #[serde(rename = "unknown")] Unknown, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -31242,11 +30543,6 @@ impl std::fmt::Display for PaymentMethodDetailsInteracPresentReceiptAccountType } } -impl Default for PaymentMethodDetailsInteracPresentReceiptAccountType { - fn default() -> PaymentMethodDetailsInteracPresentReceiptAccountType { - PaymentMethodDetailsInteracPresentReceiptAccountType::Noop - } -} impl PaymentMethodDetailsInteracPresentReceiptAccountType { pub fn is_noop(&self) -> bool { matches!( @@ -31372,9 +30668,9 @@ pub struct PaymentMethodDetailsKonbini { } /** -* The name of the convenience store chain where the payment was completed. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The name of the convenience store chain where the payment was completed. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Chain { #[serde(rename = "familymart")] Familymart, @@ -31385,6 +30681,7 @@ pub enum Chain { #[serde(rename = "seicomart")] Seicomart, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -31404,11 +30701,6 @@ impl std::fmt::Display for Chain { } } -impl Default for Chain { - fn default() -> Chain { - Chain::Noop - } -} impl Chain { pub fn is_noop(&self) -> bool { matches!(self, Chain::Noop) @@ -31463,9 +30755,9 @@ pub struct PaymentMethodDetailsOxxo { } /** -* The customer's bank. Can be one of `ing`, `citi_handlowy`, `tmobile_usbugi_bankowe`, `plus_bank`, `etransfer_pocztowy24`, `banki_spbdzielcze`, `bank_nowy_bfg_sa`, `getin_bank`, `blik`, `noble_pay`, `ideabank`, `envelobank`, `santander_przelew24`, `nest_przelew`, `mbank_mtransfer`, `inteligo`, `pbac_z_ipko`, `bnp_paribas`, `credit_agricole`, `toyota_bank`, `bank_pekao_sa`, `volkswagen_bank`, `bank_millennium`, `alior_bank`, or `boz`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The customer's bank. Can be one of `ing`, `citi_handlowy`, `tmobile_usbugi_bankowe`, `plus_bank`, `etransfer_pocztowy24`, `banki_spbdzielcze`, `bank_nowy_bfg_sa`, `getin_bank`, `blik`, `noble_pay`, `ideabank`, `envelobank`, `santander_przelew24`, `nest_przelew`, `mbank_mtransfer`, `inteligo`, `pbac_z_ipko`, `bnp_paribas`, `credit_agricole`, `toyota_bank`, `bank_pekao_sa`, `volkswagen_bank`, `bank_millennium`, `alior_bank`, or `boz`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentMethodDetailsP24Bank { #[serde(rename = "alior_bank")] AliorBank, @@ -31518,6 +30810,7 @@ pub enum PaymentMethodDetailsP24Bank { #[serde(rename = "volkswagen_bank")] VolkswagenBank, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -31558,11 +30851,6 @@ impl std::fmt::Display for PaymentMethodDetailsP24Bank { } } -impl Default for PaymentMethodDetailsP24Bank { - fn default() -> PaymentMethodDetailsP24Bank { - PaymentMethodDetailsP24Bank::Noop - } -} impl PaymentMethodDetailsP24Bank { pub fn is_noop(&self) -> bool { matches!(self, PaymentMethodDetailsP24Bank::Noop) @@ -31672,10 +30960,10 @@ pub struct PaymentMethodDetailsSepaDebit { } /** -* Preferred language of the SOFORT authorization page that the customer is redirected to. -* Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl` -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Preferred language of the SOFORT authorization page that the customer is redirected to. + * Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl` + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentMethodDetailsSofortPreferredLanguage { #[serde(rename = "de")] De, @@ -31692,6 +30980,7 @@ pub enum PaymentMethodDetailsSofortPreferredLanguage { #[serde(rename = "pl")] Pl, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -31714,11 +31003,6 @@ impl std::fmt::Display for PaymentMethodDetailsSofortPreferredLanguage { } } -impl Default for PaymentMethodDetailsSofortPreferredLanguage { - fn default() -> PaymentMethodDetailsSofortPreferredLanguage { - PaymentMethodDetailsSofortPreferredLanguage::Noop - } -} impl PaymentMethodDetailsSofortPreferredLanguage { pub fn is_noop(&self) -> bool { matches!(self, PaymentMethodDetailsSofortPreferredLanguage::Noop) @@ -31800,15 +31084,16 @@ pub struct PaymentMethodDetailsSofort { } /** -* Account type: checkings or savings. Defaults to checking if omitted. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Account type: checkings or savings. Defaults to checking if omitted. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentMethodDetailsUsBankAccountType { #[serde(rename = "checking")] Checking, #[serde(rename = "savings")] Savings, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -31826,11 +31111,6 @@ impl std::fmt::Display for PaymentMethodDetailsUsBankAccountType { } } -impl Default for PaymentMethodDetailsUsBankAccountType { - fn default() -> PaymentMethodDetailsUsBankAccountType { - PaymentMethodDetailsUsBankAccountType::Noop - } -} impl PaymentMethodDetailsUsBankAccountType { pub fn is_noop(&self) -> bool { matches!(self, PaymentMethodDetailsUsBankAccountType::Noop) @@ -31982,19 +31262,20 @@ pub struct PaymentMethodOptionsAfterpayClearpay { } /** -* Indicates that you intend to make future payments with this PaymentIntent's payment method. -* -* Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. -* -* When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentMethodOptionsAlipaySetupFutureUsage { #[serde(rename = "none")] None, #[serde(rename = "off_session")] OffSession, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -32012,11 +31293,6 @@ impl std::fmt::Display for PaymentMethodOptionsAlipaySetupFutureUsage { } } -impl Default for PaymentMethodOptionsAlipaySetupFutureUsage { - fn default() -> PaymentMethodOptionsAlipaySetupFutureUsage { - PaymentMethodOptionsAlipaySetupFutureUsage::Noop - } -} impl PaymentMethodOptionsAlipaySetupFutureUsage { pub fn is_noop(&self) -> bool { matches!(self, PaymentMethodOptionsAlipaySetupFutureUsage::Noop) @@ -32105,9 +31381,9 @@ pub struct PaymentMethodOptionsCardInstallments { } /** -* Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentMethodOptionsCardMandateInterval { #[serde(rename = "day")] Day, @@ -32120,6 +31396,7 @@ pub enum PaymentMethodOptionsCardMandateInterval { #[serde(rename = "year")] Year, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -32140,22 +31417,18 @@ impl std::fmt::Display for PaymentMethodOptionsCardMandateInterval { } } -impl Default for PaymentMethodOptionsCardMandateInterval { - fn default() -> PaymentMethodOptionsCardMandateInterval { - PaymentMethodOptionsCardMandateInterval::Noop - } -} impl PaymentMethodOptionsCardMandateInterval { pub fn is_noop(&self) -> bool { matches!(self, PaymentMethodOptionsCardMandateInterval::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SupportedTypes { #[serde(rename = "india")] India, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -32172,11 +31445,6 @@ impl std::fmt::Display for SupportedTypes { } } -impl Default for SupportedTypes { - fn default() -> SupportedTypes { - SupportedTypes::Noop - } -} impl SupportedTypes { pub fn is_noop(&self) -> bool { matches!(self, SupportedTypes::Noop) @@ -32443,9 +31711,9 @@ pub struct PaymentMethodOptionsSofort { } /** -* The client type that the end customer will pay from -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The client type that the end customer will pay from + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Client { #[serde(rename = "android")] Android, @@ -32454,6 +31722,7 @@ pub enum Client { #[serde(rename = "web")] Web, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -32472,11 +31741,6 @@ impl std::fmt::Display for Client { } } -impl Default for Client { - fn default() -> Client { - Client::Noop - } -} impl Client { pub fn is_noop(&self) -> bool { matches!(self, Client::Noop) @@ -32689,16 +31953,17 @@ pub struct PaymentPagesCheckoutSessionAfterExpirationRecovery { } /** -* If `opt_in`, the customer consents to receiving promotional communications -* from the merchant about this Checkout Session. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * If `opt_in`, the customer consents to receiving promotional communications + * from the merchant about this Checkout Session. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Promotions { #[serde(rename = "opt_in")] OptIn, #[serde(rename = "opt_out")] OptOut, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -32716,11 +31981,6 @@ impl std::fmt::Display for Promotions { } } -impl Default for Promotions { - fn default() -> Promotions { - Promotions::Noop - } -} impl Promotions { pub fn is_noop(&self) -> bool { matches!(self, Promotions::Noop) @@ -32739,15 +31999,16 @@ pub struct PaymentPagesCheckoutSessionConsent { } /** -* If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout -* Session will determine whether to display an option to opt into promotional communication -* from the merchant depending on the customer's locale. Only available to US merchants. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout + * Session will determine whether to display an option to opt into promotional communication + * from the merchant depending on the customer's locale. Only available to US merchants. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentPagesCheckoutSessionConsentCollectionPromotions { #[serde(rename = "auto")] Auto, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -32764,11 +32025,6 @@ impl std::fmt::Display for PaymentPagesCheckoutSessionConsentCollectionPromotion } } -impl Default for PaymentPagesCheckoutSessionConsentCollectionPromotions { - fn default() -> PaymentPagesCheckoutSessionConsentCollectionPromotions { - PaymentPagesCheckoutSessionConsentCollectionPromotions::Noop - } -} impl PaymentPagesCheckoutSessionConsentCollectionPromotions { pub fn is_noop(&self) -> bool { matches!( @@ -33138,13 +32394,14 @@ impl std::convert::From for String { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PayoutObject { #[serde(rename = "payout")] Payout, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -33161,11 +32418,6 @@ impl std::fmt::Display for PayoutObject { } } -impl Default for PayoutObject { - fn default() -> PayoutObject { - PayoutObject::Noop - } -} impl PayoutObject { pub fn is_noop(&self) -> bool { matches!(self, PayoutObject::Noop) @@ -33228,15 +32480,16 @@ impl std::convert::From for String { } /** -* Can be `bank_account` or `card`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Can be `bank_account` or `card`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PayoutType { #[serde(rename = "bank_account")] BankAccount, #[serde(rename = "card")] Card, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -33254,11 +32507,6 @@ impl std::fmt::Display for PayoutType { } } -impl Default for PayoutType { - fn default() -> PayoutType { - PayoutType::Noop - } -} impl PayoutType { pub fn is_noop(&self) -> bool { matches!(self, PayoutType::Noop) @@ -33534,15 +32782,16 @@ pub struct Period { } /** -* Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PoliticalExposure { #[serde(rename = "existing")] Existing, #[serde(rename = "none")] None, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -33560,11 +32809,6 @@ impl std::fmt::Display for PoliticalExposure { } } -impl Default for PoliticalExposure { - fn default() -> PoliticalExposure { - PoliticalExposure::Noop - } -} impl PoliticalExposure { pub fn is_noop(&self) -> bool { matches!(self, PoliticalExposure::Noop) @@ -34000,9 +33244,9 @@ pub struct PersonRelationship { } /** -* Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AggregateUsage { #[serde(rename = "last_during_period")] LastDuringPeriod, @@ -34013,6 +33257,7 @@ pub enum AggregateUsage { #[serde(rename = "sum")] Sum, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -34032,11 +33277,6 @@ impl std::fmt::Display for AggregateUsage { } } -impl Default for AggregateUsage { - fn default() -> AggregateUsage { - AggregateUsage::Noop - } -} impl AggregateUsage { pub fn is_noop(&self) -> bool { matches!(self, AggregateUsage::Noop) @@ -34044,15 +33284,16 @@ impl AggregateUsage { } /** -* Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BillingScheme { #[serde(rename = "per_unit")] PerUnit, #[serde(rename = "tiered")] Tiered, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -34070,11 +33311,6 @@ impl std::fmt::Display for BillingScheme { } } -impl Default for BillingScheme { - fn default() -> BillingScheme { - BillingScheme::Noop - } -} impl BillingScheme { pub fn is_noop(&self) -> bool { matches!(self, BillingScheme::Noop) @@ -34082,9 +33318,9 @@ impl BillingScheme { } /** -* The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PlanInterval { #[serde(rename = "day")] Day, @@ -34095,6 +33331,7 @@ pub enum PlanInterval { #[serde(rename = "year")] Year, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -34114,11 +33351,6 @@ impl std::fmt::Display for PlanInterval { } } -impl Default for PlanInterval { - fn default() -> PlanInterval { - PlanInterval::Noop - } -} impl PlanInterval { pub fn is_noop(&self) -> bool { matches!(self, PlanInterval::Noop) @@ -34193,15 +33425,16 @@ impl std::convert::From for String { } /** -* Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price. In `graduated` tiering, pricing can change as the quantity grows. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price. In `graduated` tiering, pricing can change as the quantity grows. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TiersMode { #[serde(rename = "graduated")] Graduated, #[serde(rename = "volume")] Volume, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -34219,11 +33452,6 @@ impl std::fmt::Display for TiersMode { } } -impl Default for TiersMode { - fn default() -> TiersMode { - TiersMode::Noop - } -} impl TiersMode { pub fn is_noop(&self) -> bool { matches!(self, TiersMode::Noop) @@ -34231,15 +33459,16 @@ impl TiersMode { } /** -* Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UsageType { #[serde(rename = "licensed")] Licensed, #[serde(rename = "metered")] Metered, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -34257,11 +33486,6 @@ impl std::fmt::Display for UsageType { } } -impl Default for UsageType { - fn default() -> UsageType { - UsageType::Noop - } -} impl UsageType { pub fn is_noop(&self) -> bool { matches!(self, UsageType::Noop) @@ -34518,13 +33742,14 @@ pub struct PlanTier { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PlatformTaxObject { #[serde(rename = "platform_tax_fee")] PlatformTaxFee, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -34541,11 +33766,6 @@ impl std::fmt::Display for PlatformTaxObject { } } -impl Default for PlatformTaxObject { - fn default() -> PlatformTaxObject { - PlatformTaxObject::Noop - } -} impl PlatformTaxObject { pub fn is_noop(&self) -> bool { matches!(self, PlatformTaxObject::Noop) @@ -34631,7 +33851,7 @@ pub struct PortalBusinessProfile { pub terms_of_service_url: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AllowedUpdates { #[serde(rename = "address")] Address, @@ -34644,6 +33864,7 @@ pub enum AllowedUpdates { #[serde(rename = "tax_id")] TaxId, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -34664,11 +33885,6 @@ impl std::fmt::Display for AllowedUpdates { } } -impl Default for AllowedUpdates { - fn default() -> AllowedUpdates { - AllowedUpdates::Noop - } -} impl AllowedUpdates { pub fn is_noop(&self) -> bool { matches!(self, AllowedUpdates::Noop) @@ -34727,15 +33943,16 @@ pub struct PortalFeatures { } /** -* Whether to cancel subscriptions immediately or at the end of the billing period. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether to cancel subscriptions immediately or at the end of the billing period. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PortalSubscriptionCancelMode { #[serde(rename = "at_period_end")] AtPeriodEnd, #[serde(rename = "immediately")] Immediately, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -34753,11 +33970,6 @@ impl std::fmt::Display for PortalSubscriptionCancelMode { } } -impl Default for PortalSubscriptionCancelMode { - fn default() -> PortalSubscriptionCancelMode { - PortalSubscriptionCancelMode::Noop - } -} impl PortalSubscriptionCancelMode { pub fn is_noop(&self) -> bool { matches!(self, PortalSubscriptionCancelMode::Noop) @@ -34765,9 +33977,9 @@ impl PortalSubscriptionCancelMode { } /** -* Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ProrationBehavior { #[serde(rename = "always_invoice")] AlwaysInvoice, @@ -34776,6 +33988,7 @@ pub enum ProrationBehavior { #[serde(rename = "none")] None, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -34794,11 +34007,6 @@ impl std::fmt::Display for ProrationBehavior { } } -impl Default for ProrationBehavior { - fn default() -> ProrationBehavior { - ProrationBehavior::Noop - } -} impl ProrationBehavior { pub fn is_noop(&self) -> bool { matches!(self, ProrationBehavior::Noop) @@ -34832,7 +34040,7 @@ pub struct PortalSubscriptionCancel { pub proration_behavior: ProrationBehavior, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Options { #[serde(rename = "customer_service")] CustomerService, @@ -34851,6 +34059,7 @@ pub enum Options { #[serde(rename = "unused")] Unused, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -34874,11 +34083,6 @@ impl std::fmt::Display for Options { } } -impl Default for Options { - fn default() -> Options { - Options::Noop - } -} impl Options { pub fn is_noop(&self) -> bool { matches!(self, Options::Noop) @@ -34907,7 +34111,7 @@ pub struct PortalSubscriptionCancellationReason { pub options: Vec, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DefaultAllowedUpdates { #[serde(rename = "price")] Price, @@ -34916,6 +34120,7 @@ pub enum DefaultAllowedUpdates { #[serde(rename = "quantity")] Quantity, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -34934,11 +34139,6 @@ impl std::fmt::Display for DefaultAllowedUpdates { } } -impl Default for DefaultAllowedUpdates { - fn default() -> DefaultAllowedUpdates { - DefaultAllowedUpdates::Noop - } -} impl DefaultAllowedUpdates { pub fn is_noop(&self) -> bool { matches!(self, DefaultAllowedUpdates::Noop) @@ -35005,9 +34205,9 @@ pub struct PortalSubscriptionUpdateProduct { } /** -* Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TaxBehavior { #[serde(rename = "exclusive")] Exclusive, @@ -35016,6 +34216,7 @@ pub enum TaxBehavior { #[serde(rename = "unspecified")] Unspecified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -35034,11 +34235,6 @@ impl std::fmt::Display for TaxBehavior { } } -impl Default for TaxBehavior { - fn default() -> TaxBehavior { - TaxBehavior::Noop - } -} impl TaxBehavior { pub fn is_noop(&self) -> bool { matches!(self, TaxBehavior::Noop) @@ -35046,15 +34242,16 @@ impl TaxBehavior { } /** -* One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PriceType { #[serde(rename = "one_time")] OneTime, #[serde(rename = "recurring")] Recurring, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -35072,11 +34269,6 @@ impl std::fmt::Display for PriceType { } } -impl Default for PriceType { - fn default() -> PriceType { - PriceType::Noop - } -} impl PriceType { pub fn is_noop(&self) -> bool { matches!(self, PriceType::Noop) @@ -35527,13 +34719,14 @@ pub struct Product { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PromotionCodeObject { #[serde(rename = "promotion_code")] PromotionCode, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -35550,11 +34743,6 @@ impl std::fmt::Display for PromotionCodeObject { } } -impl Default for PromotionCodeObject { - fn default() -> PromotionCodeObject { - PromotionCodeObject::Noop - } -} impl PromotionCodeObject { pub fn is_noop(&self) -> bool { matches!(self, PromotionCodeObject::Noop) @@ -35792,13 +34980,14 @@ impl std::convert::From for String { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum QuoteObject { #[serde(rename = "quote")] Quote, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -35815,11 +35004,6 @@ impl std::fmt::Display for QuoteObject { } } -impl Default for QuoteObject { - fn default() -> QuoteObject { - QuoteObject::Noop - } -} impl QuoteObject { pub fn is_noop(&self) -> bool { matches!(self, QuoteObject::Noop) @@ -35827,9 +35011,9 @@ impl QuoteObject { } /** -* The status of the quote. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the quote. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum QuoteStatus { #[serde(rename = "accepted")] Accepted, @@ -35840,6 +35024,7 @@ pub enum QuoteStatus { #[serde(rename = "open")] Open, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -35859,11 +35044,6 @@ impl std::fmt::Display for QuoteStatus { } } -impl Default for QuoteStatus { - fn default() -> QuoteStatus { - QuoteStatus::Noop - } -} impl QuoteStatus { pub fn is_noop(&self) -> bool { matches!(self, QuoteStatus::Noop) @@ -36370,13 +35550,14 @@ pub struct QuotesResourceUpfront { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RadarEarlyFraudWarningObject { #[serde(rename = "radar.early_fraud_warning")] RadarEarlyFraudWarning, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -36393,11 +35574,6 @@ impl std::fmt::Display for RadarEarlyFraudWarningObject { } } -impl Default for RadarEarlyFraudWarningObject { - fn default() -> RadarEarlyFraudWarningObject { - RadarEarlyFraudWarningObject::Noop - } -} impl RadarEarlyFraudWarningObject { pub fn is_noop(&self) -> bool { matches!(self, RadarEarlyFraudWarningObject::Noop) @@ -36469,9 +35645,9 @@ pub struct RadarEarlyFraudWarning { } /** -* The type of items in the value list. One of `card_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of items in the value list. One of `card_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ItemType { #[serde(rename = "card_bin")] CardBin, @@ -36490,6 +35666,7 @@ pub enum ItemType { #[serde(rename = "string")] String, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -36513,11 +35690,6 @@ impl std::fmt::Display for ItemType { } } -impl Default for ItemType { - fn default() -> ItemType { - ItemType::Noop - } -} impl ItemType { pub fn is_noop(&self) -> bool { matches!(self, ItemType::Noop) @@ -37081,13 +36253,14 @@ pub struct RecurringData { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RefundObject { #[serde(rename = "refund")] Refund, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -37104,11 +36277,6 @@ impl std::fmt::Display for RefundObject { } } -impl Default for RefundObject { - fn default() -> RefundObject { - RefundObject::Noop - } -} impl RefundObject { pub fn is_noop(&self) -> bool { matches!(self, RefundObject::Noop) @@ -37116,9 +36284,9 @@ impl RefundObject { } /** -* Reason for the refund, either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Reason for the refund, either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RefundReason { #[serde(rename = "duplicate")] Duplicate, @@ -37129,6 +36297,7 @@ pub enum RefundReason { #[serde(rename = "requested_by_customer")] RequestedByCustomer, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -37148,11 +36317,6 @@ impl std::fmt::Display for RefundReason { } } -impl Default for RefundReason { - fn default() -> RefundReason { - RefundReason::Noop - } -} impl RefundReason { pub fn is_noop(&self) -> bool { matches!(self, RefundReason::Noop) @@ -37435,13 +36599,14 @@ pub struct RefundNextActionDisplayDetails { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReportingReportRunObject { #[serde(rename = "reporting.report_run")] ReportingReportRun, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -37458,11 +36623,6 @@ impl std::fmt::Display for ReportingReportRunObject { } } -impl Default for ReportingReportRunObject { - fn default() -> ReportingReportRunObject { - ReportingReportRunObject::Noop - } -} impl ReportingReportRunObject { pub fn is_noop(&self) -> bool { matches!(self, ReportingReportRunObject::Noop) @@ -37573,13 +36733,14 @@ pub struct ReportingReportRun { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReportingReportTypeObject { #[serde(rename = "reporting.report_type")] ReportingReportType, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -37596,11 +36757,6 @@ impl std::fmt::Display for ReportingReportTypeObject { } } -impl Default for ReportingReportTypeObject { - fn default() -> ReportingReportTypeObject { - ReportingReportTypeObject::Noop - } -} impl ReportingReportTypeObject { pub fn is_noop(&self) -> bool { matches!(self, ReportingReportTypeObject::Noop) @@ -37703,13 +36859,14 @@ pub struct ReportingReportType { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReserveTransactionObject { #[serde(rename = "reserve_transaction")] ReserveTransaction, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -37726,11 +36883,6 @@ impl std::fmt::Display for ReserveTransactionObject { } } -impl Default for ReserveTransactionObject { - fn default() -> ReserveTransactionObject { - ReserveTransactionObject::Noop - } -} impl ReserveTransactionObject { pub fn is_noop(&self) -> bool { matches!(self, ReserveTransactionObject::Noop) @@ -37784,9 +36936,9 @@ pub struct ReserveTransaction { } /** -* The reason the review was closed, or null if it has not yet been closed. One of `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The reason the review was closed, or null if it has not yet been closed. One of `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ClosedReason { #[serde(rename = "approved")] Approved, @@ -37799,6 +36951,7 @@ pub enum ClosedReason { #[serde(rename = "refunded_as_fraud")] RefundedAsFraud, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -37819,11 +36972,6 @@ impl std::fmt::Display for ClosedReason { } } -impl Default for ClosedReason { - fn default() -> ClosedReason { - ClosedReason::Noop - } -} impl ClosedReason { pub fn is_noop(&self) -> bool { matches!(self, ClosedReason::Noop) @@ -37831,13 +36979,14 @@ impl ClosedReason { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReviewObject { #[serde(rename = "review")] Review, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -37854,11 +37003,6 @@ impl std::fmt::Display for ReviewObject { } } -impl Default for ReviewObject { - fn default() -> ReviewObject { - ReviewObject::Noop - } -} impl ReviewObject { pub fn is_noop(&self) -> bool { matches!(self, ReviewObject::Noop) @@ -37866,15 +37010,16 @@ impl ReviewObject { } /** -* The reason the review was opened. One of `rule` or `manual`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The reason the review was opened. One of `rule` or `manual`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OpenedReason { #[serde(rename = "manual")] Manual, #[serde(rename = "rule")] Rule, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -37892,11 +37037,6 @@ impl std::fmt::Display for OpenedReason { } } -impl Default for OpenedReason { - fn default() -> OpenedReason { - OpenedReason::Noop - } -} impl OpenedReason { pub fn is_noop(&self) -> bool { matches!(self, OpenedReason::Noop) @@ -38050,13 +37190,14 @@ pub struct Rule { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ScheduledQueryRunObject { #[serde(rename = "scheduled_query_run")] ScheduledQueryRun, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -38073,11 +37214,6 @@ impl std::fmt::Display for ScheduledQueryRunObject { } } -impl Default for ScheduledQueryRunObject { - fn default() -> ScheduledQueryRunObject { - ScheduledQueryRunObject::Noop - } -} impl ScheduledQueryRunObject { pub fn is_noop(&self) -> bool { matches!(self, ScheduledQueryRunObject::Noop) @@ -38196,13 +37332,14 @@ pub struct SepaDebitGeneratedFrom { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SetupAttemptObject { #[serde(rename = "setup_attempt")] SetupAttempt, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -38219,11 +37356,6 @@ impl std::fmt::Display for SetupAttemptObject { } } -impl Default for SetupAttemptObject { - fn default() -> SetupAttemptObject { - SetupAttemptObject::Noop - } -} impl SetupAttemptObject { pub fn is_noop(&self) -> bool { matches!(self, SetupAttemptObject::Noop) @@ -38578,9 +37710,9 @@ pub struct SetupAttemptPaymentMethodDetailsSofort { } /** -* Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SetupIntentCancellationReason { #[serde(rename = "abandoned")] Abandoned, @@ -38589,6 +37721,7 @@ pub enum SetupIntentCancellationReason { #[serde(rename = "requested_by_customer")] RequestedByCustomer, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -38607,11 +37740,6 @@ impl std::fmt::Display for SetupIntentCancellationReason { } } -impl Default for SetupIntentCancellationReason { - fn default() -> SetupIntentCancellationReason { - SetupIntentCancellationReason::Noop - } -} impl SetupIntentCancellationReason { pub fn is_noop(&self) -> bool { matches!(self, SetupIntentCancellationReason::Noop) @@ -38619,13 +37747,14 @@ impl SetupIntentCancellationReason { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SetupIntentObject { #[serde(rename = "setup_intent")] SetupIntent, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -38642,11 +37771,6 @@ impl std::fmt::Display for SetupIntentObject { } } -impl Default for SetupIntentObject { - fn default() -> SetupIntentObject { - SetupIntentObject::Noop - } -} impl SetupIntentObject { pub fn is_noop(&self) -> bool { matches!(self, SetupIntentObject::Noop) @@ -38654,9 +37778,9 @@ impl SetupIntentObject { } /** -* [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SetupIntentStatus { #[serde(rename = "canceled")] Canceled, @@ -38671,6 +37795,7 @@ pub enum SetupIntentStatus { #[serde(rename = "succeeded")] Succeeded, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -38692,11 +37817,6 @@ impl std::fmt::Display for SetupIntentStatus { } } -impl Default for SetupIntentStatus { - fn default() -> SetupIntentStatus { - SetupIntentStatus::Noop - } -} impl SetupIntentStatus { pub fn is_noop(&self) -> bool { matches!(self, SetupIntentStatus::Noop) @@ -39558,13 +38678,14 @@ pub struct ShippingMethod { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ShippingRateObject { #[serde(rename = "shipping_rate")] ShippingRate, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -39581,11 +38702,6 @@ impl std::fmt::Display for ShippingRateObject { } } -impl Default for ShippingRateObject { - fn default() -> ShippingRateObject { - ShippingRateObject::Noop - } -} impl ShippingRateObject { pub fn is_noop(&self) -> bool { matches!(self, ShippingRateObject::Noop) @@ -39593,13 +38709,14 @@ impl ShippingRateObject { } /** -* The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ShippingRateType { #[serde(rename = "fixed_amount")] FixedAmount, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -39616,11 +38733,6 @@ impl std::fmt::Display for ShippingRateType { } } -impl Default for ShippingRateType { - fn default() -> ShippingRateType { - ShippingRateType::Noop - } -} impl ShippingRateType { pub fn is_noop(&self) -> bool { matches!(self, ShippingRateType::Noop) @@ -39737,9 +38849,9 @@ pub struct ShippingRateDeliveryEstimateData { } /** -* A unit of time. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * A unit of time. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Unit { #[serde(rename = "business_day")] BusinessDay, @@ -39752,6 +38864,7 @@ pub enum Unit { #[serde(rename = "week")] Week, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -39772,11 +38885,6 @@ impl std::fmt::Display for Unit { } } -impl Default for Unit { - fn default() -> Unit { - Unit::Noop - } -} impl Unit { pub fn is_noop(&self) -> bool { matches!(self, Unit::Noop) @@ -40023,13 +39131,14 @@ pub struct SkuInventory { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SourceObject { #[serde(rename = "source")] Source, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -40046,11 +39155,6 @@ impl std::fmt::Display for SourceObject { } } -impl Default for SourceObject { - fn default() -> SourceObject { - SourceObject::Noop - } -} impl SourceObject { pub fn is_noop(&self) -> bool { matches!(self, SourceObject::Noop) @@ -40058,9 +39162,9 @@ impl SourceObject { } /** -* The `type` of the source. The `type` is a payment method, one of `ach_credit_transfer`, `ach_debit`, `alipay`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `multibanco`, `klarna`, `p24`, `sepa_debit`, `sofort`, `three_d_secure`, or `wechat`. An additional hash is included on the source with a name matching this value. It contains additional information specific to the [payment method](https://stripe.com/docs/sources) used. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The `type` of the source. The `type` is a payment method, one of `ach_credit_transfer`, `ach_debit`, `alipay`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `multibanco`, `klarna`, `p24`, `sepa_debit`, `sofort`, `three_d_secure`, or `wechat`. An additional hash is included on the source with a name matching this value. It contains additional information specific to the [payment method](https://stripe.com/docs/sources) used. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SourceType { #[serde(rename = "ach_credit_transfer")] AchCreditTransfer, @@ -40099,6 +39203,7 @@ pub enum SourceType { #[serde(rename = "wechat")] Wechat, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -40132,11 +39237,6 @@ impl std::fmt::Display for SourceType { } } -impl Default for SourceType { - fn default() -> SourceType { - SourceType::Noop - } -} impl SourceType { pub fn is_noop(&self) -> bool { matches!(self, SourceType::Noop) @@ -40549,13 +39649,14 @@ pub struct SourceCodeVerificationFlow { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SourceMandateNotificationObject { #[serde(rename = "source_mandate_notification")] SourceMandateNotification, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -40574,11 +39675,6 @@ impl std::fmt::Display for SourceMandateNotificationObject { } } -impl Default for SourceMandateNotificationObject { - fn default() -> SourceMandateNotificationObject { - SourceMandateNotificationObject::Noop - } -} impl SourceMandateNotificationObject { pub fn is_noop(&self) -> bool { matches!(self, SourceMandateNotificationObject::Noop) @@ -41033,13 +40129,14 @@ pub struct SourceRedirectFlow { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SourceTransactionObject { #[serde(rename = "source_transaction")] SourceTransaction, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -41056,11 +40153,6 @@ impl std::fmt::Display for SourceTransactionObject { } } -impl Default for SourceTransactionObject { - fn default() -> SourceTransactionObject { - SourceTransactionObject::Noop - } -} impl SourceTransactionObject { pub fn is_noop(&self) -> bool { matches!(self, SourceTransactionObject::Noop) @@ -41068,9 +40160,9 @@ impl SourceTransactionObject { } /** -* The type of source this transaction is attached to. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of source this transaction is attached to. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SourceTransactionType { #[serde(rename = "ach_credit_transfer")] AchCreditTransfer, @@ -41105,6 +40197,7 @@ pub enum SourceTransactionType { #[serde(rename = "wechat")] Wechat, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -41136,11 +40229,6 @@ impl std::fmt::Display for SourceTransactionType { } } -impl Default for SourceTransactionType { - fn default() -> SourceTransactionType { - SourceTransactionType::Noop - } -} impl SourceTransactionType { pub fn is_noop(&self) -> bool { matches!(self, SourceTransactionType::Noop) @@ -43040,13 +42128,14 @@ pub struct Items { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SubscriptionObject { #[serde(rename = "subscription")] Subscription, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -43063,11 +42152,6 @@ impl std::fmt::Display for SubscriptionObject { } } -impl Default for SubscriptionObject { - fn default() -> SubscriptionObject { - SubscriptionObject::Noop - } -} impl SubscriptionObject { pub fn is_noop(&self) -> bool { matches!(self, SubscriptionObject::Noop) @@ -43075,17 +42159,17 @@ impl SubscriptionObject { } /** -* Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, or `unpaid`. -* -* For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. A subscription in this state can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an `active` state. If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. This is a terminal state, the open invoice will be voided and no further invoices will be generated. -* -* A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. -* -* If subscription `collection_method=charge_automatically` it becomes `past_due` when payment to renew it fails and `canceled` or `unpaid` (depending on your subscriptions settings) when Stripe has exhausted all payment retry attempts. -* -* If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, or `unpaid`. + * + * For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. A subscription in this state can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an `active` state. If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. This is a terminal state, the open invoice will be voided and no further invoices will be generated. + * + * A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. + * + * If subscription `collection_method=charge_automatically` it becomes `past_due` when payment to renew it fails and `canceled` or `unpaid` (depending on your subscriptions settings) when Stripe has exhausted all payment retry attempts. + * + * If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SubscriptionStatus { #[serde(rename = "active")] Active, @@ -43102,6 +42186,7 @@ pub enum SubscriptionStatus { #[serde(rename = "unpaid")] Unpaid, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -43124,11 +42209,6 @@ impl std::fmt::Display for SubscriptionStatus { } } -impl Default for SubscriptionStatus { - fn default() -> SubscriptionStatus { - SubscriptionStatus::Noop - } -} impl SubscriptionStatus { pub fn is_noop(&self) -> bool { matches!(self, SubscriptionStatus::Noop) @@ -43576,9 +42656,9 @@ pub struct SubscriptionPendingInvoiceItemInterval { } /** -* Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` and `cancel`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` and `cancel`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EndBehavior { #[serde(rename = "cancel")] Cancel, @@ -43589,6 +42669,7 @@ pub enum EndBehavior { #[serde(rename = "renew")] Renew, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -43608,11 +42689,6 @@ impl std::fmt::Display for EndBehavior { } } -impl Default for EndBehavior { - fn default() -> EndBehavior { - EndBehavior::Noop - } -} impl EndBehavior { pub fn is_noop(&self) -> bool { matches!(self, EndBehavior::Noop) @@ -43620,13 +42696,14 @@ impl EndBehavior { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SubscriptionScheduleObject { #[serde(rename = "subscription_schedule")] SubscriptionSchedule, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -43643,11 +42720,6 @@ impl std::fmt::Display for SubscriptionScheduleObject { } } -impl Default for SubscriptionScheduleObject { - fn default() -> SubscriptionScheduleObject { - SubscriptionScheduleObject::Noop - } -} impl SubscriptionScheduleObject { pub fn is_noop(&self) -> bool { matches!(self, SubscriptionScheduleObject::Noop) @@ -43655,9 +42727,9 @@ impl SubscriptionScheduleObject { } /** -* The present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SubscriptionScheduleStatus { #[serde(rename = "active")] Active, @@ -43670,6 +42742,7 @@ pub enum SubscriptionScheduleStatus { #[serde(rename = "released")] Released, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -43690,11 +42763,6 @@ impl std::fmt::Display for SubscriptionScheduleStatus { } } -impl Default for SubscriptionScheduleStatus { - fn default() -> SubscriptionScheduleStatus { - SubscriptionScheduleStatus::Noop - } -} impl SubscriptionScheduleStatus { pub fn is_noop(&self) -> bool { matches!(self, SubscriptionScheduleStatus::Noop) @@ -43977,15 +43045,16 @@ pub struct SubscriptionScheduleCurrentPhase { } /** -* Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BillingCycleAnchor { #[serde(rename = "automatic")] Automatic, #[serde(rename = "phase_start")] PhaseStart, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -44003,11 +43072,6 @@ impl std::fmt::Display for BillingCycleAnchor { } } -impl Default for BillingCycleAnchor { - fn default() -> BillingCycleAnchor { - BillingCycleAnchor::Noop - } -} impl BillingCycleAnchor { pub fn is_noop(&self) -> bool { matches!(self, BillingCycleAnchor::Noop) @@ -44251,9 +43315,9 @@ pub struct SubscriptionTransferDataType { } /** -* The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Behavior { #[serde(rename = "keep_as_draft")] KeepAsDraft, @@ -44262,6 +43326,7 @@ pub enum Behavior { #[serde(rename = "void")] Void, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -44280,11 +43345,6 @@ impl std::fmt::Display for Behavior { } } -impl Default for Behavior { - fn default() -> Behavior { - Behavior::Noop - } -} impl Behavior { pub fn is_noop(&self) -> bool { matches!(self, Behavior::Noop) @@ -44421,13 +43481,14 @@ pub struct SubscriptionsResourcePendingUpdate { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TaxCodeObject { #[serde(rename = "tax_code")] TaxCode, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -44444,11 +43505,6 @@ impl std::fmt::Display for TaxCodeObject { } } -impl Default for TaxCodeObject { - fn default() -> TaxCodeObject { - TaxCodeObject::Noop - } -} impl TaxCodeObject { pub fn is_noop(&self) -> bool { matches!(self, TaxCodeObject::Noop) @@ -44493,13 +43549,14 @@ pub struct TaxCode { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TaxDeductedAtSourceObject { #[serde(rename = "tax_deducted_at_source")] TaxDeductedAtSource, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -44516,11 +43573,6 @@ impl std::fmt::Display for TaxDeductedAtSourceObject { } } -impl Default for TaxDeductedAtSourceObject { - fn default() -> TaxDeductedAtSourceObject { - TaxDeductedAtSourceObject::Noop - } -} impl TaxDeductedAtSourceObject { pub fn is_noop(&self) -> bool { matches!(self, TaxDeductedAtSourceObject::Noop) @@ -44656,9 +43708,9 @@ pub struct TaxId { } /** -* Verification status, one of `pending`, `verified`, `unverified`, or `unavailable`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Verification status, one of `pending`, `verified`, `unverified`, or `unavailable`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TaxVerificationStatus { #[serde(rename = "pending")] Pending, @@ -44669,6 +43721,7 @@ pub enum TaxVerificationStatus { #[serde(rename = "verified")] Verified, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -44688,11 +43741,6 @@ impl std::fmt::Display for TaxVerificationStatus { } } -impl Default for TaxVerificationStatus { - fn default() -> TaxVerificationStatus { - TaxVerificationStatus::Noop - } -} impl TaxVerificationStatus { pub fn is_noop(&self) -> bool { matches!(self, TaxVerificationStatus::Noop) @@ -44728,13 +43776,14 @@ pub struct TaxVerificationData { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TaxRateObject { #[serde(rename = "tax_rate")] TaxRate, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -44751,11 +43800,6 @@ impl std::fmt::Display for TaxRateObject { } } -impl Default for TaxRateObject { - fn default() -> TaxRateObject { - TaxRateObject::Noop - } -} impl TaxRateObject { pub fn is_noop(&self) -> bool { matches!(self, TaxRateObject::Noop) @@ -44763,9 +43807,9 @@ impl TaxRateObject { } /** -* The high-level tax type, such as `vat` or `sales_tax`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The high-level tax type, such as `vat` or `sales_tax`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TaxType { #[serde(rename = "gst")] Gst, @@ -44784,6 +43828,7 @@ pub enum TaxType { #[serde(rename = "vat")] Vat, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -44807,11 +43852,6 @@ impl std::fmt::Display for TaxType { } } -impl Default for TaxType { - fn default() -> TaxType { - TaxType::Noop - } -} impl TaxType { pub fn is_noop(&self) -> bool { matches!(self, TaxType::Noop) @@ -44951,13 +43991,14 @@ pub struct TaxRate { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TerminalConnectionTokenObject { #[serde(rename = "terminal.connection_token")] TerminalConnectionToken, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -44974,11 +44015,6 @@ impl std::fmt::Display for TerminalConnectionTokenObject { } } -impl Default for TerminalConnectionTokenObject { - fn default() -> TerminalConnectionTokenObject { - TerminalConnectionTokenObject::Noop - } -} impl TerminalConnectionTokenObject { pub fn is_noop(&self) -> bool { matches!(self, TerminalConnectionTokenObject::Noop) @@ -45075,9 +44111,9 @@ pub struct TerminalLocation { } /** -* Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, or `verifone_P400`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, or `verifone_P400`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeviceType { #[serde(rename = "bbpos_chipper2x")] BbposChipper2X, @@ -45090,6 +44126,7 @@ pub enum DeviceType { #[serde(rename = "verifone_P400")] VerifoneP400, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -45110,11 +44147,6 @@ impl std::fmt::Display for DeviceType { } } -impl Default for DeviceType { - fn default() -> DeviceType { - DeviceType::Noop - } -} impl DeviceType { pub fn is_noop(&self) -> bool { matches!(self, DeviceType::Noop) @@ -45371,9 +44403,9 @@ pub struct TerminalReaderResourceProcessSetupIntentAction { } /** -* Status of the action performed by the reader. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Status of the action performed by the reader. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TerminalReaderResourceActionStatus { #[serde(rename = "failed")] Failed, @@ -45382,6 +44414,7 @@ pub enum TerminalReaderResourceActionStatus { #[serde(rename = "succeeded")] Succeeded, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -45400,11 +44433,6 @@ impl std::fmt::Display for TerminalReaderResourceActionStatus { } } -impl Default for TerminalReaderResourceActionStatus { - fn default() -> TerminalReaderResourceActionStatus { - TerminalReaderResourceActionStatus::Noop - } -} impl TerminalReaderResourceActionStatus { pub fn is_noop(&self) -> bool { matches!(self, TerminalReaderResourceActionStatus::Noop) @@ -45412,9 +44440,9 @@ impl TerminalReaderResourceActionStatus { } /** -* Type of action performed by the reader. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Type of action performed by the reader. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TerminalReaderResourceActionType { #[serde(rename = "process_payment_intent")] ProcessPaymentIntent, @@ -45423,6 +44451,7 @@ pub enum TerminalReaderResourceActionType { #[serde(rename = "set_reader_display")] SetReaderDisplay, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -45441,11 +44470,6 @@ impl std::fmt::Display for TerminalReaderResourceActionType { } } -impl Default for TerminalReaderResourceActionType { - fn default() -> TerminalReaderResourceActionType { - TerminalReaderResourceActionType::Noop - } -} impl TerminalReaderResourceActionType { pub fn is_noop(&self) -> bool { matches!(self, TerminalReaderResourceActionType::Noop) @@ -45508,13 +44532,14 @@ pub struct TerminalReaderResourceAction { } /** -* Type of information to be displayed by the reader. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Type of information to be displayed by the reader. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TerminalReaderResourceSetDisplayActionType { #[serde(rename = "cart")] Cart, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -45531,11 +44556,6 @@ impl std::fmt::Display for TerminalReaderResourceSetDisplayActionType { } } -impl Default for TerminalReaderResourceSetDisplayActionType { - fn default() -> TerminalReaderResourceSetDisplayActionType { - TerminalReaderResourceSetDisplayActionType::Noop - } -} impl TerminalReaderResourceSetDisplayActionType { pub fn is_noop(&self) -> bool { matches!(self, TerminalReaderResourceSetDisplayActionType::Noop) @@ -45562,9 +44582,9 @@ pub struct TerminalReaderResourceSetDisplayAction { } /** -* The status of the Test Clock. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the Test Clock. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TestClockStatus { #[serde(rename = "advancing")] Advancing, @@ -45573,6 +44593,7 @@ pub enum TestClockStatus { #[serde(rename = "ready")] Ready, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -45591,11 +44612,6 @@ impl std::fmt::Display for TestClockStatus { } } -impl Default for TestClockStatus { - fn default() -> TestClockStatus { - TestClockStatus::Noop - } -} impl TestClockStatus { pub fn is_noop(&self) -> bool { matches!(self, TestClockStatus::Noop) @@ -45675,13 +44691,14 @@ pub struct TestClock { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ThreeDSecureObject { #[serde(rename = "three_d_secure")] ThreeDSecure, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -45698,11 +44715,6 @@ impl std::fmt::Display for ThreeDSecureObject { } } -impl Default for ThreeDSecureObject { - fn default() -> ThreeDSecureObject { - ThreeDSecureObject::Noop - } -} impl ThreeDSecureObject { pub fn is_noop(&self) -> bool { matches!(self, ThreeDSecureObject::Noop) @@ -45802,16 +44814,17 @@ pub struct ThreeDSecure { } /** -* For authenticated transactions: how the customer was authenticated by -* the issuing bank. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * For authenticated transactions: how the customer was authenticated by + * the issuing bank. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AuthenticationFlow { #[serde(rename = "challenge")] Challenge, #[serde(rename = "frictionless")] Frictionless, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -45829,11 +44842,6 @@ impl std::fmt::Display for AuthenticationFlow { } } -impl Default for AuthenticationFlow { - fn default() -> AuthenticationFlow { - AuthenticationFlow::Noop - } -} impl AuthenticationFlow { pub fn is_noop(&self) -> bool { matches!(self, AuthenticationFlow::Noop) @@ -45841,9 +44849,9 @@ impl AuthenticationFlow { } /** -* Indicates the outcome of 3D Secure authentication. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Indicates the outcome of 3D Secure authentication. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ThreeDSecureDetailsResult { #[serde(rename = "attempt_acknowledged")] AttemptAcknowledged, @@ -45856,6 +44864,7 @@ pub enum ThreeDSecureDetailsResult { #[serde(rename = "processing_error")] ProcessingError, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -45876,11 +44885,6 @@ impl std::fmt::Display for ThreeDSecureDetailsResult { } } -impl Default for ThreeDSecureDetailsResult { - fn default() -> ThreeDSecureDetailsResult { - ThreeDSecureDetailsResult::Noop - } -} impl ThreeDSecureDetailsResult { pub fn is_noop(&self) -> bool { matches!(self, ThreeDSecureDetailsResult::Noop) @@ -45888,10 +44892,10 @@ impl ThreeDSecureDetailsResult { } /** -* Additional information about why 3D Secure succeeded or failed based -* on the `result`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Additional information about why 3D Secure succeeded or failed based + * on the `result`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ResultReason { #[serde(rename = "abandoned")] Abandoned, @@ -45908,6 +44912,7 @@ pub enum ResultReason { #[serde(rename = "rejected")] Rejected, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -45930,11 +44935,6 @@ impl std::fmt::Display for ResultReason { } } -impl Default for ResultReason { - fn default() -> ResultReason { - ResultReason::Noop - } -} impl ResultReason { pub fn is_noop(&self) -> bool { matches!(self, ResultReason::Noop) @@ -45942,9 +44942,9 @@ impl ResultReason { } /** -* The version of 3D Secure that was used. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The version of 3D Secure that was used. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Version { #[serde(rename = "1.0.2")] OneHundredAndTwo, @@ -45953,6 +44953,7 @@ pub enum Version { #[serde(rename = "2.2.0")] Twenty, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -45971,11 +44972,6 @@ impl std::fmt::Display for Version { } } -impl Default for Version { - fn default() -> Version { - Version::Noop - } -} impl Version { pub fn is_noop(&self) -> bool { matches!(self, Version::Noop) @@ -46023,13 +45019,14 @@ pub struct ThreeDSecureUsage { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TokenObject { #[serde(rename = "token")] Token, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -46046,11 +45043,6 @@ impl std::fmt::Display for TokenObject { } } -impl Default for TokenObject { - fn default() -> TokenObject { - TokenObject::Noop - } -} impl TokenObject { pub fn is_noop(&self) -> bool { matches!(self, TokenObject::Noop) @@ -46215,13 +45207,14 @@ pub struct Token { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TopupObject { #[serde(rename = "topup")] Topup, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -46238,11 +45231,6 @@ impl std::fmt::Display for TopupObject { } } -impl Default for TopupObject { - fn default() -> TopupObject { - TopupObject::Noop - } -} impl TopupObject { pub fn is_noop(&self) -> bool { matches!(self, TopupObject::Noop) @@ -46250,9 +45238,9 @@ impl TopupObject { } /** -* The status of the top-up is either `canceled`, `failed`, `pending`, `reversed`, or `succeeded`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the top-up is either `canceled`, `failed`, `pending`, `reversed`, or `succeeded`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TopupStatus { #[serde(rename = "canceled")] Canceled, @@ -46265,6 +45253,7 @@ pub enum TopupStatus { #[serde(rename = "succeeded")] Succeeded, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -46285,11 +45274,6 @@ impl std::fmt::Display for TopupStatus { } } -impl Default for TopupStatus { - fn default() -> TopupStatus { - TopupStatus::Noop - } -} impl TopupStatus { pub fn is_noop(&self) -> bool { matches!(self, TopupStatus::Noop) @@ -46464,13 +45448,14 @@ pub struct Topup { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TransferObject { #[serde(rename = "transfer")] Transfer, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -46487,11 +45472,6 @@ impl std::fmt::Display for TransferObject { } } -impl Default for TransferObject { - fn default() -> TransferObject { - TransferObject::Noop - } -} impl TransferObject { pub fn is_noop(&self) -> bool { matches!(self, TransferObject::Noop) @@ -46749,13 +45729,14 @@ pub struct TransferData { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TransferReversalObject { #[serde(rename = "transfer_reversal")] TransferReversal, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -46772,11 +45753,6 @@ impl std::fmt::Display for TransferReversalObject { } } -impl Default for TransferReversalObject { - fn default() -> TransferReversalObject { - TransferReversalObject::Noop - } -} impl TransferReversalObject { pub fn is_noop(&self) -> bool { matches!(self, TransferReversalObject::Noop) @@ -46953,15 +45929,16 @@ pub struct TransferSchedule { } /** -* After division, either round the result `up` or `down`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * After division, either round the result `up` or `down`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Round { #[serde(rename = "down")] Down, #[serde(rename = "up")] Up, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -46979,11 +45956,6 @@ impl std::fmt::Display for Round { } } -impl Default for Round { - fn default() -> Round { - Round::Noop - } -} impl Round { pub fn is_noop(&self) -> bool { matches!(self, Round::Noop) @@ -47010,13 +45982,14 @@ pub struct TransformUsage { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UsageRecordObject { #[serde(rename = "usage_record")] UsageRecord, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -47033,11 +46006,6 @@ impl std::fmt::Display for UsageRecordObject { } } -impl Default for UsageRecordObject { - fn default() -> UsageRecordObject { - UsageRecordObject::Noop - } -} impl UsageRecordObject { pub fn is_noop(&self) -> bool { matches!(self, UsageRecordObject::Noop) @@ -47102,13 +46070,14 @@ pub struct UsageRecord { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UsageRecordSummaryObject { #[serde(rename = "usage_record_summary")] UsageRecordSummary, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -47125,11 +46094,6 @@ impl std::fmt::Display for UsageRecordSummaryObject { } } -impl Default for UsageRecordSummaryObject { - fn default() -> UsageRecordSummaryObject { - UsageRecordSummaryObject::Noop - } -} impl UsageRecordSummaryObject { pub fn is_noop(&self) -> bool { matches!(self, UsageRecordSummaryObject::Noop) @@ -47195,15 +46159,16 @@ pub struct UsageRecordSummary { } /** -* Indicates whether this object and its related objects have been redacted or not. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Indicates whether this object and its related objects have been redacted or not. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum VerificationSessionRedactionStatus { #[serde(rename = "processing")] Processing, #[serde(rename = "redacted")] Redacted, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -47221,11 +46186,6 @@ impl std::fmt::Display for VerificationSessionRedactionStatus { } } -impl Default for VerificationSessionRedactionStatus { - fn default() -> VerificationSessionRedactionStatus { - VerificationSessionRedactionStatus::Noop - } -} impl VerificationSessionRedactionStatus { pub fn is_noop(&self) -> bool { matches!(self, VerificationSessionRedactionStatus::Noop) @@ -47761,13 +46721,14 @@ pub struct GetBitcoinReceiversResponse { } /** -* String representing the object's type. Objects of the same type share the same value. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * String representing the object's type. Objects of the same type share the same value. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SearchResultObject { #[serde(rename = "search_result")] SearchResult, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -47784,11 +46745,6 @@ impl std::fmt::Display for SearchResultObject { } } -impl Default for SearchResultObject { - fn default() -> SearchResultObject { - SearchResultObject::Noop - } -} impl SearchResultObject { pub fn is_noop(&self) -> bool { matches!(self, SearchResultObject::Noop) @@ -47981,9 +46937,10 @@ pub struct CreditNotesList { pub url: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Shipping { #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -47999,11 +46956,6 @@ impl std::fmt::Display for Shipping { } } -impl Default for Shipping { - fn default() -> Shipping { - Shipping::Noop - } -} impl Shipping { pub fn is_noop(&self) -> bool { matches!(self, Shipping::Noop) @@ -48282,9 +47234,9 @@ impl DeleteCustomersCustomerCardsResponseAnyOf { } /** -* A required filter on the list, based on the object `type` field. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * A required filter on the list, based on the object `type` field. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetCustomersCustomerPaymentMethodsType { #[serde(rename = "acss_debit")] AcssDebit, @@ -48331,6 +47283,7 @@ pub enum GetCustomersCustomerPaymentMethodsType { #[serde(rename = "wechat_pay")] WechatPay, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -48368,11 +47321,6 @@ impl std::fmt::Display for GetCustomersCustomerPaymentMethodsType { } } -impl Default for GetCustomersCustomerPaymentMethodsType { - fn default() -> GetCustomersCustomerPaymentMethodsType { - GetCustomersCustomerPaymentMethodsType::Noop - } -} impl GetCustomersCustomerPaymentMethodsType { pub fn is_noop(&self) -> bool { matches!(self, GetCustomersCustomerPaymentMethodsType::Noop) @@ -48644,9 +47592,9 @@ pub struct GetInvoiceitemsResponse { } /** -* The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetInvoicesStatus { #[serde(rename = "draft")] Draft, @@ -48659,6 +47607,7 @@ pub enum GetInvoicesStatus { #[serde(rename = "void")] Void, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -48679,11 +47628,6 @@ impl std::fmt::Display for GetInvoicesStatus { } } -impl Default for GetInvoicesStatus { - fn default() -> GetInvoicesStatus { - GetInvoicesStatus::Noop - } -} impl GetInvoicesStatus { pub fn is_noop(&self) -> bool { matches!(self, GetInvoicesStatus::Noop) @@ -48895,7 +47839,7 @@ pub struct Tax { pub ip_address: Box>, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetInvoicesUpcomingCustomerDetailsTaxExempt { #[serde(rename = "exempt")] Exempt, @@ -48904,6 +47848,7 @@ pub enum GetInvoicesUpcomingCustomerDetailsTaxExempt { #[serde(rename = "reverse")] Reverse, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -48922,18 +47867,13 @@ impl std::fmt::Display for GetInvoicesUpcomingCustomerDetailsTaxExempt { } } -impl Default for GetInvoicesUpcomingCustomerDetailsTaxExempt { - fn default() -> GetInvoicesUpcomingCustomerDetailsTaxExempt { - GetInvoicesUpcomingCustomerDetailsTaxExempt::Noop - } -} impl GetInvoicesUpcomingCustomerDetailsTaxExempt { pub fn is_noop(&self) -> bool { matches!(self, GetInvoicesUpcomingCustomerDetailsTaxExempt::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetInvoicesUpcomingCustomerDetailsDataParamsType { #[serde(rename = "ae_trn")] AeTrn, @@ -49026,6 +47966,7 @@ pub enum GetInvoicesUpcomingCustomerDetailsDataParamsType { #[serde(rename = "za_vat")] ZaVat, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -49086,11 +48027,6 @@ impl std::fmt::Display for GetInvoicesUpcomingCustomerDetailsDataParamsType { } } -impl Default for GetInvoicesUpcomingCustomerDetailsDataParamsType { - fn default() -> GetInvoicesUpcomingCustomerDetailsDataParamsType { - GetInvoicesUpcomingCustomerDetailsDataParamsType::Noop - } -} impl GetInvoicesUpcomingCustomerDetailsDataParamsType { pub fn is_noop(&self) -> bool { matches!(self, GetInvoicesUpcomingCustomerDetailsDataParamsType::Noop) @@ -49364,15 +48300,16 @@ pub struct InvoiceItems { } /** -* For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SubscriptionBillingCycleAnchor { #[serde(rename = "now")] Now, #[serde(rename = "unchanged")] Unchanged, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -49390,11 +48327,6 @@ impl std::fmt::Display for SubscriptionBillingCycleAnchor { } } -impl Default for SubscriptionBillingCycleAnchor { - fn default() -> SubscriptionBillingCycleAnchor { - SubscriptionBillingCycleAnchor::Noop - } -} impl SubscriptionBillingCycleAnchor { pub fn is_noop(&self) -> bool { matches!(self, SubscriptionBillingCycleAnchor::Noop) @@ -49633,13 +48565,14 @@ pub struct SubscriptionItems { } /** -* If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SubscriptionTrialEnd { #[serde(rename = "now")] Now, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -49656,11 +48589,6 @@ impl std::fmt::Display for SubscriptionTrialEnd { } } -impl Default for SubscriptionTrialEnd { - fn default() -> SubscriptionTrialEnd { - SubscriptionTrialEnd::Noop - } -} impl SubscriptionTrialEnd { pub fn is_noop(&self) -> bool { matches!(self, SubscriptionTrialEnd::Noop) @@ -50357,13 +49285,14 @@ pub struct GetRadarValueListsResponse { pub url: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetRecipientsType { #[serde(rename = "corporation")] Corporation, #[serde(rename = "individual")] Individual, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -50381,11 +49310,6 @@ impl std::fmt::Display for GetRecipientsType { } } -impl Default for GetRecipientsType { - fn default() -> GetRecipientsType { - GetRecipientsType::Noop - } -} impl GetRecipientsType { pub fn is_noop(&self) -> bool { matches!(self, GetRecipientsType::Noop) @@ -50875,9 +49799,9 @@ pub struct GetSubscriptionSchedulesResponse { } /** -* The status of the subscriptions to retrieve. Passing in a value of `canceled` will return all canceled subscriptions, including those belonging to deleted customers. Pass `ended` to find subscriptions that are canceled and subscriptions that are expired due to [incomplete payment](https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses). Passing in a value of `all` will return subscriptions of all statuses. If no value is supplied, all subscriptions that have not been canceled are returned. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the subscriptions to retrieve. Passing in a value of `canceled` will return all canceled subscriptions, including those belonging to deleted customers. Pass `ended` to find subscriptions that are canceled and subscriptions that are expired due to [incomplete payment](https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses). Passing in a value of `all` will return subscriptions of all statuses. If no value is supplied, all subscriptions that have not been canceled are returned. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetSubscriptionsStatus { #[serde(rename = "active")] Active, @@ -50898,6 +49822,7 @@ pub enum GetSubscriptionsStatus { #[serde(rename = "unpaid")] Unpaid, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -50922,11 +49847,6 @@ impl std::fmt::Display for GetSubscriptionsStatus { } } -impl Default for GetSubscriptionsStatus { - fn default() -> GetSubscriptionsStatus { - GetSubscriptionsStatus::Noop - } -} impl GetSubscriptionsStatus { pub fn is_noop(&self) -> bool { matches!(self, GetSubscriptionsStatus::Noop) @@ -51181,9 +50101,9 @@ pub struct GetTestHelpersClocksResponse { } /** -* Only return top-ups that have the given status. One of `canceled`, `failed`, `pending` or `succeeded`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Only return top-ups that have the given status. One of `canceled`, `failed`, `pending` or `succeeded`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetTopupsStatus { #[serde(rename = "canceled")] Canceled, @@ -51194,6 +50114,7 @@ pub enum GetTopupsStatus { #[serde(rename = "succeeded")] Succeeded, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -51213,11 +50134,6 @@ impl std::fmt::Display for GetTopupsStatus { } } -impl Default for GetTopupsStatus { - fn default() -> GetTopupsStatus { - GetTopupsStatus::Noop - } -} impl GetTopupsStatus { pub fn is_noop(&self) -> bool { matches!(self, GetTopupsStatus::Noop) diff --git a/tripactions/src/types.rs b/tripactions/src/types.rs index 29ad5dcf..002cd965 100644 --- a/tripactions/src/types.rs +++ b/tripactions/src/types.rs @@ -2,13 +2,14 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TravelerType { #[serde(rename = "GUEST")] Guest, #[serde(rename = "PASSENGER")] Passenger, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -26,18 +27,13 @@ impl std::fmt::Display for TravelerType { } } -impl Default for TravelerType { - fn default() -> TravelerType { - TravelerType::Noop - } -} impl TravelerType { pub fn is_noop(&self) -> bool { matches!(self, TravelerType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BookingStatus { #[serde(rename = "ACCEPTED")] Accepted, @@ -50,6 +46,7 @@ pub enum BookingStatus { #[serde(rename = "VOIDED")] Voided, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -70,18 +67,13 @@ impl std::fmt::Display for BookingStatus { } } -impl Default for BookingStatus { - fn default() -> BookingStatus { - BookingStatus::Noop - } -} impl BookingStatus { pub fn is_noop(&self) -> bool { matches!(self, BookingStatus::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum BookingType { #[serde(rename = "BLACK_CAR")] BlackCar, @@ -96,6 +88,7 @@ pub enum BookingType { #[serde(rename = "TRANSPORTATION")] Transportation, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -117,18 +110,13 @@ impl std::fmt::Display for BookingType { } } -impl Default for BookingType { - fn default() -> BookingType { - BookingType::Noop - } -} impl BookingType { pub fn is_noop(&self) -> bool { matches!(self, BookingType::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PaymentSchedule { #[serde(rename = "LATER")] Later, @@ -139,6 +127,7 @@ pub enum PaymentSchedule { #[serde(rename = "UNKNOWN")] Unknown, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -158,24 +147,20 @@ impl std::fmt::Display for PaymentSchedule { } } -impl Default for PaymentSchedule { - fn default() -> PaymentSchedule { - PaymentSchedule::Noop - } -} impl PaymentSchedule { pub fn is_noop(&self) -> bool { matches!(self, PaymentSchedule::Noop) } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PassengerStatus { #[serde(rename = "DISABLED")] Disabled, #[serde(rename = "ENABLED")] Enabled, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -193,11 +178,6 @@ impl std::fmt::Display for PassengerStatus { } } -impl Default for PassengerStatus { - fn default() -> PassengerStatus { - PassengerStatus::Noop - } -} impl PassengerStatus { pub fn is_noop(&self) -> bool { matches!(self, PassengerStatus::Noop) diff --git a/zoom/src/types.rs b/zoom/src/types.rs index 9179d7a7..7810b81f 100644 --- a/zoom/src/types.rs +++ b/zoom/src/types.rs @@ -3,11 +3,12 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; /** -* Payee:
`master` - master account holder pays.
`sub` - Sub account holder pays. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Payee:
`master` - master account holder pays.
`sub` - Sub account holder pays. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PayMode { #[serde(rename = "master")] + #[default] Master, #[serde(rename = "sub")] Sub, @@ -26,12 +27,6 @@ impl std::fmt::Display for PayMode { } } -impl Default for PayMode { - fn default() -> PayMode { - PayMode::Master - } -} - /// Account options object. #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct Options { @@ -472,11 +467,12 @@ pub struct AccountPlans { } /** -* Determine how participants can join the audio portion of the meeting.
`both` - Telephony and VoIP.
`telephony` - Audio PSTN telephony only.
`voip` - VoIP only.
`thirdParty` - 3rd party audio conference. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Determine how participants can join the audio portion of the meeting.
`both` - Telephony and VoIP.
`telephony` - Audio PSTN telephony only.
`voip` - VoIP only.
`thirdParty` - 3rd party audio conference. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AudioType { #[serde(rename = "both")] + #[default] Both, #[serde(rename = "telephony")] Telephony, @@ -501,17 +497,11 @@ impl std::fmt::Display for AudioType { } } -impl Default for AudioType { - fn default() -> AudioType { - AudioType::Both - } -} - /** -* Require a password for a meeting held using Personal Meeting ID (PMI) This setting is always enabled for free accounts and Pro accounts with a single host and cannot be modified for these accounts. -* -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Require a password for a meeting held using Personal Meeting ID (PMI) This setting is always enabled for free accounts and Pro accounts with a single host and cannot be modified for these accounts. + * + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RequirePasswordPmiMeetings { #[serde(rename = "all")] All, @@ -520,6 +510,7 @@ pub enum RequirePasswordPmiMeetings { #[serde(rename = "none")] None, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -538,11 +529,6 @@ impl std::fmt::Display for RequirePasswordPmiMeetings { } } -impl Default for RequirePasswordPmiMeetings { - fn default() -> RequirePasswordPmiMeetings { - RequirePasswordPmiMeetings::Noop - } -} impl RequirePasswordPmiMeetings { pub fn is_noop(&self) -> bool { matches!(self, RequirePasswordPmiMeetings::Noop) @@ -763,9 +749,9 @@ pub struct ScheduleMeeting { } /** -* Play sound when participants join or leave.
`host` - Heard by host only.
`all` - Heard by host and all attendees.
`none` - Disable. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Play sound when participants join or leave.
`host` - Heard by host only.
`all` - Heard by host and all attendees.
`none` - Disable. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EntryExitChime { #[serde(rename = "all")] All, @@ -774,6 +760,7 @@ pub enum EntryExitChime { #[serde(rename = "none")] None, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -792,11 +779,6 @@ impl std::fmt::Display for EntryExitChime { } } -impl Default for EntryExitChime { - fn default() -> EntryExitChime { - EntryExitChime::Noop - } -} impl EntryExitChime { pub fn is_noop(&self) -> bool { matches!(self, EntryExitChime::Noop) @@ -891,18 +873,19 @@ pub struct VirtualBackgroundSettings { } /** -* Indicates who can share their screen or content during meetings. The value can be one of the following:
-* `host`: Only host can share the screen.
-* `all`: Both hosts and attendees can share their screen during meetings. For Webinar, the hosts and panelists can start screen sharing, but not the attendees. -* -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Indicates who can share their screen or content during meetings. The value can be one of the following:
+ * `host`: Only host can share the screen.
+ * `all`: Both hosts and attendees can share their screen during meetings. For Webinar, the hosts and panelists can start screen sharing, but not the attendees. + * + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum WhoCanShareScreen { #[serde(rename = "all")] All, #[serde(rename = "host")] Host, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -920,11 +903,6 @@ impl std::fmt::Display for WhoCanShareScreen { } } -impl Default for WhoCanShareScreen { - fn default() -> WhoCanShareScreen { - WhoCanShareScreen::Noop - } -} impl WhoCanShareScreen { pub fn is_noop(&self) -> bool { matches!(self, WhoCanShareScreen::Noop) @@ -1534,15 +1512,15 @@ pub struct PasswordRequirement { } /** -* Settings for 2FA( [two factor authentication](https://support.zoom.us/hc/en-us/articles/360038247071) ). The value can be one of the following: -* `all`: Two factor authentication will be enabled for all users in the account.
-* `none`: Two factor authentication is disabled.
-* `group`: Two factor authentication will be enabled for users belonging to specific groups. If 2FA is enabled for certain groups, the group IDs of the group(s) will be provided in the `sign_in_with_two_factor_auth_groups` field.
-* `role`: Two factor authentication will be enabled only for users assigned with specific roles in the account. If 2FA is enabled for specific roles, the role IDs will be provided in the -* `sign_in_with_two_factor_auth_roles` field. -* -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Settings for 2FA( [two factor authentication](https://support.zoom.us/hc/en-us/articles/360038247071) ). The value can be one of the following: + * `all`: Two factor authentication will be enabled for all users in the account.
+ * `none`: Two factor authentication is disabled.
+ * `group`: Two factor authentication will be enabled for users belonging to specific groups. If 2FA is enabled for certain groups, the group IDs of the group(s) will be provided in the `sign_in_with_two_factor_auth_groups` field.
+ * `role`: Two factor authentication will be enabled only for users assigned with specific roles in the account. If 2FA is enabled for specific roles, the role IDs will be provided in the + * `sign_in_with_two_factor_auth_roles` field. + * + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SignInWithTwoFactorAuth { #[serde(rename = "all")] All, @@ -1553,6 +1531,7 @@ pub enum SignInWithTwoFactorAuth { #[serde(rename = "role")] Role, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1572,11 +1551,6 @@ impl std::fmt::Display for SignInWithTwoFactorAuth { } } -impl Default for SignInWithTwoFactorAuth { - fn default() -> SignInWithTwoFactorAuth { - SignInWithTwoFactorAuth::Noop - } -} impl SignInWithTwoFactorAuth { pub fn is_noop(&self) -> bool { matches!(self, SignInWithTwoFactorAuth::Noop) @@ -1659,9 +1633,9 @@ pub struct Security { } /** -* Automatic recording:
`local` - Record on local.
`cloud` - Record on cloud.
`none` - Disabled. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Automatic recording:
`local` - Record on local.
`cloud` - Record on cloud.
`none` - Disabled. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AutoRecording { #[serde(rename = "cloud")] Cloud, @@ -1670,6 +1644,7 @@ pub enum AutoRecording { #[serde(rename = "none")] None, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -1688,11 +1663,6 @@ impl std::fmt::Display for AutoRecording { } } -impl Default for AutoRecording { - fn default() -> AutoRecording { - AutoRecording::Noop - } -} impl AutoRecording { pub fn is_noop(&self) -> bool { matches!(self, AutoRecording::Noop) @@ -2560,15 +2530,16 @@ pub struct DateTime { } /** -* Device protocol:
`H.323` - H.323.
`SIP` - SIP. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Device protocol:
`H.323` - H.323.
`SIP` - SIP. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Protocol { #[serde(rename = "H.323")] H323, #[serde(rename = "SIP")] Sip, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2586,11 +2557,6 @@ impl std::fmt::Display for Protocol { } } -impl Default for Protocol { - fn default() -> Protocol { - Protocol::Noop - } -} impl Protocol { pub fn is_noop(&self) -> bool { matches!(self, Protocol::Noop) @@ -2598,9 +2564,9 @@ impl Protocol { } /** -* Device encryption:
`auto` - auto.
`yes` - yes.
`no` - no. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Device encryption:
`auto` - auto.
`yes` - yes.
`no` - no. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Encryption { #[serde(rename = "auto")] Auto, @@ -2609,6 +2575,7 @@ pub enum Encryption { #[serde(rename = "yes")] Yes, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2627,11 +2594,6 @@ impl std::fmt::Display for Encryption { } } -impl Default for Encryption { - fn default() -> Encryption { - Encryption::Noop - } -} impl Encryption { pub fn is_noop(&self) -> bool { matches!(self, Encryption::Noop) @@ -2869,11 +2831,12 @@ pub struct Occurrence { } /** -* Determine how participants can join the audio portion of the meeting.
`both` - Both Telephony and VoIP.
`telephony` - Telephony only.
`voip` - VoIP only. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Determine how participants can join the audio portion of the meeting.
`both` - Both Telephony and VoIP.
`telephony` - Telephony only.
`voip` - VoIP only. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Audio { #[serde(rename = "both")] + #[default] Both, #[serde(rename = "telephony")] Telephony, @@ -2895,22 +2858,17 @@ impl std::fmt::Display for Audio { } } -impl Default for Audio { - fn default() -> Audio { - Audio::Both - } -} - /** -* Type of number. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Type of number. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Type { #[serde(rename = "toll")] Toll, #[serde(rename = "tollfree")] Tollfree, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -2928,11 +2886,6 @@ impl std::fmt::Display for Type { } } -impl Default for Type { - fn default() -> Type { - Type::Noop - } -} impl Type { pub fn is_noop(&self) -> bool { matches!(self, Type::Noop) @@ -2985,18 +2938,19 @@ pub struct GlobalDialInNumbers { } /** -* Choose between enhanced encryption and [end-to-end encryption](https://support.zoom.us/hc/en-us/articles/360048660871) when starting or a meeting. When using end-to-end encryption, several features (e.g. cloud recording, phone/SIP/H.323 dial-in) will be **automatically disabled**.

The value of this field can be one of the following:
-* `enhanced_encryption`: Enhanced encryption. Encryption is stored in the cloud if you enable this option.
-* -* `e2ee`: [End-to-end encryption](https://support.zoom.us/hc/en-us/articles/360048660871). The encryption key is stored in your local device and can not be obtained by anyone else. Enabling this setting also **disables** the following features: join before host, cloud recording, streaming, live transcription, breakout rooms, polling, 1:1 private chat, and meeting reactions. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Choose between enhanced encryption and [end-to-end encryption](https://support.zoom.us/hc/en-us/articles/360048660871) when starting or a meeting. When using end-to-end encryption, several features (e.g. cloud recording, phone/SIP/H.323 dial-in) will be **automatically disabled**.

The value of this field can be one of the following:
+ * `enhanced_encryption`: Enhanced encryption. Encryption is stored in the cloud if you enable this option.
+ * + * `e2ee`: [End-to-end encryption](https://support.zoom.us/hc/en-us/articles/360048660871). The encryption key is stored in your local device and can not be obtained by anyone else. Enabling this setting also **disables** the following features: join before host, cloud recording, streaming, live transcription, breakout rooms, polling, 1:1 private chat, and meeting reactions. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum EncryptionType { #[serde(rename = "e2ee")] E2Ee, #[serde(rename = "enhanced_encryption")] EnhancedEncryption, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3014,11 +2968,6 @@ impl std::fmt::Display for EncryptionType { } } -impl Default for EncryptionType { - fn default() -> EncryptionType { - EncryptionType::Noop - } -} impl EncryptionType { pub fn is_noop(&self) -> bool { matches!(self, EncryptionType::Noop) @@ -3026,17 +2975,18 @@ impl EncryptionType { } /** -* Specify whether to allow users from specific regions to join this meeting; or block users from specific regions from joining this meeting.

-* `approve`: Allow users from specific regions/countries to join this meeting. If this setting is selected, the approved regions/countries must be included in the `approved_list`.

-* `deny`: Block users from specific regions/countries from joining this meeting. If this setting is selected, the approved regions/countries must be included in the `denied_list` -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Specify whether to allow users from specific regions to join this meeting; or block users from specific regions from joining this meeting.

+ * `approve`: Allow users from specific regions/countries to join this meeting. If this setting is selected, the approved regions/countries must be included in the `approved_list`.

+ * `deny`: Block users from specific regions/countries from joining this meeting. If this setting is selected, the approved regions/countries must be included in the `denied_list` + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Method { #[serde(rename = "approve")] Approve, #[serde(rename = "deny")] Deny, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3054,11 +3004,6 @@ impl std::fmt::Display for Method { } } -impl Default for Method { - fn default() -> Method { - Method::Noop - } -} impl Method { pub fn is_noop(&self) -> bool { matches!(self, Method::Noop) @@ -3538,13 +3483,14 @@ pub struct MeetingSettings { } /** -* This field is required **if you're scheduling a recurring meeting of type** `2` to state which day(s) of the week the meeting should repeat.

The value for this field could be a number between `1` to `7` in string format. For instance, if the meeting should recur on Sunday, provide `"1"` as the value of this field.

**Note:** If you would like the meeting to occur on multiple days of a week, you should provide comma separated values for this field. For instance, if the meeting should recur on Sundays and Tuesdays provide `"1,3"` as the value of this field. -* -*
`1` - Sunday.
`2` - Monday.
`3` - Tuesday.
`4` - Wednesday.
`5` - Thursday.
`6` - Friday.
`7` - Saturday. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * This field is required **if you're scheduling a recurring meeting of type** `2` to state which day(s) of the week the meeting should repeat.

The value for this field could be a number between `1` to `7` in string format. For instance, if the meeting should recur on Sunday, provide `"1"` as the value of this field.

**Note:** If you would like the meeting to occur on multiple days of a week, you should provide comma separated values for this field. For instance, if the meeting should recur on Sundays and Tuesdays provide `"1,3"` as the value of this field. + * + *
`1` - Sunday.
`2` - Monday.
`3` - Tuesday.
`4` - Wednesday.
`5` - Thursday.
`6` - Friday.
`7` - Saturday. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum WeeklyDays { #[serde(rename = "1")] + #[default] One, #[serde(rename = "2")] Two, @@ -3578,12 +3524,6 @@ impl std::fmt::Display for WeeklyDays { } } -impl Default for WeeklyDays { - fn default() -> WeeklyDays { - WeeklyDays::One - } -} - /// Recurrence object. Use this object only for a meeting with type `8` i.e., a recurring meeting with fixed time. #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct Recurrence { @@ -3810,15 +3750,16 @@ pub struct MeetingInfo { } /** -* Meeting status -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Meeting status + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Status { #[serde(rename = "started")] Started, #[serde(rename = "waiting")] Waiting, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -3836,11 +3777,6 @@ impl std::fmt::Display for Status { } } -impl Default for Status { - fn default() -> Status { - Status::Noop - } -} impl Status { pub fn is_noop(&self) -> bool { matches!(self, Status::Noop) @@ -4237,19 +4173,20 @@ pub struct MeetingLiveStream { } /** -* Update the status of a livestream. -* -* The value can be one of the following:
-* `start`: Start a live stream.
-* `stop`: Stop an ongoing live stream. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Update the status of a livestream. + * + * The value can be one of the following:
+ * `start`: Start a live stream.
+ * `stop`: Stop an ongoing live stream. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Action { #[serde(rename = "start")] Start, #[serde(rename = "stop")] Stop, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4267,11 +4204,6 @@ impl std::fmt::Display for Action { } } -impl Default for Action { - fn default() -> Action { - Action::Noop - } -} impl Action { pub fn is_noop(&self) -> bool { matches!(self, Action::Noop) @@ -4595,13 +4527,14 @@ pub struct QosAudio { } /** -* The recording status. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The recording status. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RecordingStatus { #[serde(rename = "completed")] Completed, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4618,11 +4551,6 @@ impl std::fmt::Display for RecordingStatus { } } -impl Default for RecordingStatus { - fn default() -> RecordingStatus { - RecordingStatus::Noop - } -} impl RecordingStatus { pub fn is_noop(&self) -> bool { matches!(self, RecordingStatus::Noop) @@ -4812,9 +4740,9 @@ pub struct RecordingSeparateAudio { } /** -* Determine how the meeting recording is shared. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Determine how the meeting recording is shared. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ShareRecording { #[serde(rename = "internally")] Internally, @@ -4823,6 +4751,7 @@ pub enum ShareRecording { #[serde(rename = "publicly")] Publicly, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -4841,11 +4770,6 @@ impl std::fmt::Display for ShareRecording { } } -impl Default for ShareRecording { - fn default() -> ShareRecording { - ShareRecording::Noop - } -} impl ShareRecording { pub fn is_noop(&self) -> bool { matches!(self, ShareRecording::Noop) @@ -5093,9 +5017,9 @@ pub struct Registrant { } /** -* Registrant Status:
`approve` - Approve registrant.
`cancel` - Cancel previously approved registrant's registration.
`deny` - Deny registrant. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Registrant Status:
`approve` - Approve registrant.
`cancel` - Cancel previously approved registrant's registration.
`deny` - Deny registrant. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RegistrantStatusAction { #[serde(rename = "approve")] Approve, @@ -5104,6 +5028,7 @@ pub enum RegistrantStatusAction { #[serde(rename = "deny")] Deny, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5122,11 +5047,6 @@ impl std::fmt::Display for RegistrantStatusAction { } } -impl Default for RegistrantStatusAction { - fn default() -> RegistrantStatusAction { - RegistrantStatusAction::Noop - } -} impl RegistrantStatusAction { pub fn is_noop(&self) -> bool { matches!(self, RegistrantStatusAction::Noop) @@ -5568,19 +5488,20 @@ pub struct RecurrenceWebinar { } /** -* Indicate whether you want attendees to be able to view answered questions only or view all questions. -* -* * `only`: Attendees are able to view answered questions only. -* -* * `all`: Attendees are able to view all questions submitted in the Q&A. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Indicate whether you want attendees to be able to view answered questions only or view all questions. + * + * * `only`: Attendees are able to view answered questions only. + * + * * `all`: Attendees are able to view all questions submitted in the Q&A. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AnswerQuestions { #[serde(rename = "all")] All, #[serde(rename = "only")] Only, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -5598,11 +5519,6 @@ impl std::fmt::Display for AnswerQuestions { } } -impl Default for AnswerQuestions { - fn default() -> AnswerQuestions { - AnswerQuestions::Noop - } -} impl AnswerQuestions { pub fn is_noop(&self) -> bool { matches!(self, AnswerQuestions::Noop) @@ -6186,10 +6102,10 @@ pub struct SessionWebinarUpdate { } /** -* Dial-in number types:
`toll` - Toll number.
`tollfree` -Toll free number.
-* `media_link` - Media link. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Dial-in number types:
`toll` - Toll number.
`tollfree` -Toll free number.
+ * `media_link` - Media link. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TspAccountsListDialInNumbersType { #[serde(rename = "media_link")] MediaLink, @@ -6198,6 +6114,7 @@ pub enum TspAccountsListDialInNumbersType { #[serde(rename = "tollfree")] Tollfree, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6216,11 +6133,6 @@ impl std::fmt::Display for TspAccountsListDialInNumbersType { } } -impl Default for TspAccountsListDialInNumbersType { - fn default() -> TspAccountsListDialInNumbersType { - TspAccountsListDialInNumbersType::Noop - } -} impl TspAccountsListDialInNumbersType { pub fn is_noop(&self) -> bool { matches!(self, TspAccountsListDialInNumbersType::Noop) @@ -6265,15 +6177,16 @@ pub struct DialInNumbers { } /** -* Telephony bridge -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Telephony bridge + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TspBridge { #[serde(rename = "EU_TSP_TB")] EuTspTb, #[serde(rename = "US_TSP_TB")] UsTspTb, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6291,11 +6204,6 @@ impl std::fmt::Display for TspBridge { } } -impl Default for TspBridge { - fn default() -> TspBridge { - TspBridge::Noop - } -} impl TspBridge { pub fn is_noop(&self) -> bool { matches!(self, TspBridge::Noop) @@ -6557,14 +6465,14 @@ pub struct CustomAttributes { } /** -* The label to add to the user's phone number. You can only add one label to the user's phone number: -* -* * `Mobile` -* * `Office` -* * `Home` -* * `Fax` -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The label to add to the user's phone number. You can only add one label to the user's phone number: + * + * * `Mobile` + * * `Office` + * * `Home` + * * `Fax` + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Label { #[serde(rename = "Fax")] Fax, @@ -6575,6 +6483,7 @@ pub enum Label { #[serde(rename = "Office")] Office, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -6594,11 +6503,6 @@ impl std::fmt::Display for Label { } } -impl Default for Label { - fn default() -> Label { - Label::Noop - } -} impl Label { pub fn is_noop(&self) -> bool { matches!(self, Label::Noop) @@ -8332,15 +8236,16 @@ pub struct ZoomRoom { } /** -* Poll Question & Answer type:
`single` - Single choice
`mutliple` - Multiple choice -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Poll Question & Answer type:
`single` - Single choice
`mutliple` - Multiple choice + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PollQuestionsType { #[serde(rename = "multiple")] Multiple, #[serde(rename = "single")] Single, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8358,11 +8263,6 @@ impl std::fmt::Display for PollQuestionsType { } } -impl Default for PollQuestionsType { - fn default() -> PollQuestionsType { - PollQuestionsType::Noop - } -} impl PollQuestionsType { pub fn is_noop(&self) -> bool { matches!(self, PollQuestionsType::Noop) @@ -8423,9 +8323,9 @@ pub struct Poll { } /** -* Field name of the question. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Field name of the question. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FieldName { #[serde(rename = "address")] Address, @@ -8454,6 +8354,7 @@ pub enum FieldName { #[serde(rename = "zip")] Zip, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8482,11 +8383,6 @@ impl std::fmt::Display for FieldName { } } -impl Default for FieldName { - fn default() -> FieldName { - FieldName::Noop - } -} impl FieldName { pub fn is_noop(&self) -> bool { matches!(self, FieldName::Noop) @@ -8511,15 +8407,16 @@ pub struct MeetingRegistrantQuestions { } /** -* Type of the question being asked. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Type of the question being asked. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MeetingRegistrantQuestionsCustomType { #[serde(rename = "short")] Short, #[serde(rename = "single")] Single, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8537,11 +8434,6 @@ impl std::fmt::Display for MeetingRegistrantQuestionsCustomType { } } -impl Default for MeetingRegistrantQuestionsCustomType { - fn default() -> MeetingRegistrantQuestionsCustomType { - MeetingRegistrantQuestionsCustomType::Noop - } -} impl MeetingRegistrantQuestionsCustomType { pub fn is_noop(&self) -> bool { matches!(self, MeetingRegistrantQuestionsCustomType::Noop) @@ -8633,9 +8525,9 @@ pub struct WebinarRegistrantQuestions { } /** -* Field name. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Field name. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RecordingRegistrantQuestionsFieldName { #[serde(rename = "address")] Address, @@ -8666,6 +8558,7 @@ pub enum RecordingRegistrantQuestionsFieldName { #[serde(rename = "zip")] Zip, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8697,11 +8590,6 @@ impl std::fmt::Display for RecordingRegistrantQuestionsFieldName { } } -impl Default for RecordingRegistrantQuestionsFieldName { - fn default() -> RecordingRegistrantQuestionsFieldName { - RecordingRegistrantQuestionsFieldName::Noop - } -} impl RecordingRegistrantQuestionsFieldName { pub fn is_noop(&self) -> bool { matches!(self, RecordingRegistrantQuestionsFieldName::Noop) @@ -8726,9 +8614,9 @@ pub struct RecordingRegistrantQuestions { } /** -* The type of registration question and answers. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of registration question and answers. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RecordingRegistrantQuestionsCustomType { #[serde(rename = "multiple")] Multiple, @@ -8737,6 +8625,7 @@ pub enum RecordingRegistrantQuestionsCustomType { #[serde(rename = "single")] Single, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -8755,11 +8644,6 @@ impl std::fmt::Display for RecordingRegistrantQuestionsCustomType { } } -impl Default for RecordingRegistrantQuestionsCustomType { - fn default() -> RecordingRegistrantQuestionsCustomType { - RecordingRegistrantQuestionsCustomType::Noop - } -} impl RecordingRegistrantQuestionsCustomType { pub fn is_noop(&self) -> bool { matches!(self, RecordingRegistrantQuestionsCustomType::Noop) @@ -10246,7 +10130,7 @@ pub struct ParticipantQos { pub version: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AccountSettingsRecordingAuthenticationUpdateOptionType { #[serde(rename = "enforce_login")] EnforceLogin, @@ -10255,6 +10139,7 @@ pub enum AccountSettingsRecordingAuthenticationUpdateOptionType { #[serde(rename = "internally")] Internally, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10275,11 +10160,6 @@ impl std::fmt::Display for AccountSettingsRecordingAuthenticationUpdateOptionTyp } } -impl Default for AccountSettingsRecordingAuthenticationUpdateOptionType { - fn default() -> AccountSettingsRecordingAuthenticationUpdateOptionType { - AccountSettingsRecordingAuthenticationUpdateOptionType::Noop - } -} impl AccountSettingsRecordingAuthenticationUpdateOptionType { pub fn is_noop(&self) -> bool { matches!( @@ -10289,7 +10169,7 @@ impl AccountSettingsRecordingAuthenticationUpdateOptionType { } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AccountSettingsRecordingAuthenticationUpdateOptionAction { #[serde(rename = "add")] Add, @@ -10298,6 +10178,7 @@ pub enum AccountSettingsRecordingAuthenticationUpdateOptionAction { #[serde(rename = "update")] Update, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10316,11 +10197,6 @@ impl std::fmt::Display for AccountSettingsRecordingAuthenticationUpdateOptionAct } } -impl Default for AccountSettingsRecordingAuthenticationUpdateOptionAction { - fn default() -> AccountSettingsRecordingAuthenticationUpdateOptionAction { - AccountSettingsRecordingAuthenticationUpdateOptionAction::Noop - } -} impl AccountSettingsRecordingAuthenticationUpdateOptionAction { pub fn is_noop(&self) -> bool { matches!( @@ -10872,17 +10748,17 @@ pub struct Metrics { } /** -* The archived file's file type: -* * `MP4` — Video file. -* * `M4A` — Audio-only file. -* * `TRANSCRIPT` — A transcript file of the recording, in VTT file format. -* * `CHAT` — A TXT file containing chat messages that were sent during the meeting. -* * `CC` — A file containing the recording's closed captions, in VTT file format. -* * `CSV` — A file containing polling data in, in CSV format. -* -* For more information, read our [Managing and sharing cloud recordings](https://support.zoom.us/hc/en-us/articles/205347605-Managing-and-sharing-cloud-recordings#h_9898497b-e736-4980-a749-d55608f10773) documentation. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The archived file's file type: + * * `MP4` — Video file. + * * `M4A` — Audio-only file. + * * `TRANSCRIPT` — A transcript file of the recording, in VTT file format. + * * `CHAT` — A TXT file containing chat messages that were sent during the meeting. + * * `CC` — A file containing the recording's closed captions, in VTT file format. + * * `CSV` — A file containing polling data in, in CSV format. + * + * For more information, read our [Managing and sharing cloud recordings](https://support.zoom.us/hc/en-us/articles/205347605-Managing-and-sharing-cloud-recordings#h_9898497b-e736-4980-a749-d55608f10773) documentation. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum FileType { #[serde(rename = "CC")] Cc, @@ -10897,6 +10773,7 @@ pub enum FileType { #[serde(rename = "TRANSCRIPT")] Transcript, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10918,11 +10795,6 @@ impl std::fmt::Display for FileType { } } -impl Default for FileType { - fn default() -> FileType { - FileType::Noop - } -} impl FileType { pub fn is_noop(&self) -> bool { matches!(self, FileType::Noop) @@ -10930,22 +10802,22 @@ impl FileType { } /** -* The archived file's recording type: -* * `shared_screen_with_speaker_view(CC)` -* * `shared_screen_with_speaker_view` -* * `shared_screen_with_gallery_view` -* * `speaker_view` -* * `gallery_view` -* * `shared_screen` -* * `audio_only` -* * `audio_transcript` -* * `chat_file` -* * `active_speaker` -* * `host_video` -* -* For more information, read our [Managing and sharing cloud recordings](https://support.zoom.us/hc/en-us/articles/205347605-Managing-and-sharing-cloud-recordings#h_9898497b-e736-4980-a749-d55608f10773) documentation. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The archived file's recording type: + * * `shared_screen_with_speaker_view(CC)` + * * `shared_screen_with_speaker_view` + * * `shared_screen_with_gallery_view` + * * `speaker_view` + * * `gallery_view` + * * `shared_screen` + * * `audio_only` + * * `audio_transcript` + * * `chat_file` + * * `active_speaker` + * * `host_video` + * + * For more information, read our [Managing and sharing cloud recordings](https://support.zoom.us/hc/en-us/articles/205347605-Managing-and-sharing-cloud-recordings#h_9898497b-e736-4980-a749-d55608f10773) documentation. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RecordingType { #[serde(rename = "active_speaker")] ActiveSpeaker, @@ -10970,6 +10842,7 @@ pub enum RecordingType { #[serde(rename = "speaker_view")] SpeakerView, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -10996,11 +10869,6 @@ impl std::fmt::Display for RecordingType { } } -impl Default for RecordingType { - fn default() -> RecordingType { - RecordingType::Noop - } -} impl RecordingType { pub fn is_noop(&self) -> bool { matches!(self, RecordingType::Noop) @@ -11263,11 +11131,12 @@ pub struct InviteLinks { pub attendees: Vec, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RecordingStatusUpdateBodyRequestAction { #[serde(rename = "recover")] Recover, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11284,11 +11153,6 @@ impl std::fmt::Display for RecordingStatusUpdateBodyRequestAction { } } -impl Default for RecordingStatusUpdateBodyRequestAction { - fn default() -> RecordingStatusUpdateBodyRequestAction { - RecordingStatusUpdateBodyRequestAction::Noop - } -} impl RecordingStatusUpdateBodyRequestAction { pub fn is_noop(&self) -> bool { matches!(self, RecordingStatusUpdateBodyRequestAction::Noop) @@ -11393,13 +11257,13 @@ pub struct SetUpAccountRequest { } /** -* Query response by number assignment. The value can be one of the following: -*
-* `assigned`: The number has been assigned to either a user, a call queue, an auto-receptionist or a common area phone in an account.
`unassigned`: The number is not assigned to anyone.
-* `all`: Include both assigned and unassigned numbers in the response.
-* `byoc`: Include Bring Your Own Carrier (BYOC) numbers only in the response. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Query response by number assignment. The value can be one of the following: + *
+ * `assigned`: The number has been assigned to either a user, a call queue, an auto-receptionist or a common area phone in an account.
`unassigned`: The number is not assigned to anyone.
+ * `all`: Include both assigned and unassigned numbers in the response.
+ * `byoc`: Include Bring Your Own Carrier (BYOC) numbers only in the response. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ListAccountPhoneNumbersType { #[serde(rename = "all")] All, @@ -11408,6 +11272,7 @@ pub enum ListAccountPhoneNumbersType { #[serde(rename = "unassigned")] Unassigned, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11426,11 +11291,6 @@ impl std::fmt::Display for ListAccountPhoneNumbersType { } } -impl Default for ListAccountPhoneNumbersType { - fn default() -> ListAccountPhoneNumbersType { - ListAccountPhoneNumbersType::Noop - } -} impl ListAccountPhoneNumbersType { pub fn is_noop(&self) -> bool { matches!(self, ListAccountPhoneNumbersType::Noop) @@ -11438,11 +11298,11 @@ impl ListAccountPhoneNumbersType { } /** -* The type of assignee to whom the number is assigned. The value can be one of the following:
-* `user`
`callQueue`
`autoReceptionist`
-* `commonAreaPhone` -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of assignee to whom the number is assigned. The value can be one of the following:
+ * `user`
`callQueue`
`autoReceptionist`
+ * `commonAreaPhone` + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ExtensionType { #[serde(rename = "autoReceptionist")] AutoReceptionist, @@ -11453,6 +11313,7 @@ pub enum ExtensionType { #[serde(rename = "user")] User, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11472,11 +11333,6 @@ impl std::fmt::Display for ExtensionType { } } -impl Default for ExtensionType { - fn default() -> ExtensionType { - ExtensionType::Noop - } -} impl ExtensionType { pub fn is_noop(&self) -> bool { matches!(self, ExtensionType::Noop) @@ -11484,15 +11340,16 @@ impl ExtensionType { } /** -* Source of phone number. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Source of phone number. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Source { #[serde(rename = "external")] External, #[serde(rename = "internal")] Internal, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11510,11 +11367,6 @@ impl std::fmt::Display for Source { } } -impl Default for Source { - fn default() -> Source { - Source::Noop - } -} impl Source { pub fn is_noop(&self) -> bool { matches!(self, Source::Noop) @@ -11522,15 +11374,16 @@ impl Source { } /** -* Status of the number. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Status of the number. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ListAccountPhoneNumbersResponseStatus { #[serde(rename = "available")] Available, #[serde(rename = "pending")] Pending, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11548,11 +11401,6 @@ impl std::fmt::Display for ListAccountPhoneNumbersResponseStatus { } } -impl Default for ListAccountPhoneNumbersResponseStatus { - fn default() -> ListAccountPhoneNumbersResponseStatus { - ListAccountPhoneNumbersResponseStatus::Noop - } -} impl ListAccountPhoneNumbersResponseStatus { pub fn is_noop(&self) -> bool { matches!(self, ListAccountPhoneNumbersResponseStatus::Noop) @@ -11784,9 +11632,9 @@ pub struct ListAccountPhoneNumbersResponseData { } /** -* Protocols supported by the SIP provider.
The value must be either `UDP`, `TCP`, `TLS`, `AUTO`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Protocols supported by the SIP provider.
The value must be either `UDP`, `TCP`, `TLS`, `AUTO`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TransportProtocol { #[serde(rename = "AUTO")] Auto, @@ -11797,6 +11645,7 @@ pub enum TransportProtocol { #[serde(rename = "UDP")] Udp, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -11816,11 +11665,6 @@ impl std::fmt::Display for TransportProtocol { } } -impl Default for TransportProtocol { - fn default() -> TransportProtocol { - TransportProtocol::Noop - } -} impl TransportProtocol { pub fn is_noop(&self) -> bool { matches!(self, TransportProtocol::Noop) @@ -12330,9 +12174,9 @@ pub struct UpdateSipPhoneRequest { } /** -* The status of the Zoom Room. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the Zoom Room. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ListZoomRoomsStatus { #[serde(rename = "Available")] Available, @@ -12343,6 +12187,7 @@ pub enum ListZoomRoomsStatus { #[serde(rename = "UnderConstruction")] UnderConstruction, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -12362,11 +12207,6 @@ impl std::fmt::Display for ListZoomRoomsStatus { } } -impl Default for ListZoomRoomsStatus { - fn default() -> ListZoomRoomsStatus { - ListZoomRoomsStatus::Noop - } -} impl ListZoomRoomsStatus { pub fn is_noop(&self) -> bool { matches!(self, ListZoomRoomsStatus::Noop) @@ -12374,9 +12214,9 @@ impl ListZoomRoomsStatus { } /** -* Type of the Zoom Rooms. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Type of the Zoom Rooms. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ListZoomRoomsType { #[serde(rename = "DigitalSignageOnly")] DigitalSignageOnly, @@ -12385,6 +12225,7 @@ pub enum ListZoomRoomsType { #[serde(rename = "ZoomRoom")] ZoomRoom, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -12403,11 +12244,6 @@ impl std::fmt::Display for ListZoomRoomsType { } } -impl Default for ListZoomRoomsType { - fn default() -> ListZoomRoomsType { - ListZoomRoomsType::Noop - } -} impl ListZoomRoomsType { pub fn is_noop(&self) -> bool { matches!(self, ListZoomRoomsType::Noop) @@ -12942,10 +12778,10 @@ pub struct UpdateSiteDetailsRequest { } /** -* Presence status of the contact in Zoom Client. The value of this field can be one of the following: -* `Do_Not_Disturb`
`away`
`Available`
`Offline` -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Presence status of the contact in Zoom Client. The value of this field can be one of the following: + * `Do_Not_Disturb`
`away`
`Available`
`Offline` + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PresenceStatus { #[serde(rename = "Available")] Available, @@ -12956,6 +12792,7 @@ pub enum PresenceStatus { #[serde(rename = "Offline")] Offline, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -12975,11 +12812,6 @@ impl std::fmt::Display for PresenceStatus { } } -impl Default for PresenceStatus { - fn default() -> PresenceStatus { - PresenceStatus::Noop - } -} impl PresenceStatus { pub fn is_noop(&self) -> bool { matches!(self, PresenceStatus::Noop) @@ -13145,11 +12977,11 @@ pub struct SearchCompanyContactsResponse { } /** -* This field indicates whether a message is an original message(unedited), an edited message or a deleted message. -* -* This field is only returned if you set the value of `for include_deleted_and_edited_message` query parameter to `true`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * This field indicates whether a message is an original message(unedited), an edited message or a deleted message. + * + * This field is only returned if you set the value of `for include_deleted_and_edited_message` query parameter to `true`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetChatMessagesResponseStatus { #[serde(rename = "Deleted")] Deleted, @@ -13158,6 +12990,7 @@ pub enum GetChatMessagesResponseStatus { #[serde(rename = "Normal")] Normal, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13176,11 +13009,6 @@ impl std::fmt::Display for GetChatMessagesResponseStatus { } } -impl Default for GetChatMessagesResponseStatus { - fn default() -> GetChatMessagesResponseStatus { - GetChatMessagesResponseStatus::Noop - } -} impl GetChatMessagesResponseStatus { pub fn is_noop(&self) -> bool { matches!(self, GetChatMessagesResponseStatus::Noop) @@ -13461,17 +13289,18 @@ pub struct MarkMessageRequest { } /** -* The action to perform with the message: -* * `add` — Add an emoji reaction. -* * `remove` — Remove an emoji reaction. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The action to perform with the message: + * * `add` — Add an emoji reaction. + * * `remove` — Remove an emoji reaction. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReactMessageRequestAction { #[serde(rename = "add")] Add, #[serde(rename = "remove")] Remove, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -13489,11 +13318,6 @@ impl std::fmt::Display for ReactMessageRequestAction { } } -impl Default for ReactMessageRequestAction { - fn default() -> ReactMessageRequestAction { - ReactMessageRequestAction::Noop - } -} impl ReactMessageRequestAction { pub fn is_noop(&self) -> bool { matches!(self, ReactMessageRequestAction::Noop) @@ -14017,9 +13841,9 @@ pub struct GetUserContactResponse { } /** -* The role of the member. The value can be one of these: `owner`, `admin`, `member`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The role of the member. The value can be one of these: `owner`, `admin`, `member`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Role { #[serde(rename = "admin")] Admin, @@ -14028,6 +13852,7 @@ pub enum Role { #[serde(rename = "owner")] Owner, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14046,11 +13871,6 @@ impl std::fmt::Display for Role { } } -impl Default for Role { - fn default() -> Role { - Role::Noop - } -} impl Role { pub fn is_noop(&self) -> bool { matches!(self, Role::Noop) @@ -14361,19 +14181,20 @@ pub struct AccountResponse { } /** -* Use the following options to filter the results of the account's information: -* * `meeting_authentication` — View the account's [meeting authentication settings](https://support.zoom.us/hc/en-us/articles/360037117472-Authentication-Profiles-for-Meetings-and-Webinars). -* * `recording_authentication` — View the account's [recording authentication settings](https://support.zoom.us/hc/en-us/articles/360037756671-Authentication-Profiles-for-Cloud-Recordings). -* * `security` — View the account's security settings. For example, password requirements for user login or two-factor authentication.
-* * `meeting_security` — View the account's meeting security settings. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Use the following options to filter the results of the account's information: + * * `meeting_authentication` — View the account's [meeting authentication settings](https://support.zoom.us/hc/en-us/articles/360037117472-Authentication-Profiles-for-Meetings-and-Webinars). + * * `recording_authentication` — View the account's [recording authentication settings](https://support.zoom.us/hc/en-us/articles/360037756671-Authentication-Profiles-for-Cloud-Recordings). + * * `security` — View the account's security settings. For example, password requirements for user login or two-factor authentication.
+ * * `meeting_security` — View the account's meeting security settings. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum OptionData { #[serde(rename = "meeting_authentication")] MeetingAuthentication, #[serde(rename = "recording_authentication")] RecordingAuthentication, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14391,11 +14212,6 @@ impl std::fmt::Display for OptionData { } } -impl Default for OptionData { - fn default() -> OptionData { - OptionData::Noop - } -} impl OptionData { pub fn is_noop(&self) -> bool { matches!(self, OptionData::Noop) @@ -14492,7 +14308,7 @@ impl AccountSettingsUpdateRequestOneOf { } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AccountSettingsUpdateOption { #[serde(rename = "meeting_authentication")] MeetingAuthentication, @@ -14503,6 +14319,7 @@ pub enum AccountSettingsUpdateOption { #[serde(rename = "security")] Security, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14522,11 +14339,6 @@ impl std::fmt::Display for AccountSettingsUpdateOption { } } -impl Default for AccountSettingsUpdateOption { - fn default() -> AccountSettingsUpdateOption { - AccountSettingsUpdateOption::Noop - } -} impl AccountSettingsUpdateOption { pub fn is_noop(&self) -> bool { matches!(self, AccountSettingsUpdateOption::Noop) @@ -14550,9 +14362,9 @@ pub struct AccountTrustedDomainResponse { } /** -* Status of the plan. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Status of the plan. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AccountPlansResponsePlanBaseStatus { #[serde(rename = "active")] Active, @@ -14561,6 +14373,7 @@ pub enum AccountPlansResponsePlanBaseStatus { #[serde(rename = "expired")] Expired, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14579,11 +14392,6 @@ impl std::fmt::Display for AccountPlansResponsePlanBaseStatus { } } -impl Default for AccountPlansResponsePlanBaseStatus { - fn default() -> AccountPlansResponsePlanBaseStatus { - AccountPlansResponsePlanBaseStatus::Noop - } -} impl AccountPlansResponsePlanBaseStatus { pub fn is_noop(&self) -> bool { matches!(self, AccountPlansResponsePlanBaseStatus::Noop) @@ -14684,15 +14492,16 @@ pub struct PlanWebinar { } /** -* Status of additional Cloud Recording plan. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Status of additional Cloud Recording plan. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PlanRecordingStatus { #[serde(rename = "Active")] Active, #[serde(rename = "Cancelled")] Cancelled, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -14710,11 +14519,6 @@ impl std::fmt::Display for PlanRecordingStatus { } } -impl Default for PlanRecordingStatus { - fn default() -> PlanRecordingStatus { - PlanRecordingStatus::Noop - } -} impl PlanRecordingStatus { pub fn is_noop(&self) -> bool { matches!(self, PlanRecordingStatus::Noop) @@ -15199,17 +15003,18 @@ pub struct GroupMembersCreateResponse { } /** -* The action to perform: -* * `move` — Remove the group member from one group and move them to a different group. -* * `set_primary` — Set the user's primary group. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The action to perform: + * * `move` — Remove the group member from one group and move them to a different group. + * * `set_primary` — Set the user's primary group. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UpdateGroupMemberRequestAction { #[serde(rename = "move")] Move, #[serde(rename = "set_primary")] SetPrimary, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -15227,11 +15032,6 @@ impl std::fmt::Display for UpdateGroupMemberRequestAction { } } -impl Default for UpdateGroupMemberRequestAction { - fn default() -> UpdateGroupMemberRequestAction { - UpdateGroupMemberRequestAction::Noop - } -} impl UpdateGroupMemberRequestAction { pub fn is_noop(&self) -> bool { matches!(self, UpdateGroupMemberRequestAction::Noop) @@ -15294,11 +15094,12 @@ pub struct TrackingfieldGetResponseAllOf { } /** -* IM Group types:
`normal` - Only members can see automatically see the other members of this group. Other people can search for members within this group.
`shared` - Everyone under an account can see the group members automatically.
`restricted` - Nobody can see the group or search for members except the members in the group. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * IM Group types:
`normal` - Only members can see automatically see the other members of this group. Other people can search for members within this group.
`shared` - Everyone under an account can see the group members automatically.
`restricted` - Nobody can see the group or search for members except the members in the group. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ImGroupCreateRequestType { #[serde(rename = "normal")] + #[default] Normal, #[serde(rename = "restricted")] Restricted, @@ -15320,12 +15121,6 @@ impl std::fmt::Display for ImGroupCreateRequestType { } } -impl Default for ImGroupCreateRequestType { - fn default() -> ImGroupCreateRequestType { - ImGroupCreateRequestType::Normal - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct ImGroupCreateRequest { /** @@ -15450,15 +15245,16 @@ pub struct DashboardImResponse { } /** -* IM chat session type. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * IM chat session type. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ImChatSessionsResponseType { #[serde(rename = "1:1")] One, #[serde(rename = "Group")] Group, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -15476,11 +15272,6 @@ impl std::fmt::Display for ImChatSessionsResponseType { } } -impl Default for ImChatSessionsResponseType { - fn default() -> ImChatSessionsResponseType { - ImChatSessionsResponseType::Noop - } -} impl ImChatSessionsResponseType { pub fn is_noop(&self) -> bool { matches!(self, ImChatSessionsResponseType::Noop) @@ -15668,11 +15459,12 @@ pub struct ImChatMessagesResponseAllOf { } /** -* The meeting types:
`scheduled` - This includes all valid past meetings (unexpired), live meetings and upcoming scheduled meetings. It is equivalent to the combined list of "Previous Meetings" and "Upcoming Meetings" displayed in the user's [Meetings page](https://zoom.us/meeting) on the Zoom Web Portal.
`live` - All the ongoing meetings.
`upcoming` - All upcoming meetings including live meetings. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The meeting types:
`scheduled` - This includes all valid past meetings (unexpired), live meetings and upcoming scheduled meetings. It is equivalent to the combined list of "Previous Meetings" and "Upcoming Meetings" displayed in the user's [Meetings page](https://zoom.us/meeting) on the Zoom Web Portal.
`live` - All the ongoing meetings.
`upcoming` - All upcoming meetings including live meetings. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MeetingsType { #[serde(rename = "live")] + #[default] Live, #[serde(rename = "scheduled")] Scheduled, @@ -15694,12 +15486,6 @@ impl std::fmt::Display for MeetingsType { } } -impl Default for MeetingsType { - fn default() -> MeetingsType { - MeetingsType::Live - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct MeetingCreateResponse { /** @@ -15848,17 +15634,18 @@ pub struct MeetingUpdateRequestAllOf { } /** -* `end` - End a meeting.
-* `recover` - [Recover](https://support.zoom.us/hc/en-us/articles/360038297111-Recover-a-deleted-meeting) a deleted meeting. -* -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * `end` - End a meeting.
+ * `recover` - [Recover](https://support.zoom.us/hc/en-us/articles/360038297111-Recover-a-deleted-meeting) a deleted meeting. + * + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MeetingStatusRequestAction { #[serde(rename = "end")] End, #[serde(rename = "recover")] Recover, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -15876,11 +15663,6 @@ impl std::fmt::Display for MeetingStatusRequestAction { } } -impl Default for MeetingStatusRequestAction { - fn default() -> MeetingStatusRequestAction { - MeetingStatusRequestAction::Noop - } -} impl MeetingStatusRequestAction { pub fn is_noop(&self) -> bool { matches!(self, MeetingStatusRequestAction::Noop) @@ -15899,11 +15681,12 @@ pub struct MeetingStatusRequest { } /** -* The registrant status:
`pending` - Registrant's status is pending.
`approved` - Registrant's status is approved.
`denied` - Registrant's status is denied. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The registrant status:
`pending` - Registrant's status is pending.
`approved` - Registrant's status is approved.
`denied` - Registrant's status is denied. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MeetingRegistrantsStatus { #[serde(rename = "approved")] + #[default] Approved, #[serde(rename = "denied")] Denied, @@ -15925,12 +15708,6 @@ impl std::fmt::Display for MeetingRegistrantsStatus { } } -impl Default for MeetingRegistrantsStatus { - fn default() -> MeetingRegistrantsStatus { - MeetingRegistrantsStatus::Approved - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct MeetingRegistrantCreateResponse { /** @@ -16154,9 +15931,9 @@ pub struct PastMeetingParticipantsResponseAllOf { } /** -* Status of the Meeting Poll:
`notstart` - Poll not started
`started` - Poll started
`ended` - Poll ended
`sharing` - Sharing poll results -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Status of the Meeting Poll:
`notstart` - Poll not started
`started` - Poll started
`ended` - Poll ended
`sharing` - Sharing poll results + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MeetingPollCreateResponseStatus { #[serde(rename = "ended")] Ended, @@ -16167,6 +15944,7 @@ pub enum MeetingPollCreateResponseStatus { #[serde(rename = "started")] Started, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -16186,11 +15964,6 @@ impl std::fmt::Display for MeetingPollCreateResponseStatus { } } -impl Default for MeetingPollCreateResponseStatus { - fn default() -> MeetingPollCreateResponseStatus { - MeetingPollCreateResponseStatus::Noop - } -} impl MeetingPollCreateResponseStatus { pub fn is_noop(&self) -> bool { matches!(self, MeetingPollCreateResponseStatus::Noop) @@ -16267,13 +16040,14 @@ pub struct RecordingGetResponseAllOf { } /** -* The recording delete actions:
`trash` - Move recording to trash.
`delete` - Delete recording permanently. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The recording delete actions:
`trash` - Move recording to trash.
`delete` - Delete recording permanently. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RecordingDeleteAction { #[serde(rename = "delete")] Delete, #[serde(rename = "trash")] + #[default] Trash, #[serde(other)] FallthroughString, @@ -16290,12 +16064,6 @@ impl std::fmt::Display for RecordingDeleteAction { } } -impl Default for RecordingDeleteAction { - fn default() -> RecordingDeleteAction { - RecordingDeleteAction::Trash - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct MeetingRecordingRegistrantCreateResponse { /** @@ -16337,13 +16105,14 @@ pub struct MeetingRecordingRegistrantCreateResponse { } /** -* Specify a value to get the response for the corresponding meeting type. The value of this field can be one of the following:

`past` - Meeting that already occurred in the specified date range.
`pastOne` - Past meetings that were attended by only one user.
`live` - Live meetings.

-* -* If you do not provide this field, the default value will be `live` and thus, the API will only query responses for live meetings. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Specify a value to get the response for the corresponding meeting type. The value of this field can be one of the following:

`past` - Meeting that already occurred in the specified date range.
`pastOne` - Past meetings that were attended by only one user.
`live` - Live meetings.

+ * + * If you do not provide this field, the default value will be `live` and thus, the API will only query responses for live meetings. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DashboardMeetingsType { #[serde(rename = "live")] + #[default] Live, #[serde(rename = "past")] Past, @@ -16365,20 +16134,15 @@ impl std::fmt::Display for DashboardMeetingsType { } } -impl Default for DashboardMeetingsType { - fn default() -> DashboardMeetingsType { - DashboardMeetingsType::Live - } -} - /** -* Set the value of this field to "tracking_fields" if you would like to include tracking fields of each meeting in the response. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Set the value of this field to "tracking_fields" if you would like to include tracking fields of each meeting in the response. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum IncludeFields { #[serde(rename = "tracking_fields")] TrackingFields, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -16395,11 +16159,6 @@ impl std::fmt::Display for IncludeFields { } } -impl Default for IncludeFields { - fn default() -> IncludeFields { - IncludeFields::Noop - } -} impl IncludeFields { pub fn is_noop(&self) -> bool { matches!(self, IncludeFields::Noop) @@ -16439,13 +16198,14 @@ pub struct DashboardMeetingsResponseAllOf { } /** -* Provide `registrant_id` as the value for this field if you would like to see the registrant ID attribute in the response of this API call. A registrant ID is a unique identifier of a [meeting registrant](https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrants). This is not supported for `live` meeting types. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Provide `registrant_id` as the value for this field if you would like to see the registrant ID attribute in the response of this API call. A registrant ID is a unique identifier of a [meeting registrant](https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrants). This is not supported for `live` meeting types. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DashboardMeetingParticipantsIncludeFields { #[serde(rename = "registrant_id")] RegistrantId, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -16462,11 +16222,6 @@ impl std::fmt::Display for DashboardMeetingParticipantsIncludeFields { } } -impl Default for DashboardMeetingParticipantsIncludeFields { - fn default() -> DashboardMeetingParticipantsIncludeFields { - DashboardMeetingParticipantsIncludeFields::Noop - } -} impl DashboardMeetingParticipantsIncludeFields { pub fn is_noop(&self) -> bool { matches!(self, DashboardMeetingParticipantsIncludeFields::Noop) @@ -16474,17 +16229,17 @@ impl DashboardMeetingParticipantsIncludeFields { } /** -* The type of device the participant used to join the meeting: -* * `Phone` — Participant joined via PSTN. -* * `H.323/SIP` — Participant joined via an H.323 or SIP device. -* * `Windows` — Participant joined via VoIP using a Windows device. -* * `Mac` — Participant joined via VoIP using a Mac device. -* * `iOS` — Participant joined via VoIP using an iOS device. -* * `Android` — Participant joined via VoIP using an Android device. -* -* **Note:** This response returns an empty string (`““`) value for any users who are **not** a part of the host’s account (external users). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of device the participant used to join the meeting: + * * `Phone` — Participant joined via PSTN. + * * `H.323/SIP` — Participant joined via an H.323 or SIP device. + * * `Windows` — Participant joined via VoIP using a Windows device. + * * `Mac` — Participant joined via VoIP using a Mac device. + * * `iOS` — Participant joined via VoIP using an iOS device. + * * `Android` — Participant joined via VoIP using an Android device. + * + * **Note:** This response returns an empty string (`““`) value for any users who are **not** a part of the host’s account (external users). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DashboardMeetingParticipantsResponseDevice { #[serde(rename = "Android")] Android, @@ -16499,6 +16254,7 @@ pub enum DashboardMeetingParticipantsResponseDevice { #[serde(rename = "iOS")] IOs, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -16520,11 +16276,6 @@ impl std::fmt::Display for DashboardMeetingParticipantsResponseDevice { } } -impl Default for DashboardMeetingParticipantsResponseDevice { - fn default() -> DashboardMeetingParticipantsResponseDevice { - DashboardMeetingParticipantsResponseDevice::Noop - } -} impl DashboardMeetingParticipantsResponseDevice { pub fn is_noop(&self) -> bool { matches!(self, DashboardMeetingParticipantsResponseDevice::Noop) @@ -16532,15 +16283,15 @@ impl DashboardMeetingParticipantsResponseDevice { } /** -* The participant's network type: -* -* * `Wired` -* * `Wifi` -* * `PPP` — Point-to-Point. -* * `Cellular` — 3G, 4G, and 5G cellular. -* * `Others` — An unknown device. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The participant's network type: + * + * * `Wired` + * * `Wifi` + * * `PPP` — Point-to-Point. + * * `Cellular` — 3G, 4G, and 5G cellular. + * * `Others` — An unknown device. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum NetworkType { #[serde(rename = "Cellular")] Cellular, @@ -16553,6 +16304,7 @@ pub enum NetworkType { #[serde(rename = "Wired")] Wired, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -16573,11 +16325,6 @@ impl std::fmt::Display for NetworkType { } } -impl Default for NetworkType { - fn default() -> NetworkType { - NetworkType::Noop - } -} impl NetworkType { pub fn is_noop(&self) -> bool { matches!(self, NetworkType::Noop) @@ -16585,9 +16332,9 @@ impl NetworkType { } /** -* Audio quality of the participant. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Audio quality of the participant. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AudioQuality { #[serde(rename = "bad")] Bad, @@ -16598,6 +16345,7 @@ pub enum AudioQuality { #[serde(rename = "poor")] Poor, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -16617,11 +16365,6 @@ impl std::fmt::Display for AudioQuality { } } -impl Default for AudioQuality { - fn default() -> AudioQuality { - AudioQuality::Noop - } -} impl AudioQuality { pub fn is_noop(&self) -> bool { matches!(self, AudioQuality::Noop) @@ -16629,17 +16372,18 @@ impl AudioQuality { } /** -* Indicates whether the participant is in the waiting room or in the meeting. -* -* The value of this field can be `in_meeting` or `in_waiting_room`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Indicates whether the participant is in the waiting room or in the meeting. + * + * The value of this field can be `in_meeting` or `in_waiting_room`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DashboardMeetingParticipantsResponseStatus { #[serde(rename = "in_meeting")] InMeeting, #[serde(rename = "in_waiting_room")] InWaitingRoom, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -16657,11 +16401,6 @@ impl std::fmt::Display for DashboardMeetingParticipantsResponseStatus { } } -impl Default for DashboardMeetingParticipantsResponseStatus { - fn default() -> DashboardMeetingParticipantsResponseStatus { - DashboardMeetingParticipantsResponseStatus::Noop - } -} impl DashboardMeetingParticipantsResponseStatus { pub fn is_noop(&self) -> bool { matches!(self, DashboardMeetingParticipantsResponseStatus::Noop) @@ -17080,11 +16819,12 @@ pub struct DashboardMeetingParticipantShareResponseAllOf { } /** -* The webinar type. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The webinar type. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DashboardWebinarsType { #[serde(rename = "live")] + #[default] Live, #[serde(rename = "past")] Past, @@ -17103,12 +16843,6 @@ impl std::fmt::Display for DashboardWebinarsType { } } -impl Default for DashboardWebinarsType { - fn default() -> DashboardWebinarsType { - DashboardWebinarsType::Live - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct DashboardWebinarsResponse { /** @@ -18074,15 +17808,16 @@ pub struct ReportDailyResponse { } /** -* Active or inactive hosts.
`active` - Active hosts.
`inactive` - Inactive hosts. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Active or inactive hosts.
`active` - Active hosts.
`inactive` - Inactive hosts. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReportUsersType { #[serde(rename = "active")] Active, #[serde(rename = "inactive")] Inactive, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -18100,11 +17835,6 @@ impl std::fmt::Display for ReportUsersType { } } -impl Default for ReportUsersType { - fn default() -> ReportUsersType { - ReportUsersType::Noop - } -} impl ReportUsersType { pub fn is_noop(&self) -> bool { matches!(self, ReportUsersType::Noop) @@ -18112,11 +17842,12 @@ impl ReportUsersType { } /** -* The meeting types:
`past` - Past meetings.
`pastOne` - Past one user meetings. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The meeting types:
`past` - Past meetings.
`pastOne` - Past one user meetings. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ReportMeetingsType { #[serde(rename = "past")] + #[default] Past, #[serde(rename = "pastOne")] PastOne, @@ -18135,12 +17866,6 @@ impl std::fmt::Display for ReportMeetingsType { } } -impl Default for ReportMeetingsType { - fn default() -> ReportMeetingsType { - ReportMeetingsType::Past - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct Meetings { /** @@ -18894,13 +18619,14 @@ pub struct ReportWebinarQaResponse { } /** -* Date types:
`start_time` - Query by call start time.
`end_time` - Query by call end time. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Date types:
`start_time` - Query by call start time.
`end_time` - Query by call end time. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum QueryDateType { #[serde(rename = "end_time")] EndTime, #[serde(rename = "start_time")] + #[default] StartTime, #[serde(other)] FallthroughString, @@ -18917,12 +18643,6 @@ impl std::fmt::Display for QueryDateType { } } -impl Default for QueryDateType { - fn default() -> QueryDateType { - QueryDateType::StartTime - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct ReportCloudRecordingResponse { /** @@ -18953,11 +18673,11 @@ pub struct ReportCloudRecordingResponseAllOf { } /** -* **Optional**
-* Filter your response by a category type to see reports for a specific category. -* The value for this field can be one of the following:
`all`
`user`
`user_settings`
`account`
`billing`
`im`
`recording`
`phone_contacts`
`webinar`
`sub_account`
`role`
`zoom_rooms` -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * **Optional**
+ * Filter your response by a category type to see reports for a specific category. + * The value for this field can be one of the following:
`all`
`user`
`user_settings`
`account`
`billing`
`im`
`recording`
`phone_contacts`
`webinar`
`sub_account`
`role`
`zoom_rooms` + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CategoryType { #[serde(rename = "account")] Account, @@ -18984,6 +18704,7 @@ pub enum CategoryType { #[serde(rename = "zoom_rooms")] ZoomRooms, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -19011,11 +18732,6 @@ impl std::fmt::Display for CategoryType { } } -impl Default for CategoryType { - fn default() -> CategoryType { - CategoryType::Noop - } -} impl CategoryType { pub fn is_noop(&self) -> bool { matches!(self, CategoryType::Noop) @@ -19348,16 +19064,17 @@ pub struct TspUpdateRequest { } /** -* The user's status: -* * `active` — An active user. -* * `inactive` — A deactivated user. -* * `pending` — A pending user. -* -* This value defaults to `active`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The user's status: + * * `active` — An active user. + * * `inactive` — A deactivated user. + * * `pending` — A pending user. + * + * This value defaults to `active`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UsersStatus { #[serde(rename = "active")] + #[default] Active, #[serde(rename = "inactive")] Inactive, @@ -19379,24 +19096,19 @@ impl std::fmt::Display for UsersStatus { } } -impl Default for UsersStatus { - fn default() -> UsersStatus { - UsersStatus::Active - } -} - /** -* Use this parameter to display one of the following attributes in the API call's response: -* * `custom_attributes` — Return the user's custom attributes. -* * `host_key` — Return the user's [host key](https://support.zoom.us/hc/en-us/articles/205172555-Using-your-host-key). -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Use this parameter to display one of the following attributes in the API call's response: + * * `custom_attributes` — Return the user's custom attributes. + * * `host_key` — Return the user's [host key](https://support.zoom.us/hc/en-us/articles/205172555-Using-your-host-key). + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UsersIncludeFields { #[serde(rename = "custom_attributes")] CustomAttributes, #[serde(rename = "host_key")] HostKey, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -19414,11 +19126,6 @@ impl std::fmt::Display for UsersIncludeFields { } } -impl Default for UsersIncludeFields { - fn default() -> UsersIncludeFields { - UsersIncludeFields::Noop - } -} impl UsersIncludeFields { pub fn is_noop(&self) -> bool { matches!(self, UsersIncludeFields::Noop) @@ -19700,9 +19407,9 @@ pub struct UsersResponseData { } /** -* Specify how to create the new user:
`create` - User will get an email sent from Zoom. There is a confirmation link in this email. The user will then need to use the link to activate their Zoom account. The user can then set or change their password.
`autoCreate` - This action is provided for the enterprise customer who has a managed domain. This feature is disabled by default because of the security risk involved in creating a user who does not belong to your domain.
`custCreate` - Users created via this option do not have passwords and will not have the ability to log into the Zoom Web Portal or the Zoom Client. These users can still host and join meetings using the `start_url` and `join_url` respectively. To use this option, you must contact the ISV Platform Sales team at isv@zoom.us.
`ssoCreate` - This action is provided for the enabled “Pre-provisioning SSO User” option. A user created in this way has no password. If not a basic user, a personal vanity URL using the user name (no domain) of the provisioning email will be generated. If the user name or PMI is invalid or occupied, it will use a random number or random personal vanity URL. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Specify how to create the new user:
`create` - User will get an email sent from Zoom. There is a confirmation link in this email. The user will then need to use the link to activate their Zoom account. The user can then set or change their password.
`autoCreate` - This action is provided for the enterprise customer who has a managed domain. This feature is disabled by default because of the security risk involved in creating a user who does not belong to your domain.
`custCreate` - Users created via this option do not have passwords and will not have the ability to log into the Zoom Web Portal or the Zoom Client. These users can still host and join meetings using the `start_url` and `join_url` respectively. To use this option, you must contact the ISV Platform Sales team at isv@zoom.us.
`ssoCreate` - This action is provided for the enabled “Pre-provisioning SSO User” option. A user created in this way has no password. If not a basic user, a personal vanity URL using the user name (no domain) of the provisioning email will be generated. If the user name or PMI is invalid or occupied, it will use a random number or random personal vanity URL. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UserCreateRequestAction { #[serde(rename = "autoCreate")] AutoCreate, @@ -19713,6 +19420,7 @@ pub enum UserCreateRequestAction { #[serde(rename = "ssoCreate")] SsoCreate, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -19732,11 +19440,6 @@ impl std::fmt::Display for UserCreateRequestAction { } } -impl Default for UserCreateRequestAction { - fn default() -> UserCreateRequestAction { - UserCreateRequestAction::Noop - } -} impl UserCreateRequestAction { pub fn is_noop(&self) -> bool { matches!(self, UserCreateRequestAction::Noop) @@ -19805,15 +19508,15 @@ pub struct UserCreateRequest { } /** -* The user's login method: -* -* `0` — Facebook OAuth
`1` — Google OAuth
`24` — Apple OAuth
`27` — Microsoft OAuth
`97` — Mobile device
`98` — RingCentral OAuth
`99` — API user
`100` — Zoom Work email
`101` — Single Sign-On (SSO) -* -* The following login methods are only available in China: -* -* `11` — Phone number
`21` — WeChat
`23` — Alipay -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The user's login method: + * + * `0` — Facebook OAuth
`1` — Google OAuth
`24` — Apple OAuth
`27` — Microsoft OAuth
`97` — Mobile device
`98` — RingCentral OAuth
`99` — API user
`100` — Zoom Work email
`101` — Single Sign-On (SSO) + * + * The following login methods are only available in China: + * + * `11` — Phone number
`21` — WeChat
`23` — Alipay + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum LoginType { #[serde(rename = "0")] Zero, @@ -19840,6 +19543,7 @@ pub enum LoginType { #[serde(rename = "99")] NinetyNine, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -19867,11 +19571,6 @@ impl std::fmt::Display for LoginType { } } -impl Default for LoginType { - fn default() -> LoginType { - LoginType::Noop - } -} impl LoginType { pub fn is_noop(&self) -> bool { matches!(self, LoginType::Noop) @@ -20203,13 +19902,14 @@ pub struct UserResponseAllOf { } /** -* Delete action options:
`disassociate` - Disassociate a user.
`delete`- Permanently delete a user.
Note: To delete pending user in the account, use `disassociate` -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Delete action options:
`disassociate` - Disassociate a user.
`delete`- Permanently delete a user.
Note: To delete pending user in the account, use `disassociate` + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UserDeleteAction { #[serde(rename = "delete")] Delete, #[serde(rename = "disassociate")] + #[default] Disassociate, #[serde(other)] FallthroughString, @@ -20226,12 +19926,6 @@ impl std::fmt::Display for UserDeleteAction { } } -impl Default for UserDeleteAction { - fn default() -> UserDeleteAction { - UserDeleteAction::Disassociate - } -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct UserZakResponse { /** @@ -20323,7 +20017,7 @@ impl UserSettingsUpdateRequestOneOf { } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UserSettingsUpdateOption { #[serde(rename = "meeting_authentication")] MeetingAuthentication, @@ -20332,6 +20026,7 @@ pub enum UserSettingsUpdateOption { #[serde(rename = "recording_authentication")] RecordingAuthentication, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -20350,11 +20045,6 @@ impl std::fmt::Display for UserSettingsUpdateOption { } } -impl Default for UserSettingsUpdateOption { - fn default() -> UserSettingsUpdateOption { - UserSettingsUpdateOption::Noop - } -} impl UserSettingsUpdateOption { pub fn is_noop(&self) -> bool { matches!(self, UserSettingsUpdateOption::Noop) @@ -20362,15 +20052,16 @@ impl UserSettingsUpdateOption { } /** -* The action types:
`activate` - Activate a deactivated user.
`deactivate` - Deactivate a user. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The action types:
`activate` - Activate a deactivated user.
`deactivate` - Deactivate a user. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UserStatusRequestAction { #[serde(rename = "activate")] Activate, #[serde(rename = "deactivate")] Deactivate, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -20388,11 +20079,6 @@ impl std::fmt::Display for UserStatusRequestAction { } } -impl Default for UserStatusRequestAction { - fn default() -> UserStatusRequestAction { - UserStatusRequestAction::Noop - } -} impl UserStatusRequestAction { pub fn is_noop(&self) -> bool { matches!(self, UserStatusRequestAction::Noop) @@ -20621,15 +20307,16 @@ pub struct TspAccountData { } /** -* User token types:
`token` - Used for starting meetings with the client SDK. This token expires in 14 days and a new token will be returned after the expiry.
`zak` - Used for generating the start meeting URL. The token expiration time is two hours. For API users, the expiration time is 90 days. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * User token types:
`token` - Used for starting meetings with the client SDK. This token expires in 14 days and a new token will be returned after the expiry.
`zak` - Used for generating the start meeting URL. The token expiration time is two hours. For API users, the expiration time is 90 days. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UserTokenType { #[serde(rename = "token")] Token, #[serde(rename = "zak")] Zak, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -20647,11 +20334,6 @@ impl std::fmt::Display for UserTokenType { } } -impl Default for UserTokenType { - fn default() -> UserTokenType { - UserTokenType::Noop - } -} impl UserTokenType { pub fn is_noop(&self) -> bool { matches!(self, UserTokenType::Noop) @@ -20860,11 +20542,12 @@ pub struct ListWebinarParticipantsResponse { pub total_records: i64, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum WebinarStatusRequestAction { #[serde(rename = "end")] End, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -20881,11 +20564,6 @@ impl std::fmt::Display for WebinarStatusRequestAction { } } -impl Default for WebinarStatusRequestAction { - fn default() -> WebinarStatusRequestAction { - WebinarStatusRequestAction::Noop - } -} impl WebinarStatusRequestAction { pub fn is_noop(&self) -> bool { matches!(self, WebinarStatusRequestAction::Noop) @@ -21987,16 +21665,16 @@ pub struct PhoneUserSettingsResponse { } /** -* Template type.
-* The value of this field can be one of the following:
-* * `user`
-* * `group`
-* * `autReceptionist`
-* * `commonArea`
-* * `zr`
-* * `interop`
-*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Template type.
+ * The value of this field can be one of the following:
+ * * `user`
+ * * `group`
+ * * `autReceptionist`
+ * * `commonArea`
+ * * `zr`
+ * * `interop`
+ */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ListSettingTemplatesResponseType { #[serde(rename = "autReceptionist")] AutReceptionist, @@ -22011,6 +21689,7 @@ pub enum ListSettingTemplatesResponseType { #[serde(rename = "zr")] Zr, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -22032,11 +21711,6 @@ impl std::fmt::Display for ListSettingTemplatesResponseType { } } -impl Default for ListSettingTemplatesResponseType { - fn default() -> ListSettingTemplatesResponseType { - ListSettingTemplatesResponseType::Noop - } -} impl ListSettingTemplatesResponseType { pub fn is_noop(&self) -> bool { matches!(self, ListSettingTemplatesResponseType::Noop) @@ -22124,9 +21798,9 @@ pub struct ListSettingTemplatesResponse { } /** -* The type of template. Values include `user`, `group`, `autoReceptionist`, `commonarea`, or `interop`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of template. Values include `user`, `group`, `autoReceptionist`, `commonarea`, or `interop`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AddSettingTemplateRequestType { #[serde(rename = "autoReceptionist")] AutoReceptionist, @@ -22139,6 +21813,7 @@ pub enum AddSettingTemplateRequestType { #[serde(rename = "user")] User, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -22159,11 +21834,6 @@ impl std::fmt::Display for AddSettingTemplateRequestType { } } -impl Default for AddSettingTemplateRequestType { - fn default() -> AddSettingTemplateRequestType { - AddSettingTemplateRequestType::Noop - } -} impl AddSettingTemplateRequestType { pub fn is_noop(&self) -> bool { matches!(self, AddSettingTemplateRequestType::Noop) @@ -23161,9 +22831,9 @@ pub struct ListSipGroupsResponse { } /** -* The type of template being queried. Values: `user`, `group`, `auto receptionist` `common area`,`zr`, `interop`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of template being queried. Values: `user`, `group`, `auto receptionist` `common area`,`zr`, `interop`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetSettingTemplateResponseType { #[serde(rename = "autoReceptionist")] AutoReceptionist, @@ -23178,6 +22848,7 @@ pub enum GetSettingTemplateResponseType { #[serde(rename = "zr")] Zr, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -23199,11 +22870,6 @@ impl std::fmt::Display for GetSettingTemplateResponseType { } } -impl Default for GetSettingTemplateResponseType { - fn default() -> GetSettingTemplateResponseType { - GetSettingTemplateResponseType::Noop - } -} impl GetSettingTemplateResponseType { pub fn is_noop(&self) -> bool { matches!(self, GetSettingTemplateResponseType::Noop) @@ -23385,15 +23051,15 @@ pub struct CustomHours { } /** -* Values:
-* 1-user,
-* 2-callQueue,
-* 3-autoReceptionist,
-* 4-commonAreaPhone,
-* 5-zoomRoom,
-* 7-sharedLineGroup -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Values:
+ * 1-user,
+ * 2-callQueue,
+ * 3-autoReceptionist,
+ * 4-commonAreaPhone,
+ * 5-zoomRoom,
+ * 7-sharedLineGroup + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetSettingTemplateResponseUserSettingsCallHandlingBusinessHoursConnectOperatorType { #[serde(rename = "autoReceptionist")] AutoReceptionist, @@ -23408,6 +23074,7 @@ pub enum GetSettingTemplateResponseUserSettingsCallHandlingBusinessHoursConnectO #[serde(rename = "zoomRoom")] ZoomRoom, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -23431,14 +23098,6 @@ GetSettingTemplateResponseUserSettingsCallHandlingBusinessHoursConnectOperatorTy } } -impl Default - for GetSettingTemplateResponseUserSettingsCallHandlingBusinessHoursConnectOperatorType -{ - fn default( - ) -> GetSettingTemplateResponseUserSettingsCallHandlingBusinessHoursConnectOperatorType { - GetSettingTemplateResponseUserSettingsCallHandlingBusinessHoursConnectOperatorType::Noop - } -} impl GetSettingTemplateResponseUserSettingsCallHandlingBusinessHoursConnectOperatorType { pub fn is_noop(&self) -> bool { matches!(self, GetSettingTemplateResponseUserSettingsCallHandlingBusinessHoursConnectOperatorType::Noop) @@ -23565,19 +23224,20 @@ pub struct GetSettingTemplateResponseUserSettingsDeskPhone { } /** -* The value of this field can be either `default` or `disable`. -* -* * `default`: This means that the hold music can be set using the [audio library](https://support.zoom.us/hc/en-us/articles/360028212652-Using-the-audio-library-to-customize-greetings-and-hold-music). -* -* * `disable`: This means that the hold music is disabled. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The value of this field can be either `default` or `disable`. + * + * * `default`: This means that the hold music can be set using the [audio library](https://support.zoom.us/hc/en-us/articles/360028212652-Using-the-audio-library-to-customize-greetings-and-hold-music). + * + * * `disable`: This means that the hold music is disabled. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum HoldMusic { #[serde(rename = "default")] Default, #[serde(rename = "disable")] Disable, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -23595,11 +23255,6 @@ impl std::fmt::Display for HoldMusic { } } -impl Default for HoldMusic { - fn default() -> HoldMusic { - HoldMusic::Noop - } -} impl HoldMusic { pub fn is_noop(&self) -> bool { matches!(self, HoldMusic::Noop) @@ -23683,9 +23338,9 @@ pub struct GetSettingTemplateResponse { } /** -* Values: inbound, outbound, both. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Values: inbound, outbound, both. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum RecordingCalls { #[serde(rename = "both")] Both, @@ -23694,6 +23349,7 @@ pub enum RecordingCalls { #[serde(rename = "outbound")] Outbound, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -23712,11 +23368,6 @@ impl std::fmt::Display for RecordingCalls { } } -impl Default for RecordingCalls { - fn default() -> RecordingCalls { - RecordingCalls::Noop - } -} impl RecordingCalls { pub fn is_noop(&self) -> bool { matches!(self, RecordingCalls::Noop) @@ -23796,13 +23447,14 @@ pub struct UpdateSettingTemplateRequest { pub user_settings: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PhoneUserCallLogsType { #[serde(rename = "all")] All, #[serde(rename = "missed")] Missed, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -23820,11 +23472,6 @@ impl std::fmt::Display for PhoneUserCallLogsType { } } -impl Default for PhoneUserCallLogsType { - fn default() -> PhoneUserCallLogsType { - PhoneUserCallLogsType::Noop - } -} impl PhoneUserCallLogsType { pub fn is_noop(&self) -> bool { matches!(self, PhoneUserCallLogsType::Noop) @@ -23832,13 +23479,14 @@ impl PhoneUserCallLogsType { } /** -* Enables you to sort call logs by start or end time. Choose the sort time value. Values include `startTime` or `endTime`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Enables you to sort call logs by start or end time. Choose the sort time value. Values include `startTime` or `endTime`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum TimeType { #[serde(rename = "endTime")] EndTime, #[serde(rename = "startTime")] + #[default] StartTime, #[serde(other)] FallthroughString, @@ -23855,12 +23503,6 @@ impl std::fmt::Display for TimeType { } } -impl Default for TimeType { - fn default() -> TimeType { - TimeType::StartTime - } -} - /// Indicates who the call was forwarded to. #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct ForwardedTo { @@ -23911,7 +23553,7 @@ pub struct ForwardedTo { pub phone_number: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PhoneUserCallLogsResponseForwardedByExtensionType { #[serde(rename = "autoReceptionist")] AutoReceptionist, @@ -23924,6 +23566,7 @@ pub enum PhoneUserCallLogsResponseForwardedByExtensionType { #[serde(rename = "user")] User, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -23946,11 +23589,6 @@ impl std::fmt::Display for PhoneUserCallLogsResponseForwardedByExtensionType { } } -impl Default for PhoneUserCallLogsResponseForwardedByExtensionType { - fn default() -> PhoneUserCallLogsResponseForwardedByExtensionType { - PhoneUserCallLogsResponseForwardedByExtensionType::Noop - } -} impl PhoneUserCallLogsResponseForwardedByExtensionType { pub fn is_noop(&self) -> bool { matches!( @@ -24597,11 +24235,12 @@ pub struct PhoneUserRecordingsResponse { } /** -* Status of the voice mail -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Status of the voice mail + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PhoneUserVoiceMailsStatus { #[serde(rename = "all")] + #[default] All, #[serde(rename = "read")] Read, @@ -24623,22 +24262,17 @@ impl std::fmt::Display for PhoneUserVoiceMailsStatus { } } -impl Default for PhoneUserVoiceMailsStatus { - fn default() -> PhoneUserVoiceMailsStatus { - PhoneUserVoiceMailsStatus::All - } -} - /** -* Status of the voice mail. Can be either 'read' or 'unread' -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Status of the voice mail. Can be either 'read' or 'unread' + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum PhoneUserVoiceMailsResponseStatus { #[serde(rename = "read")] Read, #[serde(rename = "unread")] Unread, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -24656,11 +24290,6 @@ impl std::fmt::Display for PhoneUserVoiceMailsResponseStatus { } } -impl Default for PhoneUserVoiceMailsResponseStatus { - fn default() -> PhoneUserVoiceMailsResponseStatus { - PhoneUserVoiceMailsResponseStatus::Noop - } -} impl PhoneUserVoiceMailsResponseStatus { pub fn is_noop(&self) -> bool { matches!(self, PhoneUserVoiceMailsResponseStatus::Noop) @@ -24966,14 +24595,14 @@ pub struct UpdateUserSettingRequest { } /** -* The type of call: -* *`voip` (Voice over IP) -* *`pstn` (Public Switched Telephone Network) -* *`tollfree` -* *`international` -* *`contactCenter` -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of call: + * *`voip` (Voice over IP) + * *`pstn` (Public Switched Telephone Network) + * *`tollfree` + * *`international` + * *`contactCenter` + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum CallType { #[serde(rename = "contactCenter")] ContactCenter, @@ -24986,6 +24615,7 @@ pub enum CallType { #[serde(rename = "voip")] Voip, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -25006,11 +24636,6 @@ impl std::fmt::Display for CallType { } } -impl Default for CallType { - fn default() -> CallType { - CallType::Noop - } -} impl CallType { pub fn is_noop(&self) -> bool { matches!(self, CallType::Noop) @@ -25372,15 +24997,16 @@ pub struct AssignCallingPlanRequest { } /** -* The owner type: `user` or `call queue`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The owner type: `user` or `call queue`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetPhoneRecordingsResponseOwnerType { #[serde(rename = "call queue")] CallQueue, #[serde(rename = "user")] User, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -25398,11 +25024,6 @@ impl std::fmt::Display for GetPhoneRecordingsResponseOwnerType { } } -impl Default for GetPhoneRecordingsResponseOwnerType { - fn default() -> GetPhoneRecordingsResponseOwnerType { - GetPhoneRecordingsResponseOwnerType::Noop - } -} impl GetPhoneRecordingsResponseOwnerType { pub fn is_noop(&self) -> bool { matches!(self, GetPhoneRecordingsResponseOwnerType::Noop) @@ -25447,15 +25068,16 @@ pub struct GetPhoneRecordingsResponseOwner { } /** -* The direction of the call. Values: `inbound` or `outbound`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The direction of the call. Values: `inbound` or `outbound`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Direction { #[serde(rename = "inbound")] Inbound, #[serde(rename = "outbound")] Outbound, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -25473,11 +25095,6 @@ impl std::fmt::Display for Direction { } } -impl Default for Direction { - fn default() -> Direction { - Direction::Noop - } -} impl Direction { pub fn is_noop(&self) -> bool { matches!(self, Direction::Noop) @@ -25841,13 +25458,14 @@ pub struct AccountPlanBaseDeleteRequest { } /** -* The action that needs to be taken for this sub account. Value must be set to "cancel". -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The action that needs to be taken for this sub account. Value must be set to "cancel". + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum AccountPlanAddonCancelRequestAction { #[serde(rename = "cancel")] Cancel, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -25864,11 +25482,6 @@ impl std::fmt::Display for AccountPlanAddonCancelRequestAction { } } -impl Default for AccountPlanAddonCancelRequestAction { - fn default() -> AccountPlanAddonCancelRequestAction { - AccountPlanAddonCancelRequestAction::Noop - } -} impl AccountPlanAddonCancelRequestAction { pub fn is_noop(&self) -> bool { matches!(self, AccountPlanAddonCancelRequestAction::Noop) @@ -27346,7 +26959,7 @@ impl UpdateGroupSettingsRequestOneOf { } } -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UpdateGroupSettingsOption { #[serde(rename = "meeting_authentication")] MeetingAuthentication, @@ -27355,6 +26968,7 @@ pub enum UpdateGroupSettingsOption { #[serde(rename = "recording_authentication")] RecordingAuthentication, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -27373,11 +26987,6 @@ impl std::fmt::Display for UpdateGroupSettingsOption { } } -impl Default for UpdateGroupSettingsOption { - fn default() -> UpdateGroupSettingsOption { - UpdateGroupSettingsOption::Noop - } -} impl UpdateGroupSettingsOption { pub fn is_noop(&self) -> bool { matches!(self, UpdateGroupSettingsOption::Noop) @@ -28501,19 +28110,19 @@ pub struct SwitchUserAccountRequest { } /** -* The recording file type. The value of this field could be one of the following:
-* * `MP4`: Video file of the recording.
-* * `M4A` Audio-only file of the recording.
-* * `TB`: Timestamp file of the recording in JSON format.
-* * `TRANSCRIPT`: Transcription file of the recording in VTT format.
-* * `CHAT`: A TXT file containing in-meeting chat messages that were sent during the meeting.
-* * `CC`: File containing closed captions of the recording in VTT file format.
-* * `CSV`: File containing polling data in csv format. -* -* A recording file object with file type of either `CC` or `TB` **does not have** the following properties:
-* `id`, `status`, `file_size`, `recording_type`, and `play_url`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The recording file type. The value of this field could be one of the following:
+ * * `MP4`: Video file of the recording.
+ * * `M4A` Audio-only file of the recording.
+ * * `TB`: Timestamp file of the recording in JSON format.
+ * * `TRANSCRIPT`: Transcription file of the recording in VTT format.
+ * * `CHAT`: A TXT file containing in-meeting chat messages that were sent during the meeting.
+ * * `CC`: File containing closed captions of the recording in VTT file format.
+ * * `CSV`: File containing polling data in csv format. + * + * A recording file object with file type of either `CC` or `TB` **does not have** the following properties:
+ * `id`, `status`, `file_size`, `recording_type`, and `play_url`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetAccountCloudRecordingResponseMeetingsFilesFileType { #[serde(rename = "CC")] Cc, @@ -28530,6 +28139,7 @@ pub enum GetAccountCloudRecordingResponseMeetingsFilesFileType { #[serde(rename = "TRANSCRIPT")] Transcript, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -28552,11 +28162,6 @@ impl std::fmt::Display for GetAccountCloudRecordingResponseMeetingsFilesFileType } } -impl Default for GetAccountCloudRecordingResponseMeetingsFilesFileType { - fn default() -> GetAccountCloudRecordingResponseMeetingsFilesFileType { - GetAccountCloudRecordingResponseMeetingsFilesFileType::Noop - } -} impl GetAccountCloudRecordingResponseMeetingsFilesFileType { pub fn is_noop(&self) -> bool { matches!( @@ -28567,15 +28172,16 @@ impl GetAccountCloudRecordingResponseMeetingsFilesFileType { } /** -* The status of the recording, either `completed` or `processing`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The status of the recording, either `completed` or `processing`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetAccountCloudRecordingResponseMeetingsFilesStatus { #[serde(rename = "completed")] Completed, #[serde(rename = "processing")] Processing, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -28593,11 +28199,6 @@ impl std::fmt::Display for GetAccountCloudRecordingResponseMeetingsFilesStatus { } } -impl Default for GetAccountCloudRecordingResponseMeetingsFilesStatus { - fn default() -> GetAccountCloudRecordingResponseMeetingsFilesStatus { - GetAccountCloudRecordingResponseMeetingsFilesStatus::Noop - } -} impl GetAccountCloudRecordingResponseMeetingsFilesStatus { pub fn is_noop(&self) -> bool { matches!( @@ -28608,24 +28209,24 @@ impl GetAccountCloudRecordingResponseMeetingsFilesStatus { } /** -* The recording type. The value of this field can be one of the following:
-* * `shared_screen_with_speaker_view(CC)` -* * `shared_screen_with_speaker_view` -* * `shared_screen_with_gallery_view` -* * `shared_screen` -* * `active_speaker` -* * `gallery_view` -* * `audio_only` -* * `audio_transcript` -* * `chat_file` -* * `host_video` -* * `closed_caption` -* * `poll` -* * `timeline` -* * `thumbnail` -* -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The recording type. The value of this field can be one of the following:
+ * * `shared_screen_with_speaker_view(CC)` + * * `shared_screen_with_speaker_view` + * * `shared_screen_with_gallery_view` + * * `shared_screen` + * * `active_speaker` + * * `gallery_view` + * * `audio_only` + * * `audio_transcript` + * * `chat_file` + * * `host_video` + * * `closed_caption` + * * `poll` + * * `timeline` + * * `thumbnail` + * + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetAccountCloudRecordingResponseMeetingsFilesType { #[serde(rename = "active_speaker")] ActiveSpeaker, @@ -28656,6 +28257,7 @@ pub enum GetAccountCloudRecordingResponseMeetingsFilesType { #[serde(rename = "timeline")] Timeline, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -28693,11 +28295,6 @@ impl std::fmt::Display for GetAccountCloudRecordingResponseMeetingsFilesType { } } -impl Default for GetAccountCloudRecordingResponseMeetingsFilesType { - fn default() -> GetAccountCloudRecordingResponseMeetingsFilesType { - GetAccountCloudRecordingResponseMeetingsFilesType::Noop - } -} impl GetAccountCloudRecordingResponseMeetingsFilesType { pub fn is_noop(&self) -> bool { matches!( @@ -29074,15 +28671,16 @@ pub struct UpdateZrAccProfileRequest { } /** -* The type of setting that you would like to retrieve.
`alert`: Alert Settings applied on the Zoom Rooms Account.
-* `meeting`: Meeting settings of the Zoom Rooms Account.
-* `signage`: View digital signage settings of the Zoom Rooms Account. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of setting that you would like to retrieve.
`alert`: Alert Settings applied on the Zoom Rooms Account.
+ * `meeting`: Meeting settings of the Zoom Rooms Account.
+ * `signage`: View digital signage settings of the Zoom Rooms Account. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum SettingType { #[serde(rename = "alert")] Alert, #[serde(rename = "meeting")] + #[default] Meeting, #[serde(other)] FallthroughString, @@ -29099,17 +28697,11 @@ impl std::fmt::Display for SettingType { } } -impl Default for SettingType { - fn default() -> SettingType { - SettingType::Meeting - } -} - /** -* The type of location. The value can be one of the following: -* `country`, `states`, `city`, `campus`, `building`, `floor`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The type of location. The value can be one of the following: + * `country`, `states`, `city`, `campus`, `building`, `floor`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ListZrLocationsResponseType { #[serde(rename = "building")] Building, @@ -29124,6 +28716,7 @@ pub enum ListZrLocationsResponseType { #[serde(rename = "states")] States, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -29145,11 +28738,6 @@ impl std::fmt::Display for ListZrLocationsResponseType { } } -impl Default for ListZrLocationsResponseType { - fn default() -> ListZrLocationsResponseType { - ListZrLocationsResponseType::Noop - } -} impl ListZrLocationsResponseType { pub fn is_noop(&self) -> bool { matches!(self, ListZrLocationsResponseType::Noop) @@ -29475,9 +29063,9 @@ pub struct UpdateRoomProfileRequest { } /** -* Type of the device. The value of this field can be one of the following:
`Zoom Rooms Computer`,
`Controller`, `Scheduling Display`, `Zoom Rooms Control System`, `Companion Whiteboard` -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Type of the device. The value of this field can be one of the following:
`Zoom Rooms Computer`,
`Controller`, `Scheduling Display`, `Zoom Rooms Control System`, `Companion Whiteboard` + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum DeviceType { #[serde(rename = "Companion Whiteboard")] CompanionWhiteboard, @@ -29490,6 +29078,7 @@ pub enum DeviceType { #[serde(rename = "Zoom Rooms Control System")] ZoomRoomsControlSystem, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -29510,11 +29099,6 @@ impl std::fmt::Display for DeviceType { } } -impl Default for DeviceType { - fn default() -> DeviceType { - DeviceType::Noop - } -} impl DeviceType { pub fn is_noop(&self) -> bool { matches!(self, DeviceType::Noop) @@ -29522,15 +29106,16 @@ impl DeviceType { } /** -* Status of the device. The value can be either `Online` or `Offline`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Status of the device. The value can be either `Online` or `Offline`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ListZrDevicesResponseStatus { #[serde(rename = "Offline")] Offline, #[serde(rename = "Online")] Online, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -29548,11 +29133,6 @@ impl std::fmt::Display for ListZrDevicesResponseStatus { } } -impl Default for ListZrDevicesResponseStatus { - fn default() -> ListZrDevicesResponseStatus { - ListZrDevicesResponseStatus::Noop - } -} impl ListZrDevicesResponseStatus { pub fn is_noop(&self) -> bool { matches!(self, ListZrDevicesResponseStatus::Noop) @@ -29826,15 +29406,16 @@ pub struct ListMeetingSatisfactionResponse { } /** -* State of the device. The value should be either `assigned` to list devices that have been assigned to user(s) or `unassigned` to list devices that have not yet been assigned to any user in the Zoom account. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * State of the device. The value should be either `assigned` to list devices that have been assigned to user(s) or `unassigned` to list devices that have not yet been assigned to any user in the Zoom account. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ListPhoneDevicesType { #[serde(rename = "assigned")] Assigned, #[serde(rename = "unassigned")] Unassigned, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -29852,11 +29433,6 @@ impl std::fmt::Display for ListPhoneDevicesType { } } -impl Default for ListPhoneDevicesType { - fn default() -> ListPhoneDevicesType { - ListPhoneDevicesType::Noop - } -} impl ListPhoneDevicesType { pub fn is_noop(&self) -> bool { matches!(self, ListPhoneDevicesType::Noop) @@ -29895,15 +29471,16 @@ pub struct AddAutoReceptionistResponse { } /** -* Status of the device. The value is either `online` or `offline`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Status of the device. The value is either `online` or `offline`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ListPhoneDevicesResponseStatus { #[serde(rename = "offline")] Offline, #[serde(rename = "online")] Online, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -29921,11 +29498,6 @@ impl std::fmt::Display for ListPhoneDevicesResponseStatus { } } -impl Default for ListPhoneDevicesResponseStatus { - fn default() -> ListPhoneDevicesResponseStatus { - ListPhoneDevicesResponseStatus::Noop - } -} impl ListPhoneDevicesResponseStatus { pub fn is_noop(&self) -> bool { matches!(self, ListPhoneDevicesResponseStatus::Noop) @@ -30101,15 +29673,15 @@ pub struct GetDeviceResponseAssignee { } /** -* [Provisioning type](https://support.zoom.us/hc/en-us/articles/360033223411). The value can be one of the following: -* -* * `ztp` : Zero touch provisioning. -* * `assisted`: Assisted provisioning. -* * `manual`: Manual provisioning. -* -* -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * [Provisioning type](https://support.zoom.us/hc/en-us/articles/360033223411). The value can be one of the following: + * + * * `ztp` : Zero touch provisioning. + * * `assisted`: Assisted provisioning. + * * `manual`: Manual provisioning. + * + * + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetDeviceResponseProvisionType { #[serde(rename = "assisted")] Assisted, @@ -30118,6 +29690,7 @@ pub enum GetDeviceResponseProvisionType { #[serde(rename = "ztp")] Ztp, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -30136,11 +29709,6 @@ impl std::fmt::Display for GetDeviceResponseProvisionType { } } -impl Default for GetDeviceResponseProvisionType { - fn default() -> GetDeviceResponseProvisionType { - GetDeviceResponseProvisionType::Noop - } -} impl GetDeviceResponseProvisionType { pub fn is_noop(&self) -> bool { matches!(self, GetDeviceResponseProvisionType::Noop) @@ -30873,17 +30441,18 @@ pub struct CreateCallQueueResponse { } /** -* Level of the user. The value can be one of the following:
-* `manager`: A call queue manager has the privilege to change call queue settings, policy settings and manage recordings and voicemail inbox. There can only be one manager for each call queue.

-* `user`: Regular user without the privileges of a manager. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Level of the user. The value can be one of the following:
+ * `manager`: A call queue manager has the privilege to change call queue settings, policy settings and manage recordings and voicemail inbox. There can only be one manager for each call queue.

+ * `user`: Regular user without the privileges of a manager. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Level { #[serde(rename = "manager")] Manager, #[serde(rename = "user")] User, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -30901,11 +30470,6 @@ impl std::fmt::Display for Level { } } -impl Default for Level { - fn default() -> Level { - Level::Noop - } -} impl Level { pub fn is_noop(&self) -> bool { matches!(self, Level::Noop) @@ -31842,9 +31406,9 @@ pub struct InternationalCall { } /** -* Allow Hot Desking feature to current device. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Allow Hot Desking feature to current device. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum GetCommonAreaPhoneResponsePolicyHotDeskingStatus { #[serde(rename = "off")] Off, @@ -31853,6 +31417,7 @@ pub enum GetCommonAreaPhoneResponsePolicyHotDeskingStatus { #[serde(rename = "unsupported")] Unsupported, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -31871,11 +31436,6 @@ impl std::fmt::Display for GetCommonAreaPhoneResponsePolicyHotDeskingStatus { } } -impl Default for GetCommonAreaPhoneResponsePolicyHotDeskingStatus { - fn default() -> GetCommonAreaPhoneResponsePolicyHotDeskingStatus { - GetCommonAreaPhoneResponsePolicyHotDeskingStatus::Noop - } -} impl GetCommonAreaPhoneResponsePolicyHotDeskingStatus { pub fn is_noop(&self) -> bool { matches!(self, GetCommonAreaPhoneResponsePolicyHotDeskingStatus::Noop) @@ -32147,17 +31707,18 @@ pub struct AssignCallingPlansCommonAreaPhoneResponseData { } /** -* Indicates the match type for the blocked list. The values can be one of the following:
-* `phoneNumber`: Indicates that only a specific phone number that is shown in the `phone_number` field is blocked.

-* `prefix`: Indicates that all numbers starting with prefix that is shown in the `phone_number` field are blocked. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Indicates the match type for the blocked list. The values can be one of the following:
+ * `phoneNumber`: Indicates that only a specific phone number that is shown in the `phone_number` field is blocked.

+ * `prefix`: Indicates that all numbers starting with prefix that is shown in the `phone_number` field are blocked. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum MatchType { #[serde(rename = "phoneNumber")] PhoneNumber, #[serde(rename = "prefix")] Prefix, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -32175,11 +31736,6 @@ impl std::fmt::Display for MatchType { } } -impl Default for MatchType { - fn default() -> MatchType { - MatchType::Noop - } -} impl MatchType { pub fn is_noop(&self) -> bool { matches!(self, MatchType::Noop) @@ -33352,9 +32908,9 @@ pub struct AddCalloutCountriesResponse { } /** -* Specify the language in which this phone number should be displayed. Currently, the only supported languages are `en-GB`, `en-US`, `de-DE`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Specify the language in which this phone number should be displayed. Currently, the only supported languages are `en-GB`, `en-US`, `de-DE`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Languages { #[serde(rename = "de-DE")] De, @@ -33363,6 +32919,7 @@ pub enum Languages { #[serde(rename = "en-US")] EnUs, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -33381,11 +32938,6 @@ impl std::fmt::Display for Languages { } } -impl Default for Languages { - fn default() -> Languages { - Languages::Noop - } -} impl Languages { pub fn is_noop(&self) -> bool { matches!(self, Languages::Noop) @@ -33617,13 +33169,13 @@ pub struct AddInternalNumbersResponseData { } /** -* Specify one of the following values for this field: -* -* `upgrade`: Upgrade to the latest Zoom Rooms App Version.
-* `downgrade`: Downgrade the Zoom Rooms App Version.
-* `cancel`: Cancel an ongoing upgrade or downgrade process. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Specify one of the following values for this field: + * + * `upgrade`: Upgrade to the latest Zoom Rooms App Version.
+ * `downgrade`: Downgrade the Zoom Rooms App Version.
+ * `cancel`: Cancel an ongoing upgrade or downgrade process. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ChangeZoomRoomsAppVersionRequestAction { #[serde(rename = "cancel")] Cancel, @@ -33632,6 +33184,7 @@ pub enum ChangeZoomRoomsAppVersionRequestAction { #[serde(rename = "upgrade")] Upgrade, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -33650,11 +33203,6 @@ impl std::fmt::Display for ChangeZoomRoomsAppVersionRequestAction { } } -impl Default for ChangeZoomRoomsAppVersionRequestAction { - fn default() -> ChangeZoomRoomsAppVersionRequestAction { - ChangeZoomRoomsAppVersionRequestAction::Noop - } -} impl ChangeZoomRoomsAppVersionRequestAction { pub fn is_noop(&self) -> bool { matches!(self, ChangeZoomRoomsAppVersionRequestAction::Noop) @@ -33722,26 +33270,26 @@ pub struct ListWebinarTemplatesResponse { } /** -* Presence status of the user. The value can be set to one of the following:
-* * `Away` -* * `Do_Not_Disturb` -* * `Available` -* * `In_Calendar_Event` -* * `Presenting` -* * `In_A_Zoom_Meeting` -* * `On_A_Call` -* -* Users who are on Zoom Client with a version **lower than 5.3.0** can update the status from: -* * `Away` to `Do_Not_Disturb` -* * `Available` to `Do_Not_Disturb` -* -* Users who are on **Zoom Client 5.3.0** or higher can update the status from: -* * `Do_Not_Disturb` to `Away` -* * `Do_Not_Disturb` to `Available` -* * `Available` to `Away` -* * `Away` to `Available` -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Presence status of the user. The value can be set to one of the following:
+ * * `Away` + * * `Do_Not_Disturb` + * * `Available` + * * `In_Calendar_Event` + * * `Presenting` + * * `In_A_Zoom_Meeting` + * * `On_A_Call` + * + * Users who are on Zoom Client with a version **lower than 5.3.0** can update the status from: + * * `Away` to `Do_Not_Disturb` + * * `Available` to `Do_Not_Disturb` + * + * Users who are on **Zoom Client 5.3.0** or higher can update the status from: + * * `Do_Not_Disturb` to `Away` + * * `Do_Not_Disturb` to `Available` + * * `Available` to `Away` + * * `Away` to `Available` + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum UpdatePresenceStatusRequest { #[serde(rename = "Available")] Available, @@ -33758,6 +33306,7 @@ pub enum UpdatePresenceStatusRequest { #[serde(rename = "Presenting")] Presenting, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -33780,11 +33329,6 @@ impl std::fmt::Display for UpdatePresenceStatusRequest { } } -impl Default for UpdatePresenceStatusRequest { - fn default() -> UpdatePresenceStatusRequest { - UpdatePresenceStatusRequest::Noop - } -} impl UpdatePresenceStatusRequest { pub fn is_noop(&self) -> bool { matches!(self, UpdatePresenceStatusRequest::Noop) @@ -34669,18 +34213,19 @@ pub struct GetAccountBillingInvoiceResponse { } /** -* Feedback submitted by the participant. -* -* * `GOOD`: Thumbs up. -* * `NOT GOOD`: Thumbs down. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Feedback submitted by the participant. + * + * * `GOOD`: Thumbs up. + * * `NOT GOOD`: Thumbs down. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Quality { #[serde(rename = "GOOD")] Good, #[serde(rename = "NOT GOOD")] NotGood, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -34698,11 +34243,6 @@ impl std::fmt::Display for Quality { } } -impl Default for Quality { - fn default() -> Quality { - Quality::Noop - } -} impl Quality { pub fn is_noop(&self) -> bool { matches!(self, Quality::Noop) @@ -34777,9 +34317,9 @@ pub struct ParticipantFeedbackResponse { } /** -* Result of the call: `call_connected` | `recorded` | `no_answer`. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * Result of the call: `call_connected` | `recorded` | `no_answer`. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum Result { #[serde(rename = "call_connected")] CallConnected, @@ -34788,6 +34328,7 @@ pub enum Result { #[serde(rename = "recorded")] Recorded, #[serde(rename = "")] + #[default] Noop, #[serde(other)] FallthroughString, @@ -34806,11 +34347,6 @@ impl std::fmt::Display for Result { } } -impl Default for Result { - fn default() -> Result { - Result::Noop - } -} impl Result { pub fn is_noop(&self) -> bool { matches!(self, Result::Noop) @@ -35183,13 +34719,14 @@ pub struct ListMeetingTemplatesResponseData { } /** -* The query date type for the `from` and `to` parameters. -*/ -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] + * The query date type for the `from` and `to` parameters. + */ +#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema, Default)] pub enum ListArchivedFilesQueryDateType { #[serde(rename = "archive_complete_time")] ArchiveCompleteTime, #[serde(rename = "meeting_start_time")] + #[default] MeetingStartTime, #[serde(other)] FallthroughString, @@ -35206,12 +34743,6 @@ impl std::fmt::Display for ListArchivedFilesQueryDateType { } } -impl Default for ListArchivedFilesQueryDateType { - fn default() -> ListArchivedFilesQueryDateType { - ListArchivedFilesQueryDateType::MeetingStartTime - } -} - /// Information about the archived files. #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)] pub struct ListArchivedFilesResponseMeetingsArchive { From b26faf893fb2dfa12384ac30a94b54a38f1985c8 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 4 May 2023 16:20:40 -0500 Subject: [PATCH 23/40] Derive default on fully qualified path --- generator/src/types.rs | 1 + google/admin/src/types.rs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/generator/src/types.rs b/generator/src/types.rs index 664d806c..ecee96b9 100644 --- a/generator/src/types.rs +++ b/generator/src/types.rs @@ -183,6 +183,7 @@ pub fn generate_types(ts: &mut TypeSpace, proper_name: &str) -> Result { || rt.starts_with("Vec<") || rt.starts_with("Option<") || rt.starts_with("HashMap<") + || rt.starts_with("std::collections::HashMap<") { a(r#"#[serde(default,"#); if rt == "String" { diff --git a/google/admin/src/types.rs b/google/admin/src/types.rs index b4db1428..5e42c25e 100644 --- a/google/admin/src/types.rs +++ b/google/admin/src/types.rs @@ -4087,7 +4087,11 @@ pub struct User { /** * The Directory API allows you to create and manage your account's users, user aliases, and user Gmail chat profile photos. For more information about common tasks, see the [User Accounts Developer's Guide](/admin-sdk/directory/v1/guides/manage-users.html) and the [User Aliases Developer's Guide](/admin-sdk/directory/v1/guides/manage-user-aliases.html). */ - #[serde(rename = "customSchemas")] + #[serde( + default, + skip_serializing_if = "std::collections::HashMap::is_empty", + rename = "customSchemas" + )] pub custom_schemas: std::collections::HashMap>, /** From 92a3fe06af237bf0b9b958146d2bfe69b58ab0f9 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Tue, 30 May 2023 14:35:02 -0500 Subject: [PATCH 24/40] Bump base64 --- Cargo.lock | 36 ++++++++++-------------- docusign/Cargo.toml | 2 +- generator/src/client.rs | 6 ++-- generator/src/main.rs | 3 +- generator/src/template.rs | 3 +- giphy/Cargo.toml | 2 +- github/Cargo.toml | 2 +- github/README.md | 3 +- github/examples/get_repo_in_org.rs | 3 +- github/examples/list_pulls_for_repo.rs | 3 +- github/examples/list_repos_for_org.rs | 3 +- github/src/lib.rs | 3 +- google/admin/Cargo.toml | 2 +- google/admin/src/lib.rs | 4 ++- google/calendar/Cargo.toml | 2 +- google/calendar/src/lib.rs | 4 ++- google/cloud-resource-manager/Cargo.toml | 2 +- google/cloud-resource-manager/src/lib.rs | 4 ++- google/drive/Cargo.toml | 2 +- google/drive/src/lib.rs | 4 ++- google/groups-settings/Cargo.toml | 2 +- google/groups-settings/src/lib.rs | 4 ++- google/sheets/Cargo.toml | 2 +- google/sheets/src/lib.rs | 4 ++- gusto/Cargo.toml | 2 +- mailchimp/Cargo.toml | 2 +- okta/Cargo.toml | 2 +- ramp/Cargo.toml | 2 +- rev.ai/Cargo.toml | 2 +- sendgrid/Cargo.toml | 2 +- shipbob/Cargo.toml | 2 +- shopify/Cargo.toml | 2 +- slack/Cargo.toml | 2 +- stripe/Cargo.toml | 2 +- tripactions/Cargo.toml | 2 +- zoom/Cargo.toml | 2 +- 36 files changed, 72 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 24c0aca1..04a903c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -305,7 +305,7 @@ version = "0.4.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", + "base64 0.21.0", "bytes", "chrono", "dirs", @@ -343,7 +343,7 @@ version = "0.4.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", + "base64 0.21.0", "bytes", "chrono", "dirs", @@ -653,7 +653,7 @@ version = "0.4.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", + "base64 0.21.0", "bytes", "chrono", "dirs", @@ -691,7 +691,6 @@ version = "0.5.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", "base64 0.21.0", "bytes", "chrono", @@ -731,7 +730,6 @@ version = "0.4.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", "base64 0.21.0", "bytes", "chrono", @@ -771,7 +769,6 @@ version = "0.6.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", "base64 0.21.0", "bytes", "chrono", @@ -811,7 +808,6 @@ version = "0.5.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", "base64 0.21.0", "bytes", "chrono", @@ -851,7 +847,6 @@ version = "0.6.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", "base64 0.21.0", "bytes", "chrono", @@ -891,7 +886,7 @@ version = "0.4.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", + "base64 0.21.0", "bytes", "chrono", "dirs", @@ -1214,7 +1209,7 @@ version = "0.4.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", + "base64 0.21.0", "bytes", "chrono", "dirs", @@ -1426,7 +1421,7 @@ version = "0.3.2" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", + "base64 0.21.0", "bytes", "chrono", "dirs", @@ -1464,7 +1459,7 @@ version = "0.4.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", + "base64 0.21.0", "bytes", "chrono", "dirs", @@ -1743,7 +1738,7 @@ version = "0.4.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", + "base64 0.21.0", "bytes", "chrono", "dirs", @@ -2012,7 +2007,7 @@ version = "0.5.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", + "base64 0.21.0", "bytes", "chrono", "dirs", @@ -2227,7 +2222,7 @@ version = "0.4.1" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", + "base64 0.21.0", "bytes", "chrono", "dirs", @@ -2352,7 +2347,6 @@ version = "0.6.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", "base64 0.21.0", "bytes", "chrono", @@ -2392,7 +2386,7 @@ version = "0.3.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", + "base64 0.21.0", "bytes", "chrono", "dirs", @@ -2430,7 +2424,7 @@ version = "0.3.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", + "base64 0.21.0", "bytes", "chrono", "dirs", @@ -2505,7 +2499,7 @@ version = "0.4.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", + "base64 0.21.0", "bytes", "chrono", "dirs", @@ -2816,7 +2810,7 @@ version = "0.4.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", + "base64 0.21.0", "bytes", "chrono", "dirs", @@ -3294,7 +3288,7 @@ version = "0.4.0" dependencies = [ "async-recursion", "async-trait", - "base64 0.13.0", + "base64 0.21.0", "bytes", "chrono", "dirs", diff --git a/docusign/Cargo.toml b/docusign/Cargo.toml index 720a7f44..ecfc1da1 100644 --- a/docusign/Cargo.toml +++ b/docusign/Cargo.toml @@ -45,7 +45,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/generator/src/client.rs b/generator/src/client.rs index 313bbba4..d50a4962 100644 --- a/generator/src/client.rs +++ b/generator/src/client.rs @@ -869,8 +869,10 @@ where T: ToString, R: ToString, { + use base64::{Engine, engine::general_purpose::STANDARD}; + let google_key = env::var("GOOGLE_KEY_ENCODED").unwrap_or_default(); - let decoded_google_key = base64::decode(google_key).unwrap(); + let decoded_google_key = STANDARD.decode(google_key).unwrap(); let secret = yup_oauth2::parse_application_secret(decoded_google_key) .expect("failed to read from google credential env var"); @@ -2058,7 +2060,7 @@ pub fn generate_servers(servers: &[openapiv3::Server], server_prefix: &str) -> G )), top_level_type: Some(server_enum), } - }, + } } } diff --git a/generator/src/main.rs b/generator/src/main.rs index d89e5ec6..dae9d846 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -2281,6 +2281,7 @@ fn render_param( out.to_string() } +#[allow(clippy::too_many_arguments)] fn gen( api: &OpenAPI, proper_name: &str, @@ -3400,7 +3401,7 @@ thiserror = "1" tokio = {{ version = "1.25.0", features = ["full"] }} [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/generator/src/template.rs b/generator/src/template.rs index 20af3d98..bad1455e 100644 --- a/generator/src/template.rs +++ b/generator/src/template.rs @@ -403,6 +403,7 @@ pub fn generate_docs_github( //! use {name}::{{Client, auth::{{Credentials, InstallationTokenGenerator, JWTCredentials}}}}; //! #[cfg(feature = "httpcache")] //! use {name}::http_cache::FileBasedCache; +//! use base64::{{Engine, engine::general_purpose::STANDARD}}; //! //! let app_id_str = env::var("GH_APP_ID").unwrap(); //! let app_id = app_id_str.parse::().unwrap(); @@ -411,7 +412,7 @@ pub fn generate_docs_github( //! let app_installation_id = app_installation_id_str.parse::().unwrap(); //! //! let encoded_private_key = env::var("GH_PRIVATE_KEY").unwrap(); -//! let private_key = base64::decode(encoded_private_key).unwrap(); +//! let private_key = STANDARD.decode(encoded_private_key).unwrap(); //! //! // Decode the key. //! let key = nom_pem::decode_block(&private_key).unwrap(); diff --git a/giphy/Cargo.toml b/giphy/Cargo.toml index 5b12471b..806c749a 100644 --- a/giphy/Cargo.toml +++ b/giphy/Cargo.toml @@ -45,7 +45,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/github/Cargo.toml b/github/Cargo.toml index 5c38b0a0..89ca2f94 100644 --- a/github/Cargo.toml +++ b/github/Cargo.toml @@ -45,7 +45,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/github/README.md b/github/README.md index 022901d9..cfe5ab7d 100644 --- a/github/README.md +++ b/github/README.md @@ -117,6 +117,7 @@ use std::env; use octorust::{Client, auth::{Credentials, InstallationTokenGenerator, JWTCredentials}}; #[cfg(feature = "httpcache")] use octorust::http_cache::FileBasedCache; +use base64::{Engine, engine::general_purpose::STANDARD}; let app_id_str = env::var("GH_APP_ID").unwrap(); let app_id = app_id_str.parse::().unwrap(); @@ -125,7 +126,7 @@ let app_installation_id_str = env::var("GH_INSTALLATION_ID").unwrap(); let app_installation_id = app_installation_id_str.parse::().unwrap(); let encoded_private_key = env::var("GH_PRIVATE_KEY").unwrap(); -let private_key = base64::decode(encoded_private_key).unwrap(); +let private_key = STANDARD.decode(encoded_private_key).unwrap(); // Decode the key. let key = nom_pem::decode_block(&private_key).unwrap(); diff --git a/github/examples/get_repo_in_org.rs b/github/examples/get_repo_in_org.rs index b016402b..4997849d 100644 --- a/github/examples/get_repo_in_org.rs +++ b/github/examples/get_repo_in_org.rs @@ -1,3 +1,4 @@ +use base64::{engine::general_purpose::STANDARD, Engine}; use std::env; #[cfg(feature = "httpcache")] @@ -16,7 +17,7 @@ async fn main() -> Result<(), Box> { let app_installation_id = app_installation_id_str.parse::().unwrap(); let encoded_private_key = env::var("GH_PRIVATE_KEY").unwrap(); - let private_key = base64::decode(encoded_private_key).unwrap(); + let private_key = STANDARD.decode(encoded_private_key).unwrap(); // Decode the key. let key = nom_pem::decode_block(&private_key).unwrap(); diff --git a/github/examples/list_pulls_for_repo.rs b/github/examples/list_pulls_for_repo.rs index 23df42ab..60a3d915 100644 --- a/github/examples/list_pulls_for_repo.rs +++ b/github/examples/list_pulls_for_repo.rs @@ -1,3 +1,4 @@ +use base64::{engine::general_purpose::STANDARD, Engine}; use std::env; #[cfg(feature = "httpcache")] @@ -17,7 +18,7 @@ async fn main() -> Result<(), Box> { let app_installation_id = app_installation_id_str.parse::().unwrap(); let encoded_private_key = env::var("GH_PRIVATE_KEY").unwrap(); - let private_key = base64::decode(encoded_private_key).unwrap(); + let private_key = STANDARD.decode(encoded_private_key).unwrap(); // Decode the key. let key = nom_pem::decode_block(&private_key).unwrap(); diff --git a/github/examples/list_repos_for_org.rs b/github/examples/list_repos_for_org.rs index 69308c1e..c064fce8 100644 --- a/github/examples/list_repos_for_org.rs +++ b/github/examples/list_repos_for_org.rs @@ -1,3 +1,4 @@ +use base64::{engine::general_purpose::STANDARD, Engine}; use std::env; #[cfg(feature = "httpcache")] @@ -17,7 +18,7 @@ async fn main() -> Result<(), Box> { let app_installation_id = app_installation_id_str.parse::().unwrap(); let encoded_private_key = env::var("GH_PRIVATE_KEY").unwrap(); - let private_key = base64::decode(encoded_private_key).unwrap(); + let private_key = STANDARD.decode(encoded_private_key).unwrap(); // Decode the key. let key = nom_pem::decode_block(&private_key).unwrap(); diff --git a/github/src/lib.rs b/github/src/lib.rs index 005e1094..8944a8a8 100644 --- a/github/src/lib.rs +++ b/github/src/lib.rs @@ -115,6 +115,7 @@ //! use octorust::{Client, auth::{Credentials, InstallationTokenGenerator, JWTCredentials}}; //! #[cfg(feature = "httpcache")] //! use octorust::http_cache::FileBasedCache; +//! use base64::{Engine, engine::general_purpose::STANDARD}; //! //! let app_id_str = env::var("GH_APP_ID").unwrap(); //! let app_id = app_id_str.parse::().unwrap(); @@ -123,7 +124,7 @@ //! let app_installation_id = app_installation_id_str.parse::().unwrap(); //! //! let encoded_private_key = env::var("GH_PRIVATE_KEY").unwrap(); -//! let private_key = base64::decode(encoded_private_key).unwrap(); +//! let private_key = STANDARD.decode(encoded_private_key).unwrap(); //! //! // Decode the key. //! let key = nom_pem::decode_block(&private_key).unwrap(); diff --git a/google/admin/Cargo.toml b/google/admin/Cargo.toml index ee48976e..36bc4db6 100644 --- a/google/admin/Cargo.toml +++ b/google/admin/Cargo.toml @@ -47,7 +47,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/google/admin/src/lib.rs b/google/admin/src/lib.rs index 66f25ce8..4dd54173 100644 --- a/google/admin/src/lib.rs +++ b/google/admin/src/lib.rs @@ -454,8 +454,10 @@ impl Client { T: ToString, R: ToString, { + use base64::{engine::general_purpose::STANDARD, Engine}; + let google_key = env::var("GOOGLE_KEY_ENCODED").unwrap_or_default(); - let decoded_google_key = base64::decode(google_key).unwrap(); + let decoded_google_key = STANDARD.decode(google_key).unwrap(); let secret = yup_oauth2::parse_application_secret(decoded_google_key) .expect("failed to read from google credential env var"); diff --git a/google/calendar/Cargo.toml b/google/calendar/Cargo.toml index 42ddc285..809bcbc9 100644 --- a/google/calendar/Cargo.toml +++ b/google/calendar/Cargo.toml @@ -47,7 +47,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/google/calendar/src/lib.rs b/google/calendar/src/lib.rs index 6039ffe8..45883733 100644 --- a/google/calendar/src/lib.rs +++ b/google/calendar/src/lib.rs @@ -442,8 +442,10 @@ impl Client { T: ToString, R: ToString, { + use base64::{engine::general_purpose::STANDARD, Engine}; + let google_key = env::var("GOOGLE_KEY_ENCODED").unwrap_or_default(); - let decoded_google_key = base64::decode(google_key).unwrap(); + let decoded_google_key = STANDARD.decode(google_key).unwrap(); let secret = yup_oauth2::parse_application_secret(decoded_google_key) .expect("failed to read from google credential env var"); diff --git a/google/cloud-resource-manager/Cargo.toml b/google/cloud-resource-manager/Cargo.toml index 4f1be8d1..75baf36e 100644 --- a/google/cloud-resource-manager/Cargo.toml +++ b/google/cloud-resource-manager/Cargo.toml @@ -47,7 +47,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/google/cloud-resource-manager/src/lib.rs b/google/cloud-resource-manager/src/lib.rs index ab176b22..ccb6974d 100644 --- a/google/cloud-resource-manager/src/lib.rs +++ b/google/cloud-resource-manager/src/lib.rs @@ -436,8 +436,10 @@ impl Client { T: ToString, R: ToString, { + use base64::{engine::general_purpose::STANDARD, Engine}; + let google_key = env::var("GOOGLE_KEY_ENCODED").unwrap_or_default(); - let decoded_google_key = base64::decode(google_key).unwrap(); + let decoded_google_key = STANDARD.decode(google_key).unwrap(); let secret = yup_oauth2::parse_application_secret(decoded_google_key) .expect("failed to read from google credential env var"); diff --git a/google/drive/Cargo.toml b/google/drive/Cargo.toml index 9423c764..365fd1b4 100644 --- a/google/drive/Cargo.toml +++ b/google/drive/Cargo.toml @@ -47,7 +47,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/google/drive/src/lib.rs b/google/drive/src/lib.rs index 411b7c5a..a90ef70c 100644 --- a/google/drive/src/lib.rs +++ b/google/drive/src/lib.rs @@ -452,8 +452,10 @@ impl Client { T: ToString, R: ToString, { + use base64::{engine::general_purpose::STANDARD, Engine}; + let google_key = env::var("GOOGLE_KEY_ENCODED").unwrap_or_default(); - let decoded_google_key = base64::decode(google_key).unwrap(); + let decoded_google_key = STANDARD.decode(google_key).unwrap(); let secret = yup_oauth2::parse_application_secret(decoded_google_key) .expect("failed to read from google credential env var"); diff --git a/google/groups-settings/Cargo.toml b/google/groups-settings/Cargo.toml index 64e379e5..06224337 100644 --- a/google/groups-settings/Cargo.toml +++ b/google/groups-settings/Cargo.toml @@ -47,7 +47,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/google/groups-settings/src/lib.rs b/google/groups-settings/src/lib.rs index b9e041b6..f88826e8 100644 --- a/google/groups-settings/src/lib.rs +++ b/google/groups-settings/src/lib.rs @@ -435,8 +435,10 @@ impl Client { T: ToString, R: ToString, { + use base64::{engine::general_purpose::STANDARD, Engine}; + let google_key = env::var("GOOGLE_KEY_ENCODED").unwrap_or_default(); - let decoded_google_key = base64::decode(google_key).unwrap(); + let decoded_google_key = STANDARD.decode(google_key).unwrap(); let secret = yup_oauth2::parse_application_secret(decoded_google_key) .expect("failed to read from google credential env var"); diff --git a/google/sheets/Cargo.toml b/google/sheets/Cargo.toml index 7985aa2a..fd69a7ea 100644 --- a/google/sheets/Cargo.toml +++ b/google/sheets/Cargo.toml @@ -47,7 +47,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/google/sheets/src/lib.rs b/google/sheets/src/lib.rs index 861b5793..07055ec0 100644 --- a/google/sheets/src/lib.rs +++ b/google/sheets/src/lib.rs @@ -436,8 +436,10 @@ impl Client { T: ToString, R: ToString, { + use base64::{engine::general_purpose::STANDARD, Engine}; + let google_key = env::var("GOOGLE_KEY_ENCODED").unwrap_or_default(); - let decoded_google_key = base64::decode(google_key).unwrap(); + let decoded_google_key = STANDARD.decode(google_key).unwrap(); let secret = yup_oauth2::parse_application_secret(decoded_google_key) .expect("failed to read from google credential env var"); diff --git a/gusto/Cargo.toml b/gusto/Cargo.toml index 397a6430..a1e42836 100644 --- a/gusto/Cargo.toml +++ b/gusto/Cargo.toml @@ -45,7 +45,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/mailchimp/Cargo.toml b/mailchimp/Cargo.toml index 89ca5148..9c183206 100644 --- a/mailchimp/Cargo.toml +++ b/mailchimp/Cargo.toml @@ -45,7 +45,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/okta/Cargo.toml b/okta/Cargo.toml index 9e0f40b3..434a49c1 100644 --- a/okta/Cargo.toml +++ b/okta/Cargo.toml @@ -45,7 +45,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/ramp/Cargo.toml b/ramp/Cargo.toml index 8c60319d..7889eb0c 100644 --- a/ramp/Cargo.toml +++ b/ramp/Cargo.toml @@ -45,7 +45,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/rev.ai/Cargo.toml b/rev.ai/Cargo.toml index f5883d97..2a2df2d1 100644 --- a/rev.ai/Cargo.toml +++ b/rev.ai/Cargo.toml @@ -45,7 +45,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/sendgrid/Cargo.toml b/sendgrid/Cargo.toml index ef49cda7..9c0592a7 100644 --- a/sendgrid/Cargo.toml +++ b/sendgrid/Cargo.toml @@ -45,7 +45,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/shipbob/Cargo.toml b/shipbob/Cargo.toml index c1842e70..89b775f6 100644 --- a/shipbob/Cargo.toml +++ b/shipbob/Cargo.toml @@ -45,7 +45,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/shopify/Cargo.toml b/shopify/Cargo.toml index f8a298fb..5b90f292 100644 --- a/shopify/Cargo.toml +++ b/shopify/Cargo.toml @@ -45,7 +45,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/slack/Cargo.toml b/slack/Cargo.toml index c3c30f37..d5e38fd9 100644 --- a/slack/Cargo.toml +++ b/slack/Cargo.toml @@ -45,7 +45,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/stripe/Cargo.toml b/stripe/Cargo.toml index 9a1e44b6..6599c01d 100644 --- a/stripe/Cargo.toml +++ b/stripe/Cargo.toml @@ -45,7 +45,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/tripactions/Cargo.toml b/tripactions/Cargo.toml index d2aa14f8..974396e9 100644 --- a/tripactions/Cargo.toml +++ b/tripactions/Cargo.toml @@ -45,7 +45,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" diff --git a/zoom/Cargo.toml b/zoom/Cargo.toml index 1a5083e9..5906580e 100644 --- a/zoom/Cargo.toml +++ b/zoom/Cargo.toml @@ -45,7 +45,7 @@ thiserror = "1" tokio = { version = "1.25.0", features = ["full"] } [dev-dependencies] -base64 = "^0.13" +base64 = "^0.21" dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" From 0b1fcffeb1131b44994a73115b525c4dab92a2f7 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Tue, 30 May 2023 15:25:50 -0500 Subject: [PATCH 25/40] Bump reqwest-middleware --- Cargo.lock | 192 ++++++++++++++++------- docusign/Cargo.toml | 8 +- generator/src/main.rs | 8 +- giphy/Cargo.toml | 8 +- github/Cargo.toml | 8 +- google/admin/Cargo.toml | 8 +- google/calendar/Cargo.toml | 8 +- google/cloud-resource-manager/Cargo.toml | 8 +- google/drive/Cargo.toml | 8 +- google/groups-settings/Cargo.toml | 8 +- google/sheets/Cargo.toml | 8 +- gusto/Cargo.toml | 8 +- mailchimp/Cargo.toml | 8 +- okta/Cargo.toml | 8 +- ramp/Cargo.toml | 8 +- rev.ai/Cargo.toml | 8 +- sendgrid/Cargo.toml | 8 +- shipbob/Cargo.toml | 8 +- shopify/Cargo.toml | 8 +- slack/Cargo.toml | 8 +- stripe/Cargo.toml | 8 +- tripactions/Cargo.toml | 8 +- zoom/Cargo.toml | 8 +- 23 files changed, 221 insertions(+), 147 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 04a903c1..30869c16 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -74,7 +74,7 @@ checksum = "2cda8f4bcc10624c4e85bc66b3f452cca98cfa5ca002dc83a16aad2367641bea" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -85,7 +85,7 @@ checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -212,9 +212,9 @@ checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" [[package]] name = "crossbeam-channel" -version = "0.5.2" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ "cfg-if", "crossbeam-utils", @@ -542,7 +542,7 @@ dependencies = [ "proc-macro-hack", "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -637,8 +637,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.10.2+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -1094,6 +1096,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] @@ -1247,6 +1252,12 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +[[package]] +name = "matchit" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" + [[package]] name = "memchr" version = "2.4.1" @@ -1493,9 +1504,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.8.0" +version = "1.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" [[package]] name = "openapiv3" @@ -1510,9 +1521,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.48" +version = "0.10.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518915b97df115dd36109bfa429a48b8f737bd05508cf9588977b599648926d2" +checksum = "12df40a956736488b7b44fe79fe12d4f245bb5b3f5a1f6095e499760015be392" dependencies = [ "bitflags", "cfg-if", @@ -1531,7 +1542,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -1542,11 +1553,10 @@ checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" [[package]] name = "openssl-sys" -version = "0.9.83" +version = "0.9.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666416d899cf077260dac8698d60a60b435a46d57e82acb1be3d0dad87284e5b" +checksum = "c2ce0f250f34a308dcfdbb351f511359857d4ed2134ba715a4eadd46e1ffd617" dependencies = [ - "autocfg", "cc", "libc", "pkg-config", @@ -1578,6 +1588,17 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + [[package]] name = "parking_lot" version = "0.12.1" @@ -1585,7 +1606,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core", + "parking_lot_core 0.9.3", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", ] [[package]] @@ -1638,29 +1673,29 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pin-project" -version = "1.0.8" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576bc800220cc65dac09e99e97b08b358cfab6e17078de8dc5fee223bd2d0c08" +checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.8" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" +checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "pin-project-lite" -version = "0.2.7" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "pin-utils" @@ -1716,18 +1751,18 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.43" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.9" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" dependencies = [ "proc-macro2", ] @@ -1922,9 +1957,9 @@ dependencies = [ [[package]] name = "reqwest-conditional-middleware" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bce134f515eb4c2748bbd928086e7b0aae0d1568daf6c63b51e829aa6f2cf464" +checksum = "59e50a2e70970896c99d1b8f20ddc30a70b30d3ac6e619a03a8353b64a49b277" dependencies = [ "async-trait", "reqwest", @@ -1934,13 +1969,12 @@ dependencies = [ [[package]] name = "reqwest-middleware" -version = "0.1.6" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69539cea4148dce683bec9dc95be3f0397a9bb2c248a49c8296a9d21659a8cdd" +checksum = "4531c89d50effe1fac90d095c8b133c20c5c714204feee0bfc3fd158e784209d" dependencies = [ "anyhow", "async-trait", - "futures", "http", "reqwest", "serde", @@ -1950,36 +1984,41 @@ dependencies = [ [[package]] name = "reqwest-retry" -version = "0.1.5" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce246a729eaa6aff5e215aee42845bf5fed9893cc6cd51aeeb712f34e04dd9f3" +checksum = "48d0fd6ef4c6d23790399fe15efc8d12cd9f3d4133958f9bd7801ee5cbaec6c4" dependencies = [ "anyhow", "async-trait", "chrono", "futures", + "getrandom 0.2.3", "http", "hyper", + "parking_lot 0.11.2", "reqwest", "reqwest-middleware", "retry-policies", "task-local-extensions", "tokio", "tracing", + "wasm-timer", ] [[package]] name = "reqwest-tracing" -version = "0.3.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64977f9a47fa7768cc88751e29026e569730ac1667c2eaeaac04b32624849fbe" +checksum = "783e8130d2427ddd7897dd3f814d4a3aea31b05deb42a4fdf8c18258fe5aefd1" dependencies = [ + "anyhow", "async-trait", + "getrandom 0.2.3", + "matchit", "opentelemetry", "reqwest", "reqwest-middleware", "task-local-extensions", - "tokio", "tracing", "tracing-opentelemetry", ] @@ -2168,7 +2207,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn", + "syn 1.0.99", ] [[package]] @@ -2271,7 +2310,7 @@ checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -2282,7 +2321,7 @@ checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -2580,6 +2619,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "task-local-extensions" version = "0.1.4" @@ -2619,15 +2669,16 @@ checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ + "cfg-if", "once_cell", ] @@ -2677,7 +2728,7 @@ dependencies = [ "memchr", "mio", "num_cpus", - "parking_lot", + "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", "socket2", @@ -2693,7 +2744,7 @@ checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -2739,9 +2790,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.28" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f96e095c0c82419687c20ddf5cb3eadb61f4e1405923c9dc8e53a1adacbda8" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "pin-project-lite", @@ -2751,29 +2802,30 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.19" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8276d9a4a3a558d7b7ad5303ad50b53d58264641b82914b7ada36bd762e7a716" +checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "tracing-core" -version = "0.1.20" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46125608c26121c81b0c6d693eab5a420e416da7e43c426d2e8f7df8da8a3acf" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ - "lazy_static", + "once_cell", + "valuable", ] [[package]] name = "tracing-log" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" dependencies = [ "lazy_static", "log", @@ -2782,10 +2834,11 @@ dependencies = [ [[package]] name = "tracing-opentelemetry" -version = "0.17.2" +version = "0.17.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f9378e96a9361190ae297e7f3a8ff644aacd2897f244b1ff81f381669196fa6" +checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" dependencies = [ + "once_cell", "opentelemetry", "tracing", "tracing-core", @@ -2795,9 +2848,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.7" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5312f325fe3588e277415f5a6cca1f4ccad0f248c4cd5a4bd33032d7286abc22" +checksum = "4bc28f93baff38037f64e6f43d34cfa1605f27a49c34e8a04c5e78b0babf2596" dependencies = [ "sharded-slab", "thread_local", @@ -2925,6 +2978,12 @@ dependencies = [ "serde", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "vcpkg" version = "0.2.15" @@ -2998,7 +3057,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn", + "syn 1.0.99", "wasm-bindgen-shared", ] @@ -3032,7 +3091,7 @@ checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3043,6 +3102,21 @@ version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +[[package]] +name = "wasm-timer" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +dependencies = [ + "futures", + "js-sys", + "parking_lot 0.11.2", + "pin-utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "web-sys" version = "0.3.55" diff --git a/docusign/Cargo.toml b/docusign/Cargo.toml index ecfc1da1..1d8ce863 100644 --- a/docusign/Cargo.toml +++ b/docusign/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/generator/src/main.rs b/generator/src/main.rs index dae9d846..2d39dba8 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -3387,10 +3387,10 @@ parse_link_header = "0.3.3" pem = {{ version = "1.1.0", default-features = false, optional = true }} percent-encoding = "2.2" reqwest = {{ version = "0.11.14", default-features = false, features = ["json", "multipart"] }} -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = {{ version = "0.16", default-features = false, optional = true }} schemars = {{ version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] }} serde = {{ version = "1", features = ["derive"] }} diff --git a/giphy/Cargo.toml b/giphy/Cargo.toml index 806c749a..486183fd 100644 --- a/giphy/Cargo.toml +++ b/giphy/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/github/Cargo.toml b/github/Cargo.toml index 89ca2f94..38aebfa4 100644 --- a/github/Cargo.toml +++ b/github/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/google/admin/Cargo.toml b/google/admin/Cargo.toml index 36bc4db6..7381fdb4 100644 --- a/google/admin/Cargo.toml +++ b/google/admin/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/google/calendar/Cargo.toml b/google/calendar/Cargo.toml index 809bcbc9..d5cebbd5 100644 --- a/google/calendar/Cargo.toml +++ b/google/calendar/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/google/cloud-resource-manager/Cargo.toml b/google/cloud-resource-manager/Cargo.toml index 75baf36e..9b03d40e 100644 --- a/google/cloud-resource-manager/Cargo.toml +++ b/google/cloud-resource-manager/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/google/drive/Cargo.toml b/google/drive/Cargo.toml index 365fd1b4..c1bd4981 100644 --- a/google/drive/Cargo.toml +++ b/google/drive/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/google/groups-settings/Cargo.toml b/google/groups-settings/Cargo.toml index 06224337..9695e875 100644 --- a/google/groups-settings/Cargo.toml +++ b/google/groups-settings/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/google/sheets/Cargo.toml b/google/sheets/Cargo.toml index fd69a7ea..64c3249c 100644 --- a/google/sheets/Cargo.toml +++ b/google/sheets/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/gusto/Cargo.toml b/gusto/Cargo.toml index a1e42836..306587f6 100644 --- a/gusto/Cargo.toml +++ b/gusto/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/mailchimp/Cargo.toml b/mailchimp/Cargo.toml index 9c183206..32b8c175 100644 --- a/mailchimp/Cargo.toml +++ b/mailchimp/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/okta/Cargo.toml b/okta/Cargo.toml index 434a49c1..ab724e2d 100644 --- a/okta/Cargo.toml +++ b/okta/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/ramp/Cargo.toml b/ramp/Cargo.toml index 7889eb0c..d4e1b9b4 100644 --- a/ramp/Cargo.toml +++ b/ramp/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/rev.ai/Cargo.toml b/rev.ai/Cargo.toml index 2a2df2d1..3f4b9e15 100644 --- a/rev.ai/Cargo.toml +++ b/rev.ai/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/sendgrid/Cargo.toml b/sendgrid/Cargo.toml index 9c0592a7..bd0bd89f 100644 --- a/sendgrid/Cargo.toml +++ b/sendgrid/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/shipbob/Cargo.toml b/shipbob/Cargo.toml index 89b775f6..9bfc2fcc 100644 --- a/shipbob/Cargo.toml +++ b/shipbob/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/shopify/Cargo.toml b/shopify/Cargo.toml index 5b90f292..09613a85 100644 --- a/shopify/Cargo.toml +++ b/shopify/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/slack/Cargo.toml b/slack/Cargo.toml index d5e38fd9..0fc33b9a 100644 --- a/slack/Cargo.toml +++ b/slack/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/stripe/Cargo.toml b/stripe/Cargo.toml index 6599c01d..bb46e848 100644 --- a/stripe/Cargo.toml +++ b/stripe/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/tripactions/Cargo.toml b/tripactions/Cargo.toml index 974396e9..987b5129 100644 --- a/tripactions/Cargo.toml +++ b/tripactions/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } diff --git a/zoom/Cargo.toml b/zoom/Cargo.toml index 5906580e..c715a421 100644 --- a/zoom/Cargo.toml +++ b/zoom/Cargo.toml @@ -28,10 +28,10 @@ parse_link_header = "0.3.3" pem = { version = "1.1.0", default-features = false, optional = true } percent-encoding = "2.2" reqwest = { version = "0.11.14", default-features = false, features = ["json", "multipart"] } -reqwest-conditional-middleware = "0.1.0" -reqwest-middleware = "0.1.5" -reqwest-retry = "0.1.4" -reqwest-tracing = "0.3.0" +reqwest-conditional-middleware = "0.2.1" +reqwest-middleware = "0.2.2" +reqwest-retry = "0.2.2" +reqwest-tracing = "0.4.4" ring = { version = "0.16", default-features = false, optional = true } schemars = { version = "0.8", features = ["bytes", "chrono", "url", "uuid1"] } serde = { version = "1", features = ["derive"] } From 4eb04d3ed7e5ba184ad2817c75c9263a483dee7c Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Tue, 30 May 2023 16:03:32 -0500 Subject: [PATCH 26/40] Remove default opentel feature --- Cargo.lock | 113 ----------------------- docusign/Cargo.toml | 2 +- generator/src/main.rs | 2 +- giphy/Cargo.toml | 2 +- github/Cargo.toml | 2 +- google/admin/Cargo.toml | 2 +- google/calendar/Cargo.toml | 2 +- google/cloud-resource-manager/Cargo.toml | 2 +- google/drive/Cargo.toml | 2 +- google/groups-settings/Cargo.toml | 2 +- google/sheets/Cargo.toml | 2 +- gusto/Cargo.toml | 2 +- mailchimp/Cargo.toml | 2 +- okta/Cargo.toml | 2 +- ramp/Cargo.toml | 2 +- rev.ai/Cargo.toml | 2 +- sendgrid/Cargo.toml | 2 +- shipbob/Cargo.toml | 2 +- shopify/Cargo.toml | 2 +- slack/Cargo.toml | 2 +- stripe/Cargo.toml | 2 +- tripactions/Cargo.toml | 2 +- zoom/Cargo.toml | 2 +- 23 files changed, 22 insertions(+), 135 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 30869c16..242bc803 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -210,16 +210,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-utils" version = "0.8.14" @@ -1563,25 +1553,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "opentelemetry" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" -dependencies = [ - "async-trait", - "crossbeam-channel", - "futures-channel", - "futures-executor", - "futures-util", - "js-sys", - "lazy_static", - "percent-encoding", - "pin-project", - "rand 0.8.5", - "thiserror", -] - [[package]] name = "parking" version = "2.0.0" @@ -1671,26 +1642,6 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" -[[package]] -name = "pin-project" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.18", -] - [[package]] name = "pin-project-lite" version = "0.2.9" @@ -2015,12 +1966,10 @@ dependencies = [ "async-trait", "getrandom 0.2.3", "matchit", - "opentelemetry", "reqwest", "reqwest-middleware", "task-local-extensions", "tracing", - "tracing-opentelemetry", ] [[package]] @@ -2371,15 +2320,6 @@ dependencies = [ "unsafe-libyaml", ] -[[package]] -name = "sharded-slab" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" -dependencies = [ - "lazy_static", -] - [[package]] name = "sheets" version = "0.6.0" @@ -2672,16 +2612,6 @@ dependencies = [ "syn 1.0.99", ] -[[package]] -name = "thread_local" -version = "1.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" -dependencies = [ - "cfg-if", - "once_cell", -] - [[package]] name = "time" version = "0.3.13" @@ -2818,43 +2748,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" -dependencies = [ - "lazy_static", - "log", - "tracing-core", -] - -[[package]] -name = "tracing-opentelemetry" -version = "0.17.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" -dependencies = [ - "once_cell", - "opentelemetry", - "tracing", - "tracing-core", - "tracing-log", - "tracing-subscriber", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bc28f93baff38037f64e6f43d34cfa1605f27a49c34e8a04c5e78b0babf2596" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", ] [[package]] @@ -2978,12 +2871,6 @@ dependencies = [ "serde", ] -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - [[package]] name = "vcpkg" version = "0.2.15" diff --git a/docusign/Cargo.toml b/docusign/Cargo.toml index 1d8ce863..b5a13588 100644 --- a/docusign/Cargo.toml +++ b/docusign/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/generator/src/main.rs b/generator/src/main.rs index 2d39dba8..6720d4cb 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -3368,7 +3368,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/giphy/Cargo.toml b/giphy/Cargo.toml index 486183fd..deadd2ae 100644 --- a/giphy/Cargo.toml +++ b/giphy/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/github/Cargo.toml b/github/Cargo.toml index 38aebfa4..79dddd81 100644 --- a/github/Cargo.toml +++ b/github/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/google/admin/Cargo.toml b/google/admin/Cargo.toml index 7381fdb4..d157fc35 100644 --- a/google/admin/Cargo.toml +++ b/google/admin/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/google/calendar/Cargo.toml b/google/calendar/Cargo.toml index d5cebbd5..3ea5fb8f 100644 --- a/google/calendar/Cargo.toml +++ b/google/calendar/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/google/cloud-resource-manager/Cargo.toml b/google/cloud-resource-manager/Cargo.toml index 9b03d40e..848faa42 100644 --- a/google/cloud-resource-manager/Cargo.toml +++ b/google/cloud-resource-manager/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/google/drive/Cargo.toml b/google/drive/Cargo.toml index c1bd4981..551c7497 100644 --- a/google/drive/Cargo.toml +++ b/google/drive/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/google/groups-settings/Cargo.toml b/google/groups-settings/Cargo.toml index 9695e875..7620fa63 100644 --- a/google/groups-settings/Cargo.toml +++ b/google/groups-settings/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/google/sheets/Cargo.toml b/google/sheets/Cargo.toml index 64c3249c..a3c0243e 100644 --- a/google/sheets/Cargo.toml +++ b/google/sheets/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/gusto/Cargo.toml b/gusto/Cargo.toml index 306587f6..1bf64008 100644 --- a/gusto/Cargo.toml +++ b/gusto/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/mailchimp/Cargo.toml b/mailchimp/Cargo.toml index 32b8c175..3df41a2b 100644 --- a/mailchimp/Cargo.toml +++ b/mailchimp/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/okta/Cargo.toml b/okta/Cargo.toml index ab724e2d..be8e96b9 100644 --- a/okta/Cargo.toml +++ b/okta/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/ramp/Cargo.toml b/ramp/Cargo.toml index d4e1b9b4..68da31f3 100644 --- a/ramp/Cargo.toml +++ b/ramp/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/rev.ai/Cargo.toml b/rev.ai/Cargo.toml index 3f4b9e15..21f758d1 100644 --- a/rev.ai/Cargo.toml +++ b/rev.ai/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/sendgrid/Cargo.toml b/sendgrid/Cargo.toml index bd0bd89f..00ef6a26 100644 --- a/sendgrid/Cargo.toml +++ b/sendgrid/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/shipbob/Cargo.toml b/shipbob/Cargo.toml index 9bfc2fcc..0acd8322 100644 --- a/shipbob/Cargo.toml +++ b/shipbob/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/shopify/Cargo.toml b/shopify/Cargo.toml index 09613a85..43d238b3 100644 --- a/shopify/Cargo.toml +++ b/shopify/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/slack/Cargo.toml b/slack/Cargo.toml index 0fc33b9a..54b3db28 100644 --- a/slack/Cargo.toml +++ b/slack/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/stripe/Cargo.toml b/stripe/Cargo.toml index bb46e848..5dea62ff 100644 --- a/stripe/Cargo.toml +++ b/stripe/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/tripactions/Cargo.toml b/tripactions/Cargo.toml index 987b5129..bf4e7544 100644 --- a/tripactions/Cargo.toml +++ b/tripactions/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] diff --git a/zoom/Cargo.toml b/zoom/Cargo.toml index c715a421..36379b00 100644 --- a/zoom/Cargo.toml +++ b/zoom/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" license = "MIT" [features] -default = ["rustls-tls", "reqwest-tracing/opentelemetry_0_17"] +default = ["rustls-tls"] # enable etag-based http_cache functionality httpcache = ["dirs"] native-tls = ["reqwest/default-tls", "openssl"] From 8cb501805a020f1abf9c8db198e32ccd702d1b7d Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 1 Jun 2023 08:40:12 -0500 Subject: [PATCH 27/40] Update trait responses --- google/drive/src/traits.rs | 29 +++++++++++++---------------- google/sheets/src/traits.rs | 10 +++++----- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/google/drive/src/traits.rs b/google/drive/src/traits.rs index 91aa13dc..82d6ff20 100644 --- a/google/drive/src/traits.rs +++ b/google/drive/src/traits.rs @@ -28,7 +28,7 @@ pub trait PermissionOps { type_: &str, use_domain_admin_access: bool, send_notification_email: bool, - ) -> ClientResult; + ) -> ClientResult>; } #[async_trait::async_trait] @@ -58,7 +58,7 @@ impl PermissionOps for crate::permissions::Permissions { type_: &str, use_domain_admin_access: bool, send_notification_email: bool, - ) -> ClientResult { + ) -> ClientResult> { // First let's check if the permission already exists. // List all the permissions for a file. let resp = self @@ -75,7 +75,7 @@ impl PermissionOps for crate::permissions::Permissions { for perm in resp.body { if perm.email_address == email_address && perm.role == role && perm.type_ == type_ { // We found the permission, return it. - return Ok(perm); + return Ok(Response::new(resp.status, resp.headers, perm)); } } @@ -110,7 +110,6 @@ impl PermissionOps for crate::permissions::Permissions { &perm, ) .await - .map(|resp| resp.body) } } @@ -145,14 +144,14 @@ pub trait FileOps { drive_id: &str, parent_id: &str, name: &str, - ) -> ClientResult; + ) -> ClientResult>; /// Get a file's contents by it's ID. Only works for Google Docs. async fn get_contents_by_id(&self, id: &str) -> ClientResult>; /// Delete a file by its name. async fn delete_by_name(&self, drive_id: &str, parent_id: &str, name: &str) - -> ClientResult<()>; + -> ClientResult>; } #[async_trait::async_trait] @@ -303,7 +302,7 @@ impl FileOps for crate::files::Files { drive_id: &str, parent_id: &str, name: &str, - ) -> ClientResult { + ) -> ClientResult> { let folder_mime_type = "application/vnd.google-apps.folder"; let mut file: crate::types::File = Default::default(); // Set the name, @@ -341,8 +340,7 @@ impl FileOps for crate::files::Files { .await?; if !resp.body.is_empty() { - let f = resp.body.get(0).unwrap().clone(); - return Ok(f.id); + return Ok(Response::new(resp.status, resp.headers, resp.body.into_iter().nth(0).unwrap())); } // Make the request and return the ID. @@ -360,7 +358,7 @@ impl FileOps for crate::files::Files { ) .await?; - Ok(resp.body.id) + Ok(resp) } /// Get a file's contents by it's ID. Only works for Google Docs. @@ -400,13 +398,13 @@ impl FileOps for crate::files::Files { drive_id: &str, parent_id: &str, name: &str, - ) -> ClientResult<()> { + ) -> ClientResult> { // Check if the file exists. let resp = self.get_by_name(drive_id, parent_id, name).await?; if resp.body.is_empty() { // The file does not exist. - return Ok(()); + return Ok(Response::new(resp.status, resp.headers, ())); } // Delete the file. @@ -416,20 +414,19 @@ impl FileOps for crate::files::Files { true, // supports team drives ) .await - .map(|resp| resp.body) } } #[async_trait::async_trait] pub trait DriveOps { /// Get a drive by it's name. - async fn get_by_name(&self, name: &str) -> ClientResult; + async fn get_by_name(&self, name: &str) -> ClientResult>; } #[async_trait::async_trait] impl DriveOps for crate::drives::Drives { /// Get a drive by it's name. - async fn get_by_name(&self, name: &str) -> ClientResult { + async fn get_by_name(&self, name: &str) -> ClientResult> { let resp = self .list_all( //&format!("name = '{}'", name), // query @@ -439,7 +436,7 @@ impl DriveOps for crate::drives::Drives { for drive in resp.body { if drive.name == name { - return Ok(drive); + return Ok(Response::new(resp.status, resp.headers, drive)); } } diff --git a/google/sheets/src/traits.rs b/google/sheets/src/traits.rs index cc351f7e..b1124372 100644 --- a/google/sheets/src/traits.rs +++ b/google/sheets/src/traits.rs @@ -1,11 +1,11 @@ -use crate::ClientResult; +use crate::{ClientResult, Response}; #[async_trait::async_trait] pub trait SpreadsheetOps { /// Get single cell value. /// The `cell_name` is something like `A1` and what is returned is a string representation of /// the cell's value. - async fn cell_get(&self, sheet_id: &str, cell_name: &str) -> ClientResult; + async fn cell_get(&self, sheet_id: &str, cell_name: &str) -> ClientResult>; } #[async_trait::async_trait] @@ -13,7 +13,7 @@ impl SpreadsheetOps for crate::spreadsheets::Spreadsheets { /// Get single cell value. /// The `cell_name` is something like `A1` and what is returned is a string representation of /// the cell's value. - async fn cell_get(&self, sheet_id: &str, cell_name: &str) -> ClientResult { + async fn cell_get(&self, sheet_id: &str, cell_name: &str) -> ClientResult> { let resp = self .values_get( sheet_id, @@ -26,10 +26,10 @@ impl SpreadsheetOps for crate::spreadsheets::Spreadsheets { if let Some(v) = resp.body.values.get(0) { if let Some(v) = v.get(0) { - return Ok(v.to_string()); + return Ok(Response::new(resp.status, resp.headers, v.to_string())); } } - Ok(String::new()) + Ok(Response::new(resp.status, resp.headers, String::new())) } } From a4d160de01a1943a225512ceb10c4fafe341ed5a Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 1 Jun 2023 08:40:26 -0500 Subject: [PATCH 28/40] Fmt --- google/drive/src/traits.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/google/drive/src/traits.rs b/google/drive/src/traits.rs index 82d6ff20..3d53d99d 100644 --- a/google/drive/src/traits.rs +++ b/google/drive/src/traits.rs @@ -150,8 +150,12 @@ pub trait FileOps { async fn get_contents_by_id(&self, id: &str) -> ClientResult>; /// Delete a file by its name. - async fn delete_by_name(&self, drive_id: &str, parent_id: &str, name: &str) - -> ClientResult>; + async fn delete_by_name( + &self, + drive_id: &str, + parent_id: &str, + name: &str, + ) -> ClientResult>; } #[async_trait::async_trait] @@ -340,7 +344,11 @@ impl FileOps for crate::files::Files { .await?; if !resp.body.is_empty() { - return Ok(Response::new(resp.status, resp.headers, resp.body.into_iter().nth(0).unwrap())); + return Ok(Response::new( + resp.status, + resp.headers, + resp.body.into_iter().nth(0).unwrap(), + )); } // Make the request and return the ID. From d5f3e2b6b1333ff4a5e32a1fd74751621ecb410c Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 1 Jun 2023 09:50:50 -0500 Subject: [PATCH 29/40] Update versions --- Cargo.lock | 42 +++++++++++----------- Makefile | 44 +++++++++++++----------- docusign/Cargo.toml | 2 +- docusign/README.md | 2 +- docusign/src/lib.rs | 2 +- giphy/Cargo.toml | 2 +- giphy/README.md | 2 +- giphy/src/lib.rs | 2 +- github/Cargo.toml | 2 +- github/README.md | 6 ++-- github/src/lib.rs | 6 ++-- google/admin/Cargo.toml | 2 +- google/admin/README.md | 2 +- google/admin/src/lib.rs | 2 +- google/calendar/Cargo.toml | 2 +- google/calendar/README.md | 2 +- google/calendar/src/lib.rs | 2 +- google/cloud-resource-manager/Cargo.toml | 2 +- google/cloud-resource-manager/README.md | 2 +- google/cloud-resource-manager/src/lib.rs | 2 +- google/drive/Cargo.toml | 2 +- google/drive/README.md | 2 +- google/drive/src/lib.rs | 2 +- google/drive/src/traits.rs | 2 +- google/groups-settings/Cargo.toml | 2 +- google/groups-settings/README.md | 2 +- google/groups-settings/src/lib.rs | 2 +- google/sheets/Cargo.toml | 2 +- google/sheets/README.md | 2 +- google/sheets/src/lib.rs | 2 +- gusto/Cargo.toml | 2 +- gusto/README.md | 2 +- gusto/src/lib.rs | 2 +- mailchimp/Cargo.toml | 2 +- mailchimp/README.md | 2 +- mailchimp/src/lib.rs | 2 +- okta/Cargo.toml | 2 +- okta/README.md | 2 +- okta/src/lib.rs | 2 +- ramp/Cargo.toml | 2 +- ramp/README.md | 2 +- ramp/src/lib.rs | 2 +- rev.ai/Cargo.toml | 2 +- rev.ai/README.md | 2 +- rev.ai/src/lib.rs | 2 +- sendgrid/Cargo.toml | 2 +- sendgrid/README.md | 2 +- sendgrid/src/lib.rs | 2 +- shipbob/Cargo.toml | 2 +- shipbob/README.md | 2 +- shipbob/src/lib.rs | 2 +- shopify/Cargo.toml | 2 +- shopify/README.md | 2 +- shopify/src/lib.rs | 2 +- slack/Cargo.toml | 2 +- slack/README.md | 2 +- slack/src/lib.rs | 2 +- stripe/Cargo.toml | 2 +- stripe/README.md | 2 +- stripe/src/lib.rs | 2 +- tripactions/Cargo.toml | 2 +- tripactions/README.md | 2 +- tripactions/src/lib.rs | 2 +- zoom/Cargo.toml | 2 +- zoom/README.md | 2 +- zoom/src/lib.rs | 2 +- 66 files changed, 112 insertions(+), 110 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 242bc803..1c1e0ec5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -291,7 +291,7 @@ dependencies = [ [[package]] name = "docusign" -version = "0.4.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -329,7 +329,7 @@ dependencies = [ [[package]] name = "dolladollabills" -version = "0.4.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -641,7 +641,7 @@ checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" [[package]] name = "giphy-api" -version = "0.4.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -679,7 +679,7 @@ dependencies = [ [[package]] name = "google-calendar" -version = "0.5.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -718,7 +718,7 @@ dependencies = [ [[package]] name = "google-cloud-resource-manager" -version = "0.4.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -757,7 +757,7 @@ dependencies = [ [[package]] name = "google-drive" -version = "0.6.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -796,7 +796,7 @@ dependencies = [ [[package]] name = "google-groups-settings" -version = "0.5.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -835,7 +835,7 @@ dependencies = [ [[package]] name = "gsuite-api" -version = "0.6.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -874,7 +874,7 @@ dependencies = [ [[package]] name = "gusto-api" -version = "0.4.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -1200,7 +1200,7 @@ dependencies = [ [[package]] name = "mailchimp-api" -version = "0.4.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -1418,7 +1418,7 @@ dependencies = [ [[package]] name = "octorust" -version = "0.3.2" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -1456,7 +1456,7 @@ dependencies = [ [[package]] name = "okta" -version = "0.4.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -1720,7 +1720,7 @@ dependencies = [ [[package]] name = "ramp-api" -version = "0.4.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -1991,7 +1991,7 @@ dependencies = [ [[package]] name = "revai" -version = "0.5.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -2206,7 +2206,7 @@ dependencies = [ [[package]] name = "sendgrid-api" -version = "0.4.1" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -2322,7 +2322,7 @@ dependencies = [ [[package]] name = "sheets" -version = "0.6.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -2361,7 +2361,7 @@ dependencies = [ [[package]] name = "shipbob" -version = "0.3.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -2399,7 +2399,7 @@ dependencies = [ [[package]] name = "shopify" -version = "0.3.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -2474,7 +2474,7 @@ checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" [[package]] name = "slack-chat-api" -version = "0.4.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -2752,7 +2752,7 @@ dependencies = [ [[package]] name = "tripactions" -version = "0.4.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", @@ -3245,7 +3245,7 @@ checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" [[package]] name = "zoom-api" -version = "0.4.0" +version = "0.7.0-rc.1" dependencies = [ "async-recursion", "async-trait", diff --git a/Makefile b/Makefile index a8271e90..f2fcb2ab 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ SHELL := bash +VERSION = 0.7.0-rc.1 + DOCUSIGN_SPEC_DIR = $(CURDIR)/specs/docusign DOCUSIGN_SPEC = $(DOCUSIGN_SPEC_DIR)/docusign.yaml DOCUSIGN_SPEC_REPO = docusign/OpenAPI-Specifications @@ -160,7 +162,7 @@ $(DOCUSIGN_SPEC): $(DOCUSIGN_SPEC_DIR) # curl -sSL $(DOCUSIGN_SPEC_REMOTE) -o $@ docusign: target/debug/generator $(DOCUSIGN_SPEC) - ./target/debug/generator -i $(DOCUSIGN_SPEC) -v 0.4.0 \ + ./target/debug/generator -i $(DOCUSIGN_SPEC) -v $(VERSION) \ -o docusign \ -n docusign \ --proper-name DocuSign \ @@ -179,7 +181,7 @@ $(GIPHY_SPEC): $(GIPHY_SPEC_DIR) curl -sSL $(GIPHY_SPEC_REMOTE) -o $@ giphy: target/debug/generator $(GIPHY_SPEC) - ./target/debug/generator -i $(GIPHY_SPEC) -v 0.4.0 \ + ./target/debug/generator -i $(GIPHY_SPEC) -v $(VERSION) \ -o giphy \ -n giphy-api \ --proper-name "Giphy" \ @@ -196,7 +198,7 @@ $(GITHUB_SPEC): $(GITHUB_SPEC_DIR) curl -sSL $(GITHUB_SPEC_REMOTE) -o $@ github: target/debug/generator $(GITHUB_SPEC) - ./target/debug/generator -i $(GITHUB_SPEC) -v 0.3.2 \ + ./target/debug/generator -i $(GITHUB_SPEC) -v $(VERSION) \ -o github \ -n octorust \ --proper-name GitHub \ @@ -218,7 +220,7 @@ $(GOOGLE_ADMIN_SPEC): $(GOOGLE_ADMIN_SPEC_DIR) curl -sSL $(GOOGLE_ADMIN_SPEC_REMOTE) -o $@ google-admin: target/debug/generator $(GOOGLE_ADMIN_SPEC) - ./target/debug/generator -i $(GOOGLE_ADMIN_SPEC) -v 0.6.0 \ + ./target/debug/generator -i $(GOOGLE_ADMIN_SPEC) -v $(VERSION) \ -o google/admin \ -n gsuite-api \ --proper-name "Google Admin" \ @@ -237,7 +239,7 @@ $(GOOGLE_CALENDAR_SPEC): $(GOOGLE_CALENDAR_SPEC_DIR) curl -sSL $(GOOGLE_CALENDAR_SPEC_REMOTE) -o $@ google-calendar: target/debug/generator $(GOOGLE_CALENDAR_SPEC) - ./target/debug/generator -i $(GOOGLE_CALENDAR_SPEC) -v 0.5.0 \ + ./target/debug/generator -i $(GOOGLE_CALENDAR_SPEC) -v $(VERSION) \ -o google/calendar \ -n google-calendar \ --proper-name "Google Calendar" \ @@ -256,7 +258,7 @@ $(GOOGLE_CLOUD_RESOURCE_MANAGER_SPEC): $(GOOGLE_CLOUD_RESOURCE_MANAGER_SPEC_DIR) curl -sSL $(GOOGLE_CLOUD_RESOURCE_MANAGER_SPEC_REMOTE) -o $@ google-cloud-resource-manager: target/debug/generator $(GOOGLE_CLOUD_RESOURCE_MANAGER_SPEC) - ./target/debug/generator -i $(GOOGLE_CLOUD_RESOURCE_MANAGER_SPEC) -v 0.4.0 \ + ./target/debug/generator -i $(GOOGLE_CLOUD_RESOURCE_MANAGER_SPEC) -v $(VERSION) \ -o google/cloud-resource-manager \ -n google-cloud-resource-manager \ --proper-name "Google Cloud Resource Manager" \ @@ -275,7 +277,7 @@ $(GOOGLE_DRIVE_SPEC): $(GOOGLE_DRIVE_SPEC_DIR) curl -sSL $(GOOGLE_DRIVE_SPEC_REMOTE) -o $@ google-drive: target/debug/generator $(GOOGLE_DRIVE_SPEC) - ./target/debug/generator -i $(GOOGLE_DRIVE_SPEC) -v 0.6.0 \ + ./target/debug/generator -i $(GOOGLE_DRIVE_SPEC) -v $(VERSION) \ -o google/drive \ -n google-drive \ --proper-name "Google Drive" \ @@ -294,7 +296,7 @@ $(GOOGLE_GROUPS_SETTINGS_SPEC): $(GOOGLE_GROUPS_SETTINGS_SPEC_DIR) curl -sSL $(GOOGLE_GROUPS_SETTINGS_SPEC_REMOTE) -o $@ google-groups-settings: target/debug/generator $(GOOGLE_GROUPS_SETTINGS_SPEC) - ./target/debug/generator -i $(GOOGLE_GROUPS_SETTINGS_SPEC) -v 0.5.0 \ + ./target/debug/generator -i $(GOOGLE_GROUPS_SETTINGS_SPEC) -v $(VERSION) \ -o google/groups-settings \ -n google-groups-settings \ --proper-name "Google Groups Settings" \ @@ -313,7 +315,7 @@ $(GOOGLE_SHEETS_SPEC): $(GOOGLE_SHEETS_SPEC_DIR) curl -sSL $(GOOGLE_SHEETS_SPEC_REMOTE) -o $@ google-sheets: target/debug/generator $(GOOGLE_SHEETS_SPEC) - ./target/debug/generator -i $(GOOGLE_SHEETS_SPEC) -v 0.6.0 \ + ./target/debug/generator -i $(GOOGLE_SHEETS_SPEC) -v $(VERSION) \ -o google/sheets \ -n sheets \ --proper-name "Google Sheets" \ @@ -332,7 +334,7 @@ $(GUSTO_SPEC): $(GUSTO_SPEC_DIR) curl -sSL $(GUSTO_SPEC_REMOTE) -o $@ gusto: target/debug/generator $(GUSTO_SPEC) - ./target/debug/generator -i $(GUSTO_SPEC) -v 0.4.0 \ + ./target/debug/generator -i $(GUSTO_SPEC) -v $(VERSION) \ -o gusto \ -n gusto-api \ --proper-name Gusto \ @@ -354,7 +356,7 @@ $(MAILCHIMP_SPEC): $(MAILCHIMP_SPEC_DIR) $(MAILCHIMP_SPEC_REMOTE) mailchimp: target/debug/generator $(MAILCHIMP_SPEC) - ./target/debug/generator -i $(MAILCHIMP_SPEC) -v 0.4.0 \ + ./target/debug/generator -i $(MAILCHIMP_SPEC) -v $(VERSION) \ -o mailchimp \ -n mailchimp-api \ --proper-name MailChimp \ @@ -376,7 +378,7 @@ $(OKTA_SPEC): $(OKTA_SPEC_DIR) $(OKTA_SPEC_REMOTE) okta: target/debug/generator $(OKTA_SPEC) - ./target/debug/generator -i $(OKTA_SPEC) -v 0.4.0 \ + ./target/debug/generator -i $(OKTA_SPEC) -v $(VERSION) \ -o okta \ -n okta \ --proper-name Okta \ @@ -398,7 +400,7 @@ $(RAMP_SPEC): -o $@ $? ramp: target/debug/generator $(RAMP_SPEC) - ./target/debug/generator -i $(RAMP_SPEC) -v 0.4.0 \ + ./target/debug/generator -i $(RAMP_SPEC) -v $(VERSION) \ -o ramp \ -n ramp-api \ --proper-name Ramp \ @@ -417,7 +419,7 @@ $(REVAI_SPEC): $(REVAI_SPEC_DIR) curl -sSL $(REVAI_SPEC_REMOTE) -o $@ revai: target/debug/generator $(REVAI_SPEC) - ./target/debug/generator -i $(REVAI_SPEC) -v 0.5.0 \ + ./target/debug/generator -i $(REVAI_SPEC) -v $(VERSION) \ -o rev.ai \ -n revai \ --proper-name "Rev.ai" \ @@ -437,7 +439,7 @@ $(SENDGRID_SPEC): $(SENDGRID_SPEC_DIR) $(SENDGRID_SPEC_REMOTE) sendgrid: target/debug/generator $(SENDGRID_SPEC) - ./target/debug/generator -i $(SENDGRID_SPEC) -v 0.4.1 \ + ./target/debug/generator -i $(SENDGRID_SPEC) -v $(VERSION) \ -o sendgrid \ -n sendgrid-api \ --proper-name SendGrid \ @@ -458,7 +460,7 @@ $(SHIPBOB_SPEC): $(SHIPBOB_SPEC_DIR) .PHONY: shipbob shipbob: target/debug/generator $(SHIPBOB_SPEC) - ./target/debug/generator -i $(SHIPBOB_SPEC) -v 0.3.0 \ + ./target/debug/generator -i $(SHIPBOB_SPEC) -v $(VERSION) \ -o shipbob \ -n shipbob \ --proper-name "ShipBob" \ @@ -475,7 +477,7 @@ $(SHOPIFY_SPEC): $(SHOPIFY_SPEC_DIR) curl -sSL $(SHOPIFY_SPEC_REMOTE) -o $@ shopify: target/debug/generator $(SHOPIFY_SPEC) - ./target/debug/generator -i $(SHOPIFY_SPEC) -v 0.3.0 \ + ./target/debug/generator -i $(SHOPIFY_SPEC) -v $(VERSION) \ -o shopify \ -n shopify \ --proper-name "Shopify" \ @@ -497,7 +499,7 @@ $(SLACK_SPEC): $(SLACK_SPEC_DIR) $(SLACK_SPEC_REMOTE) slack: target/debug/generator $(SLACK_SPEC) - ./target/debug/generator -i $(SLACK_SPEC) -v 0.4.0 \ + ./target/debug/generator -i $(SLACK_SPEC) -v $(VERSION) \ -o slack \ -n slack-chat-api \ --proper-name Slack \ @@ -519,7 +521,7 @@ $(STRIPE_SPEC): $(STRIPE_SPEC_DIR) $(STRIPE_SPEC_REMOTE) stripe: target/debug/generator $(STRIPE_SPEC) - ./target/debug/generator -i $(STRIPE_SPEC) -v 0.4.0 \ + ./target/debug/generator -i $(STRIPE_SPEC) -v $(VERSION) \ -o stripe \ -n dolladollabills \ --proper-name Stripe \ @@ -536,7 +538,7 @@ $(TRIPACTIONS_SPEC): $(TRIPACTIONS_SPEC_DIR) curl -sSL $(TRIPACTIONS_SPEC_REMOTE) -o $@ tripactions: target/debug/generator $(TRIPACTIONS_SPEC) - ./target/debug/generator -i $(TRIPACTIONS_SPEC) -v 0.4.0 \ + ./target/debug/generator -i $(TRIPACTIONS_SPEC) -v $(VERSION) \ -o tripactions \ -n tripactions \ --proper-name "TripActions" \ @@ -557,7 +559,7 @@ $(ZOOM_SPEC): $(ZOOM_SPEC_DIR) $(ZOOM_SPEC_REMOTE) zoom: target/debug/generator $(ZOOM_SPEC) - ./target/debug/generator -i $(ZOOM_SPEC) -v 0.4.0 \ + ./target/debug/generator -i $(ZOOM_SPEC) -v $(VERSION) \ -o zoom \ -n zoom-api \ --proper-name Zoom \ diff --git a/docusign/Cargo.toml b/docusign/Cargo.toml index b5a13588..a9c0ff14 100644 --- a/docusign/Cargo.toml +++ b/docusign/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "docusign" description = "A fully generated & opinionated API client for the DocuSign API." -version = "0.4.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/docusign/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/docusign" readme = "README.md" diff --git a/docusign/README.md b/docusign/README.md index 251a1657..5ab6e0af 100644 --- a/docusign/README.md +++ b/docusign/README.md @@ -31,7 +31,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -docusign = "0.4.0" +docusign = "0.7.0-rc.1" ``` ## Basic example diff --git a/docusign/src/lib.rs b/docusign/src/lib.rs index 708f780c..2071a084 100644 --- a/docusign/src/lib.rs +++ b/docusign/src/lib.rs @@ -29,7 +29,7 @@ //! //! ```toml //! [dependencies] -//! docusign = "0.4.0" +//! docusign = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/giphy/Cargo.toml b/giphy/Cargo.toml index deadd2ae..a56b34f4 100644 --- a/giphy/Cargo.toml +++ b/giphy/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "giphy-api" description = "A fully generated & opinionated API client for the Giphy API." -version = "0.4.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/giphy-api/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/giphy" readme = "README.md" diff --git a/giphy/README.md b/giphy/README.md index 20c7703c..5f391d70 100644 --- a/giphy/README.md +++ b/giphy/README.md @@ -31,7 +31,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -giphy-api = "0.4.0" +giphy-api = "0.7.0-rc.1" ``` ## Basic example diff --git a/giphy/src/lib.rs b/giphy/src/lib.rs index 171f35be..7310c599 100644 --- a/giphy/src/lib.rs +++ b/giphy/src/lib.rs @@ -29,7 +29,7 @@ //! //! ```toml //! [dependencies] -//! giphy-api = "0.4.0" +//! giphy-api = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/github/Cargo.toml b/github/Cargo.toml index 79dddd81..6759951a 100644 --- a/github/Cargo.toml +++ b/github/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "octorust" description = "A fully generated & opinionated API client for the GitHub API." -version = "0.3.2" +version = "0.7.0-rc.1" documentation = "https://docs.rs/octorust/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/github" readme = "README.md" diff --git a/github/README.md b/github/README.md index cfe5ab7d..061dc2a7 100644 --- a/github/README.md +++ b/github/README.md @@ -37,7 +37,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -octorust = "0.3.2" +octorust = "0.7.0-rc.1" ``` ## Basic example @@ -57,7 +57,7 @@ let github = Client::new( ``` If you are a GitHub enterprise customer, you will want to create a client with the -[Client#host_override](https://docs.rs/octorust/0.3.2/octorust/struct.Client.html#method.host_override) method. +[Client#host_override](https://docs.rs/octorust/0.7.0-rc.1/octorust/struct.Client.html#method.host_override) method. ## Feature flags @@ -71,7 +71,7 @@ To enable this, add the following to your `Cargo.toml` file: ```toml [dependencies] -octorust = { version = "0.3.2", features = ["httpcache"] } +octorust = { version = "0.7.0-rc.1", features = ["httpcache"] } ``` Then use the `Client::custom` constructor to provide a cache implementation. diff --git a/github/src/lib.rs b/github/src/lib.rs index 8944a8a8..a4d577cc 100644 --- a/github/src/lib.rs +++ b/github/src/lib.rs @@ -35,7 +35,7 @@ //! //! ```toml //! [dependencies] -//! octorust = "0.3.2" +//! octorust = "0.7.0-rc.1" //! ``` //! //! ## Basic example @@ -55,7 +55,7 @@ //! ``` //! //! If you are a GitHub enterprise customer, you will want to create a client with the -//! [Client#host_override](https://docs.rs/octorust/0.3.2/octorust/struct.Client.html#method.host_override) method. +//! [Client#host_override](https://docs.rs/octorust/0.7.0-rc.1/octorust/struct.Client.html#method.host_override) method. //! //! ## Feature flags //! @@ -69,7 +69,7 @@ //! //! ```toml //! [dependencies] -//! octorust = { version = "0.3.2", features = ["httpcache"] } +//! octorust = { version = "0.7.0-rc.1", features = ["httpcache"] } //! ``` //! //! Then use the `Client::custom` constructor to provide a cache implementation. diff --git a/google/admin/Cargo.toml b/google/admin/Cargo.toml index d157fc35..8068858a 100644 --- a/google/admin/Cargo.toml +++ b/google/admin/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "gsuite-api" description = "A fully generated & opinionated API client for the Google Admin API." -version = "0.6.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/gsuite-api/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/google/admin" readme = "README.md" diff --git a/google/admin/README.md b/google/admin/README.md index 28138029..6dbf61db 100644 --- a/google/admin/README.md +++ b/google/admin/README.md @@ -37,7 +37,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -gsuite-api = "0.6.0" +gsuite-api = "0.7.0-rc.1" ``` ## Basic example diff --git a/google/admin/src/lib.rs b/google/admin/src/lib.rs index 4dd54173..a0379879 100644 --- a/google/admin/src/lib.rs +++ b/google/admin/src/lib.rs @@ -35,7 +35,7 @@ //! //! ```toml //! [dependencies] -//! gsuite-api = "0.6.0" +//! gsuite-api = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/google/calendar/Cargo.toml b/google/calendar/Cargo.toml index 3ea5fb8f..6881b5d5 100644 --- a/google/calendar/Cargo.toml +++ b/google/calendar/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "google-calendar" description = "A fully generated & opinionated API client for the Google Calendar API." -version = "0.5.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/google-calendar/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/google/calendar" readme = "README.md" diff --git a/google/calendar/README.md b/google/calendar/README.md index 883a5879..d8e0bca5 100644 --- a/google/calendar/README.md +++ b/google/calendar/README.md @@ -37,7 +37,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -google-calendar = "0.5.0" +google-calendar = "0.7.0-rc.1" ``` ## Basic example diff --git a/google/calendar/src/lib.rs b/google/calendar/src/lib.rs index 45883733..1843218d 100644 --- a/google/calendar/src/lib.rs +++ b/google/calendar/src/lib.rs @@ -35,7 +35,7 @@ //! //! ```toml //! [dependencies] -//! google-calendar = "0.5.0" +//! google-calendar = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/google/cloud-resource-manager/Cargo.toml b/google/cloud-resource-manager/Cargo.toml index 848faa42..370fcb17 100644 --- a/google/cloud-resource-manager/Cargo.toml +++ b/google/cloud-resource-manager/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "google-cloud-resource-manager" description = "A fully generated & opinionated API client for the Google Cloud Resource Manager API." -version = "0.4.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/google-cloud-resource-manager/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/google/cloud-resource-manager" readme = "README.md" diff --git a/google/cloud-resource-manager/README.md b/google/cloud-resource-manager/README.md index e8bf1ea4..79a6ff38 100644 --- a/google/cloud-resource-manager/README.md +++ b/google/cloud-resource-manager/README.md @@ -37,7 +37,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -google-cloud-resource-manager = "0.4.0" +google-cloud-resource-manager = "0.7.0-rc.1" ``` ## Basic example diff --git a/google/cloud-resource-manager/src/lib.rs b/google/cloud-resource-manager/src/lib.rs index ccb6974d..a654f993 100644 --- a/google/cloud-resource-manager/src/lib.rs +++ b/google/cloud-resource-manager/src/lib.rs @@ -35,7 +35,7 @@ //! //! ```toml //! [dependencies] -//! google-cloud-resource-manager = "0.4.0" +//! google-cloud-resource-manager = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/google/drive/Cargo.toml b/google/drive/Cargo.toml index 551c7497..4d686eed 100644 --- a/google/drive/Cargo.toml +++ b/google/drive/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "google-drive" description = "A fully generated & opinionated API client for the Google Drive API." -version = "0.6.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/google-drive/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/google/drive" readme = "README.md" diff --git a/google/drive/README.md b/google/drive/README.md index 85945081..7f6d27bd 100644 --- a/google/drive/README.md +++ b/google/drive/README.md @@ -37,7 +37,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -google-drive = "0.6.0" +google-drive = "0.7.0-rc.1" ``` ## Basic example diff --git a/google/drive/src/lib.rs b/google/drive/src/lib.rs index a90ef70c..0240a3dd 100644 --- a/google/drive/src/lib.rs +++ b/google/drive/src/lib.rs @@ -35,7 +35,7 @@ //! //! ```toml //! [dependencies] -//! google-drive = "0.6.0" +//! google-drive = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/google/drive/src/traits.rs b/google/drive/src/traits.rs index 3d53d99d..4db9f0a7 100644 --- a/google/drive/src/traits.rs +++ b/google/drive/src/traits.rs @@ -347,7 +347,7 @@ impl FileOps for crate::files::Files { return Ok(Response::new( resp.status, resp.headers, - resp.body.into_iter().nth(0).unwrap(), + resp.body.into_iter().next().unwrap(), )); } diff --git a/google/groups-settings/Cargo.toml b/google/groups-settings/Cargo.toml index 7620fa63..af1c6416 100644 --- a/google/groups-settings/Cargo.toml +++ b/google/groups-settings/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "google-groups-settings" description = "A fully generated & opinionated API client for the Google Groups Settings API." -version = "0.5.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/google-groups-settings/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/google/groups-settings" readme = "README.md" diff --git a/google/groups-settings/README.md b/google/groups-settings/README.md index eeab49b7..92fbb64e 100644 --- a/google/groups-settings/README.md +++ b/google/groups-settings/README.md @@ -37,7 +37,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -google-groups-settings = "0.5.0" +google-groups-settings = "0.7.0-rc.1" ``` ## Basic example diff --git a/google/groups-settings/src/lib.rs b/google/groups-settings/src/lib.rs index f88826e8..c7d7ba28 100644 --- a/google/groups-settings/src/lib.rs +++ b/google/groups-settings/src/lib.rs @@ -35,7 +35,7 @@ //! //! ```toml //! [dependencies] -//! google-groups-settings = "0.5.0" +//! google-groups-settings = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/google/sheets/Cargo.toml b/google/sheets/Cargo.toml index a3c0243e..dfe00b44 100644 --- a/google/sheets/Cargo.toml +++ b/google/sheets/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sheets" description = "A fully generated & opinionated API client for the Google Sheets API." -version = "0.6.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/sheets/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/google/sheets" readme = "README.md" diff --git a/google/sheets/README.md b/google/sheets/README.md index 2c6ac7b3..e7b5c1fd 100644 --- a/google/sheets/README.md +++ b/google/sheets/README.md @@ -37,7 +37,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -sheets = "0.6.0" +sheets = "0.7.0-rc.1" ``` ## Basic example diff --git a/google/sheets/src/lib.rs b/google/sheets/src/lib.rs index 07055ec0..af3f2f7e 100644 --- a/google/sheets/src/lib.rs +++ b/google/sheets/src/lib.rs @@ -35,7 +35,7 @@ //! //! ```toml //! [dependencies] -//! sheets = "0.6.0" +//! sheets = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/gusto/Cargo.toml b/gusto/Cargo.toml index 1bf64008..945ff311 100644 --- a/gusto/Cargo.toml +++ b/gusto/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "gusto-api" description = "A fully generated & opinionated API client for the Gusto API." -version = "0.4.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/gusto-api/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/gusto" readme = "README.md" diff --git a/gusto/README.md b/gusto/README.md index cd865f7c..78b932d1 100644 --- a/gusto/README.md +++ b/gusto/README.md @@ -31,7 +31,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -gusto-api = "0.4.0" +gusto-api = "0.7.0-rc.1" ``` ## Basic example diff --git a/gusto/src/lib.rs b/gusto/src/lib.rs index 88c416fd..64f434f4 100644 --- a/gusto/src/lib.rs +++ b/gusto/src/lib.rs @@ -29,7 +29,7 @@ //! //! ```toml //! [dependencies] -//! gusto-api = "0.4.0" +//! gusto-api = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/mailchimp/Cargo.toml b/mailchimp/Cargo.toml index 3df41a2b..d444e0f4 100644 --- a/mailchimp/Cargo.toml +++ b/mailchimp/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "mailchimp-api" description = "A fully generated & opinionated API client for the MailChimp API." -version = "0.4.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/mailchimp-api/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/mailchimp" readme = "README.md" diff --git a/mailchimp/README.md b/mailchimp/README.md index fb1119f7..c8921341 100644 --- a/mailchimp/README.md +++ b/mailchimp/README.md @@ -31,7 +31,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -mailchimp-api = "0.4.0" +mailchimp-api = "0.7.0-rc.1" ``` ## Basic example diff --git a/mailchimp/src/lib.rs b/mailchimp/src/lib.rs index a1dfc912..05706b46 100644 --- a/mailchimp/src/lib.rs +++ b/mailchimp/src/lib.rs @@ -29,7 +29,7 @@ //! //! ```toml //! [dependencies] -//! mailchimp-api = "0.4.0" +//! mailchimp-api = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/okta/Cargo.toml b/okta/Cargo.toml index be8e96b9..b9efe066 100644 --- a/okta/Cargo.toml +++ b/okta/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "okta" description = "A fully generated & opinionated API client for the Okta API." -version = "0.4.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/okta/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/okta" readme = "README.md" diff --git a/okta/README.md b/okta/README.md index 74807035..ba56c17f 100644 --- a/okta/README.md +++ b/okta/README.md @@ -37,7 +37,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -okta = "0.4.0" +okta = "0.7.0-rc.1" ``` ## Basic example diff --git a/okta/src/lib.rs b/okta/src/lib.rs index 06d55308..4c8dd3eb 100644 --- a/okta/src/lib.rs +++ b/okta/src/lib.rs @@ -35,7 +35,7 @@ //! //! ```toml //! [dependencies] -//! okta = "0.4.0" +//! okta = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/ramp/Cargo.toml b/ramp/Cargo.toml index 68da31f3..4c9ca908 100644 --- a/ramp/Cargo.toml +++ b/ramp/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ramp-api" description = "A fully generated & opinionated API client for the Ramp API." -version = "0.4.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/ramp-api/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/ramp" readme = "README.md" diff --git a/ramp/README.md b/ramp/README.md index 2872beba..17a796e2 100644 --- a/ramp/README.md +++ b/ramp/README.md @@ -27,7 +27,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -ramp-api = "0.4.0" +ramp-api = "0.7.0-rc.1" ``` ## Basic example diff --git a/ramp/src/lib.rs b/ramp/src/lib.rs index 5cab8006..ea004451 100644 --- a/ramp/src/lib.rs +++ b/ramp/src/lib.rs @@ -25,7 +25,7 @@ //! //! ```toml //! [dependencies] -//! ramp-api = "0.4.0" +//! ramp-api = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/rev.ai/Cargo.toml b/rev.ai/Cargo.toml index 21f758d1..b0893dde 100644 --- a/rev.ai/Cargo.toml +++ b/rev.ai/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "revai" description = "A fully generated & opinionated API client for the Rev.ai API." -version = "0.5.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/revai/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/rev.ai" readme = "README.md" diff --git a/rev.ai/README.md b/rev.ai/README.md index 0ae82a76..6718f7de 100644 --- a/rev.ai/README.md +++ b/rev.ai/README.md @@ -225,7 +225,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -revai = "0.5.0" +revai = "0.7.0-rc.1" ``` ## Basic example diff --git a/rev.ai/src/lib.rs b/rev.ai/src/lib.rs index 37fc0393..5c0b3eef 100644 --- a/rev.ai/src/lib.rs +++ b/rev.ai/src/lib.rs @@ -223,7 +223,7 @@ //! //! ```toml //! [dependencies] -//! revai = "0.5.0" +//! revai = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/sendgrid/Cargo.toml b/sendgrid/Cargo.toml index 00ef6a26..cc7a2cb6 100644 --- a/sendgrid/Cargo.toml +++ b/sendgrid/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sendgrid-api" description = "A fully generated & opinionated API client for the SendGrid API." -version = "0.4.1" +version = "0.7.0-rc.1" documentation = "https://docs.rs/sendgrid-api/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/sendgrid" readme = "README.md" diff --git a/sendgrid/README.md b/sendgrid/README.md index 7b6b44f6..f07460a8 100644 --- a/sendgrid/README.md +++ b/sendgrid/README.md @@ -29,7 +29,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -sendgrid-api = "0.4.1" +sendgrid-api = "0.7.0-rc.1" ``` ## Basic example diff --git a/sendgrid/src/lib.rs b/sendgrid/src/lib.rs index 910ba0ce..b1225652 100644 --- a/sendgrid/src/lib.rs +++ b/sendgrid/src/lib.rs @@ -27,7 +27,7 @@ //! //! ```toml //! [dependencies] -//! sendgrid-api = "0.4.1" +//! sendgrid-api = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/shipbob/Cargo.toml b/shipbob/Cargo.toml index 0acd8322..1fef02ad 100644 --- a/shipbob/Cargo.toml +++ b/shipbob/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "shipbob" description = "A fully generated & opinionated API client for the ShipBob API." -version = "0.3.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/shipbob/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/shipbob" readme = "README.md" diff --git a/shipbob/README.md b/shipbob/README.md index 930f81e7..2c4f6ee5 100644 --- a/shipbob/README.md +++ b/shipbob/README.md @@ -29,7 +29,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -shipbob = "0.3.0" +shipbob = "0.7.0-rc.1" ``` ## Basic example diff --git a/shipbob/src/lib.rs b/shipbob/src/lib.rs index a8ae3040..78affeae 100644 --- a/shipbob/src/lib.rs +++ b/shipbob/src/lib.rs @@ -27,7 +27,7 @@ //! //! ```toml //! [dependencies] -//! shipbob = "0.3.0" +//! shipbob = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/shopify/Cargo.toml b/shopify/Cargo.toml index 43d238b3..c325bea7 100644 --- a/shopify/Cargo.toml +++ b/shopify/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "shopify" description = "A fully generated & opinionated API client for the Shopify API." -version = "0.3.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/shopify/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/shopify" readme = "README.md" diff --git a/shopify/README.md b/shopify/README.md index 560e58ee..dedca099 100644 --- a/shopify/README.md +++ b/shopify/README.md @@ -25,7 +25,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -shopify = "0.3.0" +shopify = "0.7.0-rc.1" ``` ## Basic example diff --git a/shopify/src/lib.rs b/shopify/src/lib.rs index 08148558..73775da5 100644 --- a/shopify/src/lib.rs +++ b/shopify/src/lib.rs @@ -23,7 +23,7 @@ //! //! ```toml //! [dependencies] -//! shopify = "0.3.0" +//! shopify = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/slack/Cargo.toml b/slack/Cargo.toml index 54b3db28..946a6fe4 100644 --- a/slack/Cargo.toml +++ b/slack/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "slack-chat-api" description = "A fully generated & opinionated API client for the Slack API." -version = "0.4.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/slack-chat-api/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/slack" readme = "README.md" diff --git a/slack/README.md b/slack/README.md index 69c199b4..ac49c550 100644 --- a/slack/README.md +++ b/slack/README.md @@ -31,7 +31,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -slack-chat-api = "0.4.0" +slack-chat-api = "0.7.0-rc.1" ``` ## Basic example diff --git a/slack/src/lib.rs b/slack/src/lib.rs index 64986071..d5932f5f 100644 --- a/slack/src/lib.rs +++ b/slack/src/lib.rs @@ -29,7 +29,7 @@ //! //! ```toml //! [dependencies] -//! slack-chat-api = "0.4.0" +//! slack-chat-api = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/stripe/Cargo.toml b/stripe/Cargo.toml index 5dea62ff..c1380084 100644 --- a/stripe/Cargo.toml +++ b/stripe/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "dolladollabills" description = "A fully generated & opinionated API client for the Stripe API." -version = "0.4.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/dolladollabills/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/stripe" readme = "README.md" diff --git a/stripe/README.md b/stripe/README.md index 1ae621b1..3379551f 100644 --- a/stripe/README.md +++ b/stripe/README.md @@ -31,7 +31,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -dolladollabills = "0.4.0" +dolladollabills = "0.7.0-rc.1" ``` ## Basic example diff --git a/stripe/src/lib.rs b/stripe/src/lib.rs index 5f522ceb..b67057e9 100644 --- a/stripe/src/lib.rs +++ b/stripe/src/lib.rs @@ -29,7 +29,7 @@ //! //! ```toml //! [dependencies] -//! dolladollabills = "0.4.0" +//! dolladollabills = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/tripactions/Cargo.toml b/tripactions/Cargo.toml index bf4e7544..075bac54 100644 --- a/tripactions/Cargo.toml +++ b/tripactions/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tripactions" description = "A fully generated & opinionated API client for the TripActions API." -version = "0.4.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/tripactions/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/tripactions" readme = "README.md" diff --git a/tripactions/README.md b/tripactions/README.md index 2762392c..7e6f4ec3 100644 --- a/tripactions/README.md +++ b/tripactions/README.md @@ -27,7 +27,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -tripactions = "0.4.0" +tripactions = "0.7.0-rc.1" ``` ## Basic example diff --git a/tripactions/src/lib.rs b/tripactions/src/lib.rs index 9035c764..76a95693 100644 --- a/tripactions/src/lib.rs +++ b/tripactions/src/lib.rs @@ -25,7 +25,7 @@ //! //! ```toml //! [dependencies] -//! tripactions = "0.4.0" +//! tripactions = "0.7.0-rc.1" //! ``` //! //! ## Basic example diff --git a/zoom/Cargo.toml b/zoom/Cargo.toml index 36379b00..bb83f976 100644 --- a/zoom/Cargo.toml +++ b/zoom/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "zoom-api" description = "A fully generated & opinionated API client for the Zoom API." -version = "0.4.0" +version = "0.7.0-rc.1" documentation = "https://docs.rs/zoom-api/" repository = "https://github.com/oxidecomputer/third-party-api-clients/tree/main/zoom" readme = "README.md" diff --git a/zoom/README.md b/zoom/README.md index 5aeadf67..04a35a57 100644 --- a/zoom/README.md +++ b/zoom/README.md @@ -40,7 +40,7 @@ To install the library, add the following to your `Cargo.toml` file. ```toml [dependencies] -zoom-api = "0.4.0" +zoom-api = "0.7.0-rc.1" ``` ## Basic example diff --git a/zoom/src/lib.rs b/zoom/src/lib.rs index bd43196c..30bace1a 100644 --- a/zoom/src/lib.rs +++ b/zoom/src/lib.rs @@ -38,7 +38,7 @@ //! //! ```toml //! [dependencies] -//! zoom-api = "0.4.0" +//! zoom-api = "0.7.0-rc.1" //! ``` //! //! ## Basic example From e9c257f099ea98c712e1281d7b4a125fa82218d0 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 1 Jun 2023 09:51:08 -0500 Subject: [PATCH 30/40] Add changelog --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..7715900d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +## 0.7.0-rc.1 + +This update refactors all of the clients and changes the way responses are handled. Previously methods that make calls to a third party service would return an `anyhow::Result` over some structured interpretation of the response body (i.e. a deserialized struct, a unit type, or a raw string). Methods now return a `Result, ClientError>` where a `Response` contains the body type that was previously returned along with the status code and headers that were sent from the third party service. `ClientError` now provides a more structure error type than the previous `anyhow` error. + +### Breaking Changes + +* Methods now return `Result, ClientError>` instead of `anyhow::Result`. The body can be accessed via `response.body`. +* Structured errors are now returned instead of `anyhow::Error`. +* Redirects are no longer followed by default. Previously if a 3xx response code was returned by a service, the inner client would follow it. This broke the ability for a service to specify a meaningful 3xx response. Methods that receive 3xx responses will now return them immediately and not attempt to resolve them. \ No newline at end of file From 30ba5f248b6faac3189482fa6bd5dd576f58a26e Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 1 Jun 2023 11:24:31 -0500 Subject: [PATCH 31/40] Add headers to errors --- docusign/src/lib.rs | 11 +++++++++++ generator/src/client.rs | 24 ++++++++++++------------ generator/src/main.rs | 1 + giphy/src/lib.rs | 11 +++++++++++ github/src/lib.rs | 3 +++ google/admin/src/lib.rs | 11 +++++++++++ google/calendar/src/lib.rs | 11 +++++++++++ google/cloud-resource-manager/src/lib.rs | 11 +++++++++++ google/drive/src/lib.rs | 11 +++++++++++ google/drive/src/traits.rs | 1 + google/groups-settings/src/lib.rs | 11 +++++++++++ google/sheets/src/lib.rs | 11 +++++++++++ gusto/src/lib.rs | 11 +++++++++++ mailchimp/src/lib.rs | 11 +++++++++++ okta/src/lib.rs | 11 +++++++++++ ramp/src/lib.rs | 11 +++++++++++ rev.ai/src/lib.rs | 11 +++++++++++ sendgrid/src/lib.rs | 11 +++++++++++ sendgrid/src/traits.rs | 1 + shipbob/src/lib.rs | 11 +++++++++++ shopify/src/lib.rs | 11 +++++++++++ slack/src/lib.rs | 11 +++++++++++ stripe/src/lib.rs | 11 +++++++++++ tripactions/src/lib.rs | 11 +++++++++++ zoom/src/lib.rs | 11 +++++++++++ 25 files changed, 238 insertions(+), 12 deletions(-) diff --git a/docusign/src/lib.rs b/docusign/src/lib.rs index 2071a084..e608a198 100644 --- a/docusign/src/lib.rs +++ b/docusign/src/lib.rs @@ -2231,6 +2231,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -2731,11 +2732,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -2782,11 +2785,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -2847,11 +2852,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -2912,11 +2919,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -2994,11 +3003,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/generator/src/client.rs b/generator/src/client.rs index d50a4962..99f45bbc 100644 --- a/generator/src/client.rs +++ b/generator/src/client.rs @@ -340,9 +340,9 @@ impl Client { }, _ => { if response_body.is_empty() { - ClientError::HttpError{status: status, error: "empty response".into()} + ClientError::HttpError{status, headers, error: "empty response".into()} } else { - ClientError::HttpError{status: status, error: String::from_utf8_lossy(&response_body).into()} + ClientError::HttpError{status, headers, error: String::from_utf8_lossy(&response_body).into()} } } }; @@ -1098,9 +1098,9 @@ async fn request( Ok(crate::Response::new(status, headers, parsed_response)) }} else {{ let error = if response_body.is_empty() {{ - ClientError::HttpError{{status: status, error: "empty response".into()}} + ClientError::HttpError{{status, headers, error: "empty response".into()}} }} else {{ - ClientError::HttpError{{status: status, error: String::from_utf8_lossy(&response_body).into()}} + ClientError::HttpError{{status, headers, error: String::from_utf8_lossy(&response_body).into()}} }}; Err(error) @@ -1141,9 +1141,9 @@ where Ok((link, crate::Response::new(status, headers, parsed_response))) }} else {{ let error = if response_body.is_empty() {{ - ClientError::HttpError{{status: status, error: "empty response".into()}} + ClientError::HttpError{{status, headers, error: "empty response".into()}} }} else {{ - ClientError::HttpError{{status: status, error: String::from_utf8_lossy(&response_body).into()}} + ClientError::HttpError{{status, headers, error: String::from_utf8_lossy(&response_body).into()}} }}; Err(error) }} @@ -1198,9 +1198,9 @@ async fn post_form( Ok(crate::Response::new(status, headers, parsed_response)) }} else {{ let error = if response_body.is_empty() {{ - ClientError::HttpError{{status: status, error: "empty response".into()}} + ClientError::HttpError{{status, headers, error: "empty response".into()}} }} else {{ - ClientError::HttpError{{status: status, error: String::from_utf8_lossy(&response_body).into()}} + ClientError::HttpError{{status, headers, error: String::from_utf8_lossy(&response_body).into()}} }}; Err(error) @@ -1255,9 +1255,9 @@ async fn request_with_accept_mime( Ok(crate::Response::new(status, headers, parsed_response)) }} else {{ let error = if response_body.is_empty() {{ - ClientError::HttpError{{status: status, error: "empty response".into()}} + ClientError::HttpError{{status, headers, error: "empty response".into()}} }} else {{ - ClientError::HttpError{{status: status, error: String::from_utf8_lossy(&response_body).into()}} + ClientError::HttpError{{status, headers, error: String::from_utf8_lossy(&response_body).into()}} }}; Err(error) @@ -1328,9 +1328,9 @@ async fn request_with_mime( Ok(crate::Response::new(status, headers, parsed_response)) }} else {{ let error = if response_body.is_empty() {{ - ClientError::HttpError{{status: status, error: "empty response".into()}} + ClientError::HttpError{{status, headers, error: "empty response".into()}} }} else {{ - ClientError::HttpError{{status: status, error: String::from_utf8_lossy(&response_body).into()}} + ClientError::HttpError{{status, headers, error: String::from_utf8_lossy(&response_body).into()}} }}; Err(error) diff --git a/generator/src/main.rs b/generator/src/main.rs index 6720d4cb..a20bdc6e 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -2465,6 +2465,7 @@ pub enum ClientError {"#); #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } diff --git a/giphy/src/lib.rs b/giphy/src/lib.rs index 7310c599..a540a90c 100644 --- a/giphy/src/lib.rs +++ b/giphy/src/lib.rs @@ -118,6 +118,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -321,11 +322,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -372,11 +375,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -437,11 +442,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -502,11 +509,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -584,11 +593,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/github/src/lib.rs b/github/src/lib.rs index a4d577cc..0eeb4673 100644 --- a/github/src/lib.rs +++ b/github/src/lib.rs @@ -298,6 +298,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -705,11 +706,13 @@ impl Client { if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } } diff --git a/google/admin/src/lib.rs b/google/admin/src/lib.rs index a0379879..12a344b4 100644 --- a/google/admin/src/lib.rs +++ b/google/admin/src/lib.rs @@ -183,6 +183,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -718,11 +719,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -769,11 +772,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -834,11 +839,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -899,11 +906,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -981,11 +990,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/google/calendar/src/lib.rs b/google/calendar/src/lib.rs index 1843218d..0eb38af1 100644 --- a/google/calendar/src/lib.rs +++ b/google/calendar/src/lib.rs @@ -171,6 +171,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -706,11 +707,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -757,11 +760,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -822,11 +827,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -887,11 +894,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -969,11 +978,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/google/cloud-resource-manager/src/lib.rs b/google/cloud-resource-manager/src/lib.rs index a654f993..8147f518 100644 --- a/google/cloud-resource-manager/src/lib.rs +++ b/google/cloud-resource-manager/src/lib.rs @@ -165,6 +165,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -700,11 +701,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -751,11 +754,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -816,11 +821,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -881,11 +888,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -963,11 +972,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/google/drive/src/lib.rs b/google/drive/src/lib.rs index 0240a3dd..6a245ce3 100644 --- a/google/drive/src/lib.rs +++ b/google/drive/src/lib.rs @@ -181,6 +181,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -716,11 +717,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -767,11 +770,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -832,11 +837,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -897,11 +904,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -979,11 +988,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/google/drive/src/traits.rs b/google/drive/src/traits.rs index 4db9f0a7..3034dd7b 100644 --- a/google/drive/src/traits.rs +++ b/google/drive/src/traits.rs @@ -269,6 +269,7 @@ impl FileOps for crate::files::Files { .get("Location") .ok_or(ClientError::HttpError { status: resp.status(), + headers: resp.headers().clone(), error: "Missing Location header".to_string(), })? .to_str()?; diff --git a/google/groups-settings/src/lib.rs b/google/groups-settings/src/lib.rs index c7d7ba28..09ad8336 100644 --- a/google/groups-settings/src/lib.rs +++ b/google/groups-settings/src/lib.rs @@ -164,6 +164,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -699,11 +700,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -750,11 +753,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -815,11 +820,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -880,11 +887,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -962,11 +971,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/google/sheets/src/lib.rs b/google/sheets/src/lib.rs index af3f2f7e..244ad532 100644 --- a/google/sheets/src/lib.rs +++ b/google/sheets/src/lib.rs @@ -165,6 +165,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -700,11 +701,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -751,11 +754,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -816,11 +821,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -881,11 +888,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -963,11 +972,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/gusto/src/lib.rs b/gusto/src/lib.rs index 64f434f4..246714dc 100644 --- a/gusto/src/lib.rs +++ b/gusto/src/lib.rs @@ -178,6 +178,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -723,11 +724,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -774,11 +777,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -839,11 +844,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -904,11 +911,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -986,11 +995,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/mailchimp/src/lib.rs b/mailchimp/src/lib.rs index 05706b46..3e6e93b2 100644 --- a/mailchimp/src/lib.rs +++ b/mailchimp/src/lib.rs @@ -181,6 +181,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -681,11 +682,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -732,11 +735,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -797,11 +802,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -862,11 +869,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -944,11 +953,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/okta/src/lib.rs b/okta/src/lib.rs index 4c8dd3eb..b5442ea2 100644 --- a/okta/src/lib.rs +++ b/okta/src/lib.rs @@ -143,6 +143,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -346,11 +347,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -397,11 +400,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -462,11 +467,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -527,11 +534,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -609,11 +618,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/ramp/src/lib.rs b/ramp/src/lib.rs index ea004451..680c3db2 100644 --- a/ramp/src/lib.rs +++ b/ramp/src/lib.rs @@ -164,6 +164,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -662,11 +663,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -713,11 +716,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -778,11 +783,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -843,11 +850,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -925,11 +934,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/rev.ai/src/lib.rs b/rev.ai/src/lib.rs index 5c0b3eef..f4112dcb 100644 --- a/rev.ai/src/lib.rs +++ b/rev.ai/src/lib.rs @@ -315,6 +315,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -518,11 +519,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -569,11 +572,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -634,11 +639,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -699,11 +706,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -781,11 +790,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/sendgrid/src/lib.rs b/sendgrid/src/lib.rs index b1225652..18befd8d 100644 --- a/sendgrid/src/lib.rs +++ b/sendgrid/src/lib.rs @@ -173,6 +173,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -376,11 +377,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -427,11 +430,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -492,11 +497,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -557,11 +564,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -639,11 +648,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/sendgrid/src/traits.rs b/sendgrid/src/traits.rs index 16975a9e..e6a570f2 100644 --- a/sendgrid/src/traits.rs +++ b/sendgrid/src/traits.rs @@ -89,6 +89,7 @@ impl MailOps for crate::mail_send::MailSend { )), s => Err(ClientError::HttpError { status: s, + headers: resp.headers().clone(), error: "Posting to /mail/send".to_string(), }), } diff --git a/shipbob/src/lib.rs b/shipbob/src/lib.rs index 78affeae..ee22ab8f 100644 --- a/shipbob/src/lib.rs +++ b/shipbob/src/lib.rs @@ -200,6 +200,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -403,11 +404,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -454,11 +457,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -519,11 +524,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -584,11 +591,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -666,11 +675,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/shopify/src/lib.rs b/shopify/src/lib.rs index 73775da5..339efe4b 100644 --- a/shopify/src/lib.rs +++ b/shopify/src/lib.rs @@ -169,6 +169,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -659,11 +660,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -710,11 +713,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -775,11 +780,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -840,11 +847,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -922,11 +931,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/slack/src/lib.rs b/slack/src/lib.rs index d5932f5f..ec36c244 100644 --- a/slack/src/lib.rs +++ b/slack/src/lib.rs @@ -212,6 +212,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -710,11 +711,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -761,11 +764,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -826,11 +831,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -891,11 +898,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -973,11 +982,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/stripe/src/lib.rs b/stripe/src/lib.rs index b67057e9..e30df16d 100644 --- a/stripe/src/lib.rs +++ b/stripe/src/lib.rs @@ -177,6 +177,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -380,11 +381,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -431,11 +434,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -496,11 +501,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -561,11 +568,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -643,11 +652,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/tripactions/src/lib.rs b/tripactions/src/lib.rs index 76a95693..b21cbd48 100644 --- a/tripactions/src/lib.rs +++ b/tripactions/src/lib.rs @@ -133,6 +133,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -408,11 +409,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -459,11 +462,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -524,11 +529,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -589,11 +596,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -671,11 +680,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; diff --git a/zoom/src/lib.rs b/zoom/src/lib.rs index 30bace1a..a2f22a51 100644 --- a/zoom/src/lib.rs +++ b/zoom/src/lib.rs @@ -204,6 +204,7 @@ pub enum ClientError { #[error("HTTP Error. Code: {status}, message: {error}")] HttpError { status: http::StatusCode, + headers: reqwest::header::HeaderMap, error: String, }, } @@ -693,11 +694,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -744,11 +747,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -809,11 +814,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -874,11 +881,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; @@ -956,11 +965,13 @@ impl Client { let error = if response_body.is_empty() { ClientError::HttpError { status, + headers, error: "empty response".into(), } } else { ClientError::HttpError { status, + headers, error: String::from_utf8_lossy(&response_body).into(), } }; From f57a7f4fc6afcc3ea33884e0f77a22d7c5cc360b Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Mon, 5 Jun 2023 08:29:54 -0500 Subject: [PATCH 32/40] Rust indicators --- docusign/README.md | 6 +++--- docusign/src/lib.rs | 6 +++--- generator/src/template.rs | 16 ++++++++-------- giphy/README.md | 4 ++-- giphy/src/lib.rs | 4 ++-- google/admin/README.md | 6 +++--- google/admin/src/lib.rs | 6 +++--- google/calendar/README.md | 6 +++--- google/calendar/src/lib.rs | 6 +++--- google/cloud-resource-manager/README.md | 6 +++--- google/cloud-resource-manager/src/lib.rs | 6 +++--- google/drive/README.md | 6 +++--- google/drive/src/lib.rs | 6 +++--- google/groups-settings/README.md | 6 +++--- google/groups-settings/src/lib.rs | 6 +++--- google/sheets/README.md | 6 +++--- google/sheets/src/lib.rs | 6 +++--- gusto/README.md | 6 +++--- gusto/src/lib.rs | 6 +++--- mailchimp/README.md | 6 +++--- mailchimp/src/lib.rs | 6 +++--- okta/README.md | 4 ++-- okta/src/lib.rs | 4 ++-- ramp/README.md | 6 +++--- ramp/src/lib.rs | 6 +++--- rev.ai/README.md | 4 ++-- rev.ai/src/lib.rs | 4 ++-- sendgrid/README.md | 4 ++-- sendgrid/src/lib.rs | 4 ++-- shipbob/README.md | 4 ++-- shipbob/src/lib.rs | 4 ++-- shopify/README.md | 6 +++--- shopify/src/lib.rs | 6 +++--- slack/README.md | 6 +++--- slack/src/lib.rs | 6 +++--- stripe/README.md | 4 ++-- stripe/src/lib.rs | 4 ++-- tripactions/README.md | 6 +++--- tripactions/src/lib.rs | 6 +++--- zoom/README.md | 6 +++--- zoom/src/lib.rs | 6 +++--- 41 files changed, 116 insertions(+), 116 deletions(-) diff --git a/docusign/README.md b/docusign/README.md index 5ab6e0af..affa7c26 100644 --- a/docusign/README.md +++ b/docusign/README.md @@ -39,7 +39,7 @@ docusign = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use docusign::Client; let docusign = Client::new( @@ -60,7 +60,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use docusign::Client; let docusign = Client::new_from_env( @@ -74,7 +74,7 @@ the initial state of the client, you will not know these values. To start off a fresh client and get a `token` and `refresh_token`, use the following. -``` +```rust use docusign::Client; async fn do_call() { diff --git a/docusign/src/lib.rs b/docusign/src/lib.rs index e608a198..2d966757 100644 --- a/docusign/src/lib.rs +++ b/docusign/src/lib.rs @@ -37,7 +37,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use docusign::Client; //! //! let docusign = Client::new( @@ -58,7 +58,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use docusign::Client; //! //! let docusign = Client::new_from_env( @@ -72,7 +72,7 @@ //! //! To start off a fresh client and get a `token` and `refresh_token`, use the following. //! -//! ``` +//! ```rust //! use docusign::Client; //! //! async fn do_call() { diff --git a/generator/src/template.rs b/generator/src/template.rs index bad1455e..08b73b50 100644 --- a/generator/src/template.rs +++ b/generator/src/template.rs @@ -641,7 +641,7 @@ pub fn generate_docs_generic_token( //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use {}::Client; //! //! let {} = Client::new( @@ -662,7 +662,7 @@ pub fn generate_docs_generic_token( //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use {}::Client; //! //! let {} = Client::new_from_env( @@ -676,7 +676,7 @@ pub fn generate_docs_generic_token( //! //! To start off a fresh client and get a `token` and `refresh_token`, use the following. //! -//! ``` +//! ```rust //! use {}::Client; //! //! async fn do_call() {{ @@ -746,7 +746,7 @@ pub fn generate_docs_generic_api_key( //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use {}::Client; //! //! let {} = Client::new( @@ -761,7 +761,7 @@ pub fn generate_docs_generic_api_key( //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use {}::Client; //! //! let {} = Client::new_from_env(); @@ -801,7 +801,7 @@ pub fn generate_docs_generic_client_credentials( //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use {}::Client; //! //! let {} = Client::new( @@ -819,7 +819,7 @@ pub fn generate_docs_generic_client_credentials( //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use {}::Client; //! //! let {} = Client::new_from_env( @@ -832,7 +832,7 @@ pub fn generate_docs_generic_client_credentials( //! //! To start off a fresh client and get a `token`, use the following. //! -//! ``` +//! ```rust //! use {}::Client; //! //! async fn do_call() {{ diff --git a/giphy/README.md b/giphy/README.md index 5f391d70..cac2b8ed 100644 --- a/giphy/README.md +++ b/giphy/README.md @@ -39,7 +39,7 @@ giphy-api = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use giphy_api::Client; let giphy = Client::new( @@ -54,7 +54,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use giphy_api::Client; let giphy = Client::new_from_env(); diff --git a/giphy/src/lib.rs b/giphy/src/lib.rs index a540a90c..1ce15164 100644 --- a/giphy/src/lib.rs +++ b/giphy/src/lib.rs @@ -37,7 +37,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use giphy_api::Client; //! //! let giphy = Client::new( @@ -52,7 +52,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use giphy_api::Client; //! //! let giphy = Client::new_from_env(); diff --git a/google/admin/README.md b/google/admin/README.md index 6dbf61db..fe4fac38 100644 --- a/google/admin/README.md +++ b/google/admin/README.md @@ -45,7 +45,7 @@ gsuite-api = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use gsuite_api::Client; let google admin = Client::new( @@ -66,7 +66,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use gsuite_api::Client; let google admin = Client::new_from_env( @@ -80,7 +80,7 @@ the initial state of the client, you will not know these values. To start off a fresh client and get a `token` and `refresh_token`, use the following. -``` +```rust use gsuite_api::Client; async fn do_call() { diff --git a/google/admin/src/lib.rs b/google/admin/src/lib.rs index 12a344b4..028f01c4 100644 --- a/google/admin/src/lib.rs +++ b/google/admin/src/lib.rs @@ -43,7 +43,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use gsuite_api::Client; //! //! let google admin = Client::new( @@ -64,7 +64,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use gsuite_api::Client; //! //! let google admin = Client::new_from_env( @@ -78,7 +78,7 @@ //! //! To start off a fresh client and get a `token` and `refresh_token`, use the following. //! -//! ``` +//! ```rust //! use gsuite_api::Client; //! //! async fn do_call() { diff --git a/google/calendar/README.md b/google/calendar/README.md index d8e0bca5..a149e161 100644 --- a/google/calendar/README.md +++ b/google/calendar/README.md @@ -45,7 +45,7 @@ google-calendar = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use google_calendar::Client; let google calendar = Client::new( @@ -66,7 +66,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use google_calendar::Client; let google calendar = Client::new_from_env( @@ -80,7 +80,7 @@ the initial state of the client, you will not know these values. To start off a fresh client and get a `token` and `refresh_token`, use the following. -``` +```rust use google_calendar::Client; async fn do_call() { diff --git a/google/calendar/src/lib.rs b/google/calendar/src/lib.rs index 0eb38af1..79924d69 100644 --- a/google/calendar/src/lib.rs +++ b/google/calendar/src/lib.rs @@ -43,7 +43,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use google_calendar::Client; //! //! let google calendar = Client::new( @@ -64,7 +64,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use google_calendar::Client; //! //! let google calendar = Client::new_from_env( @@ -78,7 +78,7 @@ //! //! To start off a fresh client and get a `token` and `refresh_token`, use the following. //! -//! ``` +//! ```rust //! use google_calendar::Client; //! //! async fn do_call() { diff --git a/google/cloud-resource-manager/README.md b/google/cloud-resource-manager/README.md index 79a6ff38..397230e5 100644 --- a/google/cloud-resource-manager/README.md +++ b/google/cloud-resource-manager/README.md @@ -45,7 +45,7 @@ google-cloud-resource-manager = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use google_cloud_resource_manager::Client; let google cloud resource manager = Client::new( @@ -66,7 +66,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use google_cloud_resource_manager::Client; let google cloud resource manager = Client::new_from_env( @@ -80,7 +80,7 @@ the initial state of the client, you will not know these values. To start off a fresh client and get a `token` and `refresh_token`, use the following. -``` +```rust use google_cloud_resource_manager::Client; async fn do_call() { diff --git a/google/cloud-resource-manager/src/lib.rs b/google/cloud-resource-manager/src/lib.rs index 8147f518..527165bd 100644 --- a/google/cloud-resource-manager/src/lib.rs +++ b/google/cloud-resource-manager/src/lib.rs @@ -43,7 +43,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use google_cloud_resource_manager::Client; //! //! let google cloud resource manager = Client::new( @@ -64,7 +64,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use google_cloud_resource_manager::Client; //! //! let google cloud resource manager = Client::new_from_env( @@ -78,7 +78,7 @@ //! //! To start off a fresh client and get a `token` and `refresh_token`, use the following. //! -//! ``` +//! ```rust //! use google_cloud_resource_manager::Client; //! //! async fn do_call() { diff --git a/google/drive/README.md b/google/drive/README.md index 7f6d27bd..fb329d36 100644 --- a/google/drive/README.md +++ b/google/drive/README.md @@ -45,7 +45,7 @@ google-drive = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use google_drive::Client; let google drive = Client::new( @@ -66,7 +66,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use google_drive::Client; let google drive = Client::new_from_env( @@ -80,7 +80,7 @@ the initial state of the client, you will not know these values. To start off a fresh client and get a `token` and `refresh_token`, use the following. -``` +```rust use google_drive::Client; async fn do_call() { diff --git a/google/drive/src/lib.rs b/google/drive/src/lib.rs index 6a245ce3..8c70aff3 100644 --- a/google/drive/src/lib.rs +++ b/google/drive/src/lib.rs @@ -43,7 +43,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use google_drive::Client; //! //! let google drive = Client::new( @@ -64,7 +64,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use google_drive::Client; //! //! let google drive = Client::new_from_env( @@ -78,7 +78,7 @@ //! //! To start off a fresh client and get a `token` and `refresh_token`, use the following. //! -//! ``` +//! ```rust //! use google_drive::Client; //! //! async fn do_call() { diff --git a/google/groups-settings/README.md b/google/groups-settings/README.md index 92fbb64e..7629da52 100644 --- a/google/groups-settings/README.md +++ b/google/groups-settings/README.md @@ -45,7 +45,7 @@ google-groups-settings = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use google_groups_settings::Client; let google groups settings = Client::new( @@ -66,7 +66,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use google_groups_settings::Client; let google groups settings = Client::new_from_env( @@ -80,7 +80,7 @@ the initial state of the client, you will not know these values. To start off a fresh client and get a `token` and `refresh_token`, use the following. -``` +```rust use google_groups_settings::Client; async fn do_call() { diff --git a/google/groups-settings/src/lib.rs b/google/groups-settings/src/lib.rs index 09ad8336..2ca4f68d 100644 --- a/google/groups-settings/src/lib.rs +++ b/google/groups-settings/src/lib.rs @@ -43,7 +43,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use google_groups_settings::Client; //! //! let google groups settings = Client::new( @@ -64,7 +64,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use google_groups_settings::Client; //! //! let google groups settings = Client::new_from_env( @@ -78,7 +78,7 @@ //! //! To start off a fresh client and get a `token` and `refresh_token`, use the following. //! -//! ``` +//! ```rust //! use google_groups_settings::Client; //! //! async fn do_call() { diff --git a/google/sheets/README.md b/google/sheets/README.md index e7b5c1fd..f9a93e39 100644 --- a/google/sheets/README.md +++ b/google/sheets/README.md @@ -45,7 +45,7 @@ sheets = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use sheets::Client; let google sheets = Client::new( @@ -66,7 +66,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use sheets::Client; let google sheets = Client::new_from_env( @@ -80,7 +80,7 @@ the initial state of the client, you will not know these values. To start off a fresh client and get a `token` and `refresh_token`, use the following. -``` +```rust use sheets::Client; async fn do_call() { diff --git a/google/sheets/src/lib.rs b/google/sheets/src/lib.rs index 244ad532..919f1384 100644 --- a/google/sheets/src/lib.rs +++ b/google/sheets/src/lib.rs @@ -43,7 +43,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use sheets::Client; //! //! let google sheets = Client::new( @@ -64,7 +64,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use sheets::Client; //! //! let google sheets = Client::new_from_env( @@ -78,7 +78,7 @@ //! //! To start off a fresh client and get a `token` and `refresh_token`, use the following. //! -//! ``` +//! ```rust //! use sheets::Client; //! //! async fn do_call() { diff --git a/gusto/README.md b/gusto/README.md index 78b932d1..04e90ad3 100644 --- a/gusto/README.md +++ b/gusto/README.md @@ -39,7 +39,7 @@ gusto-api = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use gusto_api::Client; let gusto = Client::new( @@ -61,7 +61,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use gusto_api::Client; let gusto = Client::new_from_env( @@ -76,7 +76,7 @@ the initial state of the client, you will not know these values. To start off a fresh client and get a `token` and `refresh_token`, use the following. -``` +```rust use gusto_api::Client; async fn do_call() { diff --git a/gusto/src/lib.rs b/gusto/src/lib.rs index 246714dc..7eb955cb 100644 --- a/gusto/src/lib.rs +++ b/gusto/src/lib.rs @@ -37,7 +37,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use gusto_api::Client; //! //! let gusto = Client::new( @@ -59,7 +59,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use gusto_api::Client; //! //! let gusto = Client::new_from_env( @@ -74,7 +74,7 @@ //! //! To start off a fresh client and get a `token` and `refresh_token`, use the following. //! -//! ``` +//! ```rust //! use gusto_api::Client; //! //! async fn do_call() { diff --git a/mailchimp/README.md b/mailchimp/README.md index c8921341..a2bece00 100644 --- a/mailchimp/README.md +++ b/mailchimp/README.md @@ -39,7 +39,7 @@ mailchimp-api = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use mailchimp_api::Client; let mailchimp = Client::new( @@ -60,7 +60,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use mailchimp_api::Client; let mailchimp = Client::new_from_env( @@ -74,7 +74,7 @@ the initial state of the client, you will not know these values. To start off a fresh client and get a `token` and `refresh_token`, use the following. -``` +```rust use mailchimp_api::Client; async fn do_call() { diff --git a/mailchimp/src/lib.rs b/mailchimp/src/lib.rs index 3e6e93b2..2e3d0876 100644 --- a/mailchimp/src/lib.rs +++ b/mailchimp/src/lib.rs @@ -37,7 +37,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use mailchimp_api::Client; //! //! let mailchimp = Client::new( @@ -58,7 +58,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use mailchimp_api::Client; //! //! let mailchimp = Client::new_from_env( @@ -72,7 +72,7 @@ //! //! To start off a fresh client and get a `token` and `refresh_token`, use the following. //! -//! ``` +//! ```rust //! use mailchimp_api::Client; //! //! async fn do_call() { diff --git a/okta/README.md b/okta/README.md index ba56c17f..d40e85f7 100644 --- a/okta/README.md +++ b/okta/README.md @@ -45,7 +45,7 @@ okta = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use okta::Client; let okta = Client::new( @@ -60,7 +60,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use okta::Client; let okta = Client::new_from_env(); diff --git a/okta/src/lib.rs b/okta/src/lib.rs index b5442ea2..04e3f19f 100644 --- a/okta/src/lib.rs +++ b/okta/src/lib.rs @@ -43,7 +43,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use okta::Client; //! //! let okta = Client::new( @@ -58,7 +58,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use okta::Client; //! //! let okta = Client::new_from_env(); diff --git a/ramp/README.md b/ramp/README.md index 17a796e2..4bbcc069 100644 --- a/ramp/README.md +++ b/ramp/README.md @@ -35,7 +35,7 @@ ramp-api = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use ramp_api::Client; let ramp = Client::new( @@ -56,7 +56,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use ramp_api::Client; let ramp = Client::new_from_env( @@ -70,7 +70,7 @@ the initial state of the client, you will not know these values. To start off a fresh client and get a `token` and `refresh_token`, use the following. -``` +```rust use ramp_api::Client; async fn do_call() { diff --git a/ramp/src/lib.rs b/ramp/src/lib.rs index 680c3db2..169d228d 100644 --- a/ramp/src/lib.rs +++ b/ramp/src/lib.rs @@ -33,7 +33,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use ramp_api::Client; //! //! let ramp = Client::new( @@ -54,7 +54,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use ramp_api::Client; //! //! let ramp = Client::new_from_env( @@ -68,7 +68,7 @@ //! //! To start off a fresh client and get a `token` and `refresh_token`, use the following. //! -//! ``` +//! ```rust //! use ramp_api::Client; //! //! async fn do_call() { diff --git a/rev.ai/README.md b/rev.ai/README.md index 6718f7de..31665e4c 100644 --- a/rev.ai/README.md +++ b/rev.ai/README.md @@ -233,7 +233,7 @@ revai = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use revai::Client; let rev.ai = Client::new( @@ -248,7 +248,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use revai::Client; let rev.ai = Client::new_from_env(); diff --git a/rev.ai/src/lib.rs b/rev.ai/src/lib.rs index f4112dcb..b8664174 100644 --- a/rev.ai/src/lib.rs +++ b/rev.ai/src/lib.rs @@ -231,7 +231,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use revai::Client; //! //! let rev.ai = Client::new( @@ -246,7 +246,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use revai::Client; //! //! let rev.ai = Client::new_from_env(); diff --git a/sendgrid/README.md b/sendgrid/README.md index f07460a8..c8b5096e 100644 --- a/sendgrid/README.md +++ b/sendgrid/README.md @@ -37,7 +37,7 @@ sendgrid-api = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use sendgrid_api::Client; let sendgrid = Client::new( @@ -52,7 +52,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use sendgrid_api::Client; let sendgrid = Client::new_from_env(); diff --git a/sendgrid/src/lib.rs b/sendgrid/src/lib.rs index 18befd8d..6b2135c4 100644 --- a/sendgrid/src/lib.rs +++ b/sendgrid/src/lib.rs @@ -35,7 +35,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use sendgrid_api::Client; //! //! let sendgrid = Client::new( @@ -50,7 +50,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use sendgrid_api::Client; //! //! let sendgrid = Client::new_from_env(); diff --git a/shipbob/README.md b/shipbob/README.md index 2c4f6ee5..98e62dd0 100644 --- a/shipbob/README.md +++ b/shipbob/README.md @@ -37,7 +37,7 @@ shipbob = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use shipbob::Client; let shipbob = Client::new( @@ -52,7 +52,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use shipbob::Client; let shipbob = Client::new_from_env(); diff --git a/shipbob/src/lib.rs b/shipbob/src/lib.rs index ee22ab8f..a63254c5 100644 --- a/shipbob/src/lib.rs +++ b/shipbob/src/lib.rs @@ -35,7 +35,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use shipbob::Client; //! //! let shipbob = Client::new( @@ -50,7 +50,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use shipbob::Client; //! //! let shipbob = Client::new_from_env(); diff --git a/shopify/README.md b/shopify/README.md index dedca099..01a00c9c 100644 --- a/shopify/README.md +++ b/shopify/README.md @@ -33,7 +33,7 @@ shopify = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use shopify::Client; let shopify = Client::new( @@ -54,7 +54,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use shopify::Client; let shopify = Client::new_from_env( @@ -68,7 +68,7 @@ the initial state of the client, you will not know these values. To start off a fresh client and get a `token` and `refresh_token`, use the following. -``` +```rust use shopify::Client; async fn do_call() { diff --git a/shopify/src/lib.rs b/shopify/src/lib.rs index 339efe4b..64a05470 100644 --- a/shopify/src/lib.rs +++ b/shopify/src/lib.rs @@ -31,7 +31,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use shopify::Client; //! //! let shopify = Client::new( @@ -52,7 +52,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use shopify::Client; //! //! let shopify = Client::new_from_env( @@ -66,7 +66,7 @@ //! //! To start off a fresh client and get a `token` and `refresh_token`, use the following. //! -//! ``` +//! ```rust //! use shopify::Client; //! //! async fn do_call() { diff --git a/slack/README.md b/slack/README.md index ac49c550..1392e18a 100644 --- a/slack/README.md +++ b/slack/README.md @@ -39,7 +39,7 @@ slack-chat-api = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use slack_chat_api::Client; let slack = Client::new( @@ -60,7 +60,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use slack_chat_api::Client; let slack = Client::new_from_env( @@ -74,7 +74,7 @@ the initial state of the client, you will not know these values. To start off a fresh client and get a `token` and `refresh_token`, use the following. -``` +```rust use slack_chat_api::Client; async fn do_call() { diff --git a/slack/src/lib.rs b/slack/src/lib.rs index ec36c244..7b24024a 100644 --- a/slack/src/lib.rs +++ b/slack/src/lib.rs @@ -37,7 +37,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use slack_chat_api::Client; //! //! let slack = Client::new( @@ -58,7 +58,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use slack_chat_api::Client; //! //! let slack = Client::new_from_env( @@ -72,7 +72,7 @@ //! //! To start off a fresh client and get a `token` and `refresh_token`, use the following. //! -//! ``` +//! ```rust //! use slack_chat_api::Client; //! //! async fn do_call() { diff --git a/stripe/README.md b/stripe/README.md index 3379551f..717bf4be 100644 --- a/stripe/README.md +++ b/stripe/README.md @@ -39,7 +39,7 @@ dolladollabills = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use dolladollabills::Client; let stripe = Client::new( @@ -54,7 +54,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use dolladollabills::Client; let stripe = Client::new_from_env(); diff --git a/stripe/src/lib.rs b/stripe/src/lib.rs index e30df16d..3775b1be 100644 --- a/stripe/src/lib.rs +++ b/stripe/src/lib.rs @@ -37,7 +37,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use dolladollabills::Client; //! //! let stripe = Client::new( @@ -52,7 +52,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use dolladollabills::Client; //! //! let stripe = Client::new_from_env(); diff --git a/tripactions/README.md b/tripactions/README.md index 7e6f4ec3..a26ce8f9 100644 --- a/tripactions/README.md +++ b/tripactions/README.md @@ -35,7 +35,7 @@ tripactions = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use tripactions::Client; let tripactions = Client::new( @@ -53,7 +53,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use tripactions::Client; let tripactions = Client::new_from_env( @@ -66,7 +66,7 @@ the initial state of the client, you will not know this value. To start off a fresh client and get a `token`, use the following. -``` +```rust use tripactions::Client; async fn do_call() { diff --git a/tripactions/src/lib.rs b/tripactions/src/lib.rs index b21cbd48..1b0915cc 100644 --- a/tripactions/src/lib.rs +++ b/tripactions/src/lib.rs @@ -33,7 +33,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use tripactions::Client; //! //! let tripactions = Client::new( @@ -51,7 +51,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use tripactions::Client; //! //! let tripactions = Client::new_from_env( @@ -64,7 +64,7 @@ //! //! To start off a fresh client and get a `token`, use the following. //! -//! ``` +//! ```rust //! use tripactions::Client; //! //! async fn do_call() { diff --git a/zoom/README.md b/zoom/README.md index 04a35a57..2041937c 100644 --- a/zoom/README.md +++ b/zoom/README.md @@ -48,7 +48,7 @@ zoom-api = "0.7.0-rc.1" Typical use will require intializing a `Client`. This requires a user agent string and set of credentials. -``` +```rust use zoom_api::Client; let zoom = Client::new( @@ -69,7 +69,7 @@ the client in the environment: And then you can create a client from the environment. -``` +```rust use zoom_api::Client; let zoom = Client::new_from_env( @@ -83,7 +83,7 @@ the initial state of the client, you will not know these values. To start off a fresh client and get a `token` and `refresh_token`, use the following. -``` +```rust use zoom_api::Client; async fn do_call() { diff --git a/zoom/src/lib.rs b/zoom/src/lib.rs index a2f22a51..e76f9ad2 100644 --- a/zoom/src/lib.rs +++ b/zoom/src/lib.rs @@ -46,7 +46,7 @@ //! Typical use will require intializing a `Client`. This requires //! a user agent string and set of credentials. //! -//! ``` +//! ```rust //! use zoom_api::Client; //! //! let zoom = Client::new( @@ -67,7 +67,7 @@ //! //! And then you can create a client from the environment. //! -//! ``` +//! ```rust //! use zoom_api::Client; //! //! let zoom = Client::new_from_env( @@ -81,7 +81,7 @@ //! //! To start off a fresh client and get a `token` and `refresh_token`, use the following. //! -//! ``` +//! ```rust //! use zoom_api::Client; //! //! async fn do_call() { From ea3e14954c8d0fe34ba432ee92de5bf5fd77ae87 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Mon, 5 Jun 2023 09:08:46 -0500 Subject: [PATCH 33/40] Add change not about default features --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7715900d..e7c991ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,4 +8,6 @@ This update refactors all of the clients and changes the way responses are handl * Methods now return `Result, ClientError>` instead of `anyhow::Result`. The body can be accessed via `response.body`. * Structured errors are now returned instead of `anyhow::Error`. -* Redirects are no longer followed by default. Previously if a 3xx response code was returned by a service, the inner client would follow it. This broke the ability for a service to specify a meaningful 3xx response. Methods that receive 3xx responses will now return them immediately and not attempt to resolve them. \ No newline at end of file +* Redirects are no longer followed by default. Previously if a 3xx response code was returned by a service, the inner client would follow it. This broke the ability for a service to specify a meaningful 3xx response. Methods that receive 3xx responses will now return them immediately and not attempt to resolve them. +* Updates to 0.2 `reqwest-middleware` ecosystem. +* OpenTelemetry is no longer a default feature. To enable OpenTelemetry tracing `reqwest-tracing` with the appropriate feature should be added to target project. \ No newline at end of file From ad3de90561685a4f68410a3beb1c00750aa90c22 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Mon, 5 Jun 2023 10:09:46 -0500 Subject: [PATCH 34/40] Add redirect policy to remaining clients --- CHANGELOG.md | 2 +- docusign/src/lib.rs | 4 +++- generator/src/client.rs | 8 ++++---- giphy/src/lib.rs | 4 +++- google/admin/src/lib.rs | 8 ++++++-- google/calendar/src/lib.rs | 8 ++++++-- google/cloud-resource-manager/src/lib.rs | 8 ++++++-- google/drive/src/lib.rs | 8 ++++++-- google/groups-settings/src/lib.rs | 8 ++++++-- google/sheets/src/lib.rs | 8 ++++++-- gusto/src/lib.rs | 4 +++- mailchimp/src/lib.rs | 4 +++- okta/src/lib.rs | 4 +++- ramp/src/lib.rs | 4 +++- rev.ai/src/lib.rs | 4 +++- sendgrid/src/lib.rs | 4 +++- shipbob/src/lib.rs | 4 +++- shopify/src/lib.rs | 4 +++- slack/src/lib.rs | 4 +++- stripe/src/lib.rs | 4 +++- tripactions/src/lib.rs | 4 +++- zoom/src/lib.rs | 4 +++- 22 files changed, 83 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7c991ff..ff0bab1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,6 @@ This update refactors all of the clients and changes the way responses are handl * Methods now return `Result, ClientError>` instead of `anyhow::Result`. The body can be accessed via `response.body`. * Structured errors are now returned instead of `anyhow::Error`. -* Redirects are no longer followed by default. Previously if a 3xx response code was returned by a service, the inner client would follow it. This broke the ability for a service to specify a meaningful 3xx response. Methods that receive 3xx responses will now return them immediately and not attempt to resolve them. +* Redirects are no longer followed by default. Previously if a 3xx response code was returned by a service, the inner client would follow it. This prevented services from returning meaningful 3xx responses. Methods that receive 3xx responses will now return them immediately and not attempt to follow them. * Updates to 0.2 `reqwest-middleware` ecosystem. * OpenTelemetry is no longer a default feature. To enable OpenTelemetry tracing `reqwest-tracing` with the appropriate feature should be added to target project. \ No newline at end of file diff --git a/docusign/src/lib.rs b/docusign/src/lib.rs index 2d966757..d243a637 100644 --- a/docusign/src/lib.rs +++ b/docusign/src/lib.rs @@ -2368,7 +2368,9 @@ impl Client { // Retry up to 3 times with increasing intervals between attempts. let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); match client { Ok(c) => { let client = reqwest_middleware::ClientBuilder::new(c) diff --git a/generator/src/client.rs b/generator/src/client.rs index 99f45bbc..718a9151 100644 --- a/generator/src/client.rs +++ b/generator/src/client.rs @@ -649,7 +649,7 @@ impl Client {{ {{ // Retry up to 3 times with increasing intervals between attempts. let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder().redirect(reqwest::redirect::Policy::none()).build(); match client {{ Ok(c) => {{ let client = reqwest_middleware::ClientBuilder::new(c) @@ -876,7 +876,7 @@ where let secret = yup_oauth2::parse_application_secret(decoded_google_key) .expect("failed to read from google credential env var"); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder().redirect(reqwest::redirect::Policy::none()).build(); let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); match client { @@ -955,7 +955,7 @@ impl Client {{ where T: ToString, {{ - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder().redirect(reqwest::redirect::Policy::none()).build(); let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); match client {{ Ok(c) => {{ @@ -1817,7 +1817,7 @@ impl Client {{ K: ToString, T: ToString, {{ - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder().redirect(reqwest::redirect::Policy::none()).build(); let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); match client {{ Ok(c) => {{ diff --git a/giphy/src/lib.rs b/giphy/src/lib.rs index 1ce15164..6b53f032 100644 --- a/giphy/src/lib.rs +++ b/giphy/src/lib.rs @@ -180,7 +180,9 @@ impl Client { where T: ToString, { - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); match client { diff --git a/google/admin/src/lib.rs b/google/admin/src/lib.rs index 028f01c4..6ece4fea 100644 --- a/google/admin/src/lib.rs +++ b/google/admin/src/lib.rs @@ -320,7 +320,9 @@ impl Client { // Retry up to 3 times with increasing intervals between attempts. let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); match client { Ok(c) => { let client = reqwest_middleware::ClientBuilder::new(c) @@ -462,7 +464,9 @@ impl Client { let secret = yup_oauth2::parse_application_secret(decoded_google_key) .expect("failed to read from google credential env var"); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); diff --git a/google/calendar/src/lib.rs b/google/calendar/src/lib.rs index 79924d69..1df6bb49 100644 --- a/google/calendar/src/lib.rs +++ b/google/calendar/src/lib.rs @@ -308,7 +308,9 @@ impl Client { // Retry up to 3 times with increasing intervals between attempts. let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); match client { Ok(c) => { let client = reqwest_middleware::ClientBuilder::new(c) @@ -450,7 +452,9 @@ impl Client { let secret = yup_oauth2::parse_application_secret(decoded_google_key) .expect("failed to read from google credential env var"); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); diff --git a/google/cloud-resource-manager/src/lib.rs b/google/cloud-resource-manager/src/lib.rs index 527165bd..aa2d9c59 100644 --- a/google/cloud-resource-manager/src/lib.rs +++ b/google/cloud-resource-manager/src/lib.rs @@ -302,7 +302,9 @@ impl Client { // Retry up to 3 times with increasing intervals between attempts. let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); match client { Ok(c) => { let client = reqwest_middleware::ClientBuilder::new(c) @@ -444,7 +446,9 @@ impl Client { let secret = yup_oauth2::parse_application_secret(decoded_google_key) .expect("failed to read from google credential env var"); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); diff --git a/google/drive/src/lib.rs b/google/drive/src/lib.rs index 8c70aff3..ed1ddac6 100644 --- a/google/drive/src/lib.rs +++ b/google/drive/src/lib.rs @@ -318,7 +318,9 @@ impl Client { // Retry up to 3 times with increasing intervals between attempts. let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); match client { Ok(c) => { let client = reqwest_middleware::ClientBuilder::new(c) @@ -460,7 +462,9 @@ impl Client { let secret = yup_oauth2::parse_application_secret(decoded_google_key) .expect("failed to read from google credential env var"); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); diff --git a/google/groups-settings/src/lib.rs b/google/groups-settings/src/lib.rs index 2ca4f68d..c14bd2c8 100644 --- a/google/groups-settings/src/lib.rs +++ b/google/groups-settings/src/lib.rs @@ -301,7 +301,9 @@ impl Client { // Retry up to 3 times with increasing intervals between attempts. let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); match client { Ok(c) => { let client = reqwest_middleware::ClientBuilder::new(c) @@ -443,7 +445,9 @@ impl Client { let secret = yup_oauth2::parse_application_secret(decoded_google_key) .expect("failed to read from google credential env var"); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); diff --git a/google/sheets/src/lib.rs b/google/sheets/src/lib.rs index 919f1384..068e81e8 100644 --- a/google/sheets/src/lib.rs +++ b/google/sheets/src/lib.rs @@ -302,7 +302,9 @@ impl Client { // Retry up to 3 times with increasing intervals between attempts. let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); match client { Ok(c) => { let client = reqwest_middleware::ClientBuilder::new(c) @@ -444,7 +446,9 @@ impl Client { let secret = yup_oauth2::parse_application_secret(decoded_google_key) .expect("failed to read from google credential env var"); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); diff --git a/gusto/src/lib.rs b/gusto/src/lib.rs index 7eb955cb..72ad22ac 100644 --- a/gusto/src/lib.rs +++ b/gusto/src/lib.rs @@ -351,7 +351,9 @@ impl Client { // Retry up to 3 times with increasing intervals between attempts. let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); match client { Ok(c) => { let client = reqwest_middleware::ClientBuilder::new(c) diff --git a/mailchimp/src/lib.rs b/mailchimp/src/lib.rs index 2e3d0876..4f28553a 100644 --- a/mailchimp/src/lib.rs +++ b/mailchimp/src/lib.rs @@ -318,7 +318,9 @@ impl Client { // Retry up to 3 times with increasing intervals between attempts. let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); match client { Ok(c) => { let client = reqwest_middleware::ClientBuilder::new(c) diff --git a/okta/src/lib.rs b/okta/src/lib.rs index 04e3f19f..392c6a72 100644 --- a/okta/src/lib.rs +++ b/okta/src/lib.rs @@ -205,7 +205,9 @@ impl Client { where T: ToString, { - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); match client { diff --git a/ramp/src/lib.rs b/ramp/src/lib.rs index 169d228d..ffbe5ef5 100644 --- a/ramp/src/lib.rs +++ b/ramp/src/lib.rs @@ -301,7 +301,9 @@ impl Client { // Retry up to 3 times with increasing intervals between attempts. let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); match client { Ok(c) => { let client = reqwest_middleware::ClientBuilder::new(c) diff --git a/rev.ai/src/lib.rs b/rev.ai/src/lib.rs index b8664174..35c2254a 100644 --- a/rev.ai/src/lib.rs +++ b/rev.ai/src/lib.rs @@ -377,7 +377,9 @@ impl Client { where T: ToString, { - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); match client { diff --git a/sendgrid/src/lib.rs b/sendgrid/src/lib.rs index 6b2135c4..86f23c49 100644 --- a/sendgrid/src/lib.rs +++ b/sendgrid/src/lib.rs @@ -235,7 +235,9 @@ impl Client { where T: ToString, { - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); match client { diff --git a/shipbob/src/lib.rs b/shipbob/src/lib.rs index a63254c5..2075235e 100644 --- a/shipbob/src/lib.rs +++ b/shipbob/src/lib.rs @@ -262,7 +262,9 @@ impl Client { where T: ToString, { - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); match client { diff --git a/shopify/src/lib.rs b/shopify/src/lib.rs index 64a05470..25d6f95d 100644 --- a/shopify/src/lib.rs +++ b/shopify/src/lib.rs @@ -297,7 +297,9 @@ impl Client { // Retry up to 3 times with increasing intervals between attempts. let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); match client { Ok(c) => { let client = reqwest_middleware::ClientBuilder::new(c) diff --git a/slack/src/lib.rs b/slack/src/lib.rs index 7b24024a..090a3512 100644 --- a/slack/src/lib.rs +++ b/slack/src/lib.rs @@ -349,7 +349,9 @@ impl Client { // Retry up to 3 times with increasing intervals between attempts. let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); match client { Ok(c) => { let client = reqwest_middleware::ClientBuilder::new(c) diff --git a/stripe/src/lib.rs b/stripe/src/lib.rs index 3775b1be..2dfc8b1b 100644 --- a/stripe/src/lib.rs +++ b/stripe/src/lib.rs @@ -239,7 +239,9 @@ impl Client { where T: ToString, { - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); match client { diff --git a/tripactions/src/lib.rs b/tripactions/src/lib.rs index 1b0915cc..ea7069ef 100644 --- a/tripactions/src/lib.rs +++ b/tripactions/src/lib.rs @@ -229,7 +229,9 @@ impl Client { K: ToString, T: ToString, { - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); match client { diff --git a/zoom/src/lib.rs b/zoom/src/lib.rs index e76f9ad2..cb24fb67 100644 --- a/zoom/src/lib.rs +++ b/zoom/src/lib.rs @@ -332,7 +332,9 @@ impl Client { // Retry up to 3 times with increasing intervals between attempts. let retry_policy = reqwest_retry::policies::ExponentialBackoff::builder().build_with_max_retries(3); - let client = reqwest::Client::builder().build(); + let client = reqwest::Client::builder() + .redirect(reqwest::redirect::Policy::none()) + .build(); match client { Ok(c) => { let client = reqwest_middleware::ClientBuilder::new(c) From 14be1f3374d0cabd5e3c54a8e56078fd00f12bfd Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Wed, 7 Jun 2023 16:27:56 -0500 Subject: [PATCH 35/40] Re-export reqwest types --- docusign/src/lib.rs | 2 ++ generator/src/main.rs | 2 ++ giphy/src/lib.rs | 2 ++ github/src/lib.rs | 2 ++ google/admin/src/lib.rs | 2 ++ google/calendar/src/lib.rs | 2 ++ google/cloud-resource-manager/src/lib.rs | 2 ++ google/drive/src/lib.rs | 2 ++ google/groups-settings/src/lib.rs | 2 ++ google/sheets/src/lib.rs | 2 ++ gusto/src/lib.rs | 2 ++ mailchimp/src/lib.rs | 2 ++ okta/src/lib.rs | 2 ++ ramp/src/lib.rs | 2 ++ rev.ai/src/lib.rs | 2 ++ sendgrid/src/lib.rs | 2 ++ shipbob/src/lib.rs | 2 ++ shopify/src/lib.rs | 2 ++ slack/src/lib.rs | 2 ++ stripe/src/lib.rs | 2 ++ tripactions/src/lib.rs | 2 ++ zoom/src/lib.rs | 2 ++ 22 files changed, 44 insertions(+) diff --git a/docusign/src/lib.rs b/docusign/src/lib.rs index d243a637..e626ed42 100644 --- a/docusign/src/lib.rs +++ b/docusign/src/lib.rs @@ -2181,6 +2181,8 @@ pub mod workspace_items; ///**Note**: Documents in a template are not individually listed as files. pub mod workspaces; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/generator/src/main.rs b/generator/src/main.rs index a20bdc6e..34938b4e 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -2374,6 +2374,8 @@ fn gen( a(""); a(r#" +pub use reqwest::{StatusCode, header::HeaderMap}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/giphy/src/lib.rs b/giphy/src/lib.rs index 6b53f032..cd224d9c 100644 --- a/giphy/src/lib.rs +++ b/giphy/src/lib.rs @@ -72,6 +72,8 @@ pub mod types; #[doc(hidden)] pub mod utils; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/github/src/lib.rs b/github/src/lib.rs index 0eeb4673..96acb337 100644 --- a/github/src/lib.rs +++ b/github/src/lib.rs @@ -243,6 +243,8 @@ pub mod users; #[doc(hidden)] pub mod utils; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/google/admin/src/lib.rs b/google/admin/src/lib.rs index 6ece4fea..2576c2e5 100644 --- a/google/admin/src/lib.rs +++ b/google/admin/src/lib.rs @@ -133,6 +133,8 @@ pub mod users; pub mod utils; pub mod verification_codes; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/google/calendar/src/lib.rs b/google/calendar/src/lib.rs index 1df6bb49..229c3070 100644 --- a/google/calendar/src/lib.rs +++ b/google/calendar/src/lib.rs @@ -121,6 +121,8 @@ pub mod types; #[doc(hidden)] pub mod utils; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/google/cloud-resource-manager/src/lib.rs b/google/cloud-resource-manager/src/lib.rs index aa2d9c59..f0ec252f 100644 --- a/google/cloud-resource-manager/src/lib.rs +++ b/google/cloud-resource-manager/src/lib.rs @@ -115,6 +115,8 @@ pub mod types; #[doc(hidden)] pub mod utils; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/google/drive/src/lib.rs b/google/drive/src/lib.rs index ed1ddac6..bf93062c 100644 --- a/google/drive/src/lib.rs +++ b/google/drive/src/lib.rs @@ -124,6 +124,8 @@ pub mod types; #[doc(hidden)] pub mod utils; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/google/groups-settings/src/lib.rs b/google/groups-settings/src/lib.rs index c14bd2c8..12c061f1 100644 --- a/google/groups-settings/src/lib.rs +++ b/google/groups-settings/src/lib.rs @@ -114,6 +114,8 @@ pub mod types; #[doc(hidden)] pub mod utils; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/google/sheets/src/lib.rs b/google/sheets/src/lib.rs index 068e81e8..dee75f09 100644 --- a/google/sheets/src/lib.rs +++ b/google/sheets/src/lib.rs @@ -115,6 +115,8 @@ pub mod types; #[doc(hidden)] pub mod utils; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/gusto/src/lib.rs b/gusto/src/lib.rs index 72ad22ac..84007fb3 100644 --- a/gusto/src/lib.rs +++ b/gusto/src/lib.rs @@ -128,6 +128,8 @@ pub mod types; #[doc(hidden)] pub mod utils; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/mailchimp/src/lib.rs b/mailchimp/src/lib.rs index 4f28553a..5ef4e009 100644 --- a/mailchimp/src/lib.rs +++ b/mailchimp/src/lib.rs @@ -131,6 +131,8 @@ pub mod types; pub mod utils; pub mod verified_domains; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/okta/src/lib.rs b/okta/src/lib.rs index 392c6a72..e81f5c50 100644 --- a/okta/src/lib.rs +++ b/okta/src/lib.rs @@ -97,6 +97,8 @@ pub mod users; #[doc(hidden)] pub mod utils; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/ramp/src/lib.rs b/ramp/src/lib.rs index ffbe5ef5..e5fc095c 100644 --- a/ramp/src/lib.rs +++ b/ramp/src/lib.rs @@ -114,6 +114,8 @@ pub mod users; #[doc(hidden)] pub mod utils; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/rev.ai/src/lib.rs b/rev.ai/src/lib.rs index 35c2254a..871adea4 100644 --- a/rev.ai/src/lib.rs +++ b/rev.ai/src/lib.rs @@ -269,6 +269,8 @@ pub mod types; #[doc(hidden)] pub mod utils; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/sendgrid/src/lib.rs b/sendgrid/src/lib.rs index 86f23c49..facc58f6 100644 --- a/sendgrid/src/lib.rs +++ b/sendgrid/src/lib.rs @@ -127,6 +127,8 @@ pub mod users_api; pub mod utils; pub mod webhooks; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/shipbob/src/lib.rs b/shipbob/src/lib.rs index 2075235e..62c3afcd 100644 --- a/shipbob/src/lib.rs +++ b/shipbob/src/lib.rs @@ -154,6 +154,8 @@ pub mod utils; /// Use the Webhooks Resource to create, view or delete subscriptions for a user. pub mod webhooks; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/shopify/src/lib.rs b/shopify/src/lib.rs index 25d6f95d..c2a2e676 100644 --- a/shopify/src/lib.rs +++ b/shopify/src/lib.rs @@ -119,6 +119,8 @@ pub mod types; #[doc(hidden)] pub mod utils; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/slack/src/lib.rs b/slack/src/lib.rs index 090a3512..481ef350 100644 --- a/slack/src/lib.rs +++ b/slack/src/lib.rs @@ -162,6 +162,8 @@ pub mod utils; pub mod views; pub mod workflows; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/stripe/src/lib.rs b/stripe/src/lib.rs index 2dfc8b1b..87f3dcab 100644 --- a/stripe/src/lib.rs +++ b/stripe/src/lib.rs @@ -131,6 +131,8 @@ pub mod types; pub mod utils; pub mod webhook_endpoints; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/tripactions/src/lib.rs b/tripactions/src/lib.rs index ea7069ef..5d3e19d8 100644 --- a/tripactions/src/lib.rs +++ b/tripactions/src/lib.rs @@ -87,6 +87,8 @@ pub mod types; #[doc(hidden)] pub mod utils; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, diff --git a/zoom/src/lib.rs b/zoom/src/lib.rs index cb24fb67..a843d398 100644 --- a/zoom/src/lib.rs +++ b/zoom/src/lib.rs @@ -154,6 +154,8 @@ pub mod users; pub mod utils; pub mod webinars; +pub use reqwest::{header::HeaderMap, StatusCode}; + #[derive(Debug)] pub struct Response { pub status: reqwest::StatusCode, From bfeb4456211908fcbbbf93ad32e0367fd28b4366 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 8 Jun 2023 10:21:56 -0500 Subject: [PATCH 36/40] Clarify response values --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff0bab1c..2c01ac59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 0.7.0-rc.1 -This update refactors all of the clients and changes the way responses are handled. Previously methods that make calls to a third party service would return an `anyhow::Result` over some structured interpretation of the response body (i.e. a deserialized struct, a unit type, or a raw string). Methods now return a `Result, ClientError>` where a `Response` contains the body type that was previously returned along with the status code and headers that were sent from the third party service. `ClientError` now provides a more structure error type than the previous `anyhow` error. +This update refactors all of the clients and changes the way responses are handled. Previously methods that make calls to a third party service would return an `anyhow::Result` over some structured interpretation of the response body (i.e. a deserialized struct, a unit type, or a raw string). Methods now return a `Result, ClientError>` where a `Response` contains the body type that was previously returned along with the status code and headers that were sent from the third party service. When requesting unfolded paginated results the status code and headers returned will be the values returned from the final request made to the service. `ClientError` now provides a more structure error type than the previous `anyhow` error. ### Breaking Changes @@ -10,4 +10,4 @@ This update refactors all of the clients and changes the way responses are handl * Structured errors are now returned instead of `anyhow::Error`. * Redirects are no longer followed by default. Previously if a 3xx response code was returned by a service, the inner client would follow it. This prevented services from returning meaningful 3xx responses. Methods that receive 3xx responses will now return them immediately and not attempt to follow them. * Updates to 0.2 `reqwest-middleware` ecosystem. -* OpenTelemetry is no longer a default feature. To enable OpenTelemetry tracing `reqwest-tracing` with the appropriate feature should be added to target project. \ No newline at end of file +* OpenTelemetry is no longer a default feature. To enable OpenTelemetry tracing add `reqwest-tracing` with the appropriate version feature enabled to the target project. \ No newline at end of file From b6e954dd1110edb39934dfc80987b215b1c5d3d6 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 8 Jun 2023 11:27:24 -0500 Subject: [PATCH 37/40] Clarify new env fns --- CHANGELOG.md | 3 +++ docusign/src/lib.rs | 4 ++++ generator/src/client.rs | 29 ++++++++++++++++-------- giphy/src/lib.rs | 9 +++----- google/admin/src/lib.rs | 2 ++ google/calendar/src/lib.rs | 2 ++ google/cloud-resource-manager/src/lib.rs | 2 ++ google/drive/src/lib.rs | 2 ++ google/groups-settings/src/lib.rs | 2 ++ google/sheets/src/lib.rs | 2 ++ gusto/src/lib.rs | 4 ++++ mailchimp/src/lib.rs | 4 ++++ okta/src/lib.rs | 9 +++----- ramp/src/lib.rs | 4 ++++ rev.ai/src/lib.rs | 9 +++----- sendgrid/src/lib.rs | 9 +++----- shipbob/src/lib.rs | 9 +++----- shopify/src/lib.rs | 4 ++++ slack/src/lib.rs | 4 ++++ stripe/src/lib.rs | 9 +++----- tripactions/src/lib.rs | 8 +++---- zoom/src/lib.rs | 4 ++++ 22 files changed, 84 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c01ac59..2e4fdd83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ This update refactors all of the clients and changes the way responses are handled. Previously methods that make calls to a third party service would return an `anyhow::Result` over some structured interpretation of the response body (i.e. a deserialized struct, a unit type, or a raw string). Methods now return a `Result, ClientError>` where a `Response` contains the body type that was previously returned along with the status code and headers that were sent from the third party service. When requesting unfolded paginated results the status code and headers returned will be the values returned from the final request made to the service. `ClientError` now provides a more structure error type than the previous `anyhow` error. +### Fixes +* Fix missing default deserialization on `HashMap`s with fully qualified types. + ### Breaking Changes * Methods now return `Result, ClientError>` instead of `anyhow::Result`. The body can be accessed via `response.body`. diff --git a/docusign/src/lib.rs b/docusign/src/lib.rs index e626ed42..25be31dc 100644 --- a/docusign/src/lib.rs +++ b/docusign/src/lib.rs @@ -2502,6 +2502,10 @@ impl Client { /// given a valid API key and your requests will work. /// We pass in the token and refresh token to the client so if you are storing /// it in a database, you can get it first. + /// The following environment variables are expected to be set: + /// * `DOCUSIGN_CLIENT_ID` + /// * `DOCUSIGN_CLIENT_SECRET` + /// * `DOCUSIGN_REDIRECT_URI` pub fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/generator/src/client.rs b/generator/src/client.rs index 718a9151..f7b933f3 100644 --- a/generator/src/client.rs +++ b/generator/src/client.rs @@ -824,6 +824,10 @@ fn basic_new_from_env( /// given a valid API key and your requests will work. /// We pass in the token and refresh token to the client so if you are storing /// it in a database, you can get it first. +/// The following environment variables are expected to be set: +/// * `{}_CLIENT_ID` +/// * `{}_CLIENT_SECRET` +/// * `{}_REDIRECT_URI` pub fn new_from_env(token: T, refresh_token: R{}, {server_arg}) -> Self where T: ToString, @@ -844,6 +848,9 @@ where {server_param} ) }}"#, + proper_name.to_uppercase().replace('.', ""), + proper_name.to_uppercase().replace('.', ""), + proper_name.to_uppercase().replace('.', ""), add_post_header_type, add_post_header_args, add_post_header_args_where, @@ -864,6 +871,8 @@ const GOOGLE_NEW_FROM_ENV_TEMPLATE: &str = r#" /// given a valid API key and your requests will work. /// We pass in the token and refresh token to the client so if you are storing /// it in a database, you can get it first. +/// The following environment variables are expected to be set: +/// * `GOOGLE_KEY_ENCODED` - A base64 encoded version of JSON formatted application secret pub async fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, @@ -1009,12 +1018,9 @@ impl Client {{ format!("{{}}{{}}", self.get_host_override().or(host).unwrap_or(self.host.as_str()), path) }} - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. + /// The following environment variables are expected to be set: + /// * `{}_API_KEY` pub fn new_from_env() -> Self {{ let token = env::var("{}_API_KEY").expect("must set {}_API_KEY"); @@ -1025,6 +1031,7 @@ impl Client {{ }} {}"#, + proper_name.to_uppercase().replace('.', ""), proper_name.to_uppercase().replace('.', ""), proper_name.to_uppercase().replace('.', ""), get_shared_functions(proper_name, add_post_header) @@ -1875,10 +1882,10 @@ impl Client {{ /// Create a new Client struct from environment variables. It /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// an &str (`String` or `Vec` for example). + /// The following environment variables are expected to be set: + /// * `{}_CLIENT_ID` + /// * `{}_CLIENT_SECRET` pub fn new_from_env(token: T) -> Self where T: ToString, @@ -1902,6 +1909,8 @@ impl Client {{ proper_name.to_uppercase().replace('.', ""), proper_name.to_uppercase().replace('.', ""), proper_name.to_uppercase().replace('.', ""), + proper_name.to_uppercase().replace('.', ""), + proper_name.to_uppercase().replace('.', ""), CLIENT_AUTH_TEMPLATE, get_shared_functions(proper_name, add_post_header) ) diff --git a/giphy/src/lib.rs b/giphy/src/lib.rs index cd224d9c..c0ff247e 100644 --- a/giphy/src/lib.rs +++ b/giphy/src/lib.rs @@ -242,12 +242,9 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. + /// The following environment variables are expected to be set: + /// * `GIPHY_API_KEY` pub fn new_from_env() -> Self { let token = env::var("GIPHY_API_KEY").expect("must set GIPHY_API_KEY"); diff --git a/google/admin/src/lib.rs b/google/admin/src/lib.rs index 2576c2e5..62a5aca5 100644 --- a/google/admin/src/lib.rs +++ b/google/admin/src/lib.rs @@ -454,6 +454,8 @@ impl Client { /// given a valid API key and your requests will work. /// We pass in the token and refresh token to the client so if you are storing /// it in a database, you can get it first. + /// The following environment variables are expected to be set: + /// * `GOOGLE_KEY_ENCODED` - A base64 encoded version of JSON formatted application secret pub async fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/google/calendar/src/lib.rs b/google/calendar/src/lib.rs index 229c3070..2e736656 100644 --- a/google/calendar/src/lib.rs +++ b/google/calendar/src/lib.rs @@ -442,6 +442,8 @@ impl Client { /// given a valid API key and your requests will work. /// We pass in the token and refresh token to the client so if you are storing /// it in a database, you can get it first. + /// The following environment variables are expected to be set: + /// * `GOOGLE_KEY_ENCODED` - A base64 encoded version of JSON formatted application secret pub async fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/google/cloud-resource-manager/src/lib.rs b/google/cloud-resource-manager/src/lib.rs index f0ec252f..8f64b342 100644 --- a/google/cloud-resource-manager/src/lib.rs +++ b/google/cloud-resource-manager/src/lib.rs @@ -436,6 +436,8 @@ impl Client { /// given a valid API key and your requests will work. /// We pass in the token and refresh token to the client so if you are storing /// it in a database, you can get it first. + /// The following environment variables are expected to be set: + /// * `GOOGLE_KEY_ENCODED` - A base64 encoded version of JSON formatted application secret pub async fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/google/drive/src/lib.rs b/google/drive/src/lib.rs index bf93062c..345f1a78 100644 --- a/google/drive/src/lib.rs +++ b/google/drive/src/lib.rs @@ -452,6 +452,8 @@ impl Client { /// given a valid API key and your requests will work. /// We pass in the token and refresh token to the client so if you are storing /// it in a database, you can get it first. + /// The following environment variables are expected to be set: + /// * `GOOGLE_KEY_ENCODED` - A base64 encoded version of JSON formatted application secret pub async fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/google/groups-settings/src/lib.rs b/google/groups-settings/src/lib.rs index 12c061f1..a26fd81a 100644 --- a/google/groups-settings/src/lib.rs +++ b/google/groups-settings/src/lib.rs @@ -435,6 +435,8 @@ impl Client { /// given a valid API key and your requests will work. /// We pass in the token and refresh token to the client so if you are storing /// it in a database, you can get it first. + /// The following environment variables are expected to be set: + /// * `GOOGLE_KEY_ENCODED` - A base64 encoded version of JSON formatted application secret pub async fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/google/sheets/src/lib.rs b/google/sheets/src/lib.rs index dee75f09..c126a79c 100644 --- a/google/sheets/src/lib.rs +++ b/google/sheets/src/lib.rs @@ -436,6 +436,8 @@ impl Client { /// given a valid API key and your requests will work. /// We pass in the token and refresh token to the client so if you are storing /// it in a database, you can get it first. + /// The following environment variables are expected to be set: + /// * `GOOGLE_KEY_ENCODED` - A base64 encoded version of JSON formatted application secret pub async fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/gusto/src/lib.rs b/gusto/src/lib.rs index 84007fb3..7ed2407c 100644 --- a/gusto/src/lib.rs +++ b/gusto/src/lib.rs @@ -485,6 +485,10 @@ impl Client { /// given a valid API key and your requests will work. /// We pass in the token and refresh token to the client so if you are storing /// it in a database, you can get it first. + /// The following environment variables are expected to be set: + /// * `GUSTO_CLIENT_ID` + /// * `GUSTO_CLIENT_SECRET` + /// * `GUSTO_REDIRECT_URI` pub fn new_from_env( token: T, refresh_token: R, diff --git a/mailchimp/src/lib.rs b/mailchimp/src/lib.rs index 5ef4e009..e2964196 100644 --- a/mailchimp/src/lib.rs +++ b/mailchimp/src/lib.rs @@ -452,6 +452,10 @@ impl Client { /// given a valid API key and your requests will work. /// We pass in the token and refresh token to the client so if you are storing /// it in a database, you can get it first. + /// The following environment variables are expected to be set: + /// * `MAILCHIMP_CLIENT_ID` + /// * `MAILCHIMP_CLIENT_SECRET` + /// * `MAILCHIMP_REDIRECT_URI` pub fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/okta/src/lib.rs b/okta/src/lib.rs index e81f5c50..c35d064b 100644 --- a/okta/src/lib.rs +++ b/okta/src/lib.rs @@ -267,12 +267,9 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. + /// The following environment variables are expected to be set: + /// * `OKTA_API_KEY` pub fn new_from_env() -> Self { let token = env::var("OKTA_API_KEY").expect("must set OKTA_API_KEY"); diff --git a/ramp/src/lib.rs b/ramp/src/lib.rs index e5fc095c..a5849ed1 100644 --- a/ramp/src/lib.rs +++ b/ramp/src/lib.rs @@ -435,6 +435,10 @@ impl Client { /// given a valid API key and your requests will work. /// We pass in the token and refresh token to the client so if you are storing /// it in a database, you can get it first. + /// The following environment variables are expected to be set: + /// * `RAMP_CLIENT_ID` + /// * `RAMP_CLIENT_SECRET` + /// * `RAMP_REDIRECT_URI` pub fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/rev.ai/src/lib.rs b/rev.ai/src/lib.rs index 871adea4..632955d6 100644 --- a/rev.ai/src/lib.rs +++ b/rev.ai/src/lib.rs @@ -439,12 +439,9 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. + /// The following environment variables are expected to be set: + /// * `REVAI_API_KEY` pub fn new_from_env() -> Self { let token = env::var("REVAI_API_KEY").expect("must set REVAI_API_KEY"); diff --git a/sendgrid/src/lib.rs b/sendgrid/src/lib.rs index facc58f6..380d07cf 100644 --- a/sendgrid/src/lib.rs +++ b/sendgrid/src/lib.rs @@ -297,12 +297,9 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. + /// The following environment variables are expected to be set: + /// * `SENDGRID_API_KEY` pub fn new_from_env() -> Self { let token = env::var("SENDGRID_API_KEY").expect("must set SENDGRID_API_KEY"); diff --git a/shipbob/src/lib.rs b/shipbob/src/lib.rs index 62c3afcd..4d987584 100644 --- a/shipbob/src/lib.rs +++ b/shipbob/src/lib.rs @@ -324,12 +324,9 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. + /// The following environment variables are expected to be set: + /// * `SHIPBOB_API_KEY` pub fn new_from_env() -> Self { let token = env::var("SHIPBOB_API_KEY").expect("must set SHIPBOB_API_KEY"); diff --git a/shopify/src/lib.rs b/shopify/src/lib.rs index c2a2e676..9f2cea1e 100644 --- a/shopify/src/lib.rs +++ b/shopify/src/lib.rs @@ -431,6 +431,10 @@ impl Client { /// given a valid API key and your requests will work. /// We pass in the token and refresh token to the client so if you are storing /// it in a database, you can get it first. + /// The following environment variables are expected to be set: + /// * `SHOPIFY_CLIENT_ID` + /// * `SHOPIFY_CLIENT_SECRET` + /// * `SHOPIFY_REDIRECT_URI` pub fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/slack/src/lib.rs b/slack/src/lib.rs index 481ef350..a6561b7b 100644 --- a/slack/src/lib.rs +++ b/slack/src/lib.rs @@ -483,6 +483,10 @@ impl Client { /// given a valid API key and your requests will work. /// We pass in the token and refresh token to the client so if you are storing /// it in a database, you can get it first. + /// The following environment variables are expected to be set: + /// * `SLACK_CLIENT_ID` + /// * `SLACK_CLIENT_SECRET` + /// * `SLACK_REDIRECT_URI` pub fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/stripe/src/lib.rs b/stripe/src/lib.rs index 87f3dcab..8d41ee15 100644 --- a/stripe/src/lib.rs +++ b/stripe/src/lib.rs @@ -301,12 +301,9 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. + /// The following environment variables are expected to be set: + /// * `STRIPE_API_KEY` pub fn new_from_env() -> Self { let token = env::var("STRIPE_API_KEY").expect("must set STRIPE_API_KEY"); diff --git a/tripactions/src/lib.rs b/tripactions/src/lib.rs index 5d3e19d8..bba0b55d 100644 --- a/tripactions/src/lib.rs +++ b/tripactions/src/lib.rs @@ -295,10 +295,10 @@ impl Client { /// Create a new Client struct from environment variables. It /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// an &str (`String` or `Vec` for example). + /// The following environment variables are expected to be set: + /// * `TRIPACTIONS_CLIENT_ID` + /// * `TRIPACTIONS_CLIENT_SECRET` pub fn new_from_env(token: T) -> Self where T: ToString, diff --git a/zoom/src/lib.rs b/zoom/src/lib.rs index a843d398..6611ce8d 100644 --- a/zoom/src/lib.rs +++ b/zoom/src/lib.rs @@ -466,6 +466,10 @@ impl Client { /// given a valid API key and your requests will work. /// We pass in the token and refresh token to the client so if you are storing /// it in a database, you can get it first. + /// The following environment variables are expected to be set: + /// * `ZOOM_CLIENT_ID` + /// * `ZOOM_CLIENT_SECRET` + /// * `ZOOM_REDIRECT_URI` pub fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, From 32fd38c6c8b091c5eece07911f9b536a54231d6b Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 8 Jun 2023 13:47:46 -0500 Subject: [PATCH 38/40] Clarify docs for constructors and panics --- docusign/src/lib.rs | 20 ++++---- generator/src/client.rs | 65 +++++++++++++++--------- giphy/src/lib.rs | 13 +++-- google/admin/src/lib.rs | 22 ++++---- google/calendar/src/lib.rs | 22 ++++---- google/cloud-resource-manager/src/lib.rs | 22 ++++---- google/drive/src/lib.rs | 22 ++++---- google/groups-settings/src/lib.rs | 22 ++++---- google/sheets/src/lib.rs | 22 ++++---- gusto/src/lib.rs | 20 ++++---- mailchimp/src/lib.rs | 20 ++++---- okta/src/lib.rs | 13 +++-- ramp/src/lib.rs | 20 ++++---- rev.ai/src/lib.rs | 13 +++-- sendgrid/src/lib.rs | 13 +++-- shipbob/src/lib.rs | 13 +++-- shopify/src/lib.rs | 20 ++++---- slack/src/lib.rs | 20 ++++---- stripe/src/lib.rs | 13 +++-- tripactions/src/lib.rs | 18 ++++--- zoom/src/lib.rs | 20 ++++---- 21 files changed, 268 insertions(+), 165 deletions(-) diff --git a/docusign/src/lib.rs b/docusign/src/lib.rs index 25be31dc..cdac10bf 100644 --- a/docusign/src/lib.rs +++ b/docusign/src/lib.rs @@ -2350,9 +2350,11 @@ struct InnerToken { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. Requires OAuth2 configuration values as well as an access and refresh token. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new( client_id: I, client_secret: K, @@ -2496,16 +2498,16 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. Requires an existing access and refresh token. + /// /// The following environment variables are expected to be set: /// * `DOCUSIGN_CLIENT_ID` /// * `DOCUSIGN_CLIENT_SECRET` /// * `DOCUSIGN_REDIRECT_URI` + /// + /// # Panics + /// + /// This function will panic if the expected environment variables can not be found pub fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/generator/src/client.rs b/generator/src/client.rs index f7b933f3..d3a1de4b 100644 --- a/generator/src/client.rs +++ b/generator/src/client.rs @@ -627,9 +627,11 @@ struct InnerToken {{ }} impl Client {{ - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. Requires OAuth2 configuration values as well as an access and refresh token. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new( client_id: I, client_secret: K, @@ -818,16 +820,16 @@ fn basic_new_from_env( format!( r#" -/// Create a new Client struct from environment variables. It -/// takes a type that can convert into -/// an &str (`String` or `Vec` for example). As long as the function is -/// given a valid API key and your requests will work. -/// We pass in the token and refresh token to the client so if you are storing -/// it in a database, you can get it first. +/// Create a new Client struct from environment variables. Requires an existing access and refresh token. +/// /// The following environment variables are expected to be set: /// * `{}_CLIENT_ID` /// * `{}_CLIENT_SECRET` /// * `{}_REDIRECT_URI` +/// +/// # Panics +/// +/// This function will panic if the expected environment variables can not be found pub fn new_from_env(token: T, refresh_token: R{}, {server_arg}) -> Self where T: ToString, @@ -865,14 +867,16 @@ where } const GOOGLE_NEW_FROM_ENV_TEMPLATE: &str = r#" -/// Create a new Client struct from environment variables. It -/// takes a type that can convert into -/// an &str (`String` or `Vec` for example). As long as the function is -/// given a valid API key and your requests will work. -/// We pass in the token and refresh token to the client so if you are storing -/// it in a database, you can get it first. +/// Create a new Client struct from environment variables. Requires an existing access and refresh token +/// /// The following environment variables are expected to be set: /// * `GOOGLE_KEY_ENCODED` - A base64 encoded version of JSON formatted application secret +/// +/// # Panics +/// +/// This function will panic if an application secret can not be parsed from the encoded key +/// +/// This function will panic if the internal http client fails to create pub async fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, @@ -954,9 +958,11 @@ pub struct Client {{ }} impl Client {{ - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new( token: T, {server_arg} @@ -1019,8 +1025,13 @@ impl Client {{ }} /// Create a new Client struct from environment variables. + /// /// The following environment variables are expected to be set: /// * `{}_API_KEY` + /// + /// # Panics + /// + /// This function will panic if the expected environment variables can not be found pub fn new_from_env() -> Self {{ let token = env::var("{}_API_KEY").expect("must set {}_API_KEY"); @@ -1810,9 +1821,12 @@ pub struct Client {{ {} impl Client {{ - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. Requires OAuth2 configuration values as well as + /// an access token. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new( client_id: I, client_secret: K, @@ -1880,12 +1894,15 @@ impl Client {{ format!("{{}}{{}}", self.get_host_override().or(host).unwrap_or(self.host.as_str()), path) }} - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). + /// Create a new Client struct from environment variables. + /// /// The following environment variables are expected to be set: /// * `{}_CLIENT_ID` /// * `{}_CLIENT_SECRET` + /// + /// # Panics + /// + /// This function will panic if the expected environment variables can not be found pub fn new_from_env(token: T) -> Self where T: ToString, diff --git a/giphy/src/lib.rs b/giphy/src/lib.rs index c0ff247e..6c9994c4 100644 --- a/giphy/src/lib.rs +++ b/giphy/src/lib.rs @@ -175,9 +175,11 @@ pub struct Client { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new(token: T) -> Self where T: ToString, @@ -243,8 +245,13 @@ impl Client { } /// Create a new Client struct from environment variables. + /// /// The following environment variables are expected to be set: /// * `GIPHY_API_KEY` + /// + /// # Panics + /// + /// This function will panic if the expected environment variables can not be found pub fn new_from_env() -> Self { let token = env::var("GIPHY_API_KEY").expect("must set GIPHY_API_KEY"); diff --git a/google/admin/src/lib.rs b/google/admin/src/lib.rs index 62a5aca5..1dab648d 100644 --- a/google/admin/src/lib.rs +++ b/google/admin/src/lib.rs @@ -302,9 +302,11 @@ struct InnerToken { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. Requires OAuth2 configuration values as well as an access and refresh token. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new( client_id: I, client_secret: K, @@ -448,14 +450,16 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. Requires an existing access and refresh token + /// /// The following environment variables are expected to be set: /// * `GOOGLE_KEY_ENCODED` - A base64 encoded version of JSON formatted application secret + /// + /// # Panics + /// + /// This function will panic if an application secret can not be parsed from the encoded key + /// + /// This function will panic if the internal http client fails to create pub async fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/google/calendar/src/lib.rs b/google/calendar/src/lib.rs index 2e736656..a54074fe 100644 --- a/google/calendar/src/lib.rs +++ b/google/calendar/src/lib.rs @@ -290,9 +290,11 @@ struct InnerToken { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. Requires OAuth2 configuration values as well as an access and refresh token. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new( client_id: I, client_secret: K, @@ -436,14 +438,16 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. Requires an existing access and refresh token + /// /// The following environment variables are expected to be set: /// * `GOOGLE_KEY_ENCODED` - A base64 encoded version of JSON formatted application secret + /// + /// # Panics + /// + /// This function will panic if an application secret can not be parsed from the encoded key + /// + /// This function will panic if the internal http client fails to create pub async fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/google/cloud-resource-manager/src/lib.rs b/google/cloud-resource-manager/src/lib.rs index 8f64b342..45e4606a 100644 --- a/google/cloud-resource-manager/src/lib.rs +++ b/google/cloud-resource-manager/src/lib.rs @@ -284,9 +284,11 @@ struct InnerToken { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. Requires OAuth2 configuration values as well as an access and refresh token. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new( client_id: I, client_secret: K, @@ -430,14 +432,16 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. Requires an existing access and refresh token + /// /// The following environment variables are expected to be set: /// * `GOOGLE_KEY_ENCODED` - A base64 encoded version of JSON formatted application secret + /// + /// # Panics + /// + /// This function will panic if an application secret can not be parsed from the encoded key + /// + /// This function will panic if the internal http client fails to create pub async fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/google/drive/src/lib.rs b/google/drive/src/lib.rs index 345f1a78..0857bb6c 100644 --- a/google/drive/src/lib.rs +++ b/google/drive/src/lib.rs @@ -300,9 +300,11 @@ struct InnerToken { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. Requires OAuth2 configuration values as well as an access and refresh token. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new( client_id: I, client_secret: K, @@ -446,14 +448,16 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. Requires an existing access and refresh token + /// /// The following environment variables are expected to be set: /// * `GOOGLE_KEY_ENCODED` - A base64 encoded version of JSON formatted application secret + /// + /// # Panics + /// + /// This function will panic if an application secret can not be parsed from the encoded key + /// + /// This function will panic if the internal http client fails to create pub async fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/google/groups-settings/src/lib.rs b/google/groups-settings/src/lib.rs index a26fd81a..279d770b 100644 --- a/google/groups-settings/src/lib.rs +++ b/google/groups-settings/src/lib.rs @@ -283,9 +283,11 @@ struct InnerToken { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. Requires OAuth2 configuration values as well as an access and refresh token. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new( client_id: I, client_secret: K, @@ -429,14 +431,16 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. Requires an existing access and refresh token + /// /// The following environment variables are expected to be set: /// * `GOOGLE_KEY_ENCODED` - A base64 encoded version of JSON formatted application secret + /// + /// # Panics + /// + /// This function will panic if an application secret can not be parsed from the encoded key + /// + /// This function will panic if the internal http client fails to create pub async fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/google/sheets/src/lib.rs b/google/sheets/src/lib.rs index c126a79c..03997064 100644 --- a/google/sheets/src/lib.rs +++ b/google/sheets/src/lib.rs @@ -284,9 +284,11 @@ struct InnerToken { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. Requires OAuth2 configuration values as well as an access and refresh token. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new( client_id: I, client_secret: K, @@ -430,14 +432,16 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. Requires an existing access and refresh token + /// /// The following environment variables are expected to be set: /// * `GOOGLE_KEY_ENCODED` - A base64 encoded version of JSON formatted application secret + /// + /// # Panics + /// + /// This function will panic if an application secret can not be parsed from the encoded key + /// + /// This function will panic if the internal http client fails to create pub async fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/gusto/src/lib.rs b/gusto/src/lib.rs index 7ed2407c..c633273a 100644 --- a/gusto/src/lib.rs +++ b/gusto/src/lib.rs @@ -331,9 +331,11 @@ struct InnerToken { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. Requires OAuth2 configuration values as well as an access and refresh token. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new( client_id: I, client_secret: K, @@ -479,16 +481,16 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. Requires an existing access and refresh token. + /// /// The following environment variables are expected to be set: /// * `GUSTO_CLIENT_ID` /// * `GUSTO_CLIENT_SECRET` /// * `GUSTO_REDIRECT_URI` + /// + /// # Panics + /// + /// This function will panic if the expected environment variables can not be found pub fn new_from_env( token: T, refresh_token: R, diff --git a/mailchimp/src/lib.rs b/mailchimp/src/lib.rs index e2964196..6f2a277e 100644 --- a/mailchimp/src/lib.rs +++ b/mailchimp/src/lib.rs @@ -300,9 +300,11 @@ struct InnerToken { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. Requires OAuth2 configuration values as well as an access and refresh token. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new( client_id: I, client_secret: K, @@ -446,16 +448,16 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. Requires an existing access and refresh token. + /// /// The following environment variables are expected to be set: /// * `MAILCHIMP_CLIENT_ID` /// * `MAILCHIMP_CLIENT_SECRET` /// * `MAILCHIMP_REDIRECT_URI` + /// + /// # Panics + /// + /// This function will panic if the expected environment variables can not be found pub fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/okta/src/lib.rs b/okta/src/lib.rs index c35d064b..89287712 100644 --- a/okta/src/lib.rs +++ b/okta/src/lib.rs @@ -200,9 +200,11 @@ pub struct Client { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new(token: T) -> Self where T: ToString, @@ -268,8 +270,13 @@ impl Client { } /// Create a new Client struct from environment variables. + /// /// The following environment variables are expected to be set: /// * `OKTA_API_KEY` + /// + /// # Panics + /// + /// This function will panic if the expected environment variables can not be found pub fn new_from_env() -> Self { let token = env::var("OKTA_API_KEY").expect("must set OKTA_API_KEY"); diff --git a/ramp/src/lib.rs b/ramp/src/lib.rs index a5849ed1..00b5bf9c 100644 --- a/ramp/src/lib.rs +++ b/ramp/src/lib.rs @@ -283,9 +283,11 @@ struct InnerToken { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. Requires OAuth2 configuration values as well as an access and refresh token. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new( client_id: I, client_secret: K, @@ -429,16 +431,16 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. Requires an existing access and refresh token. + /// /// The following environment variables are expected to be set: /// * `RAMP_CLIENT_ID` /// * `RAMP_CLIENT_SECRET` /// * `RAMP_REDIRECT_URI` + /// + /// # Panics + /// + /// This function will panic if the expected environment variables can not be found pub fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/rev.ai/src/lib.rs b/rev.ai/src/lib.rs index 632955d6..6d9d7d70 100644 --- a/rev.ai/src/lib.rs +++ b/rev.ai/src/lib.rs @@ -372,9 +372,11 @@ pub struct Client { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new(token: T) -> Self where T: ToString, @@ -440,8 +442,13 @@ impl Client { } /// Create a new Client struct from environment variables. + /// /// The following environment variables are expected to be set: /// * `REVAI_API_KEY` + /// + /// # Panics + /// + /// This function will panic if the expected environment variables can not be found pub fn new_from_env() -> Self { let token = env::var("REVAI_API_KEY").expect("must set REVAI_API_KEY"); diff --git a/sendgrid/src/lib.rs b/sendgrid/src/lib.rs index 380d07cf..04741dd4 100644 --- a/sendgrid/src/lib.rs +++ b/sendgrid/src/lib.rs @@ -230,9 +230,11 @@ pub struct Client { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new(token: T) -> Self where T: ToString, @@ -298,8 +300,13 @@ impl Client { } /// Create a new Client struct from environment variables. + /// /// The following environment variables are expected to be set: /// * `SENDGRID_API_KEY` + /// + /// # Panics + /// + /// This function will panic if the expected environment variables can not be found pub fn new_from_env() -> Self { let token = env::var("SENDGRID_API_KEY").expect("must set SENDGRID_API_KEY"); diff --git a/shipbob/src/lib.rs b/shipbob/src/lib.rs index 4d987584..c359100c 100644 --- a/shipbob/src/lib.rs +++ b/shipbob/src/lib.rs @@ -257,9 +257,11 @@ pub struct Client { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new(token: T) -> Self where T: ToString, @@ -325,8 +327,13 @@ impl Client { } /// Create a new Client struct from environment variables. + /// /// The following environment variables are expected to be set: /// * `SHIPBOB_API_KEY` + /// + /// # Panics + /// + /// This function will panic if the expected environment variables can not be found pub fn new_from_env() -> Self { let token = env::var("SHIPBOB_API_KEY").expect("must set SHIPBOB_API_KEY"); diff --git a/shopify/src/lib.rs b/shopify/src/lib.rs index 9f2cea1e..e76ab576 100644 --- a/shopify/src/lib.rs +++ b/shopify/src/lib.rs @@ -279,9 +279,11 @@ struct InnerToken { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. Requires OAuth2 configuration values as well as an access and refresh token. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new( client_id: I, client_secret: K, @@ -425,16 +427,16 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. Requires an existing access and refresh token. + /// /// The following environment variables are expected to be set: /// * `SHOPIFY_CLIENT_ID` /// * `SHOPIFY_CLIENT_SECRET` /// * `SHOPIFY_REDIRECT_URI` + /// + /// # Panics + /// + /// This function will panic if the expected environment variables can not be found pub fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/slack/src/lib.rs b/slack/src/lib.rs index a6561b7b..4cb97b00 100644 --- a/slack/src/lib.rs +++ b/slack/src/lib.rs @@ -331,9 +331,11 @@ struct InnerToken { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. Requires OAuth2 configuration values as well as an access and refresh token. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new( client_id: I, client_secret: K, @@ -477,16 +479,16 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. Requires an existing access and refresh token. + /// /// The following environment variables are expected to be set: /// * `SLACK_CLIENT_ID` /// * `SLACK_CLIENT_SECRET` /// * `SLACK_REDIRECT_URI` + /// + /// # Panics + /// + /// This function will panic if the expected environment variables can not be found pub fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, diff --git a/stripe/src/lib.rs b/stripe/src/lib.rs index 8d41ee15..9239f5a8 100644 --- a/stripe/src/lib.rs +++ b/stripe/src/lib.rs @@ -234,9 +234,11 @@ pub struct Client { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new(token: T) -> Self where T: ToString, @@ -302,8 +304,13 @@ impl Client { } /// Create a new Client struct from environment variables. + /// /// The following environment variables are expected to be set: /// * `STRIPE_API_KEY` + /// + /// # Panics + /// + /// This function will panic if the expected environment variables can not be found pub fn new_from_env() -> Self { let token = env::var("STRIPE_API_KEY").expect("must set STRIPE_API_KEY"); diff --git a/tripactions/src/lib.rs b/tripactions/src/lib.rs index bba0b55d..4ac149d6 100644 --- a/tripactions/src/lib.rs +++ b/tripactions/src/lib.rs @@ -222,9 +222,12 @@ pub struct AccessToken { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. Requires OAuth2 configuration values as well as + /// an access token. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new(client_id: I, client_secret: K, token: T) -> Self where I: ToString, @@ -293,12 +296,15 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). + /// Create a new Client struct from environment variables. + /// /// The following environment variables are expected to be set: /// * `TRIPACTIONS_CLIENT_ID` /// * `TRIPACTIONS_CLIENT_SECRET` + /// + /// # Panics + /// + /// This function will panic if the expected environment variables can not be found pub fn new_from_env(token: T) -> Self where T: ToString, diff --git a/zoom/src/lib.rs b/zoom/src/lib.rs index 6611ce8d..77a20922 100644 --- a/zoom/src/lib.rs +++ b/zoom/src/lib.rs @@ -314,9 +314,11 @@ struct InnerToken { } impl Client { - /// Create a new Client struct. It takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key your requests will work. + /// Create a new Client struct. Requires OAuth2 configuration values as well as an access and refresh token. + /// + /// # Panics + /// + /// This function will panic if the internal http client fails to create pub fn new( client_id: I, client_secret: K, @@ -460,16 +462,16 @@ impl Client { ) } - /// Create a new Client struct from environment variables. It - /// takes a type that can convert into - /// an &str (`String` or `Vec` for example). As long as the function is - /// given a valid API key and your requests will work. - /// We pass in the token and refresh token to the client so if you are storing - /// it in a database, you can get it first. + /// Create a new Client struct from environment variables. Requires an existing access and refresh token. + /// /// The following environment variables are expected to be set: /// * `ZOOM_CLIENT_ID` /// * `ZOOM_CLIENT_SECRET` /// * `ZOOM_REDIRECT_URI` + /// + /// # Panics + /// + /// This function will panic if the expected environment variables can not be found pub fn new_from_env(token: T, refresh_token: R) -> Self where T: ToString, From 6956fab48fad34c08eecfcb5037c9f666277124e Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Thu, 8 Jun 2023 15:19:51 -0500 Subject: [PATCH 39/40] Remove tokio full feature --- Cargo.lock | 12 ++++++------ docusign/Cargo.toml | 4 ++-- generator/src/main.rs | 4 ++-- giphy/Cargo.toml | 4 ++-- github/Cargo.toml | 4 ++-- google/admin/Cargo.toml | 4 ++-- google/calendar/Cargo.toml | 4 ++-- google/cloud-resource-manager/Cargo.toml | 4 ++-- google/drive/Cargo.toml | 4 ++-- google/groups-settings/Cargo.toml | 4 ++-- google/sheets/Cargo.toml | 4 ++-- gusto/Cargo.toml | 4 ++-- mailchimp/Cargo.toml | 4 ++-- okta/Cargo.toml | 4 ++-- ramp/Cargo.toml | 4 ++-- rev.ai/Cargo.toml | 4 ++-- sendgrid/Cargo.toml | 4 ++-- shipbob/Cargo.toml | 4 ++-- shopify/Cargo.toml | 4 ++-- slack/Cargo.toml | 4 ++-- stripe/Cargo.toml | 4 ++-- tripactions/Cargo.toml | 4 ++-- zoom/Cargo.toml | 4 ++-- 23 files changed, 50 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1c1e0ec5..c60c0770 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1577,7 +1577,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.3", + "parking_lot_core 0.9.7", ] [[package]] @@ -1596,15 +1596,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.3" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys 0.36.1", + "windows-sys 0.45.0", ] [[package]] @@ -2437,9 +2437,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] diff --git a/docusign/Cargo.toml b/docusign/Cargo.toml index a9c0ff14..7e91a728 100644 --- a/docusign/Cargo.toml +++ b/docusign/Cargo.toml @@ -42,7 +42,7 @@ bytes = { version = "1", features = ["serde"] } async-trait = "^0.1.51" uuid = { version = "1.1", features = ["serde", "v4"] } thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -50,7 +50,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/generator/src/main.rs b/generator/src/main.rs index 34938b4e..082aca1f 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -3401,7 +3401,7 @@ serde_json = "1" serde_urlencoded = "^0.7" url = {{ version = "2", features = ["serde"] }}{}{} thiserror = "1" -tokio = {{ version = "1.25.0", features = ["full"] }} +tokio = {{ version = "1.25.0", default-features = false }} [dev-dependencies] base64 = "^0.21" @@ -3409,7 +3409,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = {{ version = "1.25.0", features = ["test-util"] }} +tokio = {{ version = "1.25.0", features = ["full", "test-util"] }} wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/giphy/Cargo.toml b/giphy/Cargo.toml index a56b34f4..0aea4281 100644 --- a/giphy/Cargo.toml +++ b/giphy/Cargo.toml @@ -42,7 +42,7 @@ bytes = { version = "1", features = ["serde"] } async-trait = "^0.1.51" uuid = { version = "1.1", features = ["serde", "v4"] } thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -50,7 +50,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/github/Cargo.toml b/github/Cargo.toml index 6759951a..50961cb9 100644 --- a/github/Cargo.toml +++ b/github/Cargo.toml @@ -42,7 +42,7 @@ bytes = { version = "1", features = ["serde"] } async-trait = "^0.1.51" uuid = { version = "1.1", features = ["serde", "v4"] } thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -50,7 +50,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/google/admin/Cargo.toml b/google/admin/Cargo.toml index 8068858a..7608582a 100644 --- a/google/admin/Cargo.toml +++ b/google/admin/Cargo.toml @@ -44,7 +44,7 @@ uuid = { version = "1.1", features = ["serde", "v4"] } base64 = "^0.21" yup-oauth2 = "^8" thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -52,7 +52,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/google/calendar/Cargo.toml b/google/calendar/Cargo.toml index 6881b5d5..a391fa8b 100644 --- a/google/calendar/Cargo.toml +++ b/google/calendar/Cargo.toml @@ -44,7 +44,7 @@ uuid = { version = "1.1", features = ["serde", "v4"] } base64 = "^0.21" yup-oauth2 = "^8" thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -52,7 +52,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/google/cloud-resource-manager/Cargo.toml b/google/cloud-resource-manager/Cargo.toml index 370fcb17..4b26d072 100644 --- a/google/cloud-resource-manager/Cargo.toml +++ b/google/cloud-resource-manager/Cargo.toml @@ -44,7 +44,7 @@ uuid = { version = "1.1", features = ["serde", "v4"] } base64 = "^0.21" yup-oauth2 = "^8" thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -52,7 +52,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/google/drive/Cargo.toml b/google/drive/Cargo.toml index 4d686eed..b3af7328 100644 --- a/google/drive/Cargo.toml +++ b/google/drive/Cargo.toml @@ -44,7 +44,7 @@ uuid = { version = "1.1", features = ["serde", "v4"] } base64 = "^0.21" yup-oauth2 = "^8" thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -52,7 +52,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/google/groups-settings/Cargo.toml b/google/groups-settings/Cargo.toml index af1c6416..5c26d195 100644 --- a/google/groups-settings/Cargo.toml +++ b/google/groups-settings/Cargo.toml @@ -44,7 +44,7 @@ uuid = { version = "1.1", features = ["serde", "v4"] } base64 = "^0.21" yup-oauth2 = "^8" thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -52,7 +52,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/google/sheets/Cargo.toml b/google/sheets/Cargo.toml index dfe00b44..7b5433b2 100644 --- a/google/sheets/Cargo.toml +++ b/google/sheets/Cargo.toml @@ -44,7 +44,7 @@ uuid = { version = "1.1", features = ["serde", "v4"] } base64 = "^0.21" yup-oauth2 = "^8" thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -52,7 +52,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/gusto/Cargo.toml b/gusto/Cargo.toml index 945ff311..789f6b83 100644 --- a/gusto/Cargo.toml +++ b/gusto/Cargo.toml @@ -42,7 +42,7 @@ bytes = { version = "1", features = ["serde"] } async-trait = "^0.1.51" uuid = { version = "1.1", features = ["serde", "v4"] } thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -50,7 +50,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/mailchimp/Cargo.toml b/mailchimp/Cargo.toml index d444e0f4..2c57b289 100644 --- a/mailchimp/Cargo.toml +++ b/mailchimp/Cargo.toml @@ -42,7 +42,7 @@ bytes = { version = "1", features = ["serde"] } async-trait = "^0.1.51" uuid = { version = "1.1", features = ["serde", "v4"] } thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -50,7 +50,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/okta/Cargo.toml b/okta/Cargo.toml index b9efe066..a7e5df44 100644 --- a/okta/Cargo.toml +++ b/okta/Cargo.toml @@ -42,7 +42,7 @@ bytes = { version = "1", features = ["serde"] } async-trait = "^0.1.51" uuid = { version = "1.1", features = ["serde", "v4"] } thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -50,7 +50,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/ramp/Cargo.toml b/ramp/Cargo.toml index 4c9ca908..29f9d8cc 100644 --- a/ramp/Cargo.toml +++ b/ramp/Cargo.toml @@ -42,7 +42,7 @@ bytes = { version = "1", features = ["serde"] } async-trait = "^0.1.51" uuid = { version = "1.1", features = ["serde", "v4"] } thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -50,7 +50,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/rev.ai/Cargo.toml b/rev.ai/Cargo.toml index b0893dde..e919090c 100644 --- a/rev.ai/Cargo.toml +++ b/rev.ai/Cargo.toml @@ -42,7 +42,7 @@ bytes = { version = "1", features = ["serde"] } async-trait = "^0.1.51" uuid = { version = "1.1", features = ["serde", "v4"] } thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -50,7 +50,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/sendgrid/Cargo.toml b/sendgrid/Cargo.toml index cc7a2cb6..ae0e0543 100644 --- a/sendgrid/Cargo.toml +++ b/sendgrid/Cargo.toml @@ -42,7 +42,7 @@ bytes = { version = "1", features = ["serde"] } async-trait = "^0.1.51" uuid = { version = "1.1", features = ["serde", "v4"] } thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -50,7 +50,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/shipbob/Cargo.toml b/shipbob/Cargo.toml index 1fef02ad..26c0f515 100644 --- a/shipbob/Cargo.toml +++ b/shipbob/Cargo.toml @@ -42,7 +42,7 @@ bytes = { version = "1", features = ["serde"] } async-trait = "^0.1.51" uuid = { version = "1.1", features = ["serde", "v4"] } thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -50,7 +50,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/shopify/Cargo.toml b/shopify/Cargo.toml index c325bea7..0eb6f443 100644 --- a/shopify/Cargo.toml +++ b/shopify/Cargo.toml @@ -42,7 +42,7 @@ bytes = { version = "1", features = ["serde"] } async-trait = "^0.1.51" uuid = { version = "1.1", features = ["serde", "v4"] } thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -50,7 +50,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/slack/Cargo.toml b/slack/Cargo.toml index 946a6fe4..11ca95ad 100644 --- a/slack/Cargo.toml +++ b/slack/Cargo.toml @@ -42,7 +42,7 @@ bytes = { version = "1", features = ["serde"] } async-trait = "^0.1.51" uuid = { version = "1.1", features = ["serde", "v4"] } thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -50,7 +50,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/stripe/Cargo.toml b/stripe/Cargo.toml index c1380084..4c98dcf9 100644 --- a/stripe/Cargo.toml +++ b/stripe/Cargo.toml @@ -42,7 +42,7 @@ bytes = { version = "1", features = ["serde"] } async-trait = "^0.1.51" uuid = { version = "1.1", features = ["serde", "v4"] } thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -50,7 +50,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/tripactions/Cargo.toml b/tripactions/Cargo.toml index 075bac54..fe722e7b 100644 --- a/tripactions/Cargo.toml +++ b/tripactions/Cargo.toml @@ -42,7 +42,7 @@ bytes = { version = "1", features = ["serde"] } async-trait = "^0.1.51" uuid = { version = "1.1", features = ["serde", "v4"] } thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -50,7 +50,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] diff --git a/zoom/Cargo.toml b/zoom/Cargo.toml index bb83f976..06f03ffc 100644 --- a/zoom/Cargo.toml +++ b/zoom/Cargo.toml @@ -42,7 +42,7 @@ bytes = { version = "1", features = ["serde"] } async-trait = "^0.1.51" uuid = { version = "1.1", features = ["serde", "v4"] } thiserror = "1" -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.0", default-features = false } [dev-dependencies] base64 = "^0.21" @@ -50,7 +50,7 @@ dirs = "^3.0.2" nom_pem = "4" rand = "0.8.5" rsa = "0.8.1" -tokio = { version = "1.25.0", features = ["test-util"] } +tokio = { version = "1.25.0", features = ["full", "test-util"] } wiremock = "0.5.17" [package.metadata.docs.rs] From 17581fec26d8f3872dbedec412cd4cb6ebc0a365 Mon Sep 17 00:00:00 2001 From: Augustus Mayo Date: Fri, 9 Jun 2023 09:38:34 -0500 Subject: [PATCH 40/40] Fix Google clients with command urls --- generator/src/template.rs | 38 ++++++++++++++++---- google/admin/src/customer.rs | 2 +- google/cloud-resource-manager/src/folders.rs | 10 +++--- google/sheets/src/spreadsheets.rs | 10 +++--- 4 files changed, 43 insertions(+), 17 deletions(-) diff --git a/generator/src/template.rs b/generator/src/template.rs index 08b73b50..f333027c 100644 --- a/generator/src/template.rs +++ b/generator/src/template.rs @@ -9,6 +9,15 @@ enum Component { Parameter(String), } +impl Component { + fn is_command(&self) -> bool { + match self { + Self::Constant(c) => c.starts_with(':'), + _ => false, + } + } +} + #[derive(Eq, PartialEq, Clone, Debug)] pub struct Template { components: Vec, @@ -121,7 +130,10 @@ impl Template { out.push_str("&format!(\""); for c in self.components.iter() { - out.push('/'); + if !c.is_command() { + out.push('/'); + } + match c { Component::Constant(n) => out.push_str(n), Component::Parameter(_) => { @@ -176,7 +188,7 @@ fn parse_inner(t: &str) -> Result