trycourier 4.8.0 → 4.10.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 +41 -0
- data/README.md +1 -1
- data/lib/courier/client.rb +8 -0
- data/lib/courier/internal/util.rb +19 -6
- data/lib/courier/models/associated_notification_list_response.rb +24 -0
- data/lib/courier/models/channel.rb +75 -0
- data/lib/courier/models/channel_metadata.rb +15 -0
- data/lib/courier/models/element_with_checksums.rb +60 -0
- data/lib/courier/models/elemental_content.rb +2 -2
- 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/message_channels.rb +8 -0
- data/lib/courier/models/message_providers.rb +8 -0
- data/lib/courier/models/message_providers_type.rb +38 -0
- data/lib/courier/models/metadata.rb +15 -0
- data/lib/courier/models/notification_archive_params.rb +20 -0
- data/lib/courier/models/notification_content_get_response.rb +26 -0
- data/lib/courier/models/notification_content_mutation_response.rb +61 -0
- data/lib/courier/models/notification_content_put_request.rb +51 -0
- data/lib/courier/models/notification_create_params.rb +14 -0
- data/lib/courier/models/notification_element_put_request.rb +62 -0
- data/lib/courier/models/notification_get_content.rb +0 -1
- 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_locale_put_request.rb +39 -0
- data/lib/courier/models/notification_publish_params.rb +20 -0
- data/lib/courier/models/notification_put_content_params.rb +20 -0
- data/lib/courier/models/notification_put_element_params.rb +26 -0
- data/lib/courier/models/notification_put_locale_params.rb +26 -0
- data/lib/courier/models/notification_replace_params.rb +20 -0
- data/lib/courier/models/notification_retrieve_content_params.rb +14 -1
- data/lib/courier/models/notification_retrieve_content_response.rb +21 -0
- 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_state.rb +16 -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/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/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_notifications_params.rb +37 -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_template_input.rb +6 -152
- data/lib/courier/models/timeouts.rb +21 -0
- data/lib/courier/models/version_node.rb +46 -0
- data/lib/courier/models.rb +110 -0
- data/lib/courier/resources/notifications.rb +289 -12
- data/lib/courier/resources/providers/catalog.rb +49 -0
- data/lib/courier/resources/providers.rb +150 -0
- data/lib/courier/resources/routing_strategies.rb +179 -0
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +60 -2
- data/rbi/courier/client.rbi +6 -0
- data/rbi/courier/internal/util.rbi +8 -0
- data/rbi/courier/models/associated_notification_list_response.rbi +45 -0
- data/rbi/courier/models/channel.rbi +106 -0
- data/rbi/courier/models/channel_metadata.rbi +28 -0
- data/rbi/courier/models/element_with_checksums.rbi +109 -0
- data/rbi/courier/models/elemental_content.rbi +6 -3
- 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/message_channels.rbi +11 -0
- data/rbi/courier/models/message_providers.rbi +11 -0
- data/rbi/courier/models/message_providers_type.rbi +60 -0
- data/rbi/courier/models/metadata.rbi +26 -0
- data/rbi/courier/models/notification_archive_params.rbi +35 -0
- data/rbi/courier/models/notification_content_get_response.rbi +45 -0
- data/rbi/courier/models/notification_content_mutation_response.rbi +95 -0
- data/rbi/courier/models/notification_content_put_request.rbi +145 -0
- data/rbi/courier/models/notification_create_params.rbi +27 -0
- data/rbi/courier/models/notification_element_put_request.rbi +98 -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_locale_put_request.rbi +79 -0
- data/rbi/courier/models/notification_publish_params.rbi +35 -0
- data/rbi/courier/models/notification_put_content_params.rbi +38 -0
- data/rbi/courier/models/notification_put_element_params.rbi +46 -0
- data/rbi/courier/models/notification_put_locale_params.rbi +46 -0
- data/rbi/courier/models/notification_replace_params.rbi +35 -0
- data/rbi/courier/models/notification_retrieve_content_params.rbi +21 -2
- data/rbi/courier/models/notification_retrieve_content_response.rbi +29 -0
- 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_state.rbi +26 -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/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/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_notifications_params.rbi +63 -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_template_input.rbi +8 -336
- data/rbi/courier/models/timeouts.rbi +33 -0
- data/rbi/courier/models/version_node.rbi +65 -0
- data/rbi/courier/models.rbi +122 -0
- data/rbi/courier/resources/notifications.rbi +222 -6
- data/rbi/courier/resources/providers/catalog.rbi +38 -0
- data/rbi/courier/resources/providers.rbi +116 -0
- data/rbi/courier/resources/routing_strategies.rbi +147 -0
- data/sig/courier/client.rbs +4 -0
- data/sig/courier/internal/util.rbs +4 -0
- data/sig/courier/models/associated_notification_list_response.rbs +25 -0
- data/sig/courier/models/channel.rbs +61 -0
- data/sig/courier/models/channel_metadata.rbs +13 -0
- data/sig/courier/models/element_with_checksums.rbs +60 -0
- 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/message_channels.rbs +7 -0
- data/sig/courier/models/message_providers.rbs +7 -0
- data/sig/courier/models/message_providers_type.rbs +35 -0
- data/sig/courier/models/metadata.rbs +13 -0
- data/sig/courier/models/notification_archive_params.rbs +20 -0
- data/sig/courier/models/notification_content_get_response.rbs +22 -0
- data/sig/courier/models/notification_content_mutation_response.rbs +47 -0
- data/sig/courier/models/notification_content_put_request.rbs +50 -0
- data/sig/courier/models/notification_create_params.rbs +15 -0
- data/sig/courier/models/notification_element_put_request.rbs +64 -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_locale_put_request.rbs +39 -0
- data/sig/courier/models/notification_publish_params.rbs +22 -0
- data/sig/courier/models/notification_put_content_params.rbs +22 -0
- data/sig/courier/models/notification_put_element_params.rbs +32 -0
- data/sig/courier/models/notification_put_locale_params.rbs +32 -0
- data/sig/courier/models/notification_replace_params.rbs +22 -0
- data/sig/courier/models/notification_retrieve_content_params.rbs +12 -2
- data/sig/courier/models/notification_retrieve_content_response.rbs +12 -0
- 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_state.rbs +14 -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/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/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_notifications_params.rbs +34 -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_template_input.rbs +12 -134
- data/sig/courier/models/timeouts.rbs +15 -0
- data/sig/courier/models/version_node.rbs +32 -0
- data/sig/courier/models.rbs +108 -0
- data/sig/courier/resources/notifications.rbs +65 -3
- data/sig/courier/resources/providers/catalog.rbs +16 -0
- data/sig/courier/resources/providers.rbs +38 -0
- data/sig/courier/resources/routing_strategies.rbs +48 -0
- metadata +182 -8
- data/lib/courier/models/notifications/draft_retrieve_content_params.rb +0 -22
- data/lib/courier/resources/notifications/draft.rb +0 -33
- data/rbi/courier/models/notifications/draft_retrieve_content_params.rbi +0 -40
- data/rbi/courier/resources/notifications/draft.rbi +0 -23
- data/sig/courier/models/notifications/draft_retrieve_content_params.rbs +0 -22
- data/sig/courier/resources/notifications/draft.rbs +0 -14
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Notifications#retrieve
|
|
6
|
+
class NotificationTemplateGetResponse < Courier::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute created
|
|
8
|
+
# Epoch milliseconds when the template was created.
|
|
9
|
+
#
|
|
10
|
+
# @return [Integer]
|
|
11
|
+
required :created, Integer
|
|
12
|
+
|
|
13
|
+
# @!attribute creator
|
|
14
|
+
# User ID of the creator.
|
|
15
|
+
#
|
|
16
|
+
# @return [String]
|
|
17
|
+
required :creator, String
|
|
18
|
+
|
|
19
|
+
# @!attribute notification
|
|
20
|
+
# Full document shape used in POST and PUT request bodies, and returned inside the
|
|
21
|
+
# GET response envelope.
|
|
22
|
+
#
|
|
23
|
+
# @return [Courier::Models::NotificationTemplateGetResponse::Notification]
|
|
24
|
+
required :notification, -> { Courier::NotificationTemplateGetResponse::Notification }
|
|
25
|
+
|
|
26
|
+
# @!attribute state
|
|
27
|
+
# The template state. Always uppercase.
|
|
28
|
+
#
|
|
29
|
+
# @return [Symbol, Courier::Models::NotificationTemplateGetResponse::State]
|
|
30
|
+
required :state, enum: -> { Courier::NotificationTemplateGetResponse::State }
|
|
31
|
+
|
|
32
|
+
# @!attribute updated
|
|
33
|
+
# Epoch milliseconds of last update.
|
|
34
|
+
#
|
|
35
|
+
# @return [Integer, nil]
|
|
36
|
+
optional :updated, Integer
|
|
37
|
+
|
|
38
|
+
# @!attribute updater
|
|
39
|
+
# User ID of the last updater.
|
|
40
|
+
#
|
|
41
|
+
# @return [String, nil]
|
|
42
|
+
optional :updater, String
|
|
43
|
+
|
|
44
|
+
# @!method initialize(created:, creator:, notification:, state:, updated: nil, updater: nil)
|
|
45
|
+
# Some parameter documentations has been truncated, see
|
|
46
|
+
# {Courier::Models::NotificationTemplateGetResponse} for more details.
|
|
47
|
+
#
|
|
48
|
+
# Envelope response for GET /notifications/{id}. The notification object mirrors
|
|
49
|
+
# the POST/PUT input shape. Nullable fields return null when unset.
|
|
50
|
+
#
|
|
51
|
+
# @param created [Integer] Epoch milliseconds when the template was created.
|
|
52
|
+
#
|
|
53
|
+
# @param creator [String] User ID of the creator.
|
|
54
|
+
#
|
|
55
|
+
# @param notification [Courier::Models::NotificationTemplateGetResponse::Notification] Full document shape used in POST and PUT request bodies, and returned inside the
|
|
56
|
+
#
|
|
57
|
+
# @param state [Symbol, Courier::Models::NotificationTemplateGetResponse::State] The template state. Always uppercase.
|
|
58
|
+
#
|
|
59
|
+
# @param updated [Integer] Epoch milliseconds of last update.
|
|
60
|
+
#
|
|
61
|
+
# @param updater [String] User ID of the last updater.
|
|
62
|
+
|
|
63
|
+
# @see Courier::Models::NotificationTemplateGetResponse#notification
|
|
64
|
+
class Notification < Courier::Models::NotificationTemplatePayload
|
|
65
|
+
# @!attribute id
|
|
66
|
+
# The template ID.
|
|
67
|
+
#
|
|
68
|
+
# @return [String]
|
|
69
|
+
required :id, String
|
|
70
|
+
|
|
71
|
+
# @!method initialize(id:)
|
|
72
|
+
# Full document shape used in POST and PUT request bodies, and returned inside the
|
|
73
|
+
# GET response envelope.
|
|
74
|
+
#
|
|
75
|
+
# @param id [String] The template ID.
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# The template state. Always uppercase.
|
|
79
|
+
#
|
|
80
|
+
# @see Courier::Models::NotificationTemplateGetResponse#state
|
|
81
|
+
module State
|
|
82
|
+
extend Courier::Internal::Type::Enum
|
|
83
|
+
|
|
84
|
+
DRAFT = :DRAFT
|
|
85
|
+
PUBLISHED = :PUBLISHED
|
|
86
|
+
|
|
87
|
+
# @!method self.values
|
|
88
|
+
# @return [Array<Symbol>]
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Notifications#create
|
|
6
|
+
class NotificationTemplateMutationResponse < Courier::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute notification
|
|
8
|
+
#
|
|
9
|
+
# @return [Courier::Models::NotificationTemplateMutationResponse::Notification]
|
|
10
|
+
required :notification, -> { Courier::NotificationTemplateMutationResponse::Notification }
|
|
11
|
+
|
|
12
|
+
# @!attribute state
|
|
13
|
+
# The template state after the operation. Always uppercase.
|
|
14
|
+
#
|
|
15
|
+
# @return [Symbol, Courier::Models::NotificationTemplateMutationResponse::State]
|
|
16
|
+
required :state, enum: -> { Courier::NotificationTemplateMutationResponse::State }
|
|
17
|
+
|
|
18
|
+
# @!method initialize(notification:, state:)
|
|
19
|
+
# Response returned by POST and PUT operations.
|
|
20
|
+
#
|
|
21
|
+
# @param notification [Courier::Models::NotificationTemplateMutationResponse::Notification]
|
|
22
|
+
#
|
|
23
|
+
# @param state [Symbol, Courier::Models::NotificationTemplateMutationResponse::State] The template state after the operation. Always uppercase.
|
|
24
|
+
|
|
25
|
+
# @see Courier::Models::NotificationTemplateMutationResponse#notification
|
|
26
|
+
class Notification < Courier::Internal::Type::BaseModel
|
|
27
|
+
# @!attribute id
|
|
28
|
+
# The ID of the created or updated template.
|
|
29
|
+
#
|
|
30
|
+
# @return [String]
|
|
31
|
+
required :id, String
|
|
32
|
+
|
|
33
|
+
# @!method initialize(id:)
|
|
34
|
+
# @param id [String] The ID of the created or updated template.
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# The template state after the operation. Always uppercase.
|
|
38
|
+
#
|
|
39
|
+
# @see Courier::Models::NotificationTemplateMutationResponse#state
|
|
40
|
+
module State
|
|
41
|
+
extend Courier::Internal::Type::Enum
|
|
42
|
+
|
|
43
|
+
DRAFT = :DRAFT
|
|
44
|
+
PUBLISHED = :PUBLISHED
|
|
45
|
+
|
|
46
|
+
# @!method self.values
|
|
47
|
+
# @return [Array<Symbol>]
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationTemplatePayload < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute brand
|
|
7
|
+
# Brand reference, or null for no brand.
|
|
8
|
+
#
|
|
9
|
+
# @return [Courier::Models::NotificationTemplatePayload::Brand, nil]
|
|
10
|
+
required :brand, -> { Courier::NotificationTemplatePayload::Brand }, nil?: true
|
|
11
|
+
|
|
12
|
+
# @!attribute content
|
|
13
|
+
# Elemental content definition.
|
|
14
|
+
#
|
|
15
|
+
# @return [Courier::Models::ElementalContent]
|
|
16
|
+
required :content, -> { Courier::ElementalContent }
|
|
17
|
+
|
|
18
|
+
# @!attribute name
|
|
19
|
+
# Display name for the template.
|
|
20
|
+
#
|
|
21
|
+
# @return [String]
|
|
22
|
+
required :name, String
|
|
23
|
+
|
|
24
|
+
# @!attribute routing
|
|
25
|
+
# Routing strategy reference, or null for none.
|
|
26
|
+
#
|
|
27
|
+
# @return [Courier::Models::NotificationTemplatePayload::Routing, nil]
|
|
28
|
+
required :routing, -> { Courier::NotificationTemplatePayload::Routing }, nil?: true
|
|
29
|
+
|
|
30
|
+
# @!attribute subscription
|
|
31
|
+
# Subscription topic reference, or null for none.
|
|
32
|
+
#
|
|
33
|
+
# @return [Courier::Models::NotificationTemplatePayload::Subscription, nil]
|
|
34
|
+
required :subscription, -> { Courier::NotificationTemplatePayload::Subscription }, nil?: true
|
|
35
|
+
|
|
36
|
+
# @!attribute tags
|
|
37
|
+
# Tags for categorization. Send empty array for none.
|
|
38
|
+
#
|
|
39
|
+
# @return [Array<String>]
|
|
40
|
+
required :tags, Courier::Internal::Type::ArrayOf[String]
|
|
41
|
+
|
|
42
|
+
# @!method initialize(brand:, content:, name:, routing:, subscription:, tags:)
|
|
43
|
+
# Full document shape used in POST and PUT request bodies, and returned inside the
|
|
44
|
+
# GET response envelope.
|
|
45
|
+
#
|
|
46
|
+
# @param brand [Courier::Models::NotificationTemplatePayload::Brand, nil] Brand reference, or null for no brand.
|
|
47
|
+
#
|
|
48
|
+
# @param content [Courier::Models::ElementalContent] Elemental content definition.
|
|
49
|
+
#
|
|
50
|
+
# @param name [String] Display name for the template.
|
|
51
|
+
#
|
|
52
|
+
# @param routing [Courier::Models::NotificationTemplatePayload::Routing, nil] Routing strategy reference, or null for none.
|
|
53
|
+
#
|
|
54
|
+
# @param subscription [Courier::Models::NotificationTemplatePayload::Subscription, nil] Subscription topic reference, or null for none.
|
|
55
|
+
#
|
|
56
|
+
# @param tags [Array<String>] Tags for categorization. Send empty array for none.
|
|
57
|
+
|
|
58
|
+
# @see Courier::Models::NotificationTemplatePayload#brand
|
|
59
|
+
class Brand < Courier::Internal::Type::BaseModel
|
|
60
|
+
# @!attribute id
|
|
61
|
+
#
|
|
62
|
+
# @return [String]
|
|
63
|
+
required :id, String
|
|
64
|
+
|
|
65
|
+
# @!method initialize(id:)
|
|
66
|
+
# Brand reference, or null for no brand.
|
|
67
|
+
#
|
|
68
|
+
# @param id [String]
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# @see Courier::Models::NotificationTemplatePayload#routing
|
|
72
|
+
class Routing < Courier::Internal::Type::BaseModel
|
|
73
|
+
# @!attribute strategy_id
|
|
74
|
+
#
|
|
75
|
+
# @return [String]
|
|
76
|
+
required :strategy_id, String
|
|
77
|
+
|
|
78
|
+
# @!method initialize(strategy_id:)
|
|
79
|
+
# Routing strategy reference, or null for none.
|
|
80
|
+
#
|
|
81
|
+
# @param strategy_id [String]
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# @see Courier::Models::NotificationTemplatePayload#subscription
|
|
85
|
+
class Subscription < Courier::Internal::Type::BaseModel
|
|
86
|
+
# @!attribute topic_id
|
|
87
|
+
#
|
|
88
|
+
# @return [String]
|
|
89
|
+
required :topic_id, String
|
|
90
|
+
|
|
91
|
+
# @!method initialize(topic_id:)
|
|
92
|
+
# Subscription topic reference, or null for none.
|
|
93
|
+
#
|
|
94
|
+
# @param topic_id [String]
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationTemplatePublishRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute version
|
|
7
|
+
# Historical version to publish (e.g. "v001"). Omit to publish the current draft.
|
|
8
|
+
#
|
|
9
|
+
# @return [String, nil]
|
|
10
|
+
optional :version, String
|
|
11
|
+
|
|
12
|
+
# @!method initialize(version: nil)
|
|
13
|
+
# Optional request body for publishing a notification template. Omit or send an
|
|
14
|
+
# empty object to publish the current draft.
|
|
15
|
+
#
|
|
16
|
+
# @param version [String] Historical version to publish (e.g. "v001"). Omit to publish the current draft.
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# Template state. Defaults to `DRAFT`.
|
|
6
|
+
module NotificationTemplateState
|
|
7
|
+
extend Courier::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
DRAFT = :DRAFT
|
|
10
|
+
PUBLISHED = :PUBLISHED
|
|
11
|
+
|
|
12
|
+
# @!method self.values
|
|
13
|
+
# @return [Array<Symbol>]
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationTemplateSummary < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute id
|
|
7
|
+
#
|
|
8
|
+
# @return [String]
|
|
9
|
+
required :id, String
|
|
10
|
+
|
|
11
|
+
# @!attribute created
|
|
12
|
+
# Epoch milliseconds when the template was created.
|
|
13
|
+
#
|
|
14
|
+
# @return [Integer]
|
|
15
|
+
required :created, Integer
|
|
16
|
+
|
|
17
|
+
# @!attribute creator
|
|
18
|
+
# User ID of the creator.
|
|
19
|
+
#
|
|
20
|
+
# @return [String]
|
|
21
|
+
required :creator, String
|
|
22
|
+
|
|
23
|
+
# @!attribute name
|
|
24
|
+
#
|
|
25
|
+
# @return [String]
|
|
26
|
+
required :name, String
|
|
27
|
+
|
|
28
|
+
# @!attribute state
|
|
29
|
+
#
|
|
30
|
+
# @return [Symbol, Courier::Models::NotificationTemplateSummary::State]
|
|
31
|
+
required :state, enum: -> { Courier::NotificationTemplateSummary::State }
|
|
32
|
+
|
|
33
|
+
# @!attribute tags
|
|
34
|
+
#
|
|
35
|
+
# @return [Array<String>]
|
|
36
|
+
required :tags, Courier::Internal::Type::ArrayOf[String]
|
|
37
|
+
|
|
38
|
+
# @!attribute updated
|
|
39
|
+
# Epoch milliseconds of last update.
|
|
40
|
+
#
|
|
41
|
+
# @return [Integer, nil]
|
|
42
|
+
optional :updated, Integer
|
|
43
|
+
|
|
44
|
+
# @!attribute updater
|
|
45
|
+
# User ID of the last updater.
|
|
46
|
+
#
|
|
47
|
+
# @return [String, nil]
|
|
48
|
+
optional :updater, String
|
|
49
|
+
|
|
50
|
+
# @!method initialize(id:, created:, creator:, name:, state:, tags:, updated: nil, updater: nil)
|
|
51
|
+
# V2 (CDS) template summary returned in list responses.
|
|
52
|
+
#
|
|
53
|
+
# @param id [String]
|
|
54
|
+
#
|
|
55
|
+
# @param created [Integer] Epoch milliseconds when the template was created.
|
|
56
|
+
#
|
|
57
|
+
# @param creator [String] User ID of the creator.
|
|
58
|
+
#
|
|
59
|
+
# @param name [String]
|
|
60
|
+
#
|
|
61
|
+
# @param state [Symbol, Courier::Models::NotificationTemplateSummary::State]
|
|
62
|
+
#
|
|
63
|
+
# @param tags [Array<String>]
|
|
64
|
+
#
|
|
65
|
+
# @param updated [Integer] Epoch milliseconds of last update.
|
|
66
|
+
#
|
|
67
|
+
# @param updater [String] User ID of the last updater.
|
|
68
|
+
|
|
69
|
+
# @see Courier::Models::NotificationTemplateSummary#state
|
|
70
|
+
module State
|
|
71
|
+
extend Courier::Internal::Type::Enum
|
|
72
|
+
|
|
73
|
+
DRAFT = :DRAFT
|
|
74
|
+
PUBLISHED = :PUBLISHED
|
|
75
|
+
|
|
76
|
+
# @!method self.values
|
|
77
|
+
# @return [Array<Symbol>]
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationTemplateUpdateRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute notification
|
|
7
|
+
# Full document shape used in POST and PUT request bodies, and returned inside the
|
|
8
|
+
# GET response envelope.
|
|
9
|
+
#
|
|
10
|
+
# @return [Courier::Models::NotificationTemplatePayload]
|
|
11
|
+
required :notification, -> { Courier::NotificationTemplatePayload }
|
|
12
|
+
|
|
13
|
+
# @!attribute state
|
|
14
|
+
# Template state after update. Case-insensitive input, normalized to uppercase in
|
|
15
|
+
# the response. Defaults to "DRAFT".
|
|
16
|
+
#
|
|
17
|
+
# @return [Symbol, Courier::Models::NotificationTemplateUpdateRequest::State, nil]
|
|
18
|
+
optional :state, enum: -> { Courier::NotificationTemplateUpdateRequest::State }
|
|
19
|
+
|
|
20
|
+
# @!method initialize(notification:, state: nil)
|
|
21
|
+
# Some parameter documentations has been truncated, see
|
|
22
|
+
# {Courier::Models::NotificationTemplateUpdateRequest} for more details.
|
|
23
|
+
#
|
|
24
|
+
# Request body for replacing a notification template. Same shape as create. All
|
|
25
|
+
# fields required (PUT = full replacement).
|
|
26
|
+
#
|
|
27
|
+
# @param notification [Courier::Models::NotificationTemplatePayload] Full document shape used in POST and PUT request bodies, and returned inside the
|
|
28
|
+
#
|
|
29
|
+
# @param state [Symbol, Courier::Models::NotificationTemplateUpdateRequest::State] Template state after update. Case-insensitive input, normalized to uppercase in
|
|
30
|
+
|
|
31
|
+
# Template state after update. Case-insensitive input, normalized to uppercase in
|
|
32
|
+
# the response. Defaults to "DRAFT".
|
|
33
|
+
#
|
|
34
|
+
# @see Courier::Models::NotificationTemplateUpdateRequest#state
|
|
35
|
+
module State
|
|
36
|
+
extend Courier::Internal::Type::Enum
|
|
37
|
+
|
|
38
|
+
DRAFT = :DRAFT
|
|
39
|
+
PUBLISHED = :PUBLISHED
|
|
40
|
+
|
|
41
|
+
# @!method self.values
|
|
42
|
+
# @return [Array<Symbol>]
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Notifications#list_versions
|
|
6
|
+
class NotificationTemplateVersionListResponse < Courier::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute paging
|
|
8
|
+
#
|
|
9
|
+
# @return [Courier::Models::Paging]
|
|
10
|
+
required :paging, -> { Courier::Paging }
|
|
11
|
+
|
|
12
|
+
# @!attribute versions
|
|
13
|
+
#
|
|
14
|
+
# @return [Array<Courier::Models::VersionNode>]
|
|
15
|
+
required :versions, -> { Courier::Internal::Type::ArrayOf[Courier::VersionNode] }
|
|
16
|
+
|
|
17
|
+
# @!method initialize(paging:, versions:)
|
|
18
|
+
# @param paging [Courier::Models::Paging]
|
|
19
|
+
# @param versions [Array<Courier::Models::VersionNode>]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Providers#create
|
|
6
|
+
class Provider < Courier::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# A unique identifier for the provider configuration.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute created
|
|
14
|
+
# Unix timestamp (ms) of when the provider was created.
|
|
15
|
+
#
|
|
16
|
+
# @return [Integer]
|
|
17
|
+
required :created, Integer
|
|
18
|
+
|
|
19
|
+
# @!attribute provider
|
|
20
|
+
# The provider key (e.g. "sendgrid", "twilio", "slack").
|
|
21
|
+
#
|
|
22
|
+
# @return [String]
|
|
23
|
+
required :provider, String
|
|
24
|
+
|
|
25
|
+
# @!attribute settings
|
|
26
|
+
# Provider-specific settings (snake_case keys on the wire).
|
|
27
|
+
#
|
|
28
|
+
# @return [Hash{Symbol=>Object}]
|
|
29
|
+
required :settings, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]
|
|
30
|
+
|
|
31
|
+
# @!attribute title
|
|
32
|
+
# Display title. Defaults to "Default Configuration" when not explicitly set.
|
|
33
|
+
#
|
|
34
|
+
# @return [String]
|
|
35
|
+
required :title, String
|
|
36
|
+
|
|
37
|
+
# @!attribute alias_
|
|
38
|
+
# Optional alias for this configuration.
|
|
39
|
+
#
|
|
40
|
+
# @return [String, nil]
|
|
41
|
+
optional :alias_, String, api_name: :alias
|
|
42
|
+
|
|
43
|
+
# @!attribute updated
|
|
44
|
+
# Unix timestamp (ms) of when the provider was last updated.
|
|
45
|
+
#
|
|
46
|
+
# @return [Integer, nil]
|
|
47
|
+
optional :updated, Integer, nil?: true
|
|
48
|
+
|
|
49
|
+
# @!method initialize(id:, created:, provider:, settings:, title:, alias_: nil, updated: nil)
|
|
50
|
+
# A configured provider in the workspace.
|
|
51
|
+
#
|
|
52
|
+
# @param id [String] A unique identifier for the provider configuration.
|
|
53
|
+
#
|
|
54
|
+
# @param created [Integer] Unix timestamp (ms) of when the provider was created.
|
|
55
|
+
#
|
|
56
|
+
# @param provider [String] The provider key (e.g. "sendgrid", "twilio", "slack").
|
|
57
|
+
#
|
|
58
|
+
# @param settings [Hash{Symbol=>Object}] Provider-specific settings (snake_case keys on the wire).
|
|
59
|
+
#
|
|
60
|
+
# @param title [String] Display title. Defaults to "Default Configuration" when not explicitly set.
|
|
61
|
+
#
|
|
62
|
+
# @param alias_ [String] Optional alias for this configuration.
|
|
63
|
+
#
|
|
64
|
+
# @param updated [Integer, nil] Unix timestamp (ms) of when the provider was last updated.
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Providers#create
|
|
6
|
+
class ProviderCreateParams < Courier::Internal::Type::BaseModel
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute provider
|
|
11
|
+
# The provider key identifying the type (e.g. "sendgrid", "twilio"). Must be a
|
|
12
|
+
# known Courier provider — see the catalog endpoint for valid keys.
|
|
13
|
+
#
|
|
14
|
+
# @return [String]
|
|
15
|
+
required :provider, String
|
|
16
|
+
|
|
17
|
+
# @!attribute alias_
|
|
18
|
+
# Optional alias for this configuration.
|
|
19
|
+
#
|
|
20
|
+
# @return [String, nil]
|
|
21
|
+
optional :alias_, String, api_name: :alias
|
|
22
|
+
|
|
23
|
+
# @!attribute settings
|
|
24
|
+
# Provider-specific settings (snake_case keys). Defaults to an empty object when
|
|
25
|
+
# omitted. Use the catalog endpoint to discover required fields for a given
|
|
26
|
+
# provider — omitting a required field returns a 400 validation error.
|
|
27
|
+
#
|
|
28
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
29
|
+
optional :settings, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]
|
|
30
|
+
|
|
31
|
+
# @!attribute title
|
|
32
|
+
# Optional display title. Omit to use "Default Configuration".
|
|
33
|
+
#
|
|
34
|
+
# @return [String, nil]
|
|
35
|
+
optional :title, String
|
|
36
|
+
|
|
37
|
+
# @!method initialize(provider:, alias_: nil, settings: nil, title: nil, request_options: {})
|
|
38
|
+
# Some parameter documentations has been truncated, see
|
|
39
|
+
# {Courier::Models::ProviderCreateParams} for more details.
|
|
40
|
+
#
|
|
41
|
+
# @param provider [String] The provider key identifying the type (e.g. "sendgrid", "twilio"). Must be a kno
|
|
42
|
+
#
|
|
43
|
+
# @param alias_ [String] Optional alias for this configuration.
|
|
44
|
+
#
|
|
45
|
+
# @param settings [Hash{Symbol=>Object}] Provider-specific settings (snake_case keys). Defaults to an empty object when o
|
|
46
|
+
#
|
|
47
|
+
# @param title [String] Optional display title. Omit to use "Default Configuration".
|
|
48
|
+
#
|
|
49
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Providers#delete
|
|
6
|
+
class ProviderDeleteParams < Courier::Internal::Type::BaseModel
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(id:, request_options: {})
|
|
16
|
+
# @param id [String]
|
|
17
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Providers#list
|
|
6
|
+
class ProviderListParams < Courier::Internal::Type::BaseModel
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute cursor
|
|
11
|
+
# Opaque cursor for fetching the next page.
|
|
12
|
+
#
|
|
13
|
+
# @return [String, nil]
|
|
14
|
+
optional :cursor, String
|
|
15
|
+
|
|
16
|
+
# @!method initialize(cursor: nil, request_options: {})
|
|
17
|
+
# @param cursor [String] Opaque cursor for fetching the next page.
|
|
18
|
+
#
|
|
19
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Providers#list
|
|
6
|
+
class ProviderListResponse < Courier::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute paging
|
|
8
|
+
#
|
|
9
|
+
# @return [Courier::Models::Paging]
|
|
10
|
+
required :paging, -> { Courier::Paging }
|
|
11
|
+
|
|
12
|
+
# @!attribute results
|
|
13
|
+
#
|
|
14
|
+
# @return [Array<Courier::Models::Provider>]
|
|
15
|
+
required :results, -> { Courier::Internal::Type::ArrayOf[Courier::Provider] }
|
|
16
|
+
|
|
17
|
+
# @!method initialize(paging:, results:)
|
|
18
|
+
# Paginated list of provider configurations.
|
|
19
|
+
#
|
|
20
|
+
# @param paging [Courier::Models::Paging]
|
|
21
|
+
# @param results [Array<Courier::Models::Provider>]
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Providers#retrieve
|
|
6
|
+
class ProviderRetrieveParams < Courier::Internal::Type::BaseModel
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(id:, request_options: {})
|
|
16
|
+
# @param id [String]
|
|
17
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|