trycourier 4.10.2 → 4.11.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.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/lib/courier/client.rb +15 -1
  4. data/lib/courier/internal/transport/base_client.rb +2 -0
  5. data/lib/courier/models/create_journey_request.rb +39 -0
  6. data/lib/courier/models/journey_ai_node.rb +77 -0
  7. data/lib/courier/models/journey_api_invoke_trigger_node.rb +73 -0
  8. data/lib/courier/models/journey_archive_params.rb +20 -0
  9. data/lib/courier/models/journey_condition_atom.rb +8 -0
  10. data/lib/courier/models/journey_condition_group.rb +26 -0
  11. data/lib/courier/models/journey_condition_nested_group.rb +24 -0
  12. data/lib/courier/models/journey_conditions_field.rb +37 -0
  13. data/lib/courier/models/journey_create_params.rb +14 -0
  14. data/lib/courier/models/journey_delay_duration_node.rb +71 -0
  15. data/lib/courier/models/journey_delay_until_node.rb +71 -0
  16. data/lib/courier/models/journey_exit_node.rb +33 -0
  17. data/lib/courier/models/journey_fetch_get_delete_node.rb +103 -0
  18. data/lib/courier/models/journey_fetch_post_put_node.rb +110 -0
  19. data/lib/courier/models/journey_list_versions_params.rb +20 -0
  20. data/lib/courier/models/journey_merge_strategy.rb +18 -0
  21. data/lib/courier/models/journey_node.rb +139 -0
  22. data/lib/courier/models/journey_publish_params.rb +20 -0
  23. data/lib/courier/models/journey_publish_request.rb +18 -0
  24. data/lib/courier/models/journey_replace_params.rb +20 -0
  25. data/lib/courier/models/journey_response.rb +82 -0
  26. data/lib/courier/models/journey_retrieve_params.rb +29 -0
  27. data/lib/courier/models/journey_segment_trigger_node.rb +90 -0
  28. data/lib/courier/models/journey_send_node.rb +124 -0
  29. data/lib/courier/models/journey_state.rb +16 -0
  30. data/lib/courier/models/journey_template_create_request.rb +138 -0
  31. data/lib/courier/models/journey_template_get_response.rb +154 -0
  32. data/lib/courier/models/journey_template_list_response.rb +23 -0
  33. data/lib/courier/models/journey_template_publish_request.rb +18 -0
  34. data/lib/courier/models/journey_template_replace_request.rb +126 -0
  35. data/lib/courier/models/journey_template_summary.rb +60 -0
  36. data/lib/courier/models/journey_throttle_dynamic_node.rb +86 -0
  37. data/lib/courier/models/journey_throttle_static_node.rb +80 -0
  38. data/lib/courier/models/journey_version_item.rb +41 -0
  39. data/lib/courier/models/journey_versions_list_response.rb +24 -0
  40. data/lib/courier/models/journeys/template_archive_params.rb +28 -0
  41. data/lib/courier/models/journeys/template_create_params.rb +22 -0
  42. data/lib/courier/models/journeys/template_list_params.rb +39 -0
  43. data/lib/courier/models/journeys/template_list_versions_params.rb +28 -0
  44. data/lib/courier/models/journeys/template_publish_params.rb +28 -0
  45. data/lib/courier/models/journeys/template_replace_params.rb +28 -0
  46. data/lib/courier/models/journeys/template_retrieve_params.rb +28 -0
  47. data/lib/courier/models/tenants/template_delete_params.rb +28 -0
  48. data/lib/courier/models.rb +73 -0
  49. data/lib/courier/resources/journeys/templates.rb +224 -0
  50. data/lib/courier/resources/journeys.rb +167 -2
  51. data/lib/courier/resources/tenants/templates.rb +32 -0
  52. data/lib/courier/version.rb +1 -1
  53. data/lib/courier.rb +44 -0
  54. data/rbi/courier/models/create_journey_request.rbi +113 -0
  55. data/rbi/courier/models/journey_ai_node.rbi +141 -0
  56. data/rbi/courier/models/journey_api_invoke_trigger_node.rbi +164 -0
  57. data/rbi/courier/models/journey_archive_params.rbi +35 -0
  58. data/rbi/courier/models/journey_condition_atom.rbi +11 -0
  59. data/rbi/courier/models/journey_condition_group.rbi +43 -0
  60. data/rbi/courier/models/journey_condition_nested_group.rbi +51 -0
  61. data/rbi/courier/models/journey_conditions_field.rbi +27 -0
  62. data/rbi/courier/models/journey_create_params.rbi +27 -0
  63. data/rbi/courier/models/journey_delay_duration_node.rbi +146 -0
  64. data/rbi/courier/models/journey_delay_until_node.rbi +139 -0
  65. data/rbi/courier/models/journey_exit_node.rbi +57 -0
  66. data/rbi/courier/models/journey_fetch_get_delete_node.rbi +186 -0
  67. data/rbi/courier/models/journey_fetch_post_put_node.rbi +190 -0
  68. data/rbi/courier/models/journey_list_versions_params.rbi +35 -0
  69. data/rbi/courier/models/journey_merge_strategy.rbi +26 -0
  70. data/rbi/courier/models/journey_node.rbi +227 -0
  71. data/rbi/courier/models/journey_publish_params.rbi +35 -0
  72. data/rbi/courier/models/journey_publish_request.rbi +28 -0
  73. data/rbi/courier/models/journey_replace_params.rbi +35 -0
  74. data/rbi/courier/models/journey_response.rbi +108 -0
  75. data/rbi/courier/models/journey_retrieve_params.rbi +52 -0
  76. data/rbi/courier/models/journey_segment_trigger_node.rbi +200 -0
  77. data/rbi/courier/models/journey_send_node.rbi +254 -0
  78. data/rbi/courier/models/journey_state.rbi +20 -0
  79. data/rbi/courier/models/journey_template_create_request.rbi +381 -0
  80. data/rbi/courier/models/journey_template_get_response.rbi +334 -0
  81. data/rbi/courier/models/journey_template_list_response.rbi +45 -0
  82. data/rbi/courier/models/journey_template_publish_request.rbi +31 -0
  83. data/rbi/courier/models/journey_template_replace_request.rbi +368 -0
  84. data/rbi/courier/models/journey_template_summary.rbi +85 -0
  85. data/rbi/courier/models/journey_throttle_dynamic_node.rbi +162 -0
  86. data/rbi/courier/models/journey_throttle_static_node.rbi +158 -0
  87. data/rbi/courier/models/journey_version_item.rbi +54 -0
  88. data/rbi/courier/models/journey_versions_list_response.rbi +45 -0
  89. data/rbi/courier/models/journeys/template_archive_params.rbi +48 -0
  90. data/rbi/courier/models/journeys/template_create_params.rbi +40 -0
  91. data/rbi/courier/models/journeys/template_list_params.rbi +68 -0
  92. data/rbi/courier/models/journeys/template_list_versions_params.rbi +48 -0
  93. data/rbi/courier/models/journeys/template_publish_params.rbi +48 -0
  94. data/rbi/courier/models/journeys/template_replace_params.rbi +48 -0
  95. data/rbi/courier/models/journeys/template_retrieve_params.rbi +48 -0
  96. data/rbi/courier/models/tenants/template_delete_params.rbi +48 -0
  97. data/rbi/courier/models.rbi +76 -0
  98. data/rbi/courier/resources/journeys/templates.rbi +160 -0
  99. data/rbi/courier/resources/journeys.rbi +156 -3
  100. data/rbi/courier/resources/tenants/templates.rbi +22 -0
  101. data/sig/courier/models/create_journey_request.rbs +41 -0
  102. data/sig/courier/models/journey_ai_node.rbs +72 -0
  103. data/sig/courier/models/journey_api_invoke_trigger_node.rbs +68 -0
  104. data/sig/courier/models/journey_archive_params.rbs +23 -0
  105. data/sig/courier/models/journey_condition_atom.rbs +7 -0
  106. data/sig/courier/models/journey_condition_group.rbs +33 -0
  107. data/sig/courier/models/journey_condition_nested_group.rbs +33 -0
  108. data/sig/courier/models/journey_conditions_field.rbs +14 -0
  109. data/sig/courier/models/journey_create_params.rbs +15 -0
  110. data/sig/courier/models/journey_delay_duration_node.rbs +66 -0
  111. data/sig/courier/models/journey_delay_until_node.rbs +66 -0
  112. data/sig/courier/models/journey_exit_node.rbs +34 -0
  113. data/sig/courier/models/journey_fetch_get_delete_node.rbs +93 -0
  114. data/sig/courier/models/journey_fetch_post_put_node.rbs +100 -0
  115. data/sig/courier/models/journey_list_versions_params.rbs +23 -0
  116. data/sig/courier/models/journey_merge_strategy.rbs +16 -0
  117. data/sig/courier/models/journey_node.rbs +117 -0
  118. data/sig/courier/models/journey_publish_params.rbs +25 -0
  119. data/sig/courier/models/journey_publish_request.rbs +15 -0
  120. data/sig/courier/models/journey_replace_params.rbs +25 -0
  121. data/sig/courier/models/journey_response.rbs +65 -0
  122. data/sig/courier/models/journey_retrieve_params.rbs +30 -0
  123. data/sig/courier/models/journey_segment_trigger_node.rbs +85 -0
  124. data/sig/courier/models/journey_send_node.rbs +140 -0
  125. data/sig/courier/models/journey_state.rbs +14 -0
  126. data/sig/courier/models/journey_template_create_request.rbs +148 -0
  127. data/sig/courier/models/journey_template_get_response.rbs +157 -0
  128. data/sig/courier/models/journey_template_list_response.rbs +25 -0
  129. data/sig/courier/models/journey_template_publish_request.rbs +15 -0
  130. data/sig/courier/models/journey_template_replace_request.rbs +136 -0
  131. data/sig/courier/models/journey_template_summary.rbs +59 -0
  132. data/sig/courier/models/journey_throttle_dynamic_node.rbs +76 -0
  133. data/sig/courier/models/journey_throttle_static_node.rbs +72 -0
  134. data/sig/courier/models/journey_version_item.rbs +40 -0
  135. data/sig/courier/models/journey_versions_list_response.rbs +22 -0
  136. data/sig/courier/models/journeys/template_archive_params.rbs +30 -0
  137. data/sig/courier/models/journeys/template_create_params.rbs +27 -0
  138. data/sig/courier/models/journeys/template_list_params.rbs +38 -0
  139. data/sig/courier/models/journeys/template_list_versions_params.rbs +30 -0
  140. data/sig/courier/models/journeys/template_publish_params.rbs +34 -0
  141. data/sig/courier/models/journeys/template_replace_params.rbs +34 -0
  142. data/sig/courier/models/journeys/template_retrieve_params.rbs +30 -0
  143. data/sig/courier/models/tenants/template_delete_params.rbs +30 -0
  144. data/sig/courier/models.rbs +72 -0
  145. data/sig/courier/resources/journeys/templates.rbs +58 -0
  146. data/sig/courier/resources/journeys.rbs +41 -0
  147. data/sig/courier/resources/tenants/templates.rbs +6 -0
  148. metadata +134 -2
@@ -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
@@ -0,0 +1,126 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyTemplateReplaceRequest < Courier::Internal::Type::BaseModel
6
+ # @!attribute notification
7
+ #
8
+ # @return [Courier::Models::JourneyTemplateReplaceRequest::Notification]
9
+ required :notification, -> { Courier::JourneyTemplateReplaceRequest::Notification }
10
+
11
+ # @!attribute state
12
+ #
13
+ # @return [String, nil]
14
+ optional :state, String
15
+
16
+ # @!method initialize(notification:, state: nil)
17
+ # Request body for replacing a journey-scoped notification template draft.
18
+ #
19
+ # @param notification [Courier::Models::JourneyTemplateReplaceRequest::Notification]
20
+ # @param state [String]
21
+
22
+ # @see Courier::Models::JourneyTemplateReplaceRequest#notification
23
+ class Notification < Courier::Internal::Type::BaseModel
24
+ # @!attribute brand
25
+ #
26
+ # @return [Courier::Models::JourneyTemplateReplaceRequest::Notification::Brand, nil]
27
+ required :brand, -> { Courier::JourneyTemplateReplaceRequest::Notification::Brand }, nil?: true
28
+
29
+ # @!attribute content
30
+ #
31
+ # @return [Courier::Models::JourneyTemplateReplaceRequest::Notification::Content]
32
+ required :content, -> { Courier::JourneyTemplateReplaceRequest::Notification::Content }
33
+
34
+ # @!attribute name
35
+ #
36
+ # @return [String]
37
+ required :name, String
38
+
39
+ # @!attribute subscription
40
+ #
41
+ # @return [Courier::Models::JourneyTemplateReplaceRequest::Notification::Subscription, nil]
42
+ required :subscription,
43
+ -> { Courier::JourneyTemplateReplaceRequest::Notification::Subscription },
44
+ nil?: true
45
+
46
+ # @!attribute tags
47
+ #
48
+ # @return [Array<String>]
49
+ required :tags, Courier::Internal::Type::ArrayOf[String]
50
+
51
+ # @!method initialize(brand:, content:, name:, subscription:, tags:)
52
+ # @param brand [Courier::Models::JourneyTemplateReplaceRequest::Notification::Brand, nil]
53
+ # @param content [Courier::Models::JourneyTemplateReplaceRequest::Notification::Content]
54
+ # @param name [String]
55
+ # @param subscription [Courier::Models::JourneyTemplateReplaceRequest::Notification::Subscription, nil]
56
+ # @param tags [Array<String>]
57
+
58
+ # @see Courier::Models::JourneyTemplateReplaceRequest::Notification#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
+ # @param id [String]
67
+ end
68
+
69
+ # @see Courier::Models::JourneyTemplateReplaceRequest::Notification#content
70
+ class Content < Courier::Internal::Type::BaseModel
71
+ # @!attribute elements
72
+ #
73
+ # @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>]
74
+ required :elements, -> { Courier::Internal::Type::ArrayOf[union: Courier::ElementalNode] }
75
+
76
+ # @!attribute version
77
+ #
78
+ # @return [Symbol, Courier::Models::JourneyTemplateReplaceRequest::Notification::Content::Version]
79
+ required :version, enum: -> { Courier::JourneyTemplateReplaceRequest::Notification::Content::Version }
80
+
81
+ # @!attribute scope
82
+ #
83
+ # @return [Symbol, Courier::Models::JourneyTemplateReplaceRequest::Notification::Content::Scope, nil]
84
+ optional :scope, enum: -> { Courier::JourneyTemplateReplaceRequest::Notification::Content::Scope }
85
+
86
+ # @!method initialize(elements:, version:, scope: nil)
87
+ # @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>]
88
+ # @param version [Symbol, Courier::Models::JourneyTemplateReplaceRequest::Notification::Content::Version]
89
+ # @param scope [Symbol, Courier::Models::JourneyTemplateReplaceRequest::Notification::Content::Scope]
90
+
91
+ # @see Courier::Models::JourneyTemplateReplaceRequest::Notification::Content#version
92
+ module Version
93
+ extend Courier::Internal::Type::Enum
94
+
95
+ VERSION_2022_01_01 = :"2022-01-01"
96
+
97
+ # @!method self.values
98
+ # @return [Array<Symbol>]
99
+ end
100
+
101
+ # @see Courier::Models::JourneyTemplateReplaceRequest::Notification::Content#scope
102
+ module Scope
103
+ extend Courier::Internal::Type::Enum
104
+
105
+ DEFAULT = :default
106
+ STRICT = :strict
107
+
108
+ # @!method self.values
109
+ # @return [Array<Symbol>]
110
+ end
111
+ end
112
+
113
+ # @see Courier::Models::JourneyTemplateReplaceRequest::Notification#subscription
114
+ class Subscription < Courier::Internal::Type::BaseModel
115
+ # @!attribute topic_id
116
+ #
117
+ # @return [String]
118
+ required :topic_id, String
119
+
120
+ # @!method initialize(topic_id:)
121
+ # @param topic_id [String]
122
+ end
123
+ end
124
+ end
125
+ end
126
+ end
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyTemplateSummary < Courier::Internal::Type::BaseModel
6
+ # @!attribute id
7
+ #
8
+ # @return [String]
9
+ required :id, String
10
+
11
+ # @!attribute created
12
+ #
13
+ # @return [Integer]
14
+ required :created, Integer
15
+
16
+ # @!attribute creator
17
+ #
18
+ # @return [String]
19
+ required :creator, String
20
+
21
+ # @!attribute name
22
+ #
23
+ # @return [String]
24
+ required :name, String
25
+
26
+ # @!attribute state
27
+ #
28
+ # @return [String]
29
+ required :state, String
30
+
31
+ # @!attribute tags
32
+ #
33
+ # @return [Array<String>]
34
+ required :tags, Courier::Internal::Type::ArrayOf[String]
35
+
36
+ # @!attribute updated
37
+ #
38
+ # @return [Integer, nil]
39
+ optional :updated, Integer
40
+
41
+ # @!attribute updater
42
+ #
43
+ # @return [String, nil]
44
+ optional :updater, String
45
+
46
+ # @!method initialize(id:, created:, creator:, name:, state:, tags:, updated: nil, updater: nil)
47
+ # Summary fields of a journey-scoped notification template returned in list
48
+ # responses.
49
+ #
50
+ # @param id [String]
51
+ # @param created [Integer]
52
+ # @param creator [String]
53
+ # @param name [String]
54
+ # @param state [String]
55
+ # @param tags [Array<String>]
56
+ # @param updated [Integer]
57
+ # @param updater [String]
58
+ end
59
+ end
60
+ end