trycourier 4.8.0 → 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 +32 -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/channel.rb +75 -0
- data/lib/courier/models/channel_metadata.rb +15 -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_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_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/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_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 +86 -0
- data/lib/courier/resources/notifications.rb +165 -3
- 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/version.rb +1 -1
- data/lib/courier.rb +47 -0
- data/rbi/courier/client.rbi +6 -0
- data/rbi/courier/internal/util.rbi +8 -0
- data/rbi/courier/models/channel.rbi +106 -0
- data/rbi/courier/models/channel_metadata.rbi +28 -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_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_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/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_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 +94 -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/sig/courier/client.rbs +4 -0
- data/sig/courier/internal/util.rbs +4 -0
- data/sig/courier/models/channel.rbs +61 -0
- data/sig/courier/models/channel_metadata.rbs +13 -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_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_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/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_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 +84 -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
- metadata +143 -2
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Notifications#list_versions
|
|
6
|
+
class NotificationListVersionsParams < 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
|
+
# @!attribute cursor
|
|
16
|
+
# Opaque pagination cursor from a previous response. Omit for the first page.
|
|
17
|
+
#
|
|
18
|
+
# @return [String, nil]
|
|
19
|
+
optional :cursor, String
|
|
20
|
+
|
|
21
|
+
# @!attribute limit
|
|
22
|
+
# Maximum number of versions to return per page. Default 10, max 10.
|
|
23
|
+
#
|
|
24
|
+
# @return [Integer, nil]
|
|
25
|
+
optional :limit, Integer
|
|
26
|
+
|
|
27
|
+
# @!method initialize(id:, cursor: nil, limit: nil, request_options: {})
|
|
28
|
+
# @param id [String]
|
|
29
|
+
#
|
|
30
|
+
# @param cursor [String] Opaque pagination cursor from a previous response. Omit for the first page.
|
|
31
|
+
#
|
|
32
|
+
# @param limit [Integer] Maximum number of versions to return per page. Default 10, max 10.
|
|
33
|
+
#
|
|
34
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Notifications#publish
|
|
6
|
+
class NotificationPublishParams < Courier::Models::NotificationTemplatePublishRequest
|
|
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,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Notifications#replace
|
|
6
|
+
class NotificationReplaceParams < Courier::Models::NotificationTemplateUpdateRequest
|
|
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,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Notifications#retrieve
|
|
6
|
+
class NotificationRetrieveParams < 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
|
+
# @!attribute version
|
|
16
|
+
# Version to retrieve. One of "draft", "published", or a version string like
|
|
17
|
+
# "v001". Defaults to "published".
|
|
18
|
+
#
|
|
19
|
+
# @return [String, nil]
|
|
20
|
+
optional :version, String
|
|
21
|
+
|
|
22
|
+
# @!method initialize(id:, version: nil, request_options: {})
|
|
23
|
+
# Some parameter documentations has been truncated, see
|
|
24
|
+
# {Courier::Models::NotificationRetrieveParams} for more details.
|
|
25
|
+
#
|
|
26
|
+
# @param id [String]
|
|
27
|
+
#
|
|
28
|
+
# @param version [String] Version to retrieve. One of "draft", "published", or a version string like "v001
|
|
29
|
+
#
|
|
30
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationTemplateCreateRequest < 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 creation. Case-insensitive input, normalized to uppercase
|
|
15
|
+
# in the response. Defaults to "DRAFT".
|
|
16
|
+
#
|
|
17
|
+
# @return [Symbol, Courier::Models::NotificationTemplateCreateRequest::State, nil]
|
|
18
|
+
optional :state, enum: -> { Courier::NotificationTemplateCreateRequest::State }
|
|
19
|
+
|
|
20
|
+
# @!method initialize(notification:, state: nil)
|
|
21
|
+
# Some parameter documentations has been truncated, see
|
|
22
|
+
# {Courier::Models::NotificationTemplateCreateRequest} for more details.
|
|
23
|
+
#
|
|
24
|
+
# Request body for creating a notification template.
|
|
25
|
+
#
|
|
26
|
+
# @param notification [Courier::Models::NotificationTemplatePayload] Full document shape used in POST and PUT request bodies, and returned inside the
|
|
27
|
+
#
|
|
28
|
+
# @param state [Symbol, Courier::Models::NotificationTemplateCreateRequest::State] Template state after creation. Case-insensitive input, normalized to uppercase i
|
|
29
|
+
|
|
30
|
+
# Template state after creation. Case-insensitive input, normalized to uppercase
|
|
31
|
+
# in the response. Defaults to "DRAFT".
|
|
32
|
+
#
|
|
33
|
+
# @see Courier::Models::NotificationTemplateCreateRequest#state
|
|
34
|
+
module State
|
|
35
|
+
extend Courier::Internal::Type::Enum
|
|
36
|
+
|
|
37
|
+
DRAFT = :DRAFT
|
|
38
|
+
PUBLISHED = :PUBLISHED
|
|
39
|
+
|
|
40
|
+
# @!method self.values
|
|
41
|
+
# @return [Array<Symbol>]
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -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,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
|