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
|
@@ -18,18 +18,26 @@ module Courier
|
|
|
18
18
|
sig { returns(String) }
|
|
19
19
|
attr_accessor :user_id
|
|
20
20
|
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :token
|
|
23
|
+
|
|
21
24
|
sig do
|
|
22
25
|
params(
|
|
23
26
|
user_id: String,
|
|
27
|
+
token: String,
|
|
24
28
|
request_options: Courier::RequestOptions::OrHash
|
|
25
29
|
).returns(T.attached_class)
|
|
26
30
|
end
|
|
27
|
-
def self.new(user_id:, request_options: {})
|
|
31
|
+
def self.new(user_id:, token:, request_options: {})
|
|
28
32
|
end
|
|
29
33
|
|
|
30
34
|
sig do
|
|
31
35
|
override.returns(
|
|
32
|
-
{
|
|
36
|
+
{
|
|
37
|
+
user_id: String,
|
|
38
|
+
token: String,
|
|
39
|
+
request_options: Courier::RequestOptions
|
|
40
|
+
}
|
|
33
41
|
)
|
|
34
42
|
end
|
|
35
43
|
def to_hash
|
|
@@ -15,23 +15,28 @@ module Courier
|
|
|
15
15
|
sig { returns(String) }
|
|
16
16
|
attr_accessor :user_id
|
|
17
17
|
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :token
|
|
20
|
+
|
|
18
21
|
sig { returns(T::Array[Courier::Users::TokenUpdateParams::Patch]) }
|
|
19
22
|
attr_accessor :patch
|
|
20
23
|
|
|
21
24
|
sig do
|
|
22
25
|
params(
|
|
23
26
|
user_id: String,
|
|
27
|
+
token: String,
|
|
24
28
|
patch: T::Array[Courier::Users::TokenUpdateParams::Patch::OrHash],
|
|
25
29
|
request_options: Courier::RequestOptions::OrHash
|
|
26
30
|
).returns(T.attached_class)
|
|
27
31
|
end
|
|
28
|
-
def self.new(user_id:, patch:, request_options: {})
|
|
32
|
+
def self.new(user_id:, token:, patch:, request_options: {})
|
|
29
33
|
end
|
|
30
34
|
|
|
31
35
|
sig do
|
|
32
36
|
override.returns(
|
|
33
37
|
{
|
|
34
38
|
user_id: String,
|
|
39
|
+
token: String,
|
|
35
40
|
patch: T::Array[Courier::Users::TokenUpdateParams::Patch],
|
|
36
41
|
request_options: Courier::RequestOptions
|
|
37
42
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class VersionNode < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias { T.any(Courier::VersionNode, Courier::Internal::AnyHash) }
|
|
8
|
+
|
|
9
|
+
# Epoch milliseconds when this version was created.
|
|
10
|
+
sig { returns(Integer) }
|
|
11
|
+
attr_accessor :created
|
|
12
|
+
|
|
13
|
+
# User ID of the version creator.
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :creator
|
|
16
|
+
|
|
17
|
+
# Version identifier. One of "draft", "published:vNNN" (current published
|
|
18
|
+
# version), or "vNNN" (historical version).
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :version
|
|
21
|
+
|
|
22
|
+
# Whether the draft has unpublished changes. Only present on the draft version.
|
|
23
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
24
|
+
attr_reader :has_changes
|
|
25
|
+
|
|
26
|
+
sig { params(has_changes: T::Boolean).void }
|
|
27
|
+
attr_writer :has_changes
|
|
28
|
+
|
|
29
|
+
# A version entry for a notification template.
|
|
30
|
+
sig do
|
|
31
|
+
params(
|
|
32
|
+
created: Integer,
|
|
33
|
+
creator: String,
|
|
34
|
+
version: String,
|
|
35
|
+
has_changes: T::Boolean
|
|
36
|
+
).returns(T.attached_class)
|
|
37
|
+
end
|
|
38
|
+
def self.new(
|
|
39
|
+
# Epoch milliseconds when this version was created.
|
|
40
|
+
created:,
|
|
41
|
+
# User ID of the version creator.
|
|
42
|
+
creator:,
|
|
43
|
+
# Version identifier. One of "draft", "published:vNNN" (current published
|
|
44
|
+
# version), or "vNNN" (historical version).
|
|
45
|
+
version:,
|
|
46
|
+
# Whether the draft has unpublished changes. Only present on the draft version.
|
|
47
|
+
has_changes: nil
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
sig do
|
|
52
|
+
override.returns(
|
|
53
|
+
{
|
|
54
|
+
created: Integer,
|
|
55
|
+
creator: String,
|
|
56
|
+
version: String,
|
|
57
|
+
has_changes: T::Boolean
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
def to_hash
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
data/rbi/courier/models.rbi
CHANGED
|
@@ -84,8 +84,12 @@ module Courier
|
|
|
84
84
|
|
|
85
85
|
BulkRunJobParams = Courier::Models::BulkRunJobParams
|
|
86
86
|
|
|
87
|
+
Channel = Courier::Models::Channel
|
|
88
|
+
|
|
87
89
|
ChannelClassification = Courier::Models::ChannelClassification
|
|
88
90
|
|
|
91
|
+
ChannelMetadata = Courier::Models::ChannelMetadata
|
|
92
|
+
|
|
89
93
|
ChannelPreference = Courier::Models::ChannelPreference
|
|
90
94
|
|
|
91
95
|
Check = Courier::Models::Check
|
|
@@ -110,6 +114,8 @@ module Courier
|
|
|
110
114
|
|
|
111
115
|
ElementalDividerNodeWithType = Courier::Models::ElementalDividerNodeWithType
|
|
112
116
|
|
|
117
|
+
ElementalHTMLNodeWithType = Courier::Models::ElementalHTMLNodeWithType
|
|
118
|
+
|
|
113
119
|
ElementalImageNodeWithType = Courier::Models::ElementalImageNodeWithType
|
|
114
120
|
|
|
115
121
|
ElementalMetaNodeWithType = Courier::Models::ElementalMetaNodeWithType
|
|
@@ -142,6 +148,18 @@ module Courier
|
|
|
142
148
|
|
|
143
149
|
IntercomRecipient = Courier::Models::IntercomRecipient
|
|
144
150
|
|
|
151
|
+
Journey = Courier::Models::Journey
|
|
152
|
+
|
|
153
|
+
JourneyInvokeParams = Courier::Models::JourneyInvokeParams
|
|
154
|
+
|
|
155
|
+
JourneyListParams = Courier::Models::JourneyListParams
|
|
156
|
+
|
|
157
|
+
JourneysInvokeRequest = Courier::Models::JourneysInvokeRequest
|
|
158
|
+
|
|
159
|
+
JourneysInvokeResponse = Courier::Models::JourneysInvokeResponse
|
|
160
|
+
|
|
161
|
+
JourneysListResponse = Courier::Models::JourneysListResponse
|
|
162
|
+
|
|
145
163
|
ListDeleteParams = Courier::Models::ListDeleteParams
|
|
146
164
|
|
|
147
165
|
ListFilter = Courier::Models::ListFilter
|
|
@@ -164,6 +182,9 @@ module Courier
|
|
|
164
182
|
|
|
165
183
|
MessageCancelParams = Courier::Models::MessageCancelParams
|
|
166
184
|
|
|
185
|
+
MessageChannels =
|
|
186
|
+
T.let(Courier::Models::MessageChannels, Courier::Internal::Type::Converter)
|
|
187
|
+
|
|
167
188
|
MessageContentParams = Courier::Models::MessageContentParams
|
|
168
189
|
|
|
169
190
|
MessageContext = Courier::Models::MessageContext
|
|
@@ -174,12 +195,19 @@ module Courier
|
|
|
174
195
|
|
|
175
196
|
MessageListParams = Courier::Models::MessageListParams
|
|
176
197
|
|
|
198
|
+
MessageProviders =
|
|
199
|
+
T.let(Courier::Models::MessageProviders, Courier::Internal::Type::Converter)
|
|
200
|
+
|
|
201
|
+
MessageProvidersType = Courier::Models::MessageProvidersType
|
|
202
|
+
|
|
177
203
|
MessageRetrieveParams = Courier::Models::MessageRetrieveParams
|
|
178
204
|
|
|
179
205
|
MessageRouting = Courier::Models::MessageRouting
|
|
180
206
|
|
|
181
207
|
MessageRoutingChannel = Courier::Models::MessageRoutingChannel
|
|
182
208
|
|
|
209
|
+
Metadata = Courier::Models::Metadata
|
|
210
|
+
|
|
183
211
|
MsTeams = Courier::Models::MsTeams
|
|
184
212
|
|
|
185
213
|
MsTeamsBaseProperties = Courier::Models::MsTeamsBaseProperties
|
|
@@ -188,17 +216,52 @@ module Courier
|
|
|
188
216
|
|
|
189
217
|
MultipleTokens = Courier::Models::MultipleTokens
|
|
190
218
|
|
|
219
|
+
NotificationArchiveParams = Courier::Models::NotificationArchiveParams
|
|
220
|
+
|
|
221
|
+
NotificationCreateParams = Courier::Models::NotificationCreateParams
|
|
222
|
+
|
|
191
223
|
NotificationGetContent = Courier::Models::NotificationGetContent
|
|
192
224
|
|
|
193
225
|
NotificationListParams = Courier::Models::NotificationListParams
|
|
194
226
|
|
|
227
|
+
NotificationListVersionsParams =
|
|
228
|
+
Courier::Models::NotificationListVersionsParams
|
|
229
|
+
|
|
195
230
|
NotificationPreferenceDetails = Courier::Models::NotificationPreferenceDetails
|
|
196
231
|
|
|
232
|
+
NotificationPublishParams = Courier::Models::NotificationPublishParams
|
|
233
|
+
|
|
234
|
+
NotificationReplaceParams = Courier::Models::NotificationReplaceParams
|
|
235
|
+
|
|
197
236
|
NotificationRetrieveContentParams =
|
|
198
237
|
Courier::Models::NotificationRetrieveContentParams
|
|
199
238
|
|
|
239
|
+
NotificationRetrieveParams = Courier::Models::NotificationRetrieveParams
|
|
240
|
+
|
|
200
241
|
Notifications = Courier::Models::Notifications
|
|
201
242
|
|
|
243
|
+
NotificationTemplateCreateRequest =
|
|
244
|
+
Courier::Models::NotificationTemplateCreateRequest
|
|
245
|
+
|
|
246
|
+
NotificationTemplateGetResponse =
|
|
247
|
+
Courier::Models::NotificationTemplateGetResponse
|
|
248
|
+
|
|
249
|
+
NotificationTemplateMutationResponse =
|
|
250
|
+
Courier::Models::NotificationTemplateMutationResponse
|
|
251
|
+
|
|
252
|
+
NotificationTemplatePayload = Courier::Models::NotificationTemplatePayload
|
|
253
|
+
|
|
254
|
+
NotificationTemplatePublishRequest =
|
|
255
|
+
Courier::Models::NotificationTemplatePublishRequest
|
|
256
|
+
|
|
257
|
+
NotificationTemplateSummary = Courier::Models::NotificationTemplateSummary
|
|
258
|
+
|
|
259
|
+
NotificationTemplateUpdateRequest =
|
|
260
|
+
Courier::Models::NotificationTemplateUpdateRequest
|
|
261
|
+
|
|
262
|
+
NotificationTemplateVersionListResponse =
|
|
263
|
+
Courier::Models::NotificationTemplateVersionListResponse
|
|
264
|
+
|
|
202
265
|
Pagerduty = Courier::Models::Pagerduty
|
|
203
266
|
|
|
204
267
|
PagerdutyRecipient = Courier::Models::PagerdutyRecipient
|
|
@@ -227,6 +290,22 @@ module Courier
|
|
|
227
290
|
|
|
228
291
|
ProfileUpdateParams = Courier::Models::ProfileUpdateParams
|
|
229
292
|
|
|
293
|
+
Provider = Courier::Models::Provider
|
|
294
|
+
|
|
295
|
+
ProviderCreateParams = Courier::Models::ProviderCreateParams
|
|
296
|
+
|
|
297
|
+
ProviderDeleteParams = Courier::Models::ProviderDeleteParams
|
|
298
|
+
|
|
299
|
+
ProviderListParams = Courier::Models::ProviderListParams
|
|
300
|
+
|
|
301
|
+
ProviderRetrieveParams = Courier::Models::ProviderRetrieveParams
|
|
302
|
+
|
|
303
|
+
Providers = Courier::Models::Providers
|
|
304
|
+
|
|
305
|
+
ProvidersCatalogEntry = Courier::Models::ProvidersCatalogEntry
|
|
306
|
+
|
|
307
|
+
ProviderUpdateParams = Courier::Models::ProviderUpdateParams
|
|
308
|
+
|
|
230
309
|
PutSubscriptionsRecipient = Courier::Models::PutSubscriptionsRecipient
|
|
231
310
|
|
|
232
311
|
PutTenantTemplateRequest = Courier::Models::PutTenantTemplateRequest
|
|
@@ -237,6 +316,29 @@ module Courier
|
|
|
237
316
|
|
|
238
317
|
RequestArchiveParams = Courier::Models::RequestArchiveParams
|
|
239
318
|
|
|
319
|
+
RoutingStrategyArchiveParams = Courier::Models::RoutingStrategyArchiveParams
|
|
320
|
+
|
|
321
|
+
RoutingStrategyCreateParams = Courier::Models::RoutingStrategyCreateParams
|
|
322
|
+
|
|
323
|
+
RoutingStrategyCreateRequest = Courier::Models::RoutingStrategyCreateRequest
|
|
324
|
+
|
|
325
|
+
RoutingStrategyGetResponse = Courier::Models::RoutingStrategyGetResponse
|
|
326
|
+
|
|
327
|
+
RoutingStrategyListParams = Courier::Models::RoutingStrategyListParams
|
|
328
|
+
|
|
329
|
+
RoutingStrategyListResponse = Courier::Models::RoutingStrategyListResponse
|
|
330
|
+
|
|
331
|
+
RoutingStrategyMutationResponse =
|
|
332
|
+
Courier::Models::RoutingStrategyMutationResponse
|
|
333
|
+
|
|
334
|
+
RoutingStrategyReplaceParams = Courier::Models::RoutingStrategyReplaceParams
|
|
335
|
+
|
|
336
|
+
RoutingStrategyReplaceRequest = Courier::Models::RoutingStrategyReplaceRequest
|
|
337
|
+
|
|
338
|
+
RoutingStrategyRetrieveParams = Courier::Models::RoutingStrategyRetrieveParams
|
|
339
|
+
|
|
340
|
+
RoutingStrategySummary = Courier::Models::RoutingStrategySummary
|
|
341
|
+
|
|
240
342
|
Rule = Courier::Models::Rule
|
|
241
343
|
|
|
242
344
|
SendDirectMessage = Courier::Models::SendDirectMessage
|
|
@@ -293,6 +395,8 @@ module Courier
|
|
|
293
395
|
|
|
294
396
|
TextStyle = Courier::Models::TextStyle
|
|
295
397
|
|
|
398
|
+
Timeouts = Courier::Models::Timeouts
|
|
399
|
+
|
|
296
400
|
Token = Courier::Models::Token
|
|
297
401
|
|
|
298
402
|
TranslationRetrieveParams = Courier::Models::TranslationRetrieveParams
|
|
@@ -309,6 +413,8 @@ module Courier
|
|
|
309
413
|
|
|
310
414
|
Utm = Courier::Models::Utm
|
|
311
415
|
|
|
416
|
+
VersionNode = Courier::Models::VersionNode
|
|
417
|
+
|
|
312
418
|
WebhookAuthentication = Courier::Models::WebhookAuthentication
|
|
313
419
|
|
|
314
420
|
WebhookAuthMode = Courier::Models::WebhookAuthMode
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Resources
|
|
5
|
+
class Journeys
|
|
6
|
+
# Get the list of journeys.
|
|
7
|
+
sig do
|
|
8
|
+
params(
|
|
9
|
+
cursor: String,
|
|
10
|
+
version: Courier::JourneyListParams::Version::OrSymbol,
|
|
11
|
+
request_options: Courier::RequestOptions::OrHash
|
|
12
|
+
).returns(Courier::JourneysListResponse)
|
|
13
|
+
end
|
|
14
|
+
def list(
|
|
15
|
+
# A cursor token for pagination. Use the cursor from the previous response to
|
|
16
|
+
# fetch the next page of results.
|
|
17
|
+
cursor: nil,
|
|
18
|
+
# The version of journeys to retrieve. Accepted values are published (for
|
|
19
|
+
# published journeys) or draft (for draft journeys). Defaults to published.
|
|
20
|
+
version: nil,
|
|
21
|
+
request_options: {}
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Invoke a journey run from a journey template.
|
|
26
|
+
sig do
|
|
27
|
+
params(
|
|
28
|
+
template_id: String,
|
|
29
|
+
data: T::Hash[Symbol, T.anything],
|
|
30
|
+
profile: T::Hash[Symbol, T.anything],
|
|
31
|
+
user_id: String,
|
|
32
|
+
request_options: Courier::RequestOptions::OrHash
|
|
33
|
+
).returns(Courier::JourneysInvokeResponse)
|
|
34
|
+
end
|
|
35
|
+
def invoke(
|
|
36
|
+
# A unique identifier representing the journey template to be invoked. This could
|
|
37
|
+
# be the Journey Template ID or the Journey Template Alias.
|
|
38
|
+
template_id,
|
|
39
|
+
# Data payload passed to the journey. The expected shape can be predefined using
|
|
40
|
+
# the schema builder in the journey editor. This data is available in journey
|
|
41
|
+
# steps for condition evaluation and template variable interpolation. Can also
|
|
42
|
+
# contain user identifiers (user_id, userId, anonymousId) if not provided
|
|
43
|
+
# elsewhere.
|
|
44
|
+
data: nil,
|
|
45
|
+
# Profile data for the user. Can contain contact information (email,
|
|
46
|
+
# phone_number), user identifiers (user_id, userId, anonymousId), or any custom
|
|
47
|
+
# profile fields. Profile fields are merged with any existing stored profile for
|
|
48
|
+
# the user. Include context.tenant_id to load a tenant-scoped profile for
|
|
49
|
+
# multi-tenant scenarios.
|
|
50
|
+
profile: nil,
|
|
51
|
+
# A unique identifier for the user. If not provided, the system will attempt to
|
|
52
|
+
# resolve the user identifier from profile or data objects.
|
|
53
|
+
user_id: nil,
|
|
54
|
+
request_options: {}
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# @api private
|
|
59
|
+
sig { params(client: Courier::Client).returns(T.attached_class) }
|
|
60
|
+
def self.new(client:)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -9,21 +9,139 @@ module Courier
|
|
|
9
9
|
sig { returns(Courier::Resources::Notifications::Checks) }
|
|
10
10
|
attr_reader :checks
|
|
11
11
|
|
|
12
|
+
# Create a notification template. Requires all fields in the notification object.
|
|
13
|
+
# Templates are created in draft state by default.
|
|
14
|
+
sig do
|
|
15
|
+
params(
|
|
16
|
+
notification: Courier::NotificationTemplatePayload::OrHash,
|
|
17
|
+
state: Courier::NotificationTemplateCreateRequest::State::OrSymbol,
|
|
18
|
+
request_options: Courier::RequestOptions::OrHash
|
|
19
|
+
).returns(Courier::NotificationTemplateMutationResponse)
|
|
20
|
+
end
|
|
21
|
+
def create(
|
|
22
|
+
# Full document shape used in POST and PUT request bodies, and returned inside the
|
|
23
|
+
# GET response envelope.
|
|
24
|
+
notification:,
|
|
25
|
+
# Template state after creation. Case-insensitive input, normalized to uppercase
|
|
26
|
+
# in the response. Defaults to "DRAFT".
|
|
27
|
+
state: nil,
|
|
28
|
+
request_options: {}
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Retrieve a notification template by ID. Returns the published version by
|
|
33
|
+
# default. Pass version=draft to retrieve an unpublished template.
|
|
34
|
+
sig do
|
|
35
|
+
params(
|
|
36
|
+
id: String,
|
|
37
|
+
version: String,
|
|
38
|
+
request_options: Courier::RequestOptions::OrHash
|
|
39
|
+
).returns(Courier::NotificationTemplateGetResponse)
|
|
40
|
+
end
|
|
41
|
+
def retrieve(
|
|
42
|
+
# Template ID (nt\_ prefix).
|
|
43
|
+
id,
|
|
44
|
+
# Version to retrieve. One of "draft", "published", or a version string like
|
|
45
|
+
# "v001". Defaults to "published".
|
|
46
|
+
version: nil,
|
|
47
|
+
request_options: {}
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# List notification templates in your workspace.
|
|
12
52
|
sig do
|
|
13
53
|
params(
|
|
14
54
|
cursor: T.nilable(String),
|
|
55
|
+
event_id: String,
|
|
15
56
|
notes: T.nilable(T::Boolean),
|
|
16
57
|
request_options: Courier::RequestOptions::OrHash
|
|
17
58
|
).returns(Courier::Models::NotificationListResponse)
|
|
18
59
|
end
|
|
19
60
|
def list(
|
|
61
|
+
# Opaque pagination cursor from a previous response. Omit for the first page.
|
|
20
62
|
cursor: nil,
|
|
21
|
-
#
|
|
63
|
+
# Filter to templates linked to this event map ID.
|
|
64
|
+
event_id: nil,
|
|
65
|
+
# Include template notes in the response. Only applies to legacy templates.
|
|
22
66
|
notes: nil,
|
|
23
67
|
request_options: {}
|
|
24
68
|
)
|
|
25
69
|
end
|
|
26
70
|
|
|
71
|
+
# Archive a notification template.
|
|
72
|
+
sig do
|
|
73
|
+
params(
|
|
74
|
+
id: String,
|
|
75
|
+
request_options: Courier::RequestOptions::OrHash
|
|
76
|
+
).void
|
|
77
|
+
end
|
|
78
|
+
def archive(
|
|
79
|
+
# Template ID (nt\_ prefix).
|
|
80
|
+
id,
|
|
81
|
+
request_options: {}
|
|
82
|
+
)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# List versions of a notification template.
|
|
86
|
+
sig do
|
|
87
|
+
params(
|
|
88
|
+
id: String,
|
|
89
|
+
cursor: String,
|
|
90
|
+
limit: Integer,
|
|
91
|
+
request_options: Courier::RequestOptions::OrHash
|
|
92
|
+
).returns(Courier::NotificationTemplateVersionListResponse)
|
|
93
|
+
end
|
|
94
|
+
def list_versions(
|
|
95
|
+
# Template ID (nt\_ prefix).
|
|
96
|
+
id,
|
|
97
|
+
# Opaque pagination cursor from a previous response. Omit for the first page.
|
|
98
|
+
cursor: nil,
|
|
99
|
+
# Maximum number of versions to return per page. Default 10, max 10.
|
|
100
|
+
limit: nil,
|
|
101
|
+
request_options: {}
|
|
102
|
+
)
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Publish a notification template. Publishes the current draft by default. Pass a
|
|
106
|
+
# version in the request body to publish a specific historical version.
|
|
107
|
+
sig do
|
|
108
|
+
params(
|
|
109
|
+
id: String,
|
|
110
|
+
version: String,
|
|
111
|
+
request_options: Courier::RequestOptions::OrHash
|
|
112
|
+
).void
|
|
113
|
+
end
|
|
114
|
+
def publish(
|
|
115
|
+
# Template ID (nt\_ prefix).
|
|
116
|
+
id,
|
|
117
|
+
# Historical version to publish (e.g. "v001"). Omit to publish the current draft.
|
|
118
|
+
version: nil,
|
|
119
|
+
request_options: {}
|
|
120
|
+
)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Replace a notification template. All fields are required.
|
|
124
|
+
sig do
|
|
125
|
+
params(
|
|
126
|
+
id: String,
|
|
127
|
+
notification: Courier::NotificationTemplatePayload::OrHash,
|
|
128
|
+
state: Courier::NotificationTemplateUpdateRequest::State::OrSymbol,
|
|
129
|
+
request_options: Courier::RequestOptions::OrHash
|
|
130
|
+
).returns(Courier::NotificationTemplateMutationResponse)
|
|
131
|
+
end
|
|
132
|
+
def replace(
|
|
133
|
+
# Template ID (nt\_ prefix).
|
|
134
|
+
id,
|
|
135
|
+
# Full document shape used in POST and PUT request bodies, and returned inside the
|
|
136
|
+
# GET response envelope.
|
|
137
|
+
notification:,
|
|
138
|
+
# Template state after update. Case-insensitive input, normalized to uppercase in
|
|
139
|
+
# the response. Defaults to "DRAFT".
|
|
140
|
+
state: nil,
|
|
141
|
+
request_options: {}
|
|
142
|
+
)
|
|
143
|
+
end
|
|
144
|
+
|
|
27
145
|
sig do
|
|
28
146
|
params(
|
|
29
147
|
id: String,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Resources
|
|
5
|
+
class Providers
|
|
6
|
+
class Catalog
|
|
7
|
+
# Returns the catalog of available provider types with their display names,
|
|
8
|
+
# descriptions, and configuration schema fields (snake_case, with `type` and
|
|
9
|
+
# `required`). Providers with no configurable schema return only `provider`,
|
|
10
|
+
# `name`, and `description`.
|
|
11
|
+
sig do
|
|
12
|
+
params(
|
|
13
|
+
channel: String,
|
|
14
|
+
keys: String,
|
|
15
|
+
name: String,
|
|
16
|
+
request_options: Courier::RequestOptions::OrHash
|
|
17
|
+
).returns(Courier::Models::Providers::CatalogListResponse)
|
|
18
|
+
end
|
|
19
|
+
def list(
|
|
20
|
+
# Exact match (case-insensitive) against the provider channel taxonomy (e.g.
|
|
21
|
+
# `email`, `sms`, `push`).
|
|
22
|
+
channel: nil,
|
|
23
|
+
# Comma-separated provider keys to filter by (e.g. `sendgrid,twilio`).
|
|
24
|
+
keys: nil,
|
|
25
|
+
# Case-insensitive substring match against the provider display name.
|
|
26
|
+
name: nil,
|
|
27
|
+
request_options: {}
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# @api private
|
|
32
|
+
sig { params(client: Courier::Client).returns(T.attached_class) }
|
|
33
|
+
def self.new(client:)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Resources
|
|
5
|
+
class Providers
|
|
6
|
+
sig { returns(Courier::Resources::Providers::Catalog) }
|
|
7
|
+
attr_reader :catalog
|
|
8
|
+
|
|
9
|
+
# Create a new provider configuration. The `provider` field must be a known
|
|
10
|
+
# Courier provider key (see catalog).
|
|
11
|
+
sig do
|
|
12
|
+
params(
|
|
13
|
+
provider: String,
|
|
14
|
+
alias_: String,
|
|
15
|
+
settings: T::Hash[Symbol, T.anything],
|
|
16
|
+
title: String,
|
|
17
|
+
request_options: Courier::RequestOptions::OrHash
|
|
18
|
+
).returns(Courier::Provider)
|
|
19
|
+
end
|
|
20
|
+
def create(
|
|
21
|
+
# The provider key identifying the type (e.g. "sendgrid", "twilio"). Must be a
|
|
22
|
+
# known Courier provider — see the catalog endpoint for valid keys.
|
|
23
|
+
provider:,
|
|
24
|
+
# Optional alias for this configuration.
|
|
25
|
+
alias_: nil,
|
|
26
|
+
# Provider-specific settings (snake_case keys). Defaults to an empty object when
|
|
27
|
+
# omitted. Use the catalog endpoint to discover required fields for a given
|
|
28
|
+
# provider — omitting a required field returns a 400 validation error.
|
|
29
|
+
settings: nil,
|
|
30
|
+
# Optional display title. Omit to use "Default Configuration".
|
|
31
|
+
title: nil,
|
|
32
|
+
request_options: {}
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Fetch a single provider configuration by ID.
|
|
37
|
+
sig do
|
|
38
|
+
params(
|
|
39
|
+
id: String,
|
|
40
|
+
request_options: Courier::RequestOptions::OrHash
|
|
41
|
+
).returns(Courier::Provider)
|
|
42
|
+
end
|
|
43
|
+
def retrieve(
|
|
44
|
+
# A unique identifier of the provider configuration.
|
|
45
|
+
id,
|
|
46
|
+
request_options: {}
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Update an existing provider configuration. The `provider` key is required. All
|
|
51
|
+
# other fields are optional — omitted fields are cleared from the stored
|
|
52
|
+
# configuration (this is a full replacement, not a partial merge).
|
|
53
|
+
sig do
|
|
54
|
+
params(
|
|
55
|
+
id: String,
|
|
56
|
+
provider: String,
|
|
57
|
+
alias_: String,
|
|
58
|
+
settings: T::Hash[Symbol, T.anything],
|
|
59
|
+
title: String,
|
|
60
|
+
request_options: Courier::RequestOptions::OrHash
|
|
61
|
+
).returns(Courier::Provider)
|
|
62
|
+
end
|
|
63
|
+
def update(
|
|
64
|
+
# A unique identifier of the provider configuration to update.
|
|
65
|
+
id,
|
|
66
|
+
# The provider key identifying the type.
|
|
67
|
+
provider:,
|
|
68
|
+
# Updated alias. Omit to clear.
|
|
69
|
+
alias_: nil,
|
|
70
|
+
# Provider-specific settings (snake_case keys). Replaces the full settings object
|
|
71
|
+
# — omitted settings fields are removed. Use the catalog endpoint to check
|
|
72
|
+
# required fields.
|
|
73
|
+
settings: nil,
|
|
74
|
+
# Updated display title.
|
|
75
|
+
title: nil,
|
|
76
|
+
request_options: {}
|
|
77
|
+
)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# List configured provider integrations for the current workspace. Supports
|
|
81
|
+
# cursor-based pagination.
|
|
82
|
+
sig do
|
|
83
|
+
params(
|
|
84
|
+
cursor: String,
|
|
85
|
+
request_options: Courier::RequestOptions::OrHash
|
|
86
|
+
).returns(Courier::Models::ProviderListResponse)
|
|
87
|
+
end
|
|
88
|
+
def list(
|
|
89
|
+
# Opaque cursor for fetching the next page.
|
|
90
|
+
cursor: nil,
|
|
91
|
+
request_options: {}
|
|
92
|
+
)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Delete a provider configuration. Returns 409 if the provider is still referenced
|
|
96
|
+
# by routing or notifications.
|
|
97
|
+
sig do
|
|
98
|
+
params(
|
|
99
|
+
id: String,
|
|
100
|
+
request_options: Courier::RequestOptions::OrHash
|
|
101
|
+
).void
|
|
102
|
+
end
|
|
103
|
+
def delete(
|
|
104
|
+
# A unique identifier of the provider configuration to delete.
|
|
105
|
+
id,
|
|
106
|
+
request_options: {}
|
|
107
|
+
)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# @api private
|
|
111
|
+
sig { params(client: Courier::Client).returns(T.attached_class) }
|
|
112
|
+
def self.new(client:)
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|