trycourier 4.10.2 → 4.12.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 +30 -0
- data/lib/courier/client.rb +15 -1
- data/lib/courier/internal/transport/base_client.rb +2 -0
- data/lib/courier/models/brand_create_params.rb +7 -7
- data/lib/courier/models/create_journey_request.rb +39 -0
- data/lib/courier/models/journey_ai_node.rb +77 -0
- data/lib/courier/models/journey_api_invoke_trigger_node.rb +73 -0
- data/lib/courier/models/journey_archive_params.rb +20 -0
- data/lib/courier/models/journey_condition_atom.rb +8 -0
- data/lib/courier/models/journey_condition_group.rb +26 -0
- data/lib/courier/models/journey_condition_nested_group.rb +24 -0
- data/lib/courier/models/journey_conditions_field.rb +37 -0
- data/lib/courier/models/journey_create_params.rb +14 -0
- data/lib/courier/models/journey_delay_duration_node.rb +71 -0
- data/lib/courier/models/journey_delay_until_node.rb +71 -0
- data/lib/courier/models/journey_exit_node.rb +33 -0
- data/lib/courier/models/journey_fetch_get_delete_node.rb +103 -0
- data/lib/courier/models/journey_fetch_post_put_node.rb +110 -0
- data/lib/courier/models/journey_list_versions_params.rb +20 -0
- data/lib/courier/models/journey_merge_strategy.rb +18 -0
- data/lib/courier/models/journey_node.rb +295 -0
- data/lib/courier/models/journey_publish_params.rb +20 -0
- data/lib/courier/models/journey_publish_request.rb +18 -0
- data/lib/courier/models/journey_replace_params.rb +20 -0
- data/lib/courier/models/journey_response.rb +82 -0
- data/lib/courier/models/journey_retrieve_params.rb +29 -0
- data/lib/courier/models/journey_segment_trigger_node.rb +90 -0
- data/lib/courier/models/journey_send_node.rb +124 -0
- data/lib/courier/models/journey_state.rb +16 -0
- data/lib/courier/models/journey_template_create_request.rb +138 -0
- data/lib/courier/models/journey_template_get_response.rb +154 -0
- data/lib/courier/models/journey_template_list_response.rb +23 -0
- data/lib/courier/models/journey_template_publish_request.rb +18 -0
- data/lib/courier/models/journey_template_replace_request.rb +126 -0
- data/lib/courier/models/journey_template_summary.rb +60 -0
- data/lib/courier/models/journey_throttle_dynamic_node.rb +86 -0
- data/lib/courier/models/journey_throttle_static_node.rb +80 -0
- data/lib/courier/models/journey_version_item.rb +41 -0
- data/lib/courier/models/journey_versions_list_response.rb +24 -0
- data/lib/courier/models/journeys/template_archive_params.rb +28 -0
- data/lib/courier/models/journeys/template_create_params.rb +22 -0
- data/lib/courier/models/journeys/template_list_params.rb +39 -0
- data/lib/courier/models/journeys/template_list_versions_params.rb +28 -0
- data/lib/courier/models/journeys/template_publish_params.rb +28 -0
- data/lib/courier/models/journeys/template_replace_params.rb +28 -0
- data/lib/courier/models/journeys/template_retrieve_params.rb +28 -0
- data/lib/courier/models/tenants/template_delete_params.rb +28 -0
- data/lib/courier/models.rb +73 -0
- data/lib/courier/resources/brands.rb +4 -3
- data/lib/courier/resources/journeys/templates.rb +224 -0
- data/lib/courier/resources/journeys.rb +167 -2
- data/lib/courier/resources/tenants/templates.rb +32 -0
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +44 -0
- data/rbi/courier/models/brand_create_params.rbi +8 -8
- data/rbi/courier/models/create_journey_request.rbi +116 -0
- data/rbi/courier/models/journey_ai_node.rbi +141 -0
- data/rbi/courier/models/journey_api_invoke_trigger_node.rbi +164 -0
- data/rbi/courier/models/journey_archive_params.rbi +35 -0
- data/rbi/courier/models/journey_condition_atom.rbi +11 -0
- data/rbi/courier/models/journey_condition_group.rbi +43 -0
- data/rbi/courier/models/journey_condition_nested_group.rbi +51 -0
- data/rbi/courier/models/journey_conditions_field.rbi +27 -0
- data/rbi/courier/models/journey_create_params.rbi +27 -0
- data/rbi/courier/models/journey_delay_duration_node.rbi +146 -0
- data/rbi/courier/models/journey_delay_until_node.rbi +139 -0
- data/rbi/courier/models/journey_exit_node.rbi +57 -0
- data/rbi/courier/models/journey_fetch_get_delete_node.rbi +186 -0
- data/rbi/courier/models/journey_fetch_post_put_node.rbi +190 -0
- data/rbi/courier/models/journey_list_versions_params.rbi +35 -0
- data/rbi/courier/models/journey_merge_strategy.rbi +26 -0
- data/rbi/courier/models/journey_node.rbi +542 -0
- data/rbi/courier/models/journey_publish_params.rbi +35 -0
- data/rbi/courier/models/journey_publish_request.rbi +28 -0
- data/rbi/courier/models/journey_replace_params.rbi +35 -0
- data/rbi/courier/models/journey_response.rbi +109 -0
- data/rbi/courier/models/journey_retrieve_params.rbi +52 -0
- data/rbi/courier/models/journey_segment_trigger_node.rbi +200 -0
- data/rbi/courier/models/journey_send_node.rbi +254 -0
- data/rbi/courier/models/journey_state.rbi +20 -0
- data/rbi/courier/models/journey_template_create_request.rbi +381 -0
- data/rbi/courier/models/journey_template_get_response.rbi +334 -0
- data/rbi/courier/models/journey_template_list_response.rbi +45 -0
- data/rbi/courier/models/journey_template_publish_request.rbi +31 -0
- data/rbi/courier/models/journey_template_replace_request.rbi +368 -0
- data/rbi/courier/models/journey_template_summary.rbi +85 -0
- data/rbi/courier/models/journey_throttle_dynamic_node.rbi +162 -0
- data/rbi/courier/models/journey_throttle_static_node.rbi +158 -0
- data/rbi/courier/models/journey_version_item.rbi +54 -0
- data/rbi/courier/models/journey_versions_list_response.rbi +45 -0
- data/rbi/courier/models/journeys/template_archive_params.rbi +48 -0
- data/rbi/courier/models/journeys/template_create_params.rbi +40 -0
- data/rbi/courier/models/journeys/template_list_params.rbi +68 -0
- data/rbi/courier/models/journeys/template_list_versions_params.rbi +48 -0
- data/rbi/courier/models/journeys/template_publish_params.rbi +48 -0
- data/rbi/courier/models/journeys/template_replace_params.rbi +48 -0
- data/rbi/courier/models/journeys/template_retrieve_params.rbi +48 -0
- data/rbi/courier/models/tenants/template_delete_params.rbi +48 -0
- data/rbi/courier/models.rbi +76 -0
- data/rbi/courier/resources/brands.rbi +4 -9
- data/rbi/courier/resources/journeys/templates.rbi +160 -0
- data/rbi/courier/resources/journeys.rbi +158 -3
- data/rbi/courier/resources/tenants/templates.rbi +22 -0
- data/sig/courier/models/brand_create_params.rbs +5 -5
- data/sig/courier/models/create_journey_request.rbs +41 -0
- data/sig/courier/models/journey_ai_node.rbs +72 -0
- data/sig/courier/models/journey_api_invoke_trigger_node.rbs +68 -0
- data/sig/courier/models/journey_archive_params.rbs +23 -0
- data/sig/courier/models/journey_condition_atom.rbs +7 -0
- data/sig/courier/models/journey_condition_group.rbs +33 -0
- data/sig/courier/models/journey_condition_nested_group.rbs +33 -0
- data/sig/courier/models/journey_conditions_field.rbs +14 -0
- data/sig/courier/models/journey_create_params.rbs +15 -0
- data/sig/courier/models/journey_delay_duration_node.rbs +66 -0
- data/sig/courier/models/journey_delay_until_node.rbs +66 -0
- data/sig/courier/models/journey_exit_node.rbs +34 -0
- data/sig/courier/models/journey_fetch_get_delete_node.rbs +93 -0
- data/sig/courier/models/journey_fetch_post_put_node.rbs +100 -0
- data/sig/courier/models/journey_list_versions_params.rbs +23 -0
- data/sig/courier/models/journey_merge_strategy.rbs +16 -0
- data/sig/courier/models/journey_node.rbs +247 -0
- data/sig/courier/models/journey_publish_params.rbs +25 -0
- data/sig/courier/models/journey_publish_request.rbs +15 -0
- data/sig/courier/models/journey_replace_params.rbs +25 -0
- data/sig/courier/models/journey_response.rbs +65 -0
- data/sig/courier/models/journey_retrieve_params.rbs +30 -0
- data/sig/courier/models/journey_segment_trigger_node.rbs +85 -0
- data/sig/courier/models/journey_send_node.rbs +140 -0
- data/sig/courier/models/journey_state.rbs +14 -0
- data/sig/courier/models/journey_template_create_request.rbs +148 -0
- data/sig/courier/models/journey_template_get_response.rbs +157 -0
- data/sig/courier/models/journey_template_list_response.rbs +25 -0
- data/sig/courier/models/journey_template_publish_request.rbs +15 -0
- data/sig/courier/models/journey_template_replace_request.rbs +136 -0
- data/sig/courier/models/journey_template_summary.rbs +59 -0
- data/sig/courier/models/journey_throttle_dynamic_node.rbs +76 -0
- data/sig/courier/models/journey_throttle_static_node.rbs +72 -0
- data/sig/courier/models/journey_version_item.rbs +40 -0
- data/sig/courier/models/journey_versions_list_response.rbs +22 -0
- data/sig/courier/models/journeys/template_archive_params.rbs +30 -0
- data/sig/courier/models/journeys/template_create_params.rbs +27 -0
- data/sig/courier/models/journeys/template_list_params.rbs +38 -0
- data/sig/courier/models/journeys/template_list_versions_params.rbs +30 -0
- data/sig/courier/models/journeys/template_publish_params.rbs +34 -0
- data/sig/courier/models/journeys/template_replace_params.rbs +34 -0
- data/sig/courier/models/journeys/template_retrieve_params.rbs +30 -0
- data/sig/courier/models/tenants/template_delete_params.rbs +30 -0
- data/sig/courier/models.rbs +72 -0
- data/sig/courier/resources/brands.rbs +1 -1
- data/sig/courier/resources/journeys/templates.rbs +58 -0
- data/sig/courier/resources/journeys.rbs +41 -0
- data/sig/courier/resources/tenants/templates.rbs +6 -0
- metadata +134 -2
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Journeys#retrieve
|
|
6
|
+
class JourneyRetrieveParams < Courier::Internal::Type::BaseModel
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute template_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :template_id, String
|
|
14
|
+
|
|
15
|
+
# @!attribute version
|
|
16
|
+
# Version selector: `draft`, `published` (default), or `vN`.
|
|
17
|
+
#
|
|
18
|
+
# @return [String, nil]
|
|
19
|
+
optional :version, String
|
|
20
|
+
|
|
21
|
+
# @!method initialize(template_id:, version: nil, request_options: {})
|
|
22
|
+
# @param template_id [String]
|
|
23
|
+
#
|
|
24
|
+
# @param version [String] Version selector: `draft`, `published` (default), or `vN`.
|
|
25
|
+
#
|
|
26
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneySegmentTriggerNode < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute request_type
|
|
7
|
+
#
|
|
8
|
+
# @return [Symbol, Courier::Models::JourneySegmentTriggerNode::RequestType]
|
|
9
|
+
required :request_type, enum: -> { Courier::JourneySegmentTriggerNode::RequestType }
|
|
10
|
+
|
|
11
|
+
# @!attribute trigger_type
|
|
12
|
+
#
|
|
13
|
+
# @return [Symbol, Courier::Models::JourneySegmentTriggerNode::TriggerType]
|
|
14
|
+
required :trigger_type, enum: -> { Courier::JourneySegmentTriggerNode::TriggerType }
|
|
15
|
+
|
|
16
|
+
# @!attribute type
|
|
17
|
+
#
|
|
18
|
+
# @return [Symbol, Courier::Models::JourneySegmentTriggerNode::Type]
|
|
19
|
+
required :type, enum: -> { Courier::JourneySegmentTriggerNode::Type }
|
|
20
|
+
|
|
21
|
+
# @!attribute id
|
|
22
|
+
#
|
|
23
|
+
# @return [String, nil]
|
|
24
|
+
optional :id, String
|
|
25
|
+
|
|
26
|
+
# @!attribute conditions
|
|
27
|
+
# Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
28
|
+
# group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
29
|
+
# express "no conditions".
|
|
30
|
+
#
|
|
31
|
+
# @return [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup, nil]
|
|
32
|
+
optional :conditions, union: -> { Courier::JourneyConditionsField }
|
|
33
|
+
|
|
34
|
+
# @!attribute event_id
|
|
35
|
+
#
|
|
36
|
+
# @return [String, nil]
|
|
37
|
+
optional :event_id, String
|
|
38
|
+
|
|
39
|
+
# @!method initialize(request_type:, trigger_type:, type:, id: nil, conditions: nil, event_id: nil)
|
|
40
|
+
# Some parameter documentations has been truncated, see
|
|
41
|
+
# {Courier::Models::JourneySegmentTriggerNode} for more details.
|
|
42
|
+
#
|
|
43
|
+
# Trigger fired by a segment event (`identify`, `group`, or `track`).
|
|
44
|
+
#
|
|
45
|
+
# @param request_type [Symbol, Courier::Models::JourneySegmentTriggerNode::RequestType]
|
|
46
|
+
#
|
|
47
|
+
# @param trigger_type [Symbol, Courier::Models::JourneySegmentTriggerNode::TriggerType]
|
|
48
|
+
#
|
|
49
|
+
# @param type [Symbol, Courier::Models::JourneySegmentTriggerNode::Type]
|
|
50
|
+
#
|
|
51
|
+
# @param id [String]
|
|
52
|
+
#
|
|
53
|
+
# @param conditions [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup] Condition spec for a journey node. Accepts a single condition atom, an AND/OR gr
|
|
54
|
+
#
|
|
55
|
+
# @param event_id [String]
|
|
56
|
+
|
|
57
|
+
# @see Courier::Models::JourneySegmentTriggerNode#request_type
|
|
58
|
+
module RequestType
|
|
59
|
+
extend Courier::Internal::Type::Enum
|
|
60
|
+
|
|
61
|
+
IDENTIFY = :identify
|
|
62
|
+
GROUP = :group
|
|
63
|
+
TRACK = :track
|
|
64
|
+
|
|
65
|
+
# @!method self.values
|
|
66
|
+
# @return [Array<Symbol>]
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# @see Courier::Models::JourneySegmentTriggerNode#trigger_type
|
|
70
|
+
module TriggerType
|
|
71
|
+
extend Courier::Internal::Type::Enum
|
|
72
|
+
|
|
73
|
+
SEGMENT = :segment
|
|
74
|
+
|
|
75
|
+
# @!method self.values
|
|
76
|
+
# @return [Array<Symbol>]
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# @see Courier::Models::JourneySegmentTriggerNode#type
|
|
80
|
+
module Type
|
|
81
|
+
extend Courier::Internal::Type::Enum
|
|
82
|
+
|
|
83
|
+
TRIGGER = :trigger
|
|
84
|
+
|
|
85
|
+
# @!method self.values
|
|
86
|
+
# @return [Array<Symbol>]
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneySendNode < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute message
|
|
7
|
+
#
|
|
8
|
+
# @return [Courier::Models::JourneySendNode::Message]
|
|
9
|
+
required :message, -> { Courier::JourneySendNode::Message }
|
|
10
|
+
|
|
11
|
+
# @!attribute type
|
|
12
|
+
#
|
|
13
|
+
# @return [Symbol, Courier::Models::JourneySendNode::Type]
|
|
14
|
+
required :type, enum: -> { Courier::JourneySendNode::Type }
|
|
15
|
+
|
|
16
|
+
# @!attribute id
|
|
17
|
+
#
|
|
18
|
+
# @return [String, nil]
|
|
19
|
+
optional :id, String
|
|
20
|
+
|
|
21
|
+
# @!attribute conditions
|
|
22
|
+
# Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
23
|
+
# group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
24
|
+
# express "no conditions".
|
|
25
|
+
#
|
|
26
|
+
# @return [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup, nil]
|
|
27
|
+
optional :conditions, union: -> { Courier::JourneyConditionsField }
|
|
28
|
+
|
|
29
|
+
# @!method initialize(message:, type:, id: nil, conditions: nil)
|
|
30
|
+
# Some parameter documentations has been truncated, see
|
|
31
|
+
# {Courier::Models::JourneySendNode} for more details.
|
|
32
|
+
#
|
|
33
|
+
# Send a notification template to the recipient. Optionally override the recipient
|
|
34
|
+
# address, delay the send, or attach `data`.
|
|
35
|
+
#
|
|
36
|
+
# @param message [Courier::Models::JourneySendNode::Message]
|
|
37
|
+
#
|
|
38
|
+
# @param type [Symbol, Courier::Models::JourneySendNode::Type]
|
|
39
|
+
#
|
|
40
|
+
# @param id [String]
|
|
41
|
+
#
|
|
42
|
+
# @param conditions [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup] Condition spec for a journey node. Accepts a single condition atom, an AND/OR gr
|
|
43
|
+
|
|
44
|
+
# @see Courier::Models::JourneySendNode#message
|
|
45
|
+
class Message < Courier::Internal::Type::BaseModel
|
|
46
|
+
# @!attribute template
|
|
47
|
+
#
|
|
48
|
+
# @return [String]
|
|
49
|
+
required :template, String
|
|
50
|
+
|
|
51
|
+
# @!attribute data
|
|
52
|
+
#
|
|
53
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
54
|
+
optional :data, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]
|
|
55
|
+
|
|
56
|
+
# @!attribute delay
|
|
57
|
+
#
|
|
58
|
+
# @return [Courier::Models::JourneySendNode::Message::Delay, nil]
|
|
59
|
+
optional :delay, -> { Courier::JourneySendNode::Message::Delay }
|
|
60
|
+
|
|
61
|
+
# @!attribute to
|
|
62
|
+
#
|
|
63
|
+
# @return [Courier::Models::JourneySendNode::Message::To, nil]
|
|
64
|
+
optional :to, -> { Courier::JourneySendNode::Message::To }
|
|
65
|
+
|
|
66
|
+
# @!method initialize(template:, data: nil, delay: nil, to: nil)
|
|
67
|
+
# @param template [String]
|
|
68
|
+
# @param data [Hash{Symbol=>Object}]
|
|
69
|
+
# @param delay [Courier::Models::JourneySendNode::Message::Delay]
|
|
70
|
+
# @param to [Courier::Models::JourneySendNode::Message::To]
|
|
71
|
+
|
|
72
|
+
# @see Courier::Models::JourneySendNode::Message#delay
|
|
73
|
+
class Delay < Courier::Internal::Type::BaseModel
|
|
74
|
+
# @!attribute until_
|
|
75
|
+
#
|
|
76
|
+
# @return [String]
|
|
77
|
+
required :until_, String, api_name: :until
|
|
78
|
+
|
|
79
|
+
# @!attribute timezone
|
|
80
|
+
#
|
|
81
|
+
# @return [String, nil]
|
|
82
|
+
optional :timezone, String
|
|
83
|
+
|
|
84
|
+
# @!method initialize(until_:, timezone: nil)
|
|
85
|
+
# @param until_ [String]
|
|
86
|
+
# @param timezone [String]
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# @see Courier::Models::JourneySendNode::Message#to
|
|
90
|
+
class To < Courier::Internal::Type::BaseModel
|
|
91
|
+
# @!attribute email_override
|
|
92
|
+
#
|
|
93
|
+
# @return [String, nil]
|
|
94
|
+
optional :email_override, String
|
|
95
|
+
|
|
96
|
+
# @!attribute phone_number_override
|
|
97
|
+
#
|
|
98
|
+
# @return [String, nil]
|
|
99
|
+
optional :phone_number_override, String
|
|
100
|
+
|
|
101
|
+
# @!attribute user_id_override
|
|
102
|
+
#
|
|
103
|
+
# @return [String, nil]
|
|
104
|
+
optional :user_id_override, String
|
|
105
|
+
|
|
106
|
+
# @!method initialize(email_override: nil, phone_number_override: nil, user_id_override: nil)
|
|
107
|
+
# @param email_override [String]
|
|
108
|
+
# @param phone_number_override [String]
|
|
109
|
+
# @param user_id_override [String]
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# @see Courier::Models::JourneySendNode#type
|
|
114
|
+
module Type
|
|
115
|
+
extend Courier::Internal::Type::Enum
|
|
116
|
+
|
|
117
|
+
SEND = :send
|
|
118
|
+
|
|
119
|
+
# @!method self.values
|
|
120
|
+
# @return [Array<Symbol>]
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# Lifecycle state of a journey.
|
|
6
|
+
module JourneyState
|
|
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,138 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneyTemplateCreateRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute channel
|
|
7
|
+
#
|
|
8
|
+
# @return [String]
|
|
9
|
+
required :channel, String
|
|
10
|
+
|
|
11
|
+
# @!attribute notification
|
|
12
|
+
#
|
|
13
|
+
# @return [Courier::Models::JourneyTemplateCreateRequest::Notification]
|
|
14
|
+
required :notification, -> { Courier::JourneyTemplateCreateRequest::Notification }
|
|
15
|
+
|
|
16
|
+
# @!attribute provider_key
|
|
17
|
+
#
|
|
18
|
+
# @return [String, nil]
|
|
19
|
+
optional :provider_key, String, api_name: :providerKey
|
|
20
|
+
|
|
21
|
+
# @!attribute state
|
|
22
|
+
#
|
|
23
|
+
# @return [String, nil]
|
|
24
|
+
optional :state, String
|
|
25
|
+
|
|
26
|
+
# @!method initialize(channel:, notification:, provider_key: nil, state: nil)
|
|
27
|
+
# Request body for creating a notification template scoped to a journey.
|
|
28
|
+
#
|
|
29
|
+
# @param channel [String]
|
|
30
|
+
# @param notification [Courier::Models::JourneyTemplateCreateRequest::Notification]
|
|
31
|
+
# @param provider_key [String]
|
|
32
|
+
# @param state [String]
|
|
33
|
+
|
|
34
|
+
# @see Courier::Models::JourneyTemplateCreateRequest#notification
|
|
35
|
+
class Notification < Courier::Internal::Type::BaseModel
|
|
36
|
+
# @!attribute brand
|
|
37
|
+
#
|
|
38
|
+
# @return [Courier::Models::JourneyTemplateCreateRequest::Notification::Brand, nil]
|
|
39
|
+
required :brand, -> { Courier::JourneyTemplateCreateRequest::Notification::Brand }, nil?: true
|
|
40
|
+
|
|
41
|
+
# @!attribute content
|
|
42
|
+
#
|
|
43
|
+
# @return [Courier::Models::JourneyTemplateCreateRequest::Notification::Content]
|
|
44
|
+
required :content, -> { Courier::JourneyTemplateCreateRequest::Notification::Content }
|
|
45
|
+
|
|
46
|
+
# @!attribute name
|
|
47
|
+
#
|
|
48
|
+
# @return [String]
|
|
49
|
+
required :name, String
|
|
50
|
+
|
|
51
|
+
# @!attribute subscription
|
|
52
|
+
#
|
|
53
|
+
# @return [Courier::Models::JourneyTemplateCreateRequest::Notification::Subscription, nil]
|
|
54
|
+
required :subscription,
|
|
55
|
+
-> { Courier::JourneyTemplateCreateRequest::Notification::Subscription },
|
|
56
|
+
nil?: true
|
|
57
|
+
|
|
58
|
+
# @!attribute tags
|
|
59
|
+
#
|
|
60
|
+
# @return [Array<String>]
|
|
61
|
+
required :tags, Courier::Internal::Type::ArrayOf[String]
|
|
62
|
+
|
|
63
|
+
# @!method initialize(brand:, content:, name:, subscription:, tags:)
|
|
64
|
+
# @param brand [Courier::Models::JourneyTemplateCreateRequest::Notification::Brand, nil]
|
|
65
|
+
# @param content [Courier::Models::JourneyTemplateCreateRequest::Notification::Content]
|
|
66
|
+
# @param name [String]
|
|
67
|
+
# @param subscription [Courier::Models::JourneyTemplateCreateRequest::Notification::Subscription, nil]
|
|
68
|
+
# @param tags [Array<String>]
|
|
69
|
+
|
|
70
|
+
# @see Courier::Models::JourneyTemplateCreateRequest::Notification#brand
|
|
71
|
+
class Brand < Courier::Internal::Type::BaseModel
|
|
72
|
+
# @!attribute id
|
|
73
|
+
#
|
|
74
|
+
# @return [String]
|
|
75
|
+
required :id, String
|
|
76
|
+
|
|
77
|
+
# @!method initialize(id:)
|
|
78
|
+
# @param id [String]
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# @see Courier::Models::JourneyTemplateCreateRequest::Notification#content
|
|
82
|
+
class Content < Courier::Internal::Type::BaseModel
|
|
83
|
+
# @!attribute elements
|
|
84
|
+
#
|
|
85
|
+
# @return [Array<Courier::Models::ElementalTextNodeWithType, Courier::Models::ElementalMetaNodeWithType, Courier::Models::ElementalChannelNodeWithType, Courier::Models::ElementalImageNodeWithType, Courier::Models::ElementalActionNodeWithType, Courier::Models::ElementalDividerNodeWithType, Courier::Models::ElementalQuoteNodeWithType, Courier::Models::ElementalHTMLNodeWithType>]
|
|
86
|
+
required :elements, -> { Courier::Internal::Type::ArrayOf[union: Courier::ElementalNode] }
|
|
87
|
+
|
|
88
|
+
# @!attribute version
|
|
89
|
+
#
|
|
90
|
+
# @return [Symbol, Courier::Models::JourneyTemplateCreateRequest::Notification::Content::Version]
|
|
91
|
+
required :version, enum: -> { Courier::JourneyTemplateCreateRequest::Notification::Content::Version }
|
|
92
|
+
|
|
93
|
+
# @!attribute scope
|
|
94
|
+
#
|
|
95
|
+
# @return [Symbol, Courier::Models::JourneyTemplateCreateRequest::Notification::Content::Scope, nil]
|
|
96
|
+
optional :scope, enum: -> { Courier::JourneyTemplateCreateRequest::Notification::Content::Scope }
|
|
97
|
+
|
|
98
|
+
# @!method initialize(elements:, version:, scope: nil)
|
|
99
|
+
# @param elements [Array<Courier::Models::ElementalTextNodeWithType, Courier::Models::ElementalMetaNodeWithType, Courier::Models::ElementalChannelNodeWithType, Courier::Models::ElementalImageNodeWithType, Courier::Models::ElementalActionNodeWithType, Courier::Models::ElementalDividerNodeWithType, Courier::Models::ElementalQuoteNodeWithType, Courier::Models::ElementalHTMLNodeWithType>]
|
|
100
|
+
# @param version [Symbol, Courier::Models::JourneyTemplateCreateRequest::Notification::Content::Version]
|
|
101
|
+
# @param scope [Symbol, Courier::Models::JourneyTemplateCreateRequest::Notification::Content::Scope]
|
|
102
|
+
|
|
103
|
+
# @see Courier::Models::JourneyTemplateCreateRequest::Notification::Content#version
|
|
104
|
+
module Version
|
|
105
|
+
extend Courier::Internal::Type::Enum
|
|
106
|
+
|
|
107
|
+
VERSION_2022_01_01 = :"2022-01-01"
|
|
108
|
+
|
|
109
|
+
# @!method self.values
|
|
110
|
+
# @return [Array<Symbol>]
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# @see Courier::Models::JourneyTemplateCreateRequest::Notification::Content#scope
|
|
114
|
+
module Scope
|
|
115
|
+
extend Courier::Internal::Type::Enum
|
|
116
|
+
|
|
117
|
+
DEFAULT = :default
|
|
118
|
+
STRICT = :strict
|
|
119
|
+
|
|
120
|
+
# @!method self.values
|
|
121
|
+
# @return [Array<Symbol>]
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# @see Courier::Models::JourneyTemplateCreateRequest::Notification#subscription
|
|
126
|
+
class Subscription < Courier::Internal::Type::BaseModel
|
|
127
|
+
# @!attribute topic_id
|
|
128
|
+
#
|
|
129
|
+
# @return [String]
|
|
130
|
+
required :topic_id, String
|
|
131
|
+
|
|
132
|
+
# @!method initialize(topic_id:)
|
|
133
|
+
# @param topic_id [String]
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
end
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneyTemplateGetResponse < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute id
|
|
7
|
+
#
|
|
8
|
+
# @return [String]
|
|
9
|
+
required :id, String
|
|
10
|
+
|
|
11
|
+
# @!attribute brand
|
|
12
|
+
#
|
|
13
|
+
# @return [Courier::Models::JourneyTemplateGetResponse::Brand, nil]
|
|
14
|
+
required :brand, -> { Courier::JourneyTemplateGetResponse::Brand }, nil?: true
|
|
15
|
+
|
|
16
|
+
# @!attribute content
|
|
17
|
+
#
|
|
18
|
+
# @return [Courier::Models::JourneyTemplateGetResponse::Content]
|
|
19
|
+
required :content, -> { Courier::JourneyTemplateGetResponse::Content }
|
|
20
|
+
|
|
21
|
+
# @!attribute created
|
|
22
|
+
#
|
|
23
|
+
# @return [Integer]
|
|
24
|
+
required :created, Integer
|
|
25
|
+
|
|
26
|
+
# @!attribute creator
|
|
27
|
+
#
|
|
28
|
+
# @return [String]
|
|
29
|
+
required :creator, String
|
|
30
|
+
|
|
31
|
+
# @!attribute name
|
|
32
|
+
#
|
|
33
|
+
# @return [String]
|
|
34
|
+
required :name, String
|
|
35
|
+
|
|
36
|
+
# @!attribute state
|
|
37
|
+
#
|
|
38
|
+
# @return [Symbol, Courier::Models::JourneyTemplateGetResponse::State]
|
|
39
|
+
required :state, enum: -> { Courier::JourneyTemplateGetResponse::State }
|
|
40
|
+
|
|
41
|
+
# @!attribute subscription
|
|
42
|
+
#
|
|
43
|
+
# @return [Courier::Models::JourneyTemplateGetResponse::Subscription, nil]
|
|
44
|
+
required :subscription, -> { Courier::JourneyTemplateGetResponse::Subscription }, nil?: true
|
|
45
|
+
|
|
46
|
+
# @!attribute tags
|
|
47
|
+
#
|
|
48
|
+
# @return [Array<String>]
|
|
49
|
+
required :tags, Courier::Internal::Type::ArrayOf[String]
|
|
50
|
+
|
|
51
|
+
# @!attribute updated
|
|
52
|
+
#
|
|
53
|
+
# @return [Integer, nil]
|
|
54
|
+
optional :updated, Integer
|
|
55
|
+
|
|
56
|
+
# @!attribute updater
|
|
57
|
+
#
|
|
58
|
+
# @return [String, nil]
|
|
59
|
+
optional :updater, String
|
|
60
|
+
|
|
61
|
+
# @!method initialize(id:, brand:, content:, created:, creator:, name:, state:, subscription:, tags:, updated: nil, updater: nil)
|
|
62
|
+
# A journey-scoped notification template.
|
|
63
|
+
#
|
|
64
|
+
# @param id [String]
|
|
65
|
+
# @param brand [Courier::Models::JourneyTemplateGetResponse::Brand, nil]
|
|
66
|
+
# @param content [Courier::Models::JourneyTemplateGetResponse::Content]
|
|
67
|
+
# @param created [Integer]
|
|
68
|
+
# @param creator [String]
|
|
69
|
+
# @param name [String]
|
|
70
|
+
# @param state [Symbol, Courier::Models::JourneyTemplateGetResponse::State]
|
|
71
|
+
# @param subscription [Courier::Models::JourneyTemplateGetResponse::Subscription, nil]
|
|
72
|
+
# @param tags [Array<String>]
|
|
73
|
+
# @param updated [Integer]
|
|
74
|
+
# @param updater [String]
|
|
75
|
+
|
|
76
|
+
# @see Courier::Models::JourneyTemplateGetResponse#brand
|
|
77
|
+
class Brand < Courier::Internal::Type::BaseModel
|
|
78
|
+
# @!attribute id
|
|
79
|
+
#
|
|
80
|
+
# @return [String]
|
|
81
|
+
required :id, String
|
|
82
|
+
|
|
83
|
+
# @!method initialize(id:)
|
|
84
|
+
# @param id [String]
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# @see Courier::Models::JourneyTemplateGetResponse#content
|
|
88
|
+
class Content < Courier::Internal::Type::BaseModel
|
|
89
|
+
# @!attribute elements
|
|
90
|
+
#
|
|
91
|
+
# @return [Array<Courier::Models::ElementalTextNodeWithType, Courier::Models::ElementalMetaNodeWithType, Courier::Models::ElementalChannelNodeWithType, Courier::Models::ElementalImageNodeWithType, Courier::Models::ElementalActionNodeWithType, Courier::Models::ElementalDividerNodeWithType, Courier::Models::ElementalQuoteNodeWithType, Courier::Models::ElementalHTMLNodeWithType>]
|
|
92
|
+
required :elements, -> { Courier::Internal::Type::ArrayOf[union: Courier::ElementalNode] }
|
|
93
|
+
|
|
94
|
+
# @!attribute version
|
|
95
|
+
#
|
|
96
|
+
# @return [Symbol, Courier::Models::JourneyTemplateGetResponse::Content::Version]
|
|
97
|
+
required :version, enum: -> { Courier::JourneyTemplateGetResponse::Content::Version }
|
|
98
|
+
|
|
99
|
+
# @!attribute scope
|
|
100
|
+
#
|
|
101
|
+
# @return [Symbol, Courier::Models::JourneyTemplateGetResponse::Content::Scope, nil]
|
|
102
|
+
optional :scope, enum: -> { Courier::JourneyTemplateGetResponse::Content::Scope }
|
|
103
|
+
|
|
104
|
+
# @!method initialize(elements:, version:, scope: nil)
|
|
105
|
+
# @param elements [Array<Courier::Models::ElementalTextNodeWithType, Courier::Models::ElementalMetaNodeWithType, Courier::Models::ElementalChannelNodeWithType, Courier::Models::ElementalImageNodeWithType, Courier::Models::ElementalActionNodeWithType, Courier::Models::ElementalDividerNodeWithType, Courier::Models::ElementalQuoteNodeWithType, Courier::Models::ElementalHTMLNodeWithType>]
|
|
106
|
+
# @param version [Symbol, Courier::Models::JourneyTemplateGetResponse::Content::Version]
|
|
107
|
+
# @param scope [Symbol, Courier::Models::JourneyTemplateGetResponse::Content::Scope]
|
|
108
|
+
|
|
109
|
+
# @see Courier::Models::JourneyTemplateGetResponse::Content#version
|
|
110
|
+
module Version
|
|
111
|
+
extend Courier::Internal::Type::Enum
|
|
112
|
+
|
|
113
|
+
VERSION_2022_01_01 = :"2022-01-01"
|
|
114
|
+
|
|
115
|
+
# @!method self.values
|
|
116
|
+
# @return [Array<Symbol>]
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# @see Courier::Models::JourneyTemplateGetResponse::Content#scope
|
|
120
|
+
module Scope
|
|
121
|
+
extend Courier::Internal::Type::Enum
|
|
122
|
+
|
|
123
|
+
DEFAULT = :default
|
|
124
|
+
STRICT = :strict
|
|
125
|
+
|
|
126
|
+
# @!method self.values
|
|
127
|
+
# @return [Array<Symbol>]
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# @see Courier::Models::JourneyTemplateGetResponse#state
|
|
132
|
+
module State
|
|
133
|
+
extend Courier::Internal::Type::Enum
|
|
134
|
+
|
|
135
|
+
DRAFT = :DRAFT
|
|
136
|
+
PUBLISHED = :PUBLISHED
|
|
137
|
+
|
|
138
|
+
# @!method self.values
|
|
139
|
+
# @return [Array<Symbol>]
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# @see Courier::Models::JourneyTemplateGetResponse#subscription
|
|
143
|
+
class Subscription < Courier::Internal::Type::BaseModel
|
|
144
|
+
# @!attribute topic_id
|
|
145
|
+
#
|
|
146
|
+
# @return [String]
|
|
147
|
+
required :topic_id, String
|
|
148
|
+
|
|
149
|
+
# @!method initialize(topic_id:)
|
|
150
|
+
# @param topic_id [String]
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneyTemplateListResponse < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute paging
|
|
7
|
+
#
|
|
8
|
+
# @return [Courier::Models::Paging]
|
|
9
|
+
required :paging, -> { Courier::Paging }
|
|
10
|
+
|
|
11
|
+
# @!attribute results
|
|
12
|
+
#
|
|
13
|
+
# @return [Array<Courier::Models::JourneyTemplateSummary>]
|
|
14
|
+
required :results, -> { Courier::Internal::Type::ArrayOf[Courier::JourneyTemplateSummary] }
|
|
15
|
+
|
|
16
|
+
# @!method initialize(paging:, results:)
|
|
17
|
+
# Paged list of journey-scoped notification templates.
|
|
18
|
+
#
|
|
19
|
+
# @param paging [Courier::Models::Paging]
|
|
20
|
+
# @param results [Array<Courier::Models::JourneyTemplateSummary>]
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneyTemplatePublishRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute version
|
|
7
|
+
#
|
|
8
|
+
# @return [String, nil]
|
|
9
|
+
optional :version, String
|
|
10
|
+
|
|
11
|
+
# @!method initialize(version: nil)
|
|
12
|
+
# Request body for publishing a journey-scoped notification template. Pass
|
|
13
|
+
# `version` to roll back to a prior version; omit to publish the current draft.
|
|
14
|
+
#
|
|
15
|
+
# @param version [String]
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|