trycourier 4.7.1 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +63 -0
- data/README.md +25 -235
- data/lib/courier/client.rb +12 -0
- data/lib/courier/internal/util.rb +50 -6
- data/lib/courier/models/audience_delete_params.rb +7 -1
- data/lib/courier/models/audience_list_members_params.rb +8 -1
- data/lib/courier/models/audience_retrieve_params.rb +7 -1
- data/lib/courier/models/audience_update_params.rb +8 -1
- data/lib/courier/models/audit_event_retrieve_params.rb +7 -1
- data/lib/courier/models/automations/invoke_invoke_by_template_params.rb +7 -1
- data/lib/courier/models/brand_delete_params.rb +7 -1
- data/lib/courier/models/brand_retrieve_params.rb +7 -1
- data/lib/courier/models/brand_update_params.rb +8 -1
- data/lib/courier/models/bulk_add_users_params.rb +7 -1
- data/lib/courier/models/bulk_list_users_params.rb +8 -1
- data/lib/courier/models/bulk_retrieve_job_params.rb +7 -1
- data/lib/courier/models/bulk_run_job_params.rb +7 -1
- data/lib/courier/models/channel.rb +75 -0
- data/lib/courier/models/channel_metadata.rb +15 -0
- data/lib/courier/models/elemental_content.rb +3 -10
- data/lib/courier/models/elemental_html_node_with_type.rb +24 -0
- data/lib/courier/models/elemental_node.rb +3 -1
- data/lib/courier/models/journey.rb +63 -0
- data/lib/courier/models/journey_invoke_params.rb +20 -0
- data/lib/courier/models/journey_list_params.rb +47 -0
- data/lib/courier/models/journeys_invoke_request.rb +49 -0
- data/lib/courier/models/journeys_invoke_response.rb +17 -0
- data/lib/courier/models/journeys_list_response.rb +24 -0
- data/lib/courier/models/list_delete_params.rb +7 -1
- data/lib/courier/models/list_restore_params.rb +7 -1
- data/lib/courier/models/list_retrieve_params.rb +7 -1
- data/lib/courier/models/list_update_params.rb +7 -1
- data/lib/courier/models/lists/subscription_add_params.rb +7 -1
- data/lib/courier/models/lists/subscription_list_params.rb +8 -1
- data/lib/courier/models/lists/subscription_subscribe_params.rb +7 -1
- data/lib/courier/models/lists/subscription_subscribe_user_params.rb +7 -1
- data/lib/courier/models/lists/subscription_unsubscribe_user_params.rb +7 -1
- data/lib/courier/models/message_cancel_params.rb +7 -1
- data/lib/courier/models/message_channels.rb +8 -0
- data/lib/courier/models/message_content_params.rb +7 -1
- data/lib/courier/models/message_details.rb +37 -37
- data/lib/courier/models/message_history_params.rb +8 -1
- data/lib/courier/models/message_providers.rb +8 -0
- data/lib/courier/models/message_providers_type.rb +38 -0
- data/lib/courier/models/message_retrieve_params.rb +7 -1
- data/lib/courier/models/metadata.rb +15 -0
- data/lib/courier/models/notification_archive_params.rb +20 -0
- data/lib/courier/models/notification_create_params.rb +14 -0
- data/lib/courier/models/notification_list_params.rb +13 -4
- data/lib/courier/models/notification_list_response.rb +108 -93
- data/lib/courier/models/notification_list_versions_params.rb +37 -0
- data/lib/courier/models/notification_publish_params.rb +20 -0
- data/lib/courier/models/notification_replace_params.rb +20 -0
- data/lib/courier/models/notification_retrieve_content_params.rb +7 -1
- data/lib/courier/models/notification_retrieve_params.rb +33 -0
- data/lib/courier/models/notification_template_create_request.rb +45 -0
- data/lib/courier/models/notification_template_get_response.rb +92 -0
- data/lib/courier/models/notification_template_mutation_response.rb +51 -0
- data/lib/courier/models/notification_template_payload.rb +98 -0
- data/lib/courier/models/notification_template_publish_request.rb +19 -0
- data/lib/courier/models/notification_template_summary.rb +81 -0
- data/lib/courier/models/notification_template_update_request.rb +46 -0
- data/lib/courier/models/notification_template_version_list_response.rb +22 -0
- data/lib/courier/models/notifications/check_delete_params.rb +7 -1
- data/lib/courier/models/notifications/check_list_params.rb +7 -1
- data/lib/courier/models/notifications/check_update_params.rb +7 -1
- data/lib/courier/models/notifications/draft_retrieve_content_params.rb +7 -1
- data/lib/courier/models/profile_create_params.rb +7 -1
- data/lib/courier/models/profile_delete_params.rb +7 -1
- data/lib/courier/models/profile_replace_params.rb +7 -1
- data/lib/courier/models/profile_retrieve_params.rb +7 -1
- data/lib/courier/models/profile_update_params.rb +8 -1
- data/lib/courier/models/profiles/list_delete_params.rb +7 -1
- data/lib/courier/models/profiles/list_retrieve_params.rb +8 -1
- data/lib/courier/models/profiles/list_subscribe_params.rb +7 -1
- data/lib/courier/models/provider.rb +67 -0
- data/lib/courier/models/provider_create_params.rb +52 -0
- data/lib/courier/models/provider_delete_params.rb +20 -0
- data/lib/courier/models/provider_list_params.rb +22 -0
- data/lib/courier/models/provider_list_response.rb +24 -0
- data/lib/courier/models/provider_retrieve_params.rb +20 -0
- data/lib/courier/models/provider_update_params.rb +58 -0
- data/lib/courier/models/providers/catalog_list_params.rb +44 -0
- data/lib/courier/models/providers/catalog_list_response.rb +26 -0
- data/lib/courier/models/providers_catalog_entry.rb +86 -0
- data/lib/courier/models/request_archive_params.rb +7 -1
- data/lib/courier/models/routing_strategy_archive_params.rb +20 -0
- data/lib/courier/models/routing_strategy_create_params.rb +14 -0
- data/lib/courier/models/routing_strategy_create_request.rb +58 -0
- data/lib/courier/models/routing_strategy_get_response.rb +99 -0
- data/lib/courier/models/routing_strategy_list_params.rb +30 -0
- data/lib/courier/models/routing_strategy_list_response.rb +24 -0
- data/lib/courier/models/routing_strategy_mutation_response.rb +19 -0
- data/lib/courier/models/routing_strategy_replace_params.rb +20 -0
- data/lib/courier/models/routing_strategy_replace_request.rb +59 -0
- data/lib/courier/models/routing_strategy_retrieve_params.rb +20 -0
- data/lib/courier/models/routing_strategy_summary.rb +75 -0
- data/lib/courier/models/send_message_params.rb +6 -154
- data/lib/courier/models/tenant_delete_params.rb +7 -1
- data/lib/courier/models/tenant_list_users_params.rb +8 -1
- data/lib/courier/models/tenant_retrieve_params.rb +7 -1
- data/lib/courier/models/tenant_template_input.rb +6 -152
- data/lib/courier/models/tenant_update_params.rb +8 -1
- data/lib/courier/models/tenants/preferences/item_delete_params.rb +7 -1
- data/lib/courier/models/tenants/preferences/item_update_params.rb +7 -1
- data/lib/courier/models/tenants/template_list_params.rb +8 -1
- data/lib/courier/models/tenants/template_publish_params.rb +7 -1
- data/lib/courier/models/tenants/template_replace_params.rb +7 -1
- data/lib/courier/models/tenants/template_retrieve_params.rb +7 -1
- data/lib/courier/models/tenants/templates/version_retrieve_params.rb +7 -1
- data/lib/courier/models/timeouts.rb +21 -0
- data/lib/courier/models/translation_retrieve_params.rb +7 -1
- data/lib/courier/models/translation_update_params.rb +7 -1
- data/lib/courier/models/users/preference_retrieve_params.rb +8 -1
- data/lib/courier/models/users/preference_retrieve_topic_params.rb +8 -1
- data/lib/courier/models/users/preference_update_or_create_topic_params.rb +8 -1
- data/lib/courier/models/users/tenant_add_multiple_params.rb +7 -1
- data/lib/courier/models/users/tenant_add_single_params.rb +7 -1
- data/lib/courier/models/users/tenant_list_params.rb +8 -1
- data/lib/courier/models/users/tenant_remove_all_params.rb +7 -1
- data/lib/courier/models/users/tenant_remove_single_params.rb +7 -1
- data/lib/courier/models/users/token_add_multiple_params.rb +7 -1
- data/lib/courier/models/users/token_add_single_params.rb +168 -2
- data/lib/courier/models/users/token_delete_params.rb +7 -1
- data/lib/courier/models/users/token_list_params.rb +7 -1
- data/lib/courier/models/users/token_retrieve_params.rb +7 -1
- data/lib/courier/models/users/token_update_params.rb +7 -1
- data/lib/courier/models/version_node.rb +46 -0
- data/lib/courier/models.rb +98 -0
- data/lib/courier/resources/audiences.rb +4 -2
- data/lib/courier/resources/audit_events.rb +2 -1
- data/lib/courier/resources/automations.rb +2 -1
- data/lib/courier/resources/brands.rb +2 -1
- data/lib/courier/resources/bulk.rb +2 -1
- data/lib/courier/resources/journeys.rb +73 -0
- data/lib/courier/resources/lists/subscriptions.rb +2 -1
- data/lib/courier/resources/lists.rb +2 -1
- data/lib/courier/resources/messages.rb +4 -2
- data/lib/courier/resources/notifications.rb +167 -4
- data/lib/courier/resources/profiles/lists.rb +2 -1
- data/lib/courier/resources/providers/catalog.rb +49 -0
- data/lib/courier/resources/providers.rb +150 -0
- data/lib/courier/resources/routing_strategies.rb +151 -0
- data/lib/courier/resources/tenants/templates.rb +2 -1
- data/lib/courier/resources/tenants.rb +4 -2
- data/lib/courier/resources/users/preferences.rb +7 -4
- data/lib/courier/resources/users/tenants.rb +2 -1
- data/lib/courier/resources/users/tokens.rb +7 -9
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +54 -0
- data/rbi/courier/client.rbi +9 -0
- data/rbi/courier/internal/util.rbi +28 -0
- data/rbi/courier/models/audience_delete_params.rbi +13 -5
- data/rbi/courier/models/audience_list_members_params.rbi +6 -0
- data/rbi/courier/models/audience_retrieve_params.rbi +13 -5
- data/rbi/courier/models/audience_update_params.rbi +6 -0
- data/rbi/courier/models/audit_event_retrieve_params.rbi +13 -5
- data/rbi/courier/models/automations/invoke_invoke_by_template_params.rbi +6 -0
- data/rbi/courier/models/brand_delete_params.rbi +13 -5
- data/rbi/courier/models/brand_retrieve_params.rbi +13 -5
- data/rbi/courier/models/brand_update_params.rbi +6 -0
- data/rbi/courier/models/bulk_add_users_params.rbi +6 -1
- data/rbi/courier/models/bulk_list_users_params.rbi +6 -0
- data/rbi/courier/models/bulk_retrieve_job_params.rbi +13 -5
- data/rbi/courier/models/bulk_run_job_params.rbi +13 -5
- data/rbi/courier/models/channel.rbi +106 -0
- data/rbi/courier/models/channel_metadata.rbi +28 -0
- data/rbi/courier/models/elemental_content.rbi +9 -12
- data/rbi/courier/models/elemental_html_node_with_type.rbi +59 -0
- data/rbi/courier/models/elemental_node.rbi +2 -1
- data/rbi/courier/models/journey.rbi +91 -0
- data/rbi/courier/models/journey_invoke_params.rbi +35 -0
- data/rbi/courier/models/journey_list_params.rbi +85 -0
- data/rbi/courier/models/journeys_invoke_request.rbi +84 -0
- data/rbi/courier/models/journeys_invoke_response.rbi +27 -0
- data/rbi/courier/models/journeys_list_response.rbi +46 -0
- data/rbi/courier/models/list_delete_params.rbi +13 -5
- data/rbi/courier/models/list_restore_params.rbi +13 -5
- data/rbi/courier/models/list_retrieve_params.rbi +13 -5
- data/rbi/courier/models/list_update_params.rbi +6 -1
- data/rbi/courier/models/lists/subscription_add_params.rbi +6 -1
- data/rbi/courier/models/lists/subscription_list_params.rbi +6 -0
- data/rbi/courier/models/lists/subscription_subscribe_params.rbi +6 -1
- data/rbi/courier/models/lists/subscription_subscribe_user_params.rbi +6 -1
- data/rbi/courier/models/lists/subscription_unsubscribe_user_params.rbi +10 -2
- data/rbi/courier/models/message_cancel_params.rbi +13 -5
- data/rbi/courier/models/message_channels.rbi +11 -0
- data/rbi/courier/models/message_content_params.rbi +13 -5
- data/rbi/courier/models/message_details.rbi +55 -43
- data/rbi/courier/models/message_history_params.rbi +10 -1
- data/rbi/courier/models/message_providers.rbi +11 -0
- data/rbi/courier/models/message_providers_type.rbi +60 -0
- data/rbi/courier/models/message_retrieve_params.rbi +13 -5
- data/rbi/courier/models/metadata.rbi +26 -0
- data/rbi/courier/models/notification_archive_params.rbi +35 -0
- data/rbi/courier/models/notification_create_params.rbi +27 -0
- data/rbi/courier/models/notification_list_params.rbi +15 -2
- data/rbi/courier/models/notification_list_response.rbi +159 -119
- data/rbi/courier/models/notification_list_versions_params.rbi +66 -0
- data/rbi/courier/models/notification_publish_params.rbi +35 -0
- data/rbi/courier/models/notification_replace_params.rbi +35 -0
- data/rbi/courier/models/notification_retrieve_content_params.rbi +13 -5
- data/rbi/courier/models/notification_retrieve_params.rbi +54 -0
- data/rbi/courier/models/notification_template_create_request.rbi +102 -0
- data/rbi/courier/models/notification_template_get_response.rbi +162 -0
- data/rbi/courier/models/notification_template_mutation_response.rbi +121 -0
- data/rbi/courier/models/notification_template_payload.rbi +183 -0
- data/rbi/courier/models/notification_template_publish_request.rbi +35 -0
- data/rbi/courier/models/notification_template_summary.rbi +124 -0
- data/rbi/courier/models/notification_template_update_request.rbi +103 -0
- data/rbi/courier/models/notification_template_version_list_response.rbi +41 -0
- data/rbi/courier/models/notifications/check_delete_params.rbi +10 -2
- data/rbi/courier/models/notifications/check_list_params.rbi +10 -2
- data/rbi/courier/models/notifications/check_update_params.rbi +6 -1
- data/rbi/courier/models/notifications/draft_retrieve_content_params.rbi +13 -5
- data/rbi/courier/models/profile_create_params.rbi +6 -1
- data/rbi/courier/models/profile_delete_params.rbi +13 -5
- data/rbi/courier/models/profile_replace_params.rbi +6 -1
- data/rbi/courier/models/profile_retrieve_params.rbi +13 -5
- data/rbi/courier/models/profile_update_params.rbi +6 -0
- data/rbi/courier/models/profiles/list_delete_params.rbi +13 -5
- data/rbi/courier/models/profiles/list_retrieve_params.rbi +6 -0
- data/rbi/courier/models/profiles/list_subscribe_params.rbi +6 -1
- data/rbi/courier/models/provider.rbi +87 -0
- data/rbi/courier/models/provider_create_params.rbi +82 -0
- data/rbi/courier/models/provider_delete_params.rbi +35 -0
- data/rbi/courier/models/provider_list_params.rbi +43 -0
- data/rbi/courier/models/provider_list_response.rbi +42 -0
- data/rbi/courier/models/provider_retrieve_params.rbi +35 -0
- data/rbi/courier/models/provider_update_params.rbi +86 -0
- data/rbi/courier/models/providers/catalog_list_params.rbi +75 -0
- data/rbi/courier/models/providers/catalog_list_response.rbi +47 -0
- data/rbi/courier/models/providers_catalog_entry.rbi +129 -0
- data/rbi/courier/models/request_archive_params.rbi +13 -5
- data/rbi/courier/models/routing_strategy_archive_params.rbi +38 -0
- data/rbi/courier/models/routing_strategy_create_params.rbi +30 -0
- data/rbi/courier/models/routing_strategy_create_request.rbi +86 -0
- data/rbi/courier/models/routing_strategy_get_response.rbi +121 -0
- data/rbi/courier/models/routing_strategy_list_params.rbi +54 -0
- data/rbi/courier/models/routing_strategy_list_response.rbi +45 -0
- data/rbi/courier/models/routing_strategy_mutation_response.rbi +31 -0
- data/rbi/courier/models/routing_strategy_replace_params.rbi +38 -0
- data/rbi/courier/models/routing_strategy_replace_request.rbi +87 -0
- data/rbi/courier/models/routing_strategy_retrieve_params.rbi +38 -0
- data/rbi/courier/models/routing_strategy_summary.rbi +95 -0
- data/rbi/courier/models/send_message_params.rbi +6 -362
- data/rbi/courier/models/tenant_delete_params.rbi +13 -5
- data/rbi/courier/models/tenant_list_users_params.rbi +6 -0
- data/rbi/courier/models/tenant_retrieve_params.rbi +13 -5
- data/rbi/courier/models/tenant_template_input.rbi +8 -336
- data/rbi/courier/models/tenant_update_params.rbi +6 -0
- data/rbi/courier/models/tenants/preferences/item_delete_params.rbi +10 -2
- data/rbi/courier/models/tenants/preferences/item_update_params.rbi +10 -2
- data/rbi/courier/models/tenants/template_list_params.rbi +6 -0
- data/rbi/courier/models/tenants/template_publish_params.rbi +10 -2
- data/rbi/courier/models/tenants/template_replace_params.rbi +10 -2
- data/rbi/courier/models/tenants/template_retrieve_params.rbi +10 -2
- data/rbi/courier/models/tenants/templates/version_retrieve_params.rbi +6 -1
- data/rbi/courier/models/timeouts.rbi +33 -0
- data/rbi/courier/models/translation_retrieve_params.rbi +10 -2
- data/rbi/courier/models/translation_update_params.rbi +6 -1
- data/rbi/courier/models/users/preference_retrieve_params.rbi +6 -0
- data/rbi/courier/models/users/preference_retrieve_topic_params.rbi +6 -0
- data/rbi/courier/models/users/preference_update_or_create_topic_params.rbi +6 -0
- data/rbi/courier/models/users/tenant_add_multiple_params.rbi +6 -1
- data/rbi/courier/models/users/tenant_add_single_params.rbi +6 -1
- data/rbi/courier/models/users/tenant_list_params.rbi +6 -0
- data/rbi/courier/models/users/tenant_remove_all_params.rbi +13 -5
- data/rbi/courier/models/users/tenant_remove_single_params.rbi +10 -2
- data/rbi/courier/models/users/token_add_multiple_params.rbi +13 -5
- data/rbi/courier/models/users/token_add_single_params.rbi +290 -3
- data/rbi/courier/models/users/token_delete_params.rbi +10 -2
- data/rbi/courier/models/users/token_list_params.rbi +13 -5
- data/rbi/courier/models/users/token_retrieve_params.rbi +10 -2
- data/rbi/courier/models/users/token_update_params.rbi +6 -1
- data/rbi/courier/models/version_node.rbi +65 -0
- data/rbi/courier/models.rbi +106 -0
- data/rbi/courier/resources/journeys.rbi +64 -0
- data/rbi/courier/resources/notifications.rbi +119 -1
- data/rbi/courier/resources/providers/catalog.rbi +38 -0
- data/rbi/courier/resources/providers.rbi +116 -0
- data/rbi/courier/resources/routing_strategies.rbi +126 -0
- data/rbi/courier/resources/users/tokens.rbi +11 -9
- data/sig/courier/client.rbs +6 -0
- data/sig/courier/internal/util.rbs +14 -0
- data/sig/courier/models/audience_delete_params.rbs +11 -3
- data/sig/courier/models/audience_list_members_params.rbs +6 -1
- data/sig/courier/models/audience_retrieve_params.rbs +11 -3
- data/sig/courier/models/audience_update_params.rbs +5 -0
- data/sig/courier/models/audit_event_retrieve_params.rbs +11 -3
- data/sig/courier/models/automations/invoke_invoke_by_template_params.rbs +5 -0
- data/sig/courier/models/brand_delete_params.rbs +11 -3
- data/sig/courier/models/brand_retrieve_params.rbs +11 -3
- data/sig/courier/models/brand_update_params.rbs +5 -0
- data/sig/courier/models/bulk_add_users_params.rbs +5 -1
- data/sig/courier/models/bulk_list_users_params.rbs +6 -1
- data/sig/courier/models/bulk_retrieve_job_params.rbs +11 -3
- data/sig/courier/models/bulk_run_job_params.rbs +11 -3
- data/sig/courier/models/channel.rbs +61 -0
- data/sig/courier/models/channel_metadata.rbs +13 -0
- data/sig/courier/models/elemental_content.rbs +3 -11
- data/sig/courier/models/elemental_html_node_with_type.rbs +32 -0
- data/sig/courier/models/elemental_node.rbs +1 -0
- data/sig/courier/models/journey.rbs +55 -0
- data/sig/courier/models/journey_invoke_params.rbs +25 -0
- data/sig/courier/models/journey_list_params.rbs +45 -0
- data/sig/courier/models/journeys_invoke_request.rbs +36 -0
- data/sig/courier/models/journeys_invoke_response.rbs +13 -0
- data/sig/courier/models/journeys_list_response.rbs +23 -0
- data/sig/courier/models/list_delete_params.rbs +12 -3
- data/sig/courier/models/list_restore_params.rbs +11 -3
- data/sig/courier/models/list_retrieve_params.rbs +11 -3
- data/sig/courier/models/list_update_params.rbs +9 -1
- data/sig/courier/models/lists/subscription_add_params.rbs +8 -1
- data/sig/courier/models/lists/subscription_list_params.rbs +6 -1
- data/sig/courier/models/lists/subscription_subscribe_params.rbs +8 -1
- data/sig/courier/models/lists/subscription_subscribe_user_params.rbs +9 -1
- data/sig/courier/models/lists/subscription_unsubscribe_user_params.rbs +6 -1
- data/sig/courier/models/message_cancel_params.rbs +11 -3
- data/sig/courier/models/message_channels.rbs +7 -0
- data/sig/courier/models/message_content_params.rbs +11 -3
- data/sig/courier/models/message_details.rbs +31 -23
- data/sig/courier/models/message_history_params.rbs +6 -1
- data/sig/courier/models/message_providers.rbs +7 -0
- data/sig/courier/models/message_providers_type.rbs +35 -0
- data/sig/courier/models/message_retrieve_params.rbs +11 -3
- data/sig/courier/models/metadata.rbs +13 -0
- data/sig/courier/models/notification_archive_params.rbs +20 -0
- data/sig/courier/models/notification_create_params.rbs +15 -0
- data/sig/courier/models/notification_list_params.rbs +7 -1
- data/sig/courier/models/notification_list_response.rbs +81 -71
- data/sig/courier/models/notification_list_versions_params.rbs +36 -0
- data/sig/courier/models/notification_publish_params.rbs +22 -0
- data/sig/courier/models/notification_replace_params.rbs +22 -0
- data/sig/courier/models/notification_retrieve_content_params.rbs +8 -3
- data/sig/courier/models/notification_retrieve_params.rbs +30 -0
- data/sig/courier/models/notification_template_create_request.rbs +40 -0
- data/sig/courier/models/notification_template_get_response.rbs +72 -0
- data/sig/courier/models/notification_template_mutation_response.rbs +46 -0
- data/sig/courier/models/notification_template_payload.rbs +75 -0
- data/sig/courier/models/notification_template_publish_request.rbs +15 -0
- data/sig/courier/models/notification_template_summary.rbs +70 -0
- data/sig/courier/models/notification_template_update_request.rbs +40 -0
- data/sig/courier/models/notification_template_version_list_response.rbs +22 -0
- data/sig/courier/models/notifications/check_delete_params.rbs +10 -2
- data/sig/courier/models/notifications/check_list_params.rbs +10 -2
- data/sig/courier/models/notifications/check_update_params.rbs +9 -1
- data/sig/courier/models/notifications/draft_retrieve_content_params.rbs +8 -3
- data/sig/courier/models/profile_create_params.rbs +5 -1
- data/sig/courier/models/profile_delete_params.rbs +11 -3
- data/sig/courier/models/profile_replace_params.rbs +5 -1
- data/sig/courier/models/profile_retrieve_params.rbs +11 -3
- data/sig/courier/models/profile_update_params.rbs +5 -1
- data/sig/courier/models/profiles/list_delete_params.rbs +11 -3
- data/sig/courier/models/profiles/list_retrieve_params.rbs +6 -1
- data/sig/courier/models/profiles/list_subscribe_params.rbs +8 -1
- data/sig/courier/models/provider.rbs +52 -0
- data/sig/courier/models/provider_create_params.rbs +47 -0
- data/sig/courier/models/provider_delete_params.rbs +20 -0
- data/sig/courier/models/provider_list_params.rbs +25 -0
- data/sig/courier/models/provider_list_response.rbs +22 -0
- data/sig/courier/models/provider_retrieve_params.rbs +20 -0
- data/sig/courier/models/provider_update_params.rbs +52 -0
- data/sig/courier/models/providers/catalog_list_params.rbs +40 -0
- data/sig/courier/models/providers/catalog_list_response.rbs +27 -0
- data/sig/courier/models/providers_catalog_entry.rbs +64 -0
- data/sig/courier/models/request_archive_params.rbs +11 -3
- data/sig/courier/models/routing_strategy_archive_params.rbs +20 -0
- data/sig/courier/models/routing_strategy_create_params.rbs +15 -0
- data/sig/courier/models/routing_strategy_create_request.rbs +45 -0
- data/sig/courier/models/routing_strategy_get_response.rbs +70 -0
- data/sig/courier/models/routing_strategy_list_params.rbs +30 -0
- data/sig/courier/models/routing_strategy_list_response.rbs +25 -0
- data/sig/courier/models/routing_strategy_mutation_response.rbs +13 -0
- data/sig/courier/models/routing_strategy_replace_params.rbs +22 -0
- data/sig/courier/models/routing_strategy_replace_request.rbs +45 -0
- data/sig/courier/models/routing_strategy_retrieve_params.rbs +20 -0
- data/sig/courier/models/routing_strategy_summary.rbs +55 -0
- data/sig/courier/models/send_message_params.rbs +8 -130
- data/sig/courier/models/tenant_delete_params.rbs +11 -3
- data/sig/courier/models/tenant_list_users_params.rbs +5 -1
- data/sig/courier/models/tenant_retrieve_params.rbs +11 -3
- data/sig/courier/models/tenant_template_input.rbs +12 -134
- data/sig/courier/models/tenant_update_params.rbs +5 -0
- data/sig/courier/models/tenants/preferences/item_delete_params.rbs +6 -1
- data/sig/courier/models/tenants/preferences/item_update_params.rbs +8 -1
- data/sig/courier/models/tenants/template_list_params.rbs +5 -1
- data/sig/courier/models/tenants/template_publish_params.rbs +8 -1
- data/sig/courier/models/tenants/template_replace_params.rbs +8 -1
- data/sig/courier/models/tenants/template_retrieve_params.rbs +6 -1
- data/sig/courier/models/tenants/templates/version_retrieve_params.rbs +5 -1
- data/sig/courier/models/timeouts.rbs +15 -0
- data/sig/courier/models/translation_retrieve_params.rbs +6 -1
- data/sig/courier/models/translation_update_params.rbs +5 -1
- data/sig/courier/models/users/preference_retrieve_params.rbs +6 -1
- data/sig/courier/models/users/preference_retrieve_topic_params.rbs +5 -1
- data/sig/courier/models/users/preference_update_or_create_topic_params.rbs +5 -0
- data/sig/courier/models/users/tenant_add_multiple_params.rbs +5 -1
- data/sig/courier/models/users/tenant_add_single_params.rbs +5 -1
- data/sig/courier/models/users/tenant_list_params.rbs +5 -1
- data/sig/courier/models/users/tenant_remove_all_params.rbs +11 -3
- data/sig/courier/models/users/tenant_remove_single_params.rbs +6 -1
- data/sig/courier/models/users/token_add_multiple_params.rbs +11 -3
- data/sig/courier/models/users/token_add_single_params.rbs +127 -4
- data/sig/courier/models/users/token_delete_params.rbs +6 -1
- data/sig/courier/models/users/token_list_params.rbs +11 -3
- data/sig/courier/models/users/token_retrieve_params.rbs +6 -1
- data/sig/courier/models/users/token_update_params.rbs +5 -0
- data/sig/courier/models/version_node.rbs +32 -0
- data/sig/courier/models.rbs +96 -0
- data/sig/courier/resources/journeys.rbs +21 -0
- data/sig/courier/resources/notifications.rbs +35 -0
- data/sig/courier/resources/providers/catalog.rbs +16 -0
- data/sig/courier/resources/providers.rbs +38 -0
- data/sig/courier/resources/routing_strategies.rbs +41 -0
- data/sig/courier/resources/users/tokens.rbs +5 -6
- metadata +164 -2
|
@@ -68,10 +68,11 @@ module Courier
|
|
|
68
68
|
# @see Courier::Models::MessageListParams
|
|
69
69
|
def list(params = {})
|
|
70
70
|
parsed, options = Courier::MessageListParams.dump_request(params)
|
|
71
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
71
72
|
@client.request(
|
|
72
73
|
method: :get,
|
|
73
74
|
path: "messages",
|
|
74
|
-
query:
|
|
75
|
+
query: query.transform_keys(message_id: "messageId", trace_id: "traceId"),
|
|
75
76
|
model: Courier::Models::MessageListResponse,
|
|
76
77
|
options: options
|
|
77
78
|
)
|
|
@@ -139,10 +140,11 @@ module Courier
|
|
|
139
140
|
# @see Courier::Models::MessageHistoryParams
|
|
140
141
|
def history(message_id, params = {})
|
|
141
142
|
parsed, options = Courier::MessageHistoryParams.dump_request(params)
|
|
143
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
142
144
|
@client.request(
|
|
143
145
|
method: :get,
|
|
144
146
|
path: ["messages/%1$s/history", message_id],
|
|
145
|
-
query:
|
|
147
|
+
query: query,
|
|
146
148
|
model: Courier::Models::MessageHistoryResponse,
|
|
147
149
|
options: options
|
|
148
150
|
)
|
|
@@ -9,11 +9,72 @@ module Courier
|
|
|
9
9
|
# @return [Courier::Resources::Notifications::Checks]
|
|
10
10
|
attr_reader :checks
|
|
11
11
|
|
|
12
|
-
#
|
|
12
|
+
# Some parameter documentations has been truncated, see
|
|
13
|
+
# {Courier::Models::NotificationCreateParams} for more details.
|
|
13
14
|
#
|
|
14
|
-
#
|
|
15
|
+
# Create a notification template. Requires all fields in the notification object.
|
|
16
|
+
# Templates are created in draft state by default.
|
|
15
17
|
#
|
|
16
|
-
# @
|
|
18
|
+
# @overload create(notification:, state: nil, request_options: {})
|
|
19
|
+
#
|
|
20
|
+
# @param notification [Courier::Models::NotificationTemplatePayload] Full document shape used in POST and PUT request bodies, and returned inside the
|
|
21
|
+
#
|
|
22
|
+
# @param state [Symbol, Courier::Models::NotificationTemplateCreateRequest::State] Template state after creation. Case-insensitive input, normalized to uppercase i
|
|
23
|
+
#
|
|
24
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
25
|
+
#
|
|
26
|
+
# @return [Courier::Models::NotificationTemplateMutationResponse]
|
|
27
|
+
#
|
|
28
|
+
# @see Courier::Models::NotificationCreateParams
|
|
29
|
+
def create(params)
|
|
30
|
+
parsed, options = Courier::NotificationCreateParams.dump_request(params)
|
|
31
|
+
@client.request(
|
|
32
|
+
method: :post,
|
|
33
|
+
path: "notifications",
|
|
34
|
+
body: parsed,
|
|
35
|
+
model: Courier::NotificationTemplateMutationResponse,
|
|
36
|
+
options: options
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Some parameter documentations has been truncated, see
|
|
41
|
+
# {Courier::Models::NotificationRetrieveParams} for more details.
|
|
42
|
+
#
|
|
43
|
+
# Retrieve a notification template by ID. Returns the published version by
|
|
44
|
+
# default. Pass version=draft to retrieve an unpublished template.
|
|
45
|
+
#
|
|
46
|
+
# @overload retrieve(id, version: nil, request_options: {})
|
|
47
|
+
#
|
|
48
|
+
# @param id [String] Template ID (nt\_ prefix).
|
|
49
|
+
#
|
|
50
|
+
# @param version [String] Version to retrieve. One of "draft", "published", or a version string like "v001
|
|
51
|
+
#
|
|
52
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
53
|
+
#
|
|
54
|
+
# @return [Courier::Models::NotificationTemplateGetResponse]
|
|
55
|
+
#
|
|
56
|
+
# @see Courier::Models::NotificationRetrieveParams
|
|
57
|
+
def retrieve(id, params = {})
|
|
58
|
+
parsed, options = Courier::NotificationRetrieveParams.dump_request(params)
|
|
59
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
60
|
+
@client.request(
|
|
61
|
+
method: :get,
|
|
62
|
+
path: ["notifications/%1$s", id],
|
|
63
|
+
query: query,
|
|
64
|
+
model: Courier::NotificationTemplateGetResponse,
|
|
65
|
+
options: options
|
|
66
|
+
)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# List notification templates in your workspace.
|
|
70
|
+
#
|
|
71
|
+
# @overload list(cursor: nil, event_id: nil, notes: nil, request_options: {})
|
|
72
|
+
#
|
|
73
|
+
# @param cursor [String, nil] Opaque pagination cursor from a previous response. Omit for the first page.
|
|
74
|
+
#
|
|
75
|
+
# @param event_id [String] Filter to templates linked to this event map ID.
|
|
76
|
+
#
|
|
77
|
+
# @param notes [Boolean, nil] Include template notes in the response. Only applies to legacy templates.
|
|
17
78
|
#
|
|
18
79
|
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
19
80
|
#
|
|
@@ -22,15 +83,117 @@ module Courier
|
|
|
22
83
|
# @see Courier::Models::NotificationListParams
|
|
23
84
|
def list(params = {})
|
|
24
85
|
parsed, options = Courier::NotificationListParams.dump_request(params)
|
|
86
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
25
87
|
@client.request(
|
|
26
88
|
method: :get,
|
|
27
89
|
path: "notifications",
|
|
28
|
-
query:
|
|
90
|
+
query: query,
|
|
29
91
|
model: Courier::Models::NotificationListResponse,
|
|
30
92
|
options: options
|
|
31
93
|
)
|
|
32
94
|
end
|
|
33
95
|
|
|
96
|
+
# Archive a notification template.
|
|
97
|
+
#
|
|
98
|
+
# @overload archive(id, request_options: {})
|
|
99
|
+
#
|
|
100
|
+
# @param id [String] Template ID (nt\_ prefix).
|
|
101
|
+
#
|
|
102
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
103
|
+
#
|
|
104
|
+
# @return [nil]
|
|
105
|
+
#
|
|
106
|
+
# @see Courier::Models::NotificationArchiveParams
|
|
107
|
+
def archive(id, params = {})
|
|
108
|
+
@client.request(
|
|
109
|
+
method: :delete,
|
|
110
|
+
path: ["notifications/%1$s", id],
|
|
111
|
+
model: NilClass,
|
|
112
|
+
options: params[:request_options]
|
|
113
|
+
)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# List versions of a notification template.
|
|
117
|
+
#
|
|
118
|
+
# @overload list_versions(id, cursor: nil, limit: nil, request_options: {})
|
|
119
|
+
#
|
|
120
|
+
# @param id [String] Template ID (nt\_ prefix).
|
|
121
|
+
#
|
|
122
|
+
# @param cursor [String] Opaque pagination cursor from a previous response. Omit for the first page.
|
|
123
|
+
#
|
|
124
|
+
# @param limit [Integer] Maximum number of versions to return per page. Default 10, max 10.
|
|
125
|
+
#
|
|
126
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
127
|
+
#
|
|
128
|
+
# @return [Courier::Models::NotificationTemplateVersionListResponse]
|
|
129
|
+
#
|
|
130
|
+
# @see Courier::Models::NotificationListVersionsParams
|
|
131
|
+
def list_versions(id, params = {})
|
|
132
|
+
parsed, options = Courier::NotificationListVersionsParams.dump_request(params)
|
|
133
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
134
|
+
@client.request(
|
|
135
|
+
method: :get,
|
|
136
|
+
path: ["notifications/%1$s/versions", id],
|
|
137
|
+
query: query,
|
|
138
|
+
model: Courier::NotificationTemplateVersionListResponse,
|
|
139
|
+
options: options
|
|
140
|
+
)
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Publish a notification template. Publishes the current draft by default. Pass a
|
|
144
|
+
# version in the request body to publish a specific historical version.
|
|
145
|
+
#
|
|
146
|
+
# @overload publish(id, version: nil, request_options: {})
|
|
147
|
+
#
|
|
148
|
+
# @param id [String] Template ID (nt\_ prefix).
|
|
149
|
+
#
|
|
150
|
+
# @param version [String] Historical version to publish (e.g. "v001"). Omit to publish the current draft.
|
|
151
|
+
#
|
|
152
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
153
|
+
#
|
|
154
|
+
# @return [nil]
|
|
155
|
+
#
|
|
156
|
+
# @see Courier::Models::NotificationPublishParams
|
|
157
|
+
def publish(id, params = {})
|
|
158
|
+
parsed, options = Courier::NotificationPublishParams.dump_request(params)
|
|
159
|
+
@client.request(
|
|
160
|
+
method: :post,
|
|
161
|
+
path: ["notifications/%1$s/publish", id],
|
|
162
|
+
body: parsed,
|
|
163
|
+
model: NilClass,
|
|
164
|
+
options: options
|
|
165
|
+
)
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Some parameter documentations has been truncated, see
|
|
169
|
+
# {Courier::Models::NotificationReplaceParams} for more details.
|
|
170
|
+
#
|
|
171
|
+
# Replace a notification template. All fields are required.
|
|
172
|
+
#
|
|
173
|
+
# @overload replace(id, notification:, state: nil, request_options: {})
|
|
174
|
+
#
|
|
175
|
+
# @param id [String] Template ID (nt\_ prefix).
|
|
176
|
+
#
|
|
177
|
+
# @param notification [Courier::Models::NotificationTemplatePayload] Full document shape used in POST and PUT request bodies, and returned inside the
|
|
178
|
+
#
|
|
179
|
+
# @param state [Symbol, Courier::Models::NotificationTemplateUpdateRequest::State] Template state after update. Case-insensitive input, normalized to uppercase in
|
|
180
|
+
#
|
|
181
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
182
|
+
#
|
|
183
|
+
# @return [Courier::Models::NotificationTemplateMutationResponse]
|
|
184
|
+
#
|
|
185
|
+
# @see Courier::Models::NotificationReplaceParams
|
|
186
|
+
def replace(id, params)
|
|
187
|
+
parsed, options = Courier::NotificationReplaceParams.dump_request(params)
|
|
188
|
+
@client.request(
|
|
189
|
+
method: :put,
|
|
190
|
+
path: ["notifications/%1$s", id],
|
|
191
|
+
body: parsed,
|
|
192
|
+
model: Courier::NotificationTemplateMutationResponse,
|
|
193
|
+
options: options
|
|
194
|
+
)
|
|
195
|
+
end
|
|
196
|
+
|
|
34
197
|
# @overload retrieve_content(id, request_options: {})
|
|
35
198
|
#
|
|
36
199
|
# @param id [String]
|
|
@@ -22,10 +22,11 @@ module Courier
|
|
|
22
22
|
# @see Courier::Models::Profiles::ListRetrieveParams
|
|
23
23
|
def retrieve(user_id, params = {})
|
|
24
24
|
parsed, options = Courier::Profiles::ListRetrieveParams.dump_request(params)
|
|
25
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
25
26
|
@client.request(
|
|
26
27
|
method: :get,
|
|
27
28
|
path: ["profiles/%1$s/lists", user_id],
|
|
28
|
-
query:
|
|
29
|
+
query: query,
|
|
29
30
|
model: Courier::Models::Profiles::ListRetrieveResponse,
|
|
30
31
|
options: options
|
|
31
32
|
)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Resources
|
|
5
|
+
class Providers
|
|
6
|
+
class Catalog
|
|
7
|
+
# Some parameter documentations has been truncated, see
|
|
8
|
+
# {Courier::Models::Providers::CatalogListParams} for more details.
|
|
9
|
+
#
|
|
10
|
+
# Returns the catalog of available provider types with their display names,
|
|
11
|
+
# descriptions, and configuration schema fields (snake_case, with `type` and
|
|
12
|
+
# `required`). Providers with no configurable schema return only `provider`,
|
|
13
|
+
# `name`, and `description`.
|
|
14
|
+
#
|
|
15
|
+
# @overload list(channel: nil, keys: nil, name: nil, request_options: {})
|
|
16
|
+
#
|
|
17
|
+
# @param channel [String] Exact match (case-insensitive) against the provider channel taxonomy (e.g. `emai
|
|
18
|
+
#
|
|
19
|
+
# @param keys [String] Comma-separated provider keys to filter by (e.g. `sendgrid,twilio`).
|
|
20
|
+
#
|
|
21
|
+
# @param name [String] Case-insensitive substring match against the provider display name.
|
|
22
|
+
#
|
|
23
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
24
|
+
#
|
|
25
|
+
# @return [Courier::Models::Providers::CatalogListResponse]
|
|
26
|
+
#
|
|
27
|
+
# @see Courier::Models::Providers::CatalogListParams
|
|
28
|
+
def list(params = {})
|
|
29
|
+
parsed, options = Courier::Providers::CatalogListParams.dump_request(params)
|
|
30
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
31
|
+
@client.request(
|
|
32
|
+
method: :get,
|
|
33
|
+
path: "providers/catalog",
|
|
34
|
+
query: query,
|
|
35
|
+
model: Courier::Models::Providers::CatalogListResponse,
|
|
36
|
+
options: options
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# @api private
|
|
41
|
+
#
|
|
42
|
+
# @param client [Courier::Client]
|
|
43
|
+
def initialize(client:)
|
|
44
|
+
@client = client
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Resources
|
|
5
|
+
class Providers
|
|
6
|
+
# @return [Courier::Resources::Providers::Catalog]
|
|
7
|
+
attr_reader :catalog
|
|
8
|
+
|
|
9
|
+
# Some parameter documentations has been truncated, see
|
|
10
|
+
# {Courier::Models::ProviderCreateParams} for more details.
|
|
11
|
+
#
|
|
12
|
+
# Create a new provider configuration. The `provider` field must be a known
|
|
13
|
+
# Courier provider key (see catalog).
|
|
14
|
+
#
|
|
15
|
+
# @overload create(provider:, alias_: nil, settings: nil, title: nil, request_options: {})
|
|
16
|
+
#
|
|
17
|
+
# @param provider [String] The provider key identifying the type (e.g. "sendgrid", "twilio"). Must be a kno
|
|
18
|
+
#
|
|
19
|
+
# @param alias_ [String] Optional alias for this configuration.
|
|
20
|
+
#
|
|
21
|
+
# @param settings [Hash{Symbol=>Object}] Provider-specific settings (snake_case keys). Defaults to an empty object when o
|
|
22
|
+
#
|
|
23
|
+
# @param title [String] Optional display title. Omit to use "Default Configuration".
|
|
24
|
+
#
|
|
25
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
26
|
+
#
|
|
27
|
+
# @return [Courier::Models::Provider]
|
|
28
|
+
#
|
|
29
|
+
# @see Courier::Models::ProviderCreateParams
|
|
30
|
+
def create(params)
|
|
31
|
+
parsed, options = Courier::ProviderCreateParams.dump_request(params)
|
|
32
|
+
@client.request(
|
|
33
|
+
method: :post,
|
|
34
|
+
path: "providers",
|
|
35
|
+
body: parsed,
|
|
36
|
+
model: Courier::Provider,
|
|
37
|
+
options: options
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Fetch a single provider configuration by ID.
|
|
42
|
+
#
|
|
43
|
+
# @overload retrieve(id, request_options: {})
|
|
44
|
+
#
|
|
45
|
+
# @param id [String] A unique identifier of the provider configuration.
|
|
46
|
+
#
|
|
47
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
48
|
+
#
|
|
49
|
+
# @return [Courier::Models::Provider]
|
|
50
|
+
#
|
|
51
|
+
# @see Courier::Models::ProviderRetrieveParams
|
|
52
|
+
def retrieve(id, params = {})
|
|
53
|
+
@client.request(
|
|
54
|
+
method: :get,
|
|
55
|
+
path: ["providers/%1$s", id],
|
|
56
|
+
model: Courier::Provider,
|
|
57
|
+
options: params[:request_options]
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Some parameter documentations has been truncated, see
|
|
62
|
+
# {Courier::Models::ProviderUpdateParams} for more details.
|
|
63
|
+
#
|
|
64
|
+
# Update an existing provider configuration. The `provider` key is required. All
|
|
65
|
+
# other fields are optional — omitted fields are cleared from the stored
|
|
66
|
+
# configuration (this is a full replacement, not a partial merge).
|
|
67
|
+
#
|
|
68
|
+
# @overload update(id, provider:, alias_: nil, settings: nil, title: nil, request_options: {})
|
|
69
|
+
#
|
|
70
|
+
# @param id [String] A unique identifier of the provider configuration to update.
|
|
71
|
+
#
|
|
72
|
+
# @param provider [String] The provider key identifying the type.
|
|
73
|
+
#
|
|
74
|
+
# @param alias_ [String] Updated alias. Omit to clear.
|
|
75
|
+
#
|
|
76
|
+
# @param settings [Hash{Symbol=>Object}] Provider-specific settings (snake_case keys). Replaces the full settings object
|
|
77
|
+
#
|
|
78
|
+
# @param title [String] Updated display title.
|
|
79
|
+
#
|
|
80
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
81
|
+
#
|
|
82
|
+
# @return [Courier::Models::Provider]
|
|
83
|
+
#
|
|
84
|
+
# @see Courier::Models::ProviderUpdateParams
|
|
85
|
+
def update(id, params)
|
|
86
|
+
parsed, options = Courier::ProviderUpdateParams.dump_request(params)
|
|
87
|
+
@client.request(
|
|
88
|
+
method: :post,
|
|
89
|
+
path: ["providers/%1$s", id],
|
|
90
|
+
body: parsed,
|
|
91
|
+
model: Courier::Provider,
|
|
92
|
+
options: options
|
|
93
|
+
)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# List configured provider integrations for the current workspace. Supports
|
|
97
|
+
# cursor-based pagination.
|
|
98
|
+
#
|
|
99
|
+
# @overload list(cursor: nil, request_options: {})
|
|
100
|
+
#
|
|
101
|
+
# @param cursor [String] Opaque cursor for fetching the next page.
|
|
102
|
+
#
|
|
103
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
104
|
+
#
|
|
105
|
+
# @return [Courier::Models::ProviderListResponse]
|
|
106
|
+
#
|
|
107
|
+
# @see Courier::Models::ProviderListParams
|
|
108
|
+
def list(params = {})
|
|
109
|
+
parsed, options = Courier::ProviderListParams.dump_request(params)
|
|
110
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
111
|
+
@client.request(
|
|
112
|
+
method: :get,
|
|
113
|
+
path: "providers",
|
|
114
|
+
query: query,
|
|
115
|
+
model: Courier::Models::ProviderListResponse,
|
|
116
|
+
options: options
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Delete a provider configuration. Returns 409 if the provider is still referenced
|
|
121
|
+
# by routing or notifications.
|
|
122
|
+
#
|
|
123
|
+
# @overload delete(id, request_options: {})
|
|
124
|
+
#
|
|
125
|
+
# @param id [String] A unique identifier of the provider configuration to delete.
|
|
126
|
+
#
|
|
127
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
128
|
+
#
|
|
129
|
+
# @return [nil]
|
|
130
|
+
#
|
|
131
|
+
# @see Courier::Models::ProviderDeleteParams
|
|
132
|
+
def delete(id, params = {})
|
|
133
|
+
@client.request(
|
|
134
|
+
method: :delete,
|
|
135
|
+
path: ["providers/%1$s", id],
|
|
136
|
+
model: NilClass,
|
|
137
|
+
options: params[:request_options]
|
|
138
|
+
)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# @api private
|
|
142
|
+
#
|
|
143
|
+
# @param client [Courier::Client]
|
|
144
|
+
def initialize(client:)
|
|
145
|
+
@client = client
|
|
146
|
+
@catalog = Courier::Resources::Providers::Catalog.new(client: client)
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Resources
|
|
5
|
+
class RoutingStrategies
|
|
6
|
+
# Create a routing strategy. Requires a name and routing configuration at minimum.
|
|
7
|
+
# Channels and providers default to empty if omitted.
|
|
8
|
+
#
|
|
9
|
+
# @overload create(name:, routing:, channels: nil, description: nil, providers: nil, tags: nil, request_options: {})
|
|
10
|
+
#
|
|
11
|
+
# @param name [String] Human-readable name for the routing strategy.
|
|
12
|
+
#
|
|
13
|
+
# @param routing [Courier::Models::MessageRouting] Routing tree defining channel selection method and order.
|
|
14
|
+
#
|
|
15
|
+
# @param channels [Hash{Symbol=>Courier::Models::Channel}, nil] Per-channel delivery configuration. Defaults to empty if omitted.
|
|
16
|
+
#
|
|
17
|
+
# @param description [String, nil] Optional description of the routing strategy.
|
|
18
|
+
#
|
|
19
|
+
# @param providers [Hash{Symbol=>Courier::Models::MessageProvidersType}, nil] Per-provider delivery configuration. Defaults to empty if omitted.
|
|
20
|
+
#
|
|
21
|
+
# @param tags [Array<String>, nil] Optional tags for categorization.
|
|
22
|
+
#
|
|
23
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
24
|
+
#
|
|
25
|
+
# @return [Courier::Models::RoutingStrategyMutationResponse]
|
|
26
|
+
#
|
|
27
|
+
# @see Courier::Models::RoutingStrategyCreateParams
|
|
28
|
+
def create(params)
|
|
29
|
+
parsed, options = Courier::RoutingStrategyCreateParams.dump_request(params)
|
|
30
|
+
@client.request(
|
|
31
|
+
method: :post,
|
|
32
|
+
path: "routing-strategies",
|
|
33
|
+
body: parsed,
|
|
34
|
+
model: Courier::RoutingStrategyMutationResponse,
|
|
35
|
+
options: options
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Retrieve a routing strategy by ID. Returns the full entity including routing
|
|
40
|
+
# content and metadata.
|
|
41
|
+
#
|
|
42
|
+
# @overload retrieve(id, request_options: {})
|
|
43
|
+
#
|
|
44
|
+
# @param id [String] Routing strategy ID (rs\_ prefix).
|
|
45
|
+
#
|
|
46
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
47
|
+
#
|
|
48
|
+
# @return [Courier::Models::RoutingStrategyGetResponse]
|
|
49
|
+
#
|
|
50
|
+
# @see Courier::Models::RoutingStrategyRetrieveParams
|
|
51
|
+
def retrieve(id, params = {})
|
|
52
|
+
@client.request(
|
|
53
|
+
method: :get,
|
|
54
|
+
path: ["routing-strategies/%1$s", id],
|
|
55
|
+
model: Courier::RoutingStrategyGetResponse,
|
|
56
|
+
options: params[:request_options]
|
|
57
|
+
)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List routing strategies in your workspace. Returns metadata only (no
|
|
61
|
+
# routing/channels/providers content). Use GET /routing-strategies/{id} for full
|
|
62
|
+
# details.
|
|
63
|
+
#
|
|
64
|
+
# @overload list(cursor: nil, limit: nil, request_options: {})
|
|
65
|
+
#
|
|
66
|
+
# @param cursor [String, nil] Opaque pagination cursor from a previous response. Omit for the first page.
|
|
67
|
+
#
|
|
68
|
+
# @param limit [Integer] Maximum number of results per page. Default 20, max 100.
|
|
69
|
+
#
|
|
70
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
71
|
+
#
|
|
72
|
+
# @return [Courier::Models::RoutingStrategyListResponse]
|
|
73
|
+
#
|
|
74
|
+
# @see Courier::Models::RoutingStrategyListParams
|
|
75
|
+
def list(params = {})
|
|
76
|
+
parsed, options = Courier::RoutingStrategyListParams.dump_request(params)
|
|
77
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
78
|
+
@client.request(
|
|
79
|
+
method: :get,
|
|
80
|
+
path: "routing-strategies",
|
|
81
|
+
query: query,
|
|
82
|
+
model: Courier::RoutingStrategyListResponse,
|
|
83
|
+
options: options
|
|
84
|
+
)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Archive a routing strategy. The strategy must not have associated notification
|
|
88
|
+
# templates. Unlink all templates before archiving.
|
|
89
|
+
#
|
|
90
|
+
# @overload archive(id, request_options: {})
|
|
91
|
+
#
|
|
92
|
+
# @param id [String] Routing strategy ID (rs\_ prefix).
|
|
93
|
+
#
|
|
94
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
95
|
+
#
|
|
96
|
+
# @return [nil]
|
|
97
|
+
#
|
|
98
|
+
# @see Courier::Models::RoutingStrategyArchiveParams
|
|
99
|
+
def archive(id, params = {})
|
|
100
|
+
@client.request(
|
|
101
|
+
method: :delete,
|
|
102
|
+
path: ["routing-strategies/%1$s", id],
|
|
103
|
+
model: NilClass,
|
|
104
|
+
options: params[:request_options]
|
|
105
|
+
)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Replace a routing strategy. Full document replacement; the caller must send the
|
|
109
|
+
# complete desired state. Missing optional fields are cleared.
|
|
110
|
+
#
|
|
111
|
+
# @overload replace(id, name:, routing:, channels: nil, description: nil, providers: nil, tags: nil, request_options: {})
|
|
112
|
+
#
|
|
113
|
+
# @param id [String] Routing strategy ID (rs\_ prefix).
|
|
114
|
+
#
|
|
115
|
+
# @param name [String] Human-readable name for the routing strategy.
|
|
116
|
+
#
|
|
117
|
+
# @param routing [Courier::Models::MessageRouting] Routing tree defining channel selection method and order.
|
|
118
|
+
#
|
|
119
|
+
# @param channels [Hash{Symbol=>Courier::Models::Channel}, nil] Per-channel delivery configuration. Omit to clear.
|
|
120
|
+
#
|
|
121
|
+
# @param description [String, nil] Optional description. Omit or null to clear.
|
|
122
|
+
#
|
|
123
|
+
# @param providers [Hash{Symbol=>Courier::Models::MessageProvidersType}, nil] Per-provider delivery configuration. Omit to clear.
|
|
124
|
+
#
|
|
125
|
+
# @param tags [Array<String>, nil] Optional tags. Omit or null to clear.
|
|
126
|
+
#
|
|
127
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
128
|
+
#
|
|
129
|
+
# @return [Courier::Models::RoutingStrategyMutationResponse]
|
|
130
|
+
#
|
|
131
|
+
# @see Courier::Models::RoutingStrategyReplaceParams
|
|
132
|
+
def replace(id, params)
|
|
133
|
+
parsed, options = Courier::RoutingStrategyReplaceParams.dump_request(params)
|
|
134
|
+
@client.request(
|
|
135
|
+
method: :put,
|
|
136
|
+
path: ["routing-strategies/%1$s", id],
|
|
137
|
+
body: parsed,
|
|
138
|
+
model: Courier::RoutingStrategyMutationResponse,
|
|
139
|
+
options: options
|
|
140
|
+
)
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# @api private
|
|
144
|
+
#
|
|
145
|
+
# @param client [Courier::Client]
|
|
146
|
+
def initialize(client:)
|
|
147
|
+
@client = client
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
@@ -51,10 +51,11 @@ module Courier
|
|
|
51
51
|
# @see Courier::Models::Tenants::TemplateListParams
|
|
52
52
|
def list(tenant_id, params = {})
|
|
53
53
|
parsed, options = Courier::Tenants::TemplateListParams.dump_request(params)
|
|
54
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
54
55
|
@client.request(
|
|
55
56
|
method: :get,
|
|
56
57
|
path: ["tenants/%1$s/templates", tenant_id],
|
|
57
|
-
query:
|
|
58
|
+
query: query,
|
|
58
59
|
model: Courier::Models::Tenants::TemplateListResponse,
|
|
59
60
|
options: options
|
|
60
61
|
)
|
|
@@ -86,10 +86,11 @@ module Courier
|
|
|
86
86
|
# @see Courier::Models::TenantListParams
|
|
87
87
|
def list(params = {})
|
|
88
88
|
parsed, options = Courier::TenantListParams.dump_request(params)
|
|
89
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
89
90
|
@client.request(
|
|
90
91
|
method: :get,
|
|
91
92
|
path: "tenants",
|
|
92
|
-
query:
|
|
93
|
+
query: query,
|
|
93
94
|
model: Courier::Models::TenantListResponse,
|
|
94
95
|
options: options
|
|
95
96
|
)
|
|
@@ -135,10 +136,11 @@ module Courier
|
|
|
135
136
|
# @see Courier::Models::TenantListUsersParams
|
|
136
137
|
def list_users(tenant_id, params = {})
|
|
137
138
|
parsed, options = Courier::TenantListUsersParams.dump_request(params)
|
|
139
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
138
140
|
@client.request(
|
|
139
141
|
method: :get,
|
|
140
142
|
path: ["tenants/%1$s/users", tenant_id],
|
|
141
|
-
query:
|
|
143
|
+
query: query,
|
|
142
144
|
model: Courier::Models::TenantListUsersResponse,
|
|
143
145
|
options: options
|
|
144
146
|
)
|
|
@@ -22,10 +22,11 @@ module Courier
|
|
|
22
22
|
# @see Courier::Models::Users::PreferenceRetrieveParams
|
|
23
23
|
def retrieve(user_id, params = {})
|
|
24
24
|
parsed, options = Courier::Users::PreferenceRetrieveParams.dump_request(params)
|
|
25
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
25
26
|
@client.request(
|
|
26
27
|
method: :get,
|
|
27
28
|
path: ["users/%1$s/preferences", user_id],
|
|
28
|
-
query:
|
|
29
|
+
query: query,
|
|
29
30
|
model: Courier::Models::Users::PreferenceRetrieveResponse,
|
|
30
31
|
options: options
|
|
31
32
|
)
|
|
@@ -51,6 +52,7 @@ module Courier
|
|
|
51
52
|
# @see Courier::Models::Users::PreferenceRetrieveTopicParams
|
|
52
53
|
def retrieve_topic(topic_id, params)
|
|
53
54
|
parsed, options = Courier::Users::PreferenceRetrieveTopicParams.dump_request(params)
|
|
55
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
54
56
|
user_id =
|
|
55
57
|
parsed.delete(:user_id) do
|
|
56
58
|
raise ArgumentError.new("missing required path argument #{_1}")
|
|
@@ -58,7 +60,7 @@ module Courier
|
|
|
58
60
|
@client.request(
|
|
59
61
|
method: :get,
|
|
60
62
|
path: ["users/%1$s/preferences/%2$s", user_id, topic_id],
|
|
61
|
-
query:
|
|
63
|
+
query: query,
|
|
62
64
|
model: Courier::Models::Users::PreferenceRetrieveTopicResponse,
|
|
63
65
|
options: options
|
|
64
66
|
)
|
|
@@ -85,16 +87,17 @@ module Courier
|
|
|
85
87
|
#
|
|
86
88
|
# @see Courier::Models::Users::PreferenceUpdateOrCreateTopicParams
|
|
87
89
|
def update_or_create_topic(topic_id, params)
|
|
90
|
+
query_params = [:tenant_id]
|
|
88
91
|
parsed, options = Courier::Users::PreferenceUpdateOrCreateTopicParams.dump_request(params)
|
|
92
|
+
query = Courier::Internal::Util.encode_query_params(parsed.slice(*query_params))
|
|
89
93
|
user_id =
|
|
90
94
|
parsed.delete(:user_id) do
|
|
91
95
|
raise ArgumentError.new("missing required path argument #{_1}")
|
|
92
96
|
end
|
|
93
|
-
query_params = [:tenant_id]
|
|
94
97
|
@client.request(
|
|
95
98
|
method: :put,
|
|
96
99
|
path: ["users/%1$s/preferences/%2$s", user_id, topic_id],
|
|
97
|
-
query:
|
|
100
|
+
query: query,
|
|
98
101
|
body: parsed.except(*query_params),
|
|
99
102
|
model: Courier::Models::Users::PreferenceUpdateOrCreateTopicResponse,
|
|
100
103
|
options: options
|
|
@@ -24,10 +24,11 @@ module Courier
|
|
|
24
24
|
# @see Courier::Models::Users::TenantListParams
|
|
25
25
|
def list(user_id, params = {})
|
|
26
26
|
parsed, options = Courier::Users::TenantListParams.dump_request(params)
|
|
27
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
27
28
|
@client.request(
|
|
28
29
|
method: :get,
|
|
29
30
|
path: ["users/%1$s/tenants", user_id],
|
|
30
|
-
query:
|
|
31
|
+
query: query,
|
|
31
32
|
model: Courier::Models::Users::TenantListResponse,
|
|
32
33
|
options: options
|
|
33
34
|
)
|