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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3402c91918996a99ee5f6847167c87f49ca1d0a711da6de88c1ab620ea1ca58c
|
|
4
|
+
data.tar.gz: cc72a6efa7d4c23d88069a482f153da899680bcebc0a418e85361e759441fe52
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bea7a9fa2457eca3c876aa38a6bbb492fec8f965b06e4b2e1a8ae3df10454cfe08aa04536546e392a36c03341a54bf7103a8444c6de9dd97c1cdc35abba942f6
|
|
7
|
+
data.tar.gz: 10913c571258c67c3ce10362794e30d2a742b117cde9f4ddbe02a8eabf7c568be4bb64871169ece92b2fe443a3480471adab6c506ac41b7a172579740827b3a0
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,68 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.9.0 (2026-04-01)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v4.8.0...v4.9.0](https://github.com/trycourier/courier-ruby/compare/v4.8.0...v4.9.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** add html variant to elemental_node union ([a5a5a5d](https://github.com/trycourier/courier-ruby/commit/a5a5a5d025d5ddb27a79872b15efaaa08785b032))
|
|
10
|
+
* **api:** add notification template CRUD methods, update list params/types ([4861f87](https://github.com/trycourier/courier-ruby/commit/4861f87ead15aba7b148dc8d2790fe2d018157c9))
|
|
11
|
+
* **api:** add providers resource with create/retrieve/update/list/delete and catalog ([5191261](https://github.com/trycourier/courier-ruby/commit/519126120e84dea8276094325e49d350eff3f7bc))
|
|
12
|
+
* **api:** add routing_strategies resource with create/retrieve/list/replace/archive ([6c64599](https://github.com/trycourier/courier-ruby/commit/6c645999dd54ac75bdb777745363d662f7d9da64))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* align path encoding with RFC 3986 section 3.3 ([916afaa](https://github.com/trycourier/courier-ruby/commit/916afaafd525d4d77a42a0739e892c4d4cf5d933))
|
|
18
|
+
* **internal:** correct multipart form field name encoding ([7925b72](https://github.com/trycourier/courier-ruby/commit/7925b72544622783dd17527da1729f6f48ddb744))
|
|
19
|
+
* variable name typo ([1f59fd2](https://github.com/trycourier/courier-ruby/commit/1f59fd2c73459908b337b98135efbd79bf0bfb9a))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Chores
|
|
23
|
+
|
|
24
|
+
* **ci:** skip lint on metadata-only changes ([22a3e8d](https://github.com/trycourier/courier-ruby/commit/22a3e8d5bbfe6953bca20ba54b7bb2007f4f37c0))
|
|
25
|
+
* **ci:** support opting out of skipping builds on metadata-only commits ([a6c047e](https://github.com/trycourier/courier-ruby/commit/a6c047eaa9730f8c398082cd422bf0bc1087e882))
|
|
26
|
+
* **internal:** tweak CI branches ([08eccfe](https://github.com/trycourier/courier-ruby/commit/08eccfe4c37358304a97686df7248dc02f6ea0f4))
|
|
27
|
+
* **internal:** update gitignore ([95860ac](https://github.com/trycourier/courier-ruby/commit/95860acf54c665132e957913d0fc6187cadaf64c))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Documentation
|
|
31
|
+
|
|
32
|
+
* add AGENTS.md for AI coding assistants ([#81](https://github.com/trycourier/courier-ruby/issues/81)) ([ff1b8c2](https://github.com/trycourier/courier-ruby/commit/ff1b8c2e58007e1ccd5e631e07f28daf2027cef2))
|
|
33
|
+
* sync README from mintlify-docs (2026-03-23 19:54 UTC) ([#79](https://github.com/trycourier/courier-ruby/issues/79)) ([4b83d99](https://github.com/trycourier/courier-ruby/commit/4b83d99126c8ddedf8e137cfc683bc6be998cc35))
|
|
34
|
+
|
|
35
|
+
## 4.8.0 (2026-03-12)
|
|
36
|
+
|
|
37
|
+
Full Changelog: [v4.7.1...v4.8.0](https://github.com/trycourier/courier-ruby/compare/v4.7.1...v4.8.0)
|
|
38
|
+
|
|
39
|
+
### Features
|
|
40
|
+
|
|
41
|
+
* **api:** add journeys resource with list and invoke methods ([26a80de](https://github.com/trycourier/courier-ruby/commit/26a80de1aa75c947f63e09da0ae7cb539947ecc4))
|
|
42
|
+
* **api:** add provider_key/device/tracking to token params, remove body_token ([acb3031](https://github.com/trycourier/courier-ruby/commit/acb30313188a385e2ad39be4f4040e4e5836106d))
|
|
43
|
+
* **api:** remove brand field from ElementalContent model ([519fcc0](https://github.com/trycourier/courier-ruby/commit/519fcc0a2f35a1fd61e64362b5a2e7b2d8225232))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Bug Fixes
|
|
47
|
+
|
|
48
|
+
* mark MessageDetails timestamp fields as optional ([31a0be6](https://github.com/trycourier/courier-ruby/commit/31a0be63ee9969176a7bb3a627eabeb7c26d50f6))
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### Chores
|
|
52
|
+
|
|
53
|
+
* **ci:** add build step ([d07ae3d](https://github.com/trycourier/courier-ruby/commit/d07ae3dc073f38ac30af1311f1d70153e441bf51))
|
|
54
|
+
* **ci:** skip uploading artifacts on stainless-internal branches ([d4c0636](https://github.com/trycourier/courier-ruby/commit/d4c06361e5ef4e7c0a3a1660215d63fe845694c5))
|
|
55
|
+
* **internal:** codegen related update ([3a0f51e](https://github.com/trycourier/courier-ruby/commit/3a0f51e6a03c33097f1307ac7974a3c5ca72ac90))
|
|
56
|
+
* **internal:** codegen related update ([1cce4a8](https://github.com/trycourier/courier-ruby/commit/1cce4a8be23782aae7fb9185b8ac2efd06516842))
|
|
57
|
+
* **internal:** remove mock server code ([a81351a](https://github.com/trycourier/courier-ruby/commit/a81351a2fde27b8a785a79436394a991e9048d97))
|
|
58
|
+
* update mock server docs ([62d69fc](https://github.com/trycourier/courier-ruby/commit/62d69fc657babf8ff535e150d74a2283ddb64459))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Documentation
|
|
62
|
+
|
|
63
|
+
* add AUTO-GENERATED-OVERVIEW markers for README sync ([#75](https://github.com/trycourier/courier-ruby/issues/75)) ([ab86102](https://github.com/trycourier/courier-ruby/commit/ab86102437d2af03dc45beae7262371c70b6847f))
|
|
64
|
+
* sync README from mintlify-docs (2026-02-20 18:11 UTC) ([#76](https://github.com/trycourier/courier-ruby/issues/76)) ([cc67458](https://github.com/trycourier/courier-ruby/commit/cc6745816e152b890b84caaf666178bdbd9d3192))
|
|
65
|
+
|
|
3
66
|
## 4.7.1 (2026-02-07)
|
|
4
67
|
|
|
5
68
|
Full Changelog: [v4.7.0...v4.7.1](https://github.com/trycourier/courier-ruby/compare/v4.7.0...v4.7.1)
|
data/README.md
CHANGED
|
@@ -1,259 +1,49 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- AUTO-GENERATED-OVERVIEW:START — Do not edit this section. It is synced from mintlify-docs. -->
|
|
2
|
+
# Courier Ruby SDK
|
|
2
3
|
|
|
3
|
-
The Courier Ruby
|
|
4
|
-
|
|
5
|
-
It is generated with [Stainless](https://www.stainless.com/).
|
|
6
|
-
|
|
7
|
-
## Documentation
|
|
8
|
-
|
|
9
|
-
Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/trycourier).
|
|
10
|
-
|
|
11
|
-
The REST API documentation can be found on [www.courier.com](https://www.courier.com/docs).
|
|
4
|
+
The Courier Ruby SDK provides typed access to the Courier REST API from any Ruby 3.2+ application. It ships with Yard docstrings, RBS and RBI type definitions for Sorbet, and uses `net/http` with connection pooling.
|
|
12
5
|
|
|
13
6
|
## Installation
|
|
14
7
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<!-- x-release-please-start-version -->
|
|
8
|
+
Add to your `Gemfile`:
|
|
18
9
|
|
|
19
10
|
```ruby
|
|
20
|
-
gem "trycourier"
|
|
11
|
+
gem "trycourier"
|
|
21
12
|
```
|
|
22
13
|
|
|
23
|
-
|
|
14
|
+
Then run `bundle install`.
|
|
24
15
|
|
|
25
|
-
##
|
|
16
|
+
## Quick Start
|
|
26
17
|
|
|
27
18
|
```ruby
|
|
28
19
|
require "bundler/setup"
|
|
29
20
|
require "courier"
|
|
30
21
|
|
|
31
|
-
|
|
32
|
-
api_key: ENV["COURIER_API_KEY"] # This is the default and can be omitted
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
response = courier.send_.message(
|
|
36
|
-
message: {to: {user_id: "your_user_id"}, template: "your_template_id", data: {foo: "bar"}}
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
puts(response.requestId)
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### Handling errors
|
|
43
|
-
|
|
44
|
-
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Courier::Errors::APIError` will be thrown:
|
|
45
|
-
|
|
46
|
-
```ruby
|
|
47
|
-
begin
|
|
48
|
-
send_ = courier.send_.message(
|
|
49
|
-
message: {to: {user_id: "your_user_id"}, template: "your_template_id", data: {foo: "bar"}}
|
|
50
|
-
)
|
|
51
|
-
rescue Courier::Errors::APIConnectionError => e
|
|
52
|
-
puts("The server could not be reached")
|
|
53
|
-
puts(e.cause) # an underlying Exception, likely raised within `net/http`
|
|
54
|
-
rescue Courier::Errors::RateLimitError => e
|
|
55
|
-
puts("A 429 status code was received; we should back off a bit.")
|
|
56
|
-
rescue Courier::Errors::APIStatusError => e
|
|
57
|
-
puts("Another non-200-range status code was received")
|
|
58
|
-
puts(e.status)
|
|
59
|
-
end
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Error codes are as follows:
|
|
63
|
-
|
|
64
|
-
| Cause | Error Type |
|
|
65
|
-
| ---------------- | -------------------------- |
|
|
66
|
-
| HTTP 400 | `BadRequestError` |
|
|
67
|
-
| HTTP 401 | `AuthenticationError` |
|
|
68
|
-
| HTTP 403 | `PermissionDeniedError` |
|
|
69
|
-
| HTTP 404 | `NotFoundError` |
|
|
70
|
-
| HTTP 409 | `ConflictError` |
|
|
71
|
-
| HTTP 422 | `UnprocessableEntityError` |
|
|
72
|
-
| HTTP 429 | `RateLimitError` |
|
|
73
|
-
| HTTP >= 500 | `InternalServerError` |
|
|
74
|
-
| Other HTTP error | `APIStatusError` |
|
|
75
|
-
| Timeout | `APITimeoutError` |
|
|
76
|
-
| Network error | `APIConnectionError` |
|
|
77
|
-
|
|
78
|
-
### Retries
|
|
79
|
-
|
|
80
|
-
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
|
|
81
|
-
|
|
82
|
-
Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default.
|
|
83
|
-
|
|
84
|
-
You can use the `max_retries` option to configure or disable this:
|
|
85
|
-
|
|
86
|
-
```ruby
|
|
87
|
-
# Configure the default for all requests:
|
|
88
|
-
courier = Courier::Client.new(
|
|
89
|
-
max_retries: 0 # default is 2
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
# Or, configure per-request:
|
|
93
|
-
courier.send_.message(
|
|
94
|
-
message: {to: {user_id: "your_user_id"}, template: "your_template_id", data: {foo: "bar"}},
|
|
95
|
-
request_options: {max_retries: 5}
|
|
96
|
-
)
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### Timeouts
|
|
100
|
-
|
|
101
|
-
By default, requests will time out after 60 seconds. You can use the timeout option to configure or disable this:
|
|
102
|
-
|
|
103
|
-
```ruby
|
|
104
|
-
# Configure the default for all requests:
|
|
105
|
-
courier = Courier::Client.new(
|
|
106
|
-
timeout: nil # default is 60
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
# Or, configure per-request:
|
|
110
|
-
courier.send_.message(
|
|
111
|
-
message: {to: {user_id: "your_user_id"}, template: "your_template_id", data: {foo: "bar"}},
|
|
112
|
-
request_options: {timeout: 5}
|
|
113
|
-
)
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
On timeout, `Courier::Errors::APITimeoutError` is raised.
|
|
117
|
-
|
|
118
|
-
Note that requests that time out are retried by default.
|
|
119
|
-
|
|
120
|
-
## Advanced concepts
|
|
121
|
-
|
|
122
|
-
### BaseModel
|
|
123
|
-
|
|
124
|
-
All parameter and response objects inherit from `Courier::Internal::Type::BaseModel`, which provides several conveniences, including:
|
|
125
|
-
|
|
126
|
-
1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax.
|
|
127
|
-
|
|
128
|
-
2. Structural equivalence for equality; if two API calls return the same values, comparing the responses with == will return true.
|
|
129
|
-
|
|
130
|
-
3. Both instances and the classes themselves can be pretty-printed.
|
|
131
|
-
|
|
132
|
-
4. Helpers such as `#to_h`, `#deep_to_h`, `#to_json`, and `#to_yaml`.
|
|
133
|
-
|
|
134
|
-
### Making custom or undocumented requests
|
|
22
|
+
client = Courier::Client.new
|
|
135
23
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
```ruby
|
|
143
|
-
response =
|
|
144
|
-
courier.send_.message(
|
|
145
|
-
message: {to: {user_id: "your_user_id"}, template: "your_template_id", data: {foo: "bar"}},
|
|
146
|
-
request_options: {
|
|
147
|
-
extra_query: {my_query_parameter: value},
|
|
148
|
-
extra_body: {my_body_parameter: value},
|
|
149
|
-
extra_headers: {"my-header": value}
|
|
24
|
+
response = client.send_.message(
|
|
25
|
+
message: {
|
|
26
|
+
to: { email: "you@example.com" },
|
|
27
|
+
content: {
|
|
28
|
+
title: "Hello from Courier!",
|
|
29
|
+
body: "Your first notification, sent with the Ruby SDK."
|
|
150
30
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
puts(response[:my_undocumented_property])
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
#### Undocumented request params
|
|
157
|
-
|
|
158
|
-
If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request, as seen in the examples above.
|
|
159
|
-
|
|
160
|
-
#### Undocumented endpoints
|
|
161
|
-
|
|
162
|
-
To make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using `client.request`, like so:
|
|
163
|
-
|
|
164
|
-
```ruby
|
|
165
|
-
response = client.request(
|
|
166
|
-
method: :post,
|
|
167
|
-
path: '/undocumented/endpoint',
|
|
168
|
-
query: {"dog": "woof"},
|
|
169
|
-
headers: {"useful-header": "interesting-value"},
|
|
170
|
-
body: {"hello": "world"}
|
|
171
|
-
)
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
### Concurrency & connection pooling
|
|
175
|
-
|
|
176
|
-
The `Courier::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests.
|
|
177
|
-
|
|
178
|
-
Each instance of `Courier::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.
|
|
179
|
-
|
|
180
|
-
When all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout.
|
|
181
|
-
|
|
182
|
-
Unless otherwise specified, other classes in the SDK do not have locks protecting their underlying data structure.
|
|
183
|
-
|
|
184
|
-
## Sorbet
|
|
185
|
-
|
|
186
|
-
This library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitions, and has no dependency on sorbet-runtime.
|
|
187
|
-
|
|
188
|
-
You can provide typesafe request parameters like so:
|
|
189
|
-
|
|
190
|
-
```ruby
|
|
191
|
-
courier.send_.message(
|
|
192
|
-
message: Courier::SendMessageParams::Message.new(
|
|
193
|
-
to: Courier::UserRecipient.new(user_id: "your_user_id"),
|
|
194
|
-
template: "your_template_id",
|
|
195
|
-
data: {foo: "bar"}
|
|
196
|
-
)
|
|
197
|
-
)
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
Or, equivalently:
|
|
201
|
-
|
|
202
|
-
```ruby
|
|
203
|
-
# Hashes work, but are not typesafe:
|
|
204
|
-
courier.send_.message(
|
|
205
|
-
message: {to: {user_id: "your_user_id"}, template: "your_template_id", data: {foo: "bar"}}
|
|
31
|
+
}
|
|
206
32
|
)
|
|
207
33
|
|
|
208
|
-
|
|
209
|
-
params = Courier::SendMessageParams.new(
|
|
210
|
-
message: Courier::SendMessageParams::Message.new(
|
|
211
|
-
to: Courier::UserRecipient.new(user_id: "your_user_id"),
|
|
212
|
-
template: "your_template_id",
|
|
213
|
-
data: {foo: "bar"}
|
|
214
|
-
)
|
|
215
|
-
)
|
|
216
|
-
courier.send_.message(**params)
|
|
34
|
+
puts response.request_id
|
|
217
35
|
```
|
|
218
36
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime:
|
|
222
|
-
|
|
223
|
-
```ruby
|
|
224
|
-
# :AND
|
|
225
|
-
puts(Courier::AudienceUpdateParams::Operator::AND)
|
|
226
|
-
|
|
227
|
-
# Revealed type: `T.all(Courier::AudienceUpdateParams::Operator, Symbol)`
|
|
228
|
-
T.reveal_type(Courier::AudienceUpdateParams::Operator::AND)
|
|
229
|
-
```
|
|
37
|
+
The client reads `COURIER_API_KEY` from your environment automatically. You can also pass it explicitly: `Courier::Client.new(api_key: "your-key")`.
|
|
230
38
|
|
|
231
|
-
|
|
39
|
+
> **Note**: The method is `send_` (with trailing underscore) because `send` is a reserved method in Ruby.
|
|
232
40
|
|
|
233
|
-
|
|
234
|
-
# Using the enum constants preserves the tagged type information:
|
|
235
|
-
courier.audiences.update(
|
|
236
|
-
operator: Courier::AudienceUpdateParams::Operator::AND,
|
|
237
|
-
# …
|
|
238
|
-
)
|
|
239
|
-
|
|
240
|
-
# Literal values are also permissible:
|
|
241
|
-
courier.audiences.update(
|
|
242
|
-
operator: :AND,
|
|
243
|
-
# …
|
|
244
|
-
)
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
## Versioning
|
|
248
|
-
|
|
249
|
-
This package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time.
|
|
250
|
-
|
|
251
|
-
This package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes.
|
|
252
|
-
|
|
253
|
-
## Requirements
|
|
254
|
-
|
|
255
|
-
Ruby 3.2.0 or higher.
|
|
41
|
+
## Documentation
|
|
256
42
|
|
|
257
|
-
|
|
43
|
+
Full documentation: **[courier.com/docs/sdk-libraries/ruby](https://www.courier.com/docs/sdk-libraries/ruby/)**
|
|
258
44
|
|
|
259
|
-
|
|
45
|
+
- [Quickstart](https://www.courier.com/docs/getting-started/quickstart/)
|
|
46
|
+
- [Send API](https://www.courier.com/docs/platform/sending/send-message/)
|
|
47
|
+
- [API Reference](https://www.courier.com/docs/reference/get-started/)
|
|
48
|
+
- [RubyDoc](https://gemdocs.org/gems/trycourier)
|
|
49
|
+
<!-- AUTO-GENERATED-OVERVIEW:END -->
|
data/lib/courier/client.rb
CHANGED
|
@@ -24,6 +24,9 @@ module Courier
|
|
|
24
24
|
# @return [Courier::Resources::Audiences]
|
|
25
25
|
attr_reader :audiences
|
|
26
26
|
|
|
27
|
+
# @return [Courier::Resources::Providers]
|
|
28
|
+
attr_reader :providers
|
|
29
|
+
|
|
27
30
|
# @return [Courier::Resources::AuditEvents]
|
|
28
31
|
attr_reader :audit_events
|
|
29
32
|
|
|
@@ -33,6 +36,9 @@ module Courier
|
|
|
33
36
|
# @return [Courier::Resources::Automations]
|
|
34
37
|
attr_reader :automations
|
|
35
38
|
|
|
39
|
+
# @return [Courier::Resources::Journeys]
|
|
40
|
+
attr_reader :journeys
|
|
41
|
+
|
|
36
42
|
# @return [Courier::Resources::Brands]
|
|
37
43
|
attr_reader :brands
|
|
38
44
|
|
|
@@ -54,6 +60,9 @@ module Courier
|
|
|
54
60
|
# @return [Courier::Resources::Notifications]
|
|
55
61
|
attr_reader :notifications
|
|
56
62
|
|
|
63
|
+
# @return [Courier::Resources::RoutingStrategies]
|
|
64
|
+
attr_reader :routing_strategies
|
|
65
|
+
|
|
57
66
|
# @return [Courier::Resources::Profiles]
|
|
58
67
|
attr_reader :profiles
|
|
59
68
|
|
|
@@ -115,9 +124,11 @@ module Courier
|
|
|
115
124
|
|
|
116
125
|
@send_ = Courier::Resources::Send.new(client: self)
|
|
117
126
|
@audiences = Courier::Resources::Audiences.new(client: self)
|
|
127
|
+
@providers = Courier::Resources::Providers.new(client: self)
|
|
118
128
|
@audit_events = Courier::Resources::AuditEvents.new(client: self)
|
|
119
129
|
@auth = Courier::Resources::Auth.new(client: self)
|
|
120
130
|
@automations = Courier::Resources::Automations.new(client: self)
|
|
131
|
+
@journeys = Courier::Resources::Journeys.new(client: self)
|
|
121
132
|
@brands = Courier::Resources::Brands.new(client: self)
|
|
122
133
|
@bulk = Courier::Resources::Bulk.new(client: self)
|
|
123
134
|
@inbound = Courier::Resources::Inbound.new(client: self)
|
|
@@ -125,6 +136,7 @@ module Courier
|
|
|
125
136
|
@messages = Courier::Resources::Messages.new(client: self)
|
|
126
137
|
@requests = Courier::Resources::Requests.new(client: self)
|
|
127
138
|
@notifications = Courier::Resources::Notifications.new(client: self)
|
|
139
|
+
@routing_strategies = Courier::Resources::RoutingStrategies.new(client: self)
|
|
128
140
|
@profiles = Courier::Resources::Profiles.new(client: self)
|
|
129
141
|
@tenants = Courier::Resources::Tenants.new(client: self)
|
|
130
142
|
@translations = Courier::Resources::Translations.new(client: self)
|
|
@@ -157,7 +157,7 @@ module Courier
|
|
|
157
157
|
in Hash | nil => coerced
|
|
158
158
|
coerced
|
|
159
159
|
else
|
|
160
|
-
message = "Expected a #{Hash} or #{Courier::Internal::Type::BaseModel}, got #{
|
|
160
|
+
message = "Expected a #{Hash} or #{Courier::Internal::Type::BaseModel}, got #{input.inspect}"
|
|
161
161
|
raise ArgumentError.new(message)
|
|
162
162
|
end
|
|
163
163
|
end
|
|
@@ -237,6 +237,11 @@ module Courier
|
|
|
237
237
|
end
|
|
238
238
|
end
|
|
239
239
|
|
|
240
|
+
# @type [Regexp]
|
|
241
|
+
#
|
|
242
|
+
# https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
|
|
243
|
+
RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/
|
|
244
|
+
|
|
240
245
|
class << self
|
|
241
246
|
# @api private
|
|
242
247
|
#
|
|
@@ -247,6 +252,15 @@ module Courier
|
|
|
247
252
|
"#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
|
|
248
253
|
end
|
|
249
254
|
|
|
255
|
+
# @api private
|
|
256
|
+
#
|
|
257
|
+
# @param path [String, Integer]
|
|
258
|
+
#
|
|
259
|
+
# @return [String]
|
|
260
|
+
def encode_path(path)
|
|
261
|
+
path.to_s.gsub(Courier::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) }
|
|
262
|
+
end
|
|
263
|
+
|
|
250
264
|
# @api private
|
|
251
265
|
#
|
|
252
266
|
# @param path [String, Array<String>]
|
|
@@ -259,7 +273,7 @@ module Courier
|
|
|
259
273
|
in []
|
|
260
274
|
""
|
|
261
275
|
in [String => p, *interpolations]
|
|
262
|
-
encoded = interpolations.map {
|
|
276
|
+
encoded = interpolations.map { encode_path(_1) }
|
|
263
277
|
format(p, *encoded)
|
|
264
278
|
end
|
|
265
279
|
end
|
|
@@ -490,6 +504,37 @@ module Courier
|
|
|
490
504
|
JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}
|
|
491
505
|
|
|
492
506
|
class << self
|
|
507
|
+
# @api private
|
|
508
|
+
#
|
|
509
|
+
# @param query [Hash{Symbol=>Object}]
|
|
510
|
+
#
|
|
511
|
+
# @return [Hash{Symbol=>Object}]
|
|
512
|
+
def encode_query_params(query)
|
|
513
|
+
out = {}
|
|
514
|
+
query.each { write_query_param_element!(out, _1, _2) }
|
|
515
|
+
out
|
|
516
|
+
end
|
|
517
|
+
|
|
518
|
+
# @api private
|
|
519
|
+
#
|
|
520
|
+
# @param collection [Hash{Symbol=>Object}]
|
|
521
|
+
# @param key [String]
|
|
522
|
+
# @param element [Object]
|
|
523
|
+
#
|
|
524
|
+
# @return [nil]
|
|
525
|
+
private def write_query_param_element!(collection, key, element)
|
|
526
|
+
case element
|
|
527
|
+
in Hash
|
|
528
|
+
element.each do |name, value|
|
|
529
|
+
write_query_param_element!(collection, "#{key}[#{name}]", value)
|
|
530
|
+
end
|
|
531
|
+
in Array
|
|
532
|
+
collection[key] = element.map(&:to_s).join(",")
|
|
533
|
+
else
|
|
534
|
+
collection[key] = element.to_s
|
|
535
|
+
end
|
|
536
|
+
end
|
|
537
|
+
|
|
493
538
|
# @api private
|
|
494
539
|
#
|
|
495
540
|
# @param y [Enumerator::Yielder]
|
|
@@ -540,16 +585,15 @@ module Courier
|
|
|
540
585
|
y << "Content-Disposition: form-data"
|
|
541
586
|
|
|
542
587
|
unless key.nil?
|
|
543
|
-
|
|
544
|
-
y << "; name=\"#{name}\""
|
|
588
|
+
y << "; name=\"#{key}\""
|
|
545
589
|
end
|
|
546
590
|
|
|
547
591
|
case val
|
|
548
592
|
in Courier::FilePart unless val.filename.nil?
|
|
549
|
-
filename =
|
|
593
|
+
filename = encode_path(val.filename)
|
|
550
594
|
y << "; filename=\"#{filename}\""
|
|
551
595
|
in Pathname | IO
|
|
552
|
-
filename =
|
|
596
|
+
filename = encode_path(::File.basename(val.to_path))
|
|
553
597
|
y << "; filename=\"#{filename}\""
|
|
554
598
|
else
|
|
555
599
|
end
|
|
@@ -7,7 +7,13 @@ module Courier
|
|
|
7
7
|
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Courier::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
|
-
# @!
|
|
10
|
+
# @!attribute audience_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :audience_id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(audience_id:, request_options: {})
|
|
16
|
+
# @param audience_id [String]
|
|
11
17
|
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
12
18
|
end
|
|
13
19
|
end
|
|
@@ -7,13 +7,20 @@ module Courier
|
|
|
7
7
|
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Courier::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
|
+
# @!attribute audience_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :audience_id, String
|
|
14
|
+
|
|
10
15
|
# @!attribute cursor
|
|
11
16
|
# A unique identifier that allows for fetching the next set of members
|
|
12
17
|
#
|
|
13
18
|
# @return [String, nil]
|
|
14
19
|
optional :cursor, String, nil?: true
|
|
15
20
|
|
|
16
|
-
# @!method initialize(cursor: nil, request_options: {})
|
|
21
|
+
# @!method initialize(audience_id:, cursor: nil, request_options: {})
|
|
22
|
+
# @param audience_id [String]
|
|
23
|
+
#
|
|
17
24
|
# @param cursor [String, nil] A unique identifier that allows for fetching the next set of members
|
|
18
25
|
#
|
|
19
26
|
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
@@ -7,7 +7,13 @@ module Courier
|
|
|
7
7
|
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Courier::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
|
-
# @!
|
|
10
|
+
# @!attribute audience_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :audience_id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(audience_id:, request_options: {})
|
|
16
|
+
# @param audience_id [String]
|
|
11
17
|
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
12
18
|
end
|
|
13
19
|
end
|
|
@@ -7,6 +7,11 @@ module Courier
|
|
|
7
7
|
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Courier::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
|
+
# @!attribute audience_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :audience_id, String
|
|
14
|
+
|
|
10
15
|
# @!attribute description
|
|
11
16
|
# A description of the audience
|
|
12
17
|
#
|
|
@@ -31,10 +36,12 @@ module Courier
|
|
|
31
36
|
# @return [Symbol, Courier::Models::AudienceUpdateParams::Operator, nil]
|
|
32
37
|
optional :operator, enum: -> { Courier::AudienceUpdateParams::Operator }, nil?: true
|
|
33
38
|
|
|
34
|
-
# @!method initialize(description: nil, filter: nil, name: nil, operator: nil, request_options: {})
|
|
39
|
+
# @!method initialize(audience_id:, description: nil, filter: nil, name: nil, operator: nil, request_options: {})
|
|
35
40
|
# Some parameter documentations has been truncated, see
|
|
36
41
|
# {Courier::Models::AudienceUpdateParams} for more details.
|
|
37
42
|
#
|
|
43
|
+
# @param audience_id [String]
|
|
44
|
+
#
|
|
38
45
|
# @param description [String, nil] A description of the audience
|
|
39
46
|
#
|
|
40
47
|
# @param filter [Courier::Models::AudienceFilterConfig, nil] Filter configuration for audience membership containing an array of filter rules
|
|
@@ -7,7 +7,13 @@ module Courier
|
|
|
7
7
|
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Courier::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
|
-
# @!
|
|
10
|
+
# @!attribute audit_event_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :audit_event_id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(audit_event_id:, request_options: {})
|
|
16
|
+
# @param audit_event_id [String]
|
|
11
17
|
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
12
18
|
end
|
|
13
19
|
end
|
|
@@ -8,6 +8,11 @@ module Courier
|
|
|
8
8
|
extend Courier::Internal::Type::RequestParameters::Converter
|
|
9
9
|
include Courier::Internal::Type::RequestParameters
|
|
10
10
|
|
|
11
|
+
# @!attribute template_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :template_id, String
|
|
15
|
+
|
|
11
16
|
# @!attribute recipient
|
|
12
17
|
#
|
|
13
18
|
# @return [String, nil]
|
|
@@ -33,7 +38,8 @@ module Courier
|
|
|
33
38
|
# @return [String, nil]
|
|
34
39
|
optional :template, String, nil?: true
|
|
35
40
|
|
|
36
|
-
# @!method initialize(recipient:, brand: nil, data: nil, profile: nil, template: nil, request_options: {})
|
|
41
|
+
# @!method initialize(template_id:, recipient:, brand: nil, data: nil, profile: nil, template: nil, request_options: {})
|
|
42
|
+
# @param template_id [String]
|
|
37
43
|
# @param recipient [String, nil]
|
|
38
44
|
# @param brand [String, nil]
|
|
39
45
|
# @param data [Hash{Symbol=>Object}, nil]
|
|
@@ -7,7 +7,13 @@ module Courier
|
|
|
7
7
|
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Courier::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
|
-
# @!
|
|
10
|
+
# @!attribute brand_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :brand_id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(brand_id:, request_options: {})
|
|
16
|
+
# @param brand_id [String]
|
|
11
17
|
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
12
18
|
end
|
|
13
19
|
end
|
|
@@ -7,7 +7,13 @@ module Courier
|
|
|
7
7
|
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Courier::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
|
-
# @!
|
|
10
|
+
# @!attribute brand_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :brand_id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(brand_id:, request_options: {})
|
|
16
|
+
# @param brand_id [String]
|
|
11
17
|
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
12
18
|
end
|
|
13
19
|
end
|