trycourier 4.10.1 → 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 (168) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -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/notification_list_response.rb +8 -8
  48. data/lib/courier/models/notification_template_create_request.rb +3 -3
  49. data/lib/courier/models/notification_template_payload.rb +2 -2
  50. data/lib/courier/models/notification_template_response.rb +71 -0
  51. data/lib/courier/models/notification_template_update_request.rb +3 -3
  52. data/lib/courier/models/tenants/template_delete_params.rb +28 -0
  53. data/lib/courier/models.rb +75 -2
  54. data/lib/courier/resources/journeys/templates.rb +224 -0
  55. data/lib/courier/resources/journeys.rb +167 -2
  56. data/lib/courier/resources/notifications/checks.rb +16 -6
  57. data/lib/courier/resources/notifications.rb +8 -8
  58. data/lib/courier/resources/tenants/templates.rb +32 -0
  59. data/lib/courier/version.rb +1 -1
  60. data/lib/courier.rb +45 -1
  61. data/rbi/courier/models/create_journey_request.rbi +113 -0
  62. data/rbi/courier/models/journey_ai_node.rbi +141 -0
  63. data/rbi/courier/models/journey_api_invoke_trigger_node.rbi +164 -0
  64. data/rbi/courier/models/journey_archive_params.rbi +35 -0
  65. data/rbi/courier/models/journey_condition_atom.rbi +11 -0
  66. data/rbi/courier/models/journey_condition_group.rbi +43 -0
  67. data/rbi/courier/models/journey_condition_nested_group.rbi +51 -0
  68. data/rbi/courier/models/journey_conditions_field.rbi +27 -0
  69. data/rbi/courier/models/journey_create_params.rbi +27 -0
  70. data/rbi/courier/models/journey_delay_duration_node.rbi +146 -0
  71. data/rbi/courier/models/journey_delay_until_node.rbi +139 -0
  72. data/rbi/courier/models/journey_exit_node.rbi +57 -0
  73. data/rbi/courier/models/journey_fetch_get_delete_node.rbi +186 -0
  74. data/rbi/courier/models/journey_fetch_post_put_node.rbi +190 -0
  75. data/rbi/courier/models/journey_list_versions_params.rbi +35 -0
  76. data/rbi/courier/models/journey_merge_strategy.rbi +26 -0
  77. data/rbi/courier/models/journey_node.rbi +227 -0
  78. data/rbi/courier/models/journey_publish_params.rbi +35 -0
  79. data/rbi/courier/models/journey_publish_request.rbi +28 -0
  80. data/rbi/courier/models/journey_replace_params.rbi +35 -0
  81. data/rbi/courier/models/journey_response.rbi +108 -0
  82. data/rbi/courier/models/journey_retrieve_params.rbi +52 -0
  83. data/rbi/courier/models/journey_segment_trigger_node.rbi +200 -0
  84. data/rbi/courier/models/journey_send_node.rbi +254 -0
  85. data/rbi/courier/models/journey_state.rbi +20 -0
  86. data/rbi/courier/models/journey_template_create_request.rbi +381 -0
  87. data/rbi/courier/models/journey_template_get_response.rbi +334 -0
  88. data/rbi/courier/models/journey_template_list_response.rbi +45 -0
  89. data/rbi/courier/models/journey_template_publish_request.rbi +31 -0
  90. data/rbi/courier/models/journey_template_replace_request.rbi +368 -0
  91. data/rbi/courier/models/journey_template_summary.rbi +85 -0
  92. data/rbi/courier/models/journey_throttle_dynamic_node.rbi +162 -0
  93. data/rbi/courier/models/journey_throttle_static_node.rbi +158 -0
  94. data/rbi/courier/models/journey_version_item.rbi +54 -0
  95. data/rbi/courier/models/journey_versions_list_response.rbi +45 -0
  96. data/rbi/courier/models/journeys/template_archive_params.rbi +48 -0
  97. data/rbi/courier/models/journeys/template_create_params.rbi +40 -0
  98. data/rbi/courier/models/journeys/template_list_params.rbi +68 -0
  99. data/rbi/courier/models/journeys/template_list_versions_params.rbi +48 -0
  100. data/rbi/courier/models/journeys/template_publish_params.rbi +48 -0
  101. data/rbi/courier/models/journeys/template_replace_params.rbi +48 -0
  102. data/rbi/courier/models/journeys/template_retrieve_params.rbi +48 -0
  103. data/rbi/courier/models/notification_list_response.rbi +9 -6
  104. data/rbi/courier/models/notification_template_create_request.rbi +4 -4
  105. data/rbi/courier/models/notification_template_payload.rbi +2 -2
  106. data/rbi/courier/models/notification_template_response.rbi +120 -0
  107. data/rbi/courier/models/notification_template_update_request.rbi +4 -4
  108. data/rbi/courier/models/tenants/template_delete_params.rbi +48 -0
  109. data/rbi/courier/models.rbi +78 -3
  110. data/rbi/courier/resources/journeys/templates.rbi +160 -0
  111. data/rbi/courier/resources/journeys.rbi +156 -3
  112. data/rbi/courier/resources/notifications/checks.rbi +19 -4
  113. data/rbi/courier/resources/notifications.rbi +7 -7
  114. data/rbi/courier/resources/tenants/templates.rbi +22 -0
  115. data/sig/courier/models/create_journey_request.rbs +41 -0
  116. data/sig/courier/models/journey_ai_node.rbs +72 -0
  117. data/sig/courier/models/journey_api_invoke_trigger_node.rbs +68 -0
  118. data/sig/courier/models/journey_archive_params.rbs +23 -0
  119. data/sig/courier/models/journey_condition_atom.rbs +7 -0
  120. data/sig/courier/models/journey_condition_group.rbs +33 -0
  121. data/sig/courier/models/journey_condition_nested_group.rbs +33 -0
  122. data/sig/courier/models/journey_conditions_field.rbs +14 -0
  123. data/sig/courier/models/journey_create_params.rbs +15 -0
  124. data/sig/courier/models/journey_delay_duration_node.rbs +66 -0
  125. data/sig/courier/models/journey_delay_until_node.rbs +66 -0
  126. data/sig/courier/models/journey_exit_node.rbs +34 -0
  127. data/sig/courier/models/journey_fetch_get_delete_node.rbs +93 -0
  128. data/sig/courier/models/journey_fetch_post_put_node.rbs +100 -0
  129. data/sig/courier/models/journey_list_versions_params.rbs +23 -0
  130. data/sig/courier/models/journey_merge_strategy.rbs +16 -0
  131. data/sig/courier/models/journey_node.rbs +117 -0
  132. data/sig/courier/models/journey_publish_params.rbs +25 -0
  133. data/sig/courier/models/journey_publish_request.rbs +15 -0
  134. data/sig/courier/models/journey_replace_params.rbs +25 -0
  135. data/sig/courier/models/journey_response.rbs +65 -0
  136. data/sig/courier/models/journey_retrieve_params.rbs +30 -0
  137. data/sig/courier/models/journey_segment_trigger_node.rbs +85 -0
  138. data/sig/courier/models/journey_send_node.rbs +140 -0
  139. data/sig/courier/models/journey_state.rbs +14 -0
  140. data/sig/courier/models/journey_template_create_request.rbs +148 -0
  141. data/sig/courier/models/journey_template_get_response.rbs +157 -0
  142. data/sig/courier/models/journey_template_list_response.rbs +25 -0
  143. data/sig/courier/models/journey_template_publish_request.rbs +15 -0
  144. data/sig/courier/models/journey_template_replace_request.rbs +136 -0
  145. data/sig/courier/models/journey_template_summary.rbs +59 -0
  146. data/sig/courier/models/journey_throttle_dynamic_node.rbs +76 -0
  147. data/sig/courier/models/journey_throttle_static_node.rbs +72 -0
  148. data/sig/courier/models/journey_version_item.rbs +40 -0
  149. data/sig/courier/models/journey_versions_list_response.rbs +22 -0
  150. data/sig/courier/models/journeys/template_archive_params.rbs +30 -0
  151. data/sig/courier/models/journeys/template_create_params.rbs +27 -0
  152. data/sig/courier/models/journeys/template_list_params.rbs +38 -0
  153. data/sig/courier/models/journeys/template_list_versions_params.rbs +30 -0
  154. data/sig/courier/models/journeys/template_publish_params.rbs +34 -0
  155. data/sig/courier/models/journeys/template_replace_params.rbs +34 -0
  156. data/sig/courier/models/journeys/template_retrieve_params.rbs +30 -0
  157. data/sig/courier/models/notification_list_response.rbs +7 -5
  158. data/sig/courier/models/notification_template_response.rbs +70 -0
  159. data/sig/courier/models/tenants/template_delete_params.rbs +30 -0
  160. data/sig/courier/models.rbs +74 -2
  161. data/sig/courier/resources/journeys/templates.rbs +58 -0
  162. data/sig/courier/resources/journeys.rbs +41 -0
  163. data/sig/courier/resources/notifications.rbs +3 -3
  164. data/sig/courier/resources/tenants/templates.rbs +6 -0
  165. metadata +137 -5
  166. data/lib/courier/models/notification_template_get_response.rb +0 -92
  167. data/rbi/courier/models/notification_template_get_response.rbi +0 -162
  168. data/sig/courier/models/notification_template_get_response.rbs +0 -72
@@ -0,0 +1,86 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyThrottleDynamicNode < Courier::Internal::Type::BaseModel
6
+ # @!attribute max_allowed
7
+ #
8
+ # @return [Integer]
9
+ required :max_allowed, Integer
10
+
11
+ # @!attribute period
12
+ #
13
+ # @return [String]
14
+ required :period, String
15
+
16
+ # @!attribute scope
17
+ #
18
+ # @return [Symbol, Courier::Models::JourneyThrottleDynamicNode::Scope]
19
+ required :scope, enum: -> { Courier::JourneyThrottleDynamicNode::Scope }
20
+
21
+ # @!attribute throttle_key
22
+ #
23
+ # @return [String]
24
+ required :throttle_key, String
25
+
26
+ # @!attribute type
27
+ #
28
+ # @return [Symbol, Courier::Models::JourneyThrottleDynamicNode::Type]
29
+ required :type, enum: -> { Courier::JourneyThrottleDynamicNode::Type }
30
+
31
+ # @!attribute id
32
+ #
33
+ # @return [String, nil]
34
+ optional :id, String
35
+
36
+ # @!attribute conditions
37
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
38
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
39
+ # express "no conditions".
40
+ #
41
+ # @return [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup, nil]
42
+ optional :conditions, union: -> { Courier::JourneyConditionsField }
43
+
44
+ # @!method initialize(max_allowed:, period:, scope:, throttle_key:, type:, id: nil, conditions: nil)
45
+ # Some parameter documentations has been truncated, see
46
+ # {Courier::Models::JourneyThrottleDynamicNode} for more details.
47
+ #
48
+ # Throttle the journey by a dynamic `throttle_key`, allowing at most `max_allowed`
49
+ # invocations per `period`.
50
+ #
51
+ # @param max_allowed [Integer]
52
+ #
53
+ # @param period [String]
54
+ #
55
+ # @param scope [Symbol, Courier::Models::JourneyThrottleDynamicNode::Scope]
56
+ #
57
+ # @param throttle_key [String]
58
+ #
59
+ # @param type [Symbol, Courier::Models::JourneyThrottleDynamicNode::Type]
60
+ #
61
+ # @param id [String]
62
+ #
63
+ # @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
64
+
65
+ # @see Courier::Models::JourneyThrottleDynamicNode#scope
66
+ module Scope
67
+ extend Courier::Internal::Type::Enum
68
+
69
+ DYNAMIC = :dynamic
70
+
71
+ # @!method self.values
72
+ # @return [Array<Symbol>]
73
+ end
74
+
75
+ # @see Courier::Models::JourneyThrottleDynamicNode#type
76
+ module Type
77
+ extend Courier::Internal::Type::Enum
78
+
79
+ THROTTLE = :throttle
80
+
81
+ # @!method self.values
82
+ # @return [Array<Symbol>]
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyThrottleStaticNode < Courier::Internal::Type::BaseModel
6
+ # @!attribute max_allowed
7
+ #
8
+ # @return [Integer]
9
+ required :max_allowed, Integer
10
+
11
+ # @!attribute period
12
+ #
13
+ # @return [String]
14
+ required :period, String
15
+
16
+ # @!attribute scope
17
+ #
18
+ # @return [Symbol, Courier::Models::JourneyThrottleStaticNode::Scope]
19
+ required :scope, enum: -> { Courier::JourneyThrottleStaticNode::Scope }
20
+
21
+ # @!attribute type
22
+ #
23
+ # @return [Symbol, Courier::Models::JourneyThrottleStaticNode::Type]
24
+ required :type, enum: -> { Courier::JourneyThrottleStaticNode::Type }
25
+
26
+ # @!attribute id
27
+ #
28
+ # @return [String, nil]
29
+ optional :id, String
30
+
31
+ # @!attribute conditions
32
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
33
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
34
+ # express "no conditions".
35
+ #
36
+ # @return [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup, nil]
37
+ optional :conditions, union: -> { Courier::JourneyConditionsField }
38
+
39
+ # @!method initialize(max_allowed:, period:, scope:, type:, id: nil, conditions: nil)
40
+ # Some parameter documentations has been truncated, see
41
+ # {Courier::Models::JourneyThrottleStaticNode} for more details.
42
+ #
43
+ # Throttle the journey by a static `scope` (`user` or `global`), allowing at most
44
+ # `max_allowed` invocations per `period`.
45
+ #
46
+ # @param max_allowed [Integer]
47
+ #
48
+ # @param period [String]
49
+ #
50
+ # @param scope [Symbol, Courier::Models::JourneyThrottleStaticNode::Scope]
51
+ #
52
+ # @param type [Symbol, Courier::Models::JourneyThrottleStaticNode::Type]
53
+ #
54
+ # @param id [String]
55
+ #
56
+ # @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
57
+
58
+ # @see Courier::Models::JourneyThrottleStaticNode#scope
59
+ module Scope
60
+ extend Courier::Internal::Type::Enum
61
+
62
+ USER = :user
63
+ GLOBAL = :global
64
+
65
+ # @!method self.values
66
+ # @return [Array<Symbol>]
67
+ end
68
+
69
+ # @see Courier::Models::JourneyThrottleStaticNode#type
70
+ module Type
71
+ extend Courier::Internal::Type::Enum
72
+
73
+ THROTTLE = :throttle
74
+
75
+ # @!method self.values
76
+ # @return [Array<Symbol>]
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyVersionItem < Courier::Internal::Type::BaseModel
6
+ # @!attribute created
7
+ #
8
+ # @return [Integer, nil]
9
+ required :created, Integer, nil?: true
10
+
11
+ # @!attribute creator
12
+ #
13
+ # @return [String, nil]
14
+ required :creator, String, nil?: true
15
+
16
+ # @!attribute name
17
+ #
18
+ # @return [String]
19
+ required :name, String
20
+
21
+ # @!attribute published
22
+ #
23
+ # @return [Integer, nil]
24
+ required :published, Integer, nil?: true
25
+
26
+ # @!attribute version
27
+ #
28
+ # @return [String]
29
+ required :version, String
30
+
31
+ # @!method initialize(created:, creator:, name:, published:, version:)
32
+ # A published version of a journey.
33
+ #
34
+ # @param created [Integer, nil]
35
+ # @param creator [String, nil]
36
+ # @param name [String]
37
+ # @param published [Integer, nil]
38
+ # @param version [String]
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::Journeys#list_versions
6
+ class JourneyVersionsListResponse < Courier::Internal::Type::BaseModel
7
+ # @!attribute paging
8
+ #
9
+ # @return [Courier::Models::Paging]
10
+ required :paging, -> { Courier::Paging }
11
+
12
+ # @!attribute results
13
+ #
14
+ # @return [Array<Courier::Models::JourneyVersionItem>]
15
+ required :results, -> { Courier::Internal::Type::ArrayOf[Courier::JourneyVersionItem] }
16
+
17
+ # @!method initialize(paging:, results:)
18
+ # Paged list of published journey versions, most recent first.
19
+ #
20
+ # @param paging [Courier::Models::Paging]
21
+ # @param results [Array<Courier::Models::JourneyVersionItem>]
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ module Journeys
6
+ # @see Courier::Resources::Journeys::Templates#archive
7
+ class TemplateArchiveParams < Courier::Internal::Type::BaseModel
8
+ extend Courier::Internal::Type::RequestParameters::Converter
9
+ include Courier::Internal::Type::RequestParameters
10
+
11
+ # @!attribute template_id
12
+ #
13
+ # @return [String]
14
+ required :template_id, String
15
+
16
+ # @!attribute notification_id
17
+ #
18
+ # @return [String]
19
+ required :notification_id, String
20
+
21
+ # @!method initialize(template_id:, notification_id:, request_options: {})
22
+ # @param template_id [String]
23
+ # @param notification_id [String]
24
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ module Journeys
6
+ # @see Courier::Resources::Journeys::Templates#create
7
+ class TemplateCreateParams < Courier::Models::JourneyTemplateCreateRequest
8
+ extend Courier::Internal::Type::RequestParameters::Converter
9
+ include Courier::Internal::Type::RequestParameters
10
+
11
+ # @!attribute template_id
12
+ #
13
+ # @return [String]
14
+ required :template_id, String
15
+
16
+ # @!method initialize(template_id:, request_options: {})
17
+ # @param template_id [String]
18
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ module Journeys
6
+ # @see Courier::Resources::Journeys::Templates#list
7
+ class TemplateListParams < Courier::Internal::Type::BaseModel
8
+ extend Courier::Internal::Type::RequestParameters::Converter
9
+ include Courier::Internal::Type::RequestParameters
10
+
11
+ # @!attribute template_id
12
+ #
13
+ # @return [String]
14
+ required :template_id, String
15
+
16
+ # @!attribute cursor
17
+ # Pagination cursor from a prior response.
18
+ #
19
+ # @return [String, nil]
20
+ optional :cursor, String
21
+
22
+ # @!attribute limit
23
+ # Page size. Minimum 1, maximum 100.
24
+ #
25
+ # @return [Integer, nil]
26
+ optional :limit, Integer
27
+
28
+ # @!method initialize(template_id:, cursor: nil, limit: nil, request_options: {})
29
+ # @param template_id [String]
30
+ #
31
+ # @param cursor [String] Pagination cursor from a prior response.
32
+ #
33
+ # @param limit [Integer] Page size. Minimum 1, maximum 100.
34
+ #
35
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ module Journeys
6
+ # @see Courier::Resources::Journeys::Templates#list_versions
7
+ class TemplateListVersionsParams < Courier::Internal::Type::BaseModel
8
+ extend Courier::Internal::Type::RequestParameters::Converter
9
+ include Courier::Internal::Type::RequestParameters
10
+
11
+ # @!attribute template_id
12
+ #
13
+ # @return [String]
14
+ required :template_id, String
15
+
16
+ # @!attribute notification_id
17
+ #
18
+ # @return [String]
19
+ required :notification_id, String
20
+
21
+ # @!method initialize(template_id:, notification_id:, request_options: {})
22
+ # @param template_id [String]
23
+ # @param notification_id [String]
24
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ module Journeys
6
+ # @see Courier::Resources::Journeys::Templates#publish
7
+ class TemplatePublishParams < Courier::Models::JourneyTemplatePublishRequest
8
+ extend Courier::Internal::Type::RequestParameters::Converter
9
+ include Courier::Internal::Type::RequestParameters
10
+
11
+ # @!attribute template_id
12
+ #
13
+ # @return [String]
14
+ required :template_id, String
15
+
16
+ # @!attribute notification_id
17
+ #
18
+ # @return [String]
19
+ required :notification_id, String
20
+
21
+ # @!method initialize(template_id:, notification_id:, request_options: {})
22
+ # @param template_id [String]
23
+ # @param notification_id [String]
24
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ module Journeys
6
+ # @see Courier::Resources::Journeys::Templates#replace
7
+ class TemplateReplaceParams < Courier::Models::JourneyTemplateReplaceRequest
8
+ extend Courier::Internal::Type::RequestParameters::Converter
9
+ include Courier::Internal::Type::RequestParameters
10
+
11
+ # @!attribute template_id
12
+ #
13
+ # @return [String]
14
+ required :template_id, String
15
+
16
+ # @!attribute notification_id
17
+ #
18
+ # @return [String]
19
+ required :notification_id, String
20
+
21
+ # @!method initialize(template_id:, notification_id:, request_options: {})
22
+ # @param template_id [String]
23
+ # @param notification_id [String]
24
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ module Journeys
6
+ # @see Courier::Resources::Journeys::Templates#retrieve
7
+ class TemplateRetrieveParams < Courier::Internal::Type::BaseModel
8
+ extend Courier::Internal::Type::RequestParameters::Converter
9
+ include Courier::Internal::Type::RequestParameters
10
+
11
+ # @!attribute template_id
12
+ #
13
+ # @return [String]
14
+ required :template_id, String
15
+
16
+ # @!attribute notification_id
17
+ #
18
+ # @return [String]
19
+ required :notification_id, String
20
+
21
+ # @!method initialize(template_id:, notification_id:, request_options: {})
22
+ # @param template_id [String]
23
+ # @param notification_id [String]
24
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
25
+ end
26
+ end
27
+ end
28
+ end
@@ -47,11 +47,6 @@ module Courier
47
47
  # @return [Array<String>]
48
48
  required :event_ids, Courier::Internal::Type::ArrayOf[String]
49
49
 
50
- # @!attribute note
51
- #
52
- # @return [String]
53
- required :note, String
54
-
55
50
  # @!attribute routing
56
51
  #
57
52
  # @return [Courier::Models::MessageRouting]
@@ -67,6 +62,11 @@ module Courier
67
62
  # @return [Integer]
68
63
  required :updated_at, Integer
69
64
 
65
+ # @!attribute note
66
+ #
67
+ # @return [String, nil]
68
+ optional :note, String
69
+
70
70
  # @!attribute tags
71
71
  #
72
72
  # @return [Courier::Models::NotificationListResponse::Result::Notification::Tags, nil]
@@ -77,21 +77,21 @@ module Courier
77
77
  # @return [String, nil]
78
78
  optional :title, String, nil?: true
79
79
 
80
- # @!method initialize(id:, created_at:, event_ids:, note:, routing:, topic_id:, updated_at:, tags: nil, title: nil)
80
+ # @!method initialize(id:, created_at:, event_ids:, routing:, topic_id:, updated_at:, note: nil, tags: nil, title: nil)
81
81
  # @param id [String]
82
82
  #
83
83
  # @param created_at [Integer]
84
84
  #
85
85
  # @param event_ids [Array<String>] Array of event IDs associated with this notification
86
86
  #
87
- # @param note [String]
88
- #
89
87
  # @param routing [Courier::Models::MessageRouting]
90
88
  #
91
89
  # @param topic_id [String]
92
90
  #
93
91
  # @param updated_at [Integer]
94
92
  #
93
+ # @param note [String]
94
+ #
95
95
  # @param tags [Courier::Models::NotificationListResponse::Result::Notification::Tags, nil]
96
96
  #
97
97
  # @param title [String, nil]
@@ -4,8 +4,8 @@ module Courier
4
4
  module Models
5
5
  class NotificationTemplateCreateRequest < Courier::Internal::Type::BaseModel
6
6
  # @!attribute notification
7
- # Full document shape used in POST and PUT request bodies, and returned inside the
8
- # GET response envelope.
7
+ # Core template fields used in POST and PUT request bodies (nested under a
8
+ # `notification` key) and returned at the top level in responses.
9
9
  #
10
10
  # @return [Courier::Models::NotificationTemplatePayload]
11
11
  required :notification, -> { Courier::NotificationTemplatePayload }
@@ -23,7 +23,7 @@ module Courier
23
23
  #
24
24
  # Request body for creating a notification template.
25
25
  #
26
- # @param notification [Courier::Models::NotificationTemplatePayload] Full document shape used in POST and PUT request bodies, and returned inside the
26
+ # @param notification [Courier::Models::NotificationTemplatePayload] Core template fields used in POST and PUT request bodies (nested under a `notifi
27
27
  #
28
28
  # @param state [Symbol, Courier::Models::NotificationTemplateCreateRequest::State] Template state after creation. Case-insensitive input, normalized to uppercase i
29
29
 
@@ -40,8 +40,8 @@ module Courier
40
40
  required :tags, Courier::Internal::Type::ArrayOf[String]
41
41
 
42
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.
43
+ # Core template fields used in POST and PUT request bodies (nested under a
44
+ # `notification` key) and returned at the top level in responses.
45
45
  #
46
46
  # @param brand [Courier::Models::NotificationTemplatePayload::Brand, nil] Brand reference, or null for no brand.
47
47
  #
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::Notifications#create
6
+ class NotificationTemplateResponse < Courier::Models::NotificationTemplatePayload
7
+ # @!attribute id
8
+ # The template ID.
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute created
14
+ # Epoch milliseconds when the template was created.
15
+ #
16
+ # @return [Integer]
17
+ required :created, Integer
18
+
19
+ # @!attribute creator
20
+ # User ID of the creator.
21
+ #
22
+ # @return [String]
23
+ required :creator, String
24
+
25
+ # @!attribute state
26
+ # The template state. Always uppercase.
27
+ #
28
+ # @return [Symbol, Courier::Models::NotificationTemplateResponse::State]
29
+ required :state, enum: -> { Courier::NotificationTemplateResponse::State }
30
+
31
+ # @!attribute updated
32
+ # Epoch milliseconds of last update.
33
+ #
34
+ # @return [Integer, nil]
35
+ optional :updated, Integer
36
+
37
+ # @!attribute updater
38
+ # User ID of the last updater.
39
+ #
40
+ # @return [String, nil]
41
+ optional :updater, String
42
+
43
+ # @!method initialize(id:, created:, creator:, state:, updated: nil, updater: nil)
44
+ # Response for GET /notifications/{id}, POST /notifications, and PUT
45
+ # /notifications/{id}. Returns all template fields at the top level.
46
+ #
47
+ # @param id [String] The template ID.
48
+ #
49
+ # @param created [Integer] Epoch milliseconds when the template was created.
50
+ #
51
+ # @param creator [String] User ID of the creator.
52
+ #
53
+ # @param state [Symbol, Courier::Models::NotificationTemplateResponse::State] The template state. Always uppercase.
54
+ #
55
+ # @param updated [Integer] Epoch milliseconds of last update.
56
+ #
57
+ # @param updater [String] User ID of the last updater.
58
+
59
+ # The template state. Always uppercase.
60
+ module State
61
+ extend Courier::Internal::Type::Enum
62
+
63
+ DRAFT = :DRAFT
64
+ PUBLISHED = :PUBLISHED
65
+
66
+ # @!method self.values
67
+ # @return [Array<Symbol>]
68
+ end
69
+ end
70
+ end
71
+ end
@@ -4,8 +4,8 @@ module Courier
4
4
  module Models
5
5
  class NotificationTemplateUpdateRequest < Courier::Internal::Type::BaseModel
6
6
  # @!attribute notification
7
- # Full document shape used in POST and PUT request bodies, and returned inside the
8
- # GET response envelope.
7
+ # Core template fields used in POST and PUT request bodies (nested under a
8
+ # `notification` key) and returned at the top level in responses.
9
9
  #
10
10
  # @return [Courier::Models::NotificationTemplatePayload]
11
11
  required :notification, -> { Courier::NotificationTemplatePayload }
@@ -24,7 +24,7 @@ module Courier
24
24
  # Request body for replacing a notification template. Same shape as create. All
25
25
  # fields required (PUT = full replacement).
26
26
  #
27
- # @param notification [Courier::Models::NotificationTemplatePayload] Full document shape used in POST and PUT request bodies, and returned inside the
27
+ # @param notification [Courier::Models::NotificationTemplatePayload] Core template fields used in POST and PUT request bodies (nested under a `notifi
28
28
  #
29
29
  # @param state [Symbol, Courier::Models::NotificationTemplateUpdateRequest::State] Template state after update. Case-insensitive input, normalized to uppercase in
30
30
 
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ module Tenants
6
+ # @see Courier::Resources::Tenants::Templates#delete
7
+ class TemplateDeleteParams < Courier::Internal::Type::BaseModel
8
+ extend Courier::Internal::Type::RequestParameters::Converter
9
+ include Courier::Internal::Type::RequestParameters
10
+
11
+ # @!attribute tenant_id
12
+ #
13
+ # @return [String]
14
+ required :tenant_id, String
15
+
16
+ # @!attribute template_id
17
+ #
18
+ # @return [String]
19
+ required :template_id, String
20
+
21
+ # @!method initialize(tenant_id:, template_id:, request_options: {})
22
+ # @param tenant_id [String]
23
+ # @param template_id [String]
24
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
25
+ end
26
+ end
27
+ end
28
+ end