trycourier 4.15.0 → 4.17.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 (89) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/lib/courier/client.rb +4 -0
  4. data/lib/courier/models/journeys/template_put_content_params.rb +28 -0
  5. data/lib/courier/models/journeys/template_put_locale_params.rb +34 -0
  6. data/lib/courier/models/journeys/template_retrieve_content_params.rb +42 -0
  7. data/lib/courier/models/preference_section_archive_params.rb +20 -0
  8. data/lib/courier/models/preference_section_create_params.rb +14 -0
  9. data/lib/courier/models/preference_section_create_request.rb +36 -0
  10. data/lib/courier/models/preference_section_get_response.rb +83 -0
  11. data/lib/courier/models/preference_section_list_params.rb +14 -0
  12. data/lib/courier/models/preference_section_list_response.rb +18 -0
  13. data/lib/courier/models/preference_section_publish_params.rb +14 -0
  14. data/lib/courier/models/preference_section_replace_params.rb +20 -0
  15. data/lib/courier/models/preference_section_replace_request.rb +37 -0
  16. data/lib/courier/models/preference_section_retrieve_params.rb +20 -0
  17. data/lib/courier/models/preference_sections/topic_archive_params.rb +28 -0
  18. data/lib/courier/models/preference_sections/topic_create_params.rb +22 -0
  19. data/lib/courier/models/preference_sections/topic_list_params.rb +22 -0
  20. data/lib/courier/models/preference_sections/topic_replace_params.rb +28 -0
  21. data/lib/courier/models/preference_sections/topic_retrieve_params.rb +28 -0
  22. data/lib/courier/models/preference_topic_create_request.rb +93 -0
  23. data/lib/courier/models/preference_topic_get_response.rb +124 -0
  24. data/lib/courier/models/preference_topic_list_response.rb +17 -0
  25. data/lib/courier/models/preference_topic_replace_request.rb +90 -0
  26. data/lib/courier/models/publish_preferences_response.rb +51 -0
  27. data/lib/courier/models.rb +32 -0
  28. data/lib/courier/resources/journeys/templates.rb +113 -0
  29. data/lib/courier/resources/preference_sections/topics.rb +173 -0
  30. data/lib/courier/resources/preference_sections.rb +155 -0
  31. data/lib/courier/version.rb +1 -1
  32. data/lib/courier.rb +27 -2
  33. data/rbi/courier/client.rbi +3 -0
  34. data/rbi/courier/models/journeys/template_put_content_params.rbi +48 -0
  35. data/rbi/courier/models/journeys/template_put_locale_params.rbi +58 -0
  36. data/rbi/courier/models/journeys/template_retrieve_content_params.rbi +65 -0
  37. data/rbi/courier/models/preference_section_archive_params.rbi +38 -0
  38. data/rbi/courier/models/preference_section_create_params.rbi +30 -0
  39. data/rbi/courier/models/preference_section_create_request.rbi +61 -0
  40. data/rbi/courier/models/preference_section_get_response.rbi +106 -0
  41. data/rbi/courier/models/preference_section_list_params.rbi +30 -0
  42. data/rbi/courier/models/preference_section_list_response.rbi +35 -0
  43. data/rbi/courier/models/preference_section_publish_params.rbi +30 -0
  44. data/rbi/courier/models/preference_section_replace_params.rbi +38 -0
  45. data/rbi/courier/models/preference_section_replace_request.rbi +62 -0
  46. data/rbi/courier/models/preference_section_retrieve_params.rbi +38 -0
  47. data/rbi/courier/models/preference_sections/topic_archive_params.rbi +48 -0
  48. data/rbi/courier/models/preference_sections/topic_create_params.rbi +40 -0
  49. data/rbi/courier/models/preference_sections/topic_list_params.rbi +40 -0
  50. data/rbi/courier/models/preference_sections/topic_replace_params.rbi +48 -0
  51. data/rbi/courier/models/preference_sections/topic_retrieve_params.rbi +48 -0
  52. data/rbi/courier/models/preference_topic_create_request.rbi +181 -0
  53. data/rbi/courier/models/preference_topic_get_response.rbi +209 -0
  54. data/rbi/courier/models/preference_topic_list_response.rbi +35 -0
  55. data/rbi/courier/models/preference_topic_replace_request.rbi +180 -0
  56. data/rbi/courier/models/publish_preferences_response.rbi +70 -0
  57. data/rbi/courier/models.rbi +38 -0
  58. data/rbi/courier/resources/journeys/templates.rbi +78 -0
  59. data/rbi/courier/resources/preference_sections/topics.rbi +149 -0
  60. data/rbi/courier/resources/preference_sections.rbi +113 -0
  61. data/sig/courier/client.rbs +2 -0
  62. data/sig/courier/models/journeys/template_put_content_params.rbs +34 -0
  63. data/sig/courier/models/journeys/template_put_locale_params.rbs +40 -0
  64. data/sig/courier/models/journeys/template_retrieve_content_params.rbs +36 -0
  65. data/sig/courier/models/preference_section_archive_params.rbs +23 -0
  66. data/sig/courier/models/preference_section_create_params.rbs +15 -0
  67. data/sig/courier/models/preference_section_create_request.rbs +30 -0
  68. data/sig/courier/models/preference_section_get_response.rbs +60 -0
  69. data/sig/courier/models/preference_section_list_params.rbs +15 -0
  70. data/sig/courier/models/preference_section_list_response.rbs +18 -0
  71. data/sig/courier/models/preference_section_publish_params.rbs +15 -0
  72. data/sig/courier/models/preference_section_replace_params.rbs +25 -0
  73. data/sig/courier/models/preference_section_replace_request.rbs +30 -0
  74. data/sig/courier/models/preference_section_retrieve_params.rbs +23 -0
  75. data/sig/courier/models/preference_sections/topic_archive_params.rbs +30 -0
  76. data/sig/courier/models/preference_sections/topic_create_params.rbs +27 -0
  77. data/sig/courier/models/preference_sections/topic_list_params.rbs +25 -0
  78. data/sig/courier/models/preference_sections/topic_replace_params.rbs +34 -0
  79. data/sig/courier/models/preference_sections/topic_retrieve_params.rbs +30 -0
  80. data/sig/courier/models/preference_topic_create_request.rbs +68 -0
  81. data/sig/courier/models/preference_topic_get_response.rbs +93 -0
  82. data/sig/courier/models/preference_topic_list_response.rbs +16 -0
  83. data/sig/courier/models/preference_topic_replace_request.rbs +68 -0
  84. data/sig/courier/models/publish_preferences_response.rbs +40 -0
  85. data/sig/courier/models.rbs +32 -0
  86. data/sig/courier/resources/journeys/templates.rbs +24 -0
  87. data/sig/courier/resources/preference_sections/topics.rbs +49 -0
  88. data/sig/courier/resources/preference_sections.rbs +42 -0
  89. metadata +77 -2
@@ -0,0 +1,93 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class PreferenceTopicCreateRequest < Courier::Internal::Type::BaseModel
6
+ # @!attribute default_status
7
+ # The default subscription status applied when a recipient has not set their own.
8
+ #
9
+ # @return [Symbol, Courier::Models::PreferenceTopicCreateRequest::DefaultStatus]
10
+ required :default_status, enum: -> { Courier::PreferenceTopicCreateRequest::DefaultStatus }
11
+
12
+ # @!attribute name
13
+ # Human-readable name for the preference topic.
14
+ #
15
+ # @return [String]
16
+ required :name, String
17
+
18
+ # @!attribute allowed_preferences
19
+ # Preference controls a recipient may customize for this topic. Defaults to empty
20
+ # if omitted.
21
+ #
22
+ # @return [Array<Symbol, Courier::Models::PreferenceTopicCreateRequest::AllowedPreference>, nil]
23
+ optional :allowed_preferences,
24
+ -> {
25
+ Courier::Internal::Type::ArrayOf[enum: Courier::PreferenceTopicCreateRequest::AllowedPreference]
26
+ },
27
+ nil?: true
28
+
29
+ # @!attribute include_unsubscribe_header
30
+ # Whether to include a list-unsubscribe header on emails for this topic.
31
+ #
32
+ # @return [Boolean, nil]
33
+ optional :include_unsubscribe_header, Courier::Internal::Type::Boolean, nil?: true
34
+
35
+ # @!attribute routing_options
36
+ # Default channels delivered for this topic. Defaults to empty if omitted.
37
+ #
38
+ # @return [Array<Symbol, Courier::Models::ChannelClassification>, nil]
39
+ optional :routing_options,
40
+ -> { Courier::Internal::Type::ArrayOf[enum: Courier::ChannelClassification] },
41
+ nil?: true
42
+
43
+ # @!attribute topic_data
44
+ # Arbitrary metadata associated with the topic.
45
+ #
46
+ # @return [Hash{Symbol=>Object}, nil]
47
+ optional :topic_data, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown], nil?: true
48
+
49
+ # @!method initialize(default_status:, name:, allowed_preferences: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil)
50
+ # Some parameter documentations has been truncated, see
51
+ # {Courier::Models::PreferenceTopicCreateRequest} for more details.
52
+ #
53
+ # Request body for creating a preference topic.
54
+ #
55
+ # @param default_status [Symbol, Courier::Models::PreferenceTopicCreateRequest::DefaultStatus] The default subscription status applied when a recipient has not set their own.
56
+ #
57
+ # @param name [String] Human-readable name for the preference topic.
58
+ #
59
+ # @param allowed_preferences [Array<Symbol, Courier::Models::PreferenceTopicCreateRequest::AllowedPreference>, nil] Preference controls a recipient may customize for this topic. Defaults to empty
60
+ #
61
+ # @param include_unsubscribe_header [Boolean, nil] Whether to include a list-unsubscribe header on emails for this topic.
62
+ #
63
+ # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels delivered for this topic. Defaults to empty if omitted.
64
+ #
65
+ # @param topic_data [Hash{Symbol=>Object}, nil] Arbitrary metadata associated with the topic.
66
+
67
+ # The default subscription status applied when a recipient has not set their own.
68
+ #
69
+ # @see Courier::Models::PreferenceTopicCreateRequest#default_status
70
+ module DefaultStatus
71
+ extend Courier::Internal::Type::Enum
72
+
73
+ OPTED_OUT = :OPTED_OUT
74
+ OPTED_IN = :OPTED_IN
75
+ REQUIRED = :REQUIRED
76
+
77
+ # @!method self.values
78
+ # @return [Array<Symbol>]
79
+ end
80
+
81
+ # A preference control a recipient may customize for a topic.
82
+ module AllowedPreference
83
+ extend Courier::Internal::Type::Enum
84
+
85
+ SNOOZE = :snooze
86
+ CHANNEL_PREFERENCES = :channel_preferences
87
+
88
+ # @!method self.values
89
+ # @return [Array<Symbol>]
90
+ end
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,124 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class PreferenceTopicGetResponse < Courier::Internal::Type::BaseModel
6
+ # @!attribute id
7
+ # The preference topic id.
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute allowed_preferences
13
+ # Preference controls a recipient may customize. May be empty.
14
+ #
15
+ # @return [Array<Symbol, Courier::Models::PreferenceTopicGetResponse::AllowedPreference>]
16
+ required :allowed_preferences,
17
+ -> { Courier::Internal::Type::ArrayOf[enum: Courier::PreferenceTopicGetResponse::AllowedPreference] }
18
+
19
+ # @!attribute created
20
+ # ISO-8601 timestamp of when the topic was created.
21
+ #
22
+ # @return [String]
23
+ required :created, String
24
+
25
+ # @!attribute default_status
26
+ # The default subscription status applied when a recipient has not set their own.
27
+ #
28
+ # @return [Symbol, Courier::Models::PreferenceTopicGetResponse::DefaultStatus]
29
+ required :default_status, enum: -> { Courier::PreferenceTopicGetResponse::DefaultStatus }
30
+
31
+ # @!attribute include_unsubscribe_header
32
+ # Whether a list-unsubscribe header is included on emails for this topic.
33
+ #
34
+ # @return [Boolean]
35
+ required :include_unsubscribe_header, Courier::Internal::Type::Boolean
36
+
37
+ # @!attribute name
38
+ # Human-readable name.
39
+ #
40
+ # @return [String]
41
+ required :name, String
42
+
43
+ # @!attribute routing_options
44
+ # Default channels delivered for this topic. May be empty.
45
+ #
46
+ # @return [Array<Symbol, Courier::Models::ChannelClassification>]
47
+ required :routing_options, -> { Courier::Internal::Type::ArrayOf[enum: Courier::ChannelClassification] }
48
+
49
+ # @!attribute topic_data
50
+ # Arbitrary metadata associated with the topic.
51
+ #
52
+ # @return [Hash{Symbol=>Object}]
53
+ required :topic_data, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]
54
+
55
+ # @!attribute updated
56
+ # ISO-8601 timestamp of the last update.
57
+ #
58
+ # @return [String]
59
+ required :updated, String
60
+
61
+ # @!attribute creator
62
+ # Id of the creator.
63
+ #
64
+ # @return [String, nil]
65
+ optional :creator, String, nil?: true
66
+
67
+ # @!attribute updater
68
+ # Id of the last updater.
69
+ #
70
+ # @return [String, nil]
71
+ optional :updater, String, nil?: true
72
+
73
+ # @!method initialize(id:, allowed_preferences:, created:, default_status:, include_unsubscribe_header:, name:, routing_options:, topic_data:, updated:, creator: nil, updater: nil)
74
+ # A subscription preference topic in your workspace.
75
+ #
76
+ # @param id [String] The preference topic id.
77
+ #
78
+ # @param allowed_preferences [Array<Symbol, Courier::Models::PreferenceTopicGetResponse::AllowedPreference>] Preference controls a recipient may customize. May be empty.
79
+ #
80
+ # @param created [String] ISO-8601 timestamp of when the topic was created.
81
+ #
82
+ # @param default_status [Symbol, Courier::Models::PreferenceTopicGetResponse::DefaultStatus] The default subscription status applied when a recipient has not set their own.
83
+ #
84
+ # @param include_unsubscribe_header [Boolean] Whether a list-unsubscribe header is included on emails for this topic.
85
+ #
86
+ # @param name [String] Human-readable name.
87
+ #
88
+ # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>] Default channels delivered for this topic. May be empty.
89
+ #
90
+ # @param topic_data [Hash{Symbol=>Object}] Arbitrary metadata associated with the topic.
91
+ #
92
+ # @param updated [String] ISO-8601 timestamp of the last update.
93
+ #
94
+ # @param creator [String, nil] Id of the creator.
95
+ #
96
+ # @param updater [String, nil] Id of the last updater.
97
+
98
+ # A preference control a recipient may customize for a topic.
99
+ module AllowedPreference
100
+ extend Courier::Internal::Type::Enum
101
+
102
+ SNOOZE = :snooze
103
+ CHANNEL_PREFERENCES = :channel_preferences
104
+
105
+ # @!method self.values
106
+ # @return [Array<Symbol>]
107
+ end
108
+
109
+ # The default subscription status applied when a recipient has not set their own.
110
+ #
111
+ # @see Courier::Models::PreferenceTopicGetResponse#default_status
112
+ module DefaultStatus
113
+ extend Courier::Internal::Type::Enum
114
+
115
+ OPTED_OUT = :OPTED_OUT
116
+ OPTED_IN = :OPTED_IN
117
+ REQUIRED = :REQUIRED
118
+
119
+ # @!method self.values
120
+ # @return [Array<Symbol>]
121
+ end
122
+ end
123
+ end
124
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class PreferenceTopicListResponse < Courier::Internal::Type::BaseModel
6
+ # @!attribute results
7
+ #
8
+ # @return [Array<Courier::Models::PreferenceTopicGetResponse>]
9
+ required :results, -> { Courier::Internal::Type::ArrayOf[Courier::PreferenceTopicGetResponse] }
10
+
11
+ # @!method initialize(results:)
12
+ # Topics contained in a preference section.
13
+ #
14
+ # @param results [Array<Courier::Models::PreferenceTopicGetResponse>]
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class PreferenceTopicReplaceRequest < Courier::Internal::Type::BaseModel
6
+ # @!attribute default_status
7
+ # The default subscription status applied when a recipient has not set their own.
8
+ #
9
+ # @return [Symbol, Courier::Models::PreferenceTopicReplaceRequest::DefaultStatus]
10
+ required :default_status, enum: -> { Courier::PreferenceTopicReplaceRequest::DefaultStatus }
11
+
12
+ # @!attribute name
13
+ # Human-readable name for the preference topic.
14
+ #
15
+ # @return [String]
16
+ required :name, String
17
+
18
+ # @!attribute allowed_preferences
19
+ # Preference controls a recipient may customize. Omit to clear.
20
+ #
21
+ # @return [Array<Symbol, Courier::Models::PreferenceTopicReplaceRequest::AllowedPreference>, nil]
22
+ optional :allowed_preferences,
23
+ -> {
24
+ Courier::Internal::Type::ArrayOf[enum: Courier::PreferenceTopicReplaceRequest::AllowedPreference]
25
+ },
26
+ nil?: true
27
+
28
+ # @!attribute include_unsubscribe_header
29
+ # Whether to include a list-unsubscribe header on emails for this topic.
30
+ #
31
+ # @return [Boolean, nil]
32
+ optional :include_unsubscribe_header, Courier::Internal::Type::Boolean, nil?: true
33
+
34
+ # @!attribute routing_options
35
+ # Default channels delivered for this topic. Omit to clear.
36
+ #
37
+ # @return [Array<Symbol, Courier::Models::ChannelClassification>, nil]
38
+ optional :routing_options,
39
+ -> { Courier::Internal::Type::ArrayOf[enum: Courier::ChannelClassification] },
40
+ nil?: true
41
+
42
+ # @!attribute topic_data
43
+ # Arbitrary metadata associated with the topic. Omit to clear.
44
+ #
45
+ # @return [Hash{Symbol=>Object}, nil]
46
+ optional :topic_data, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown], nil?: true
47
+
48
+ # @!method initialize(default_status:, name:, allowed_preferences: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil)
49
+ # Request body for replacing a preference topic. Full document replacement;
50
+ # missing optional fields are cleared.
51
+ #
52
+ # @param default_status [Symbol, Courier::Models::PreferenceTopicReplaceRequest::DefaultStatus] The default subscription status applied when a recipient has not set their own.
53
+ #
54
+ # @param name [String] Human-readable name for the preference topic.
55
+ #
56
+ # @param allowed_preferences [Array<Symbol, Courier::Models::PreferenceTopicReplaceRequest::AllowedPreference>, nil] Preference controls a recipient may customize. Omit to clear.
57
+ #
58
+ # @param include_unsubscribe_header [Boolean, nil] Whether to include a list-unsubscribe header on emails for this topic.
59
+ #
60
+ # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels delivered for this topic. Omit to clear.
61
+ #
62
+ # @param topic_data [Hash{Symbol=>Object}, nil] Arbitrary metadata associated with the topic. Omit to clear.
63
+
64
+ # The default subscription status applied when a recipient has not set their own.
65
+ #
66
+ # @see Courier::Models::PreferenceTopicReplaceRequest#default_status
67
+ module DefaultStatus
68
+ extend Courier::Internal::Type::Enum
69
+
70
+ OPTED_OUT = :OPTED_OUT
71
+ OPTED_IN = :OPTED_IN
72
+ REQUIRED = :REQUIRED
73
+
74
+ # @!method self.values
75
+ # @return [Array<Symbol>]
76
+ end
77
+
78
+ # A preference control a recipient may customize for a topic.
79
+ module AllowedPreference
80
+ extend Courier::Internal::Type::Enum
81
+
82
+ SNOOZE = :snooze
83
+ CHANNEL_PREFERENCES = :channel_preferences
84
+
85
+ # @!method self.values
86
+ # @return [Array<Symbol>]
87
+ end
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::PreferenceSections#publish
6
+ class PublishPreferencesResponse < Courier::Internal::Type::BaseModel
7
+ # @!attribute page_id
8
+ # Id of the published page snapshot.
9
+ #
10
+ # @return [String]
11
+ required :page_id, String
12
+
13
+ # @!attribute published_at
14
+ # ISO-8601 timestamp of the publish.
15
+ #
16
+ # @return [String]
17
+ required :published_at, String
18
+
19
+ # @!attribute published_version
20
+ # Monotonic published version (epoch milliseconds).
21
+ #
22
+ # @return [Float]
23
+ required :published_version, Float
24
+
25
+ # @!attribute preview_url
26
+ # Draft-mode hosted preferences page URL for previewing.
27
+ #
28
+ # @return [String, nil]
29
+ optional :preview_url, String, nil?: true
30
+
31
+ # @!attribute published_by
32
+ # Id of the publisher.
33
+ #
34
+ # @return [String, nil]
35
+ optional :published_by, String, nil?: true
36
+
37
+ # @!method initialize(page_id:, published_at:, published_version:, preview_url: nil, published_by: nil)
38
+ # Result of publishing the workspace's preferences page.
39
+ #
40
+ # @param page_id [String] Id of the published page snapshot.
41
+ #
42
+ # @param published_at [String] ISO-8601 timestamp of the publish.
43
+ #
44
+ # @param published_version [Float] Monotonic published version (epoch milliseconds).
45
+ #
46
+ # @param preview_url [String, nil] Draft-mode hosted preferences page URL for previewing.
47
+ #
48
+ # @param published_by [String, nil] Id of the publisher.
49
+ end
50
+ end
51
+ end
@@ -404,8 +404,38 @@ module Courier
404
404
 
405
405
  Preference = Courier::Models::Preference
406
406
 
407
+ PreferenceSectionArchiveParams = Courier::Models::PreferenceSectionArchiveParams
408
+
409
+ PreferenceSectionCreateParams = Courier::Models::PreferenceSectionCreateParams
410
+
411
+ PreferenceSectionCreateRequest = Courier::Models::PreferenceSectionCreateRequest
412
+
413
+ PreferenceSectionGetResponse = Courier::Models::PreferenceSectionGetResponse
414
+
415
+ PreferenceSectionListParams = Courier::Models::PreferenceSectionListParams
416
+
417
+ PreferenceSectionListResponse = Courier::Models::PreferenceSectionListResponse
418
+
419
+ PreferenceSectionPublishParams = Courier::Models::PreferenceSectionPublishParams
420
+
421
+ PreferenceSectionReplaceParams = Courier::Models::PreferenceSectionReplaceParams
422
+
423
+ PreferenceSectionReplaceRequest = Courier::Models::PreferenceSectionReplaceRequest
424
+
425
+ PreferenceSectionRetrieveParams = Courier::Models::PreferenceSectionRetrieveParams
426
+
427
+ PreferenceSections = Courier::Models::PreferenceSections
428
+
407
429
  PreferenceStatus = Courier::Models::PreferenceStatus
408
430
 
431
+ PreferenceTopicCreateRequest = Courier::Models::PreferenceTopicCreateRequest
432
+
433
+ PreferenceTopicGetResponse = Courier::Models::PreferenceTopicGetResponse
434
+
435
+ PreferenceTopicListResponse = Courier::Models::PreferenceTopicListResponse
436
+
437
+ PreferenceTopicReplaceRequest = Courier::Models::PreferenceTopicReplaceRequest
438
+
409
439
  ProfileCreateParams = Courier::Models::ProfileCreateParams
410
440
 
411
441
  ProfileDeleteParams = Courier::Models::ProfileDeleteParams
@@ -434,6 +464,8 @@ module Courier
434
464
 
435
465
  ProviderUpdateParams = Courier::Models::ProviderUpdateParams
436
466
 
467
+ PublishPreferencesResponse = Courier::Models::PublishPreferencesResponse
468
+
437
469
  PutSubscriptionsRecipient = Courier::Models::PutSubscriptionsRecipient
438
470
 
439
471
  PutTenantTemplateRequest = Courier::Models::PutTenantTemplateRequest
@@ -180,6 +180,81 @@ module Courier
180
180
  )
181
181
  end
182
182
 
183
+ # Some parameter documentations has been truncated, see
184
+ # {Courier::Models::Journeys::TemplatePutContentParams} for more details.
185
+ #
186
+ # Replace the elemental content of a journey-scoped notification template.
187
+ # Overwrites all elements in the template draft with the provided content.
188
+ #
189
+ # @overload put_content(notification_id, template_id:, content:, state: nil, request_options: {})
190
+ #
191
+ # @param notification_id [String] Path param: Notification template id
192
+ #
193
+ # @param template_id [String] Path param: Journey id
194
+ #
195
+ # @param content [Courier::Models::NotificationContentPutRequest::Content] Body param: Elemental content payload. The server defaults `version` when omitte
196
+ #
197
+ # @param state [Symbol, Courier::Models::NotificationTemplateState] Body param: Template state. Defaults to `DRAFT`.
198
+ #
199
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
200
+ #
201
+ # @return [Courier::Models::NotificationContentMutationResponse]
202
+ #
203
+ # @see Courier::Models::Journeys::TemplatePutContentParams
204
+ def put_content(notification_id, params)
205
+ parsed, options = Courier::Journeys::TemplatePutContentParams.dump_request(params)
206
+ template_id =
207
+ parsed.delete(:template_id) do
208
+ raise ArgumentError.new("missing required path argument #{_1}")
209
+ end
210
+ @client.request(
211
+ method: :put,
212
+ path: ["journeys/%1$s/templates/%2$s/content", template_id, notification_id],
213
+ body: parsed,
214
+ model: Courier::NotificationContentMutationResponse,
215
+ options: options
216
+ )
217
+ end
218
+
219
+ # Set locale-specific content overrides for a journey-scoped notification
220
+ # template. Each element override must reference an existing element by ID.
221
+ #
222
+ # @overload put_locale(locale_id, template_id:, notification_id:, elements:, state: nil, request_options: {})
223
+ #
224
+ # @param locale_id [String] Path param: Locale code (e.g., `es`, `fr`, `pt-BR`).
225
+ #
226
+ # @param template_id [String] Path param: Journey id
227
+ #
228
+ # @param notification_id [String] Path param: Notification template id
229
+ #
230
+ # @param elements [Array<Courier::Models::NotificationLocalePutRequest::Element>] Body param: Elements with locale-specific content overrides.
231
+ #
232
+ # @param state [Symbol, Courier::Models::NotificationTemplateState] Body param: Template state. Defaults to `DRAFT`.
233
+ #
234
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
235
+ #
236
+ # @return [Courier::Models::NotificationContentMutationResponse]
237
+ #
238
+ # @see Courier::Models::Journeys::TemplatePutLocaleParams
239
+ def put_locale(locale_id, params)
240
+ parsed, options = Courier::Journeys::TemplatePutLocaleParams.dump_request(params)
241
+ template_id =
242
+ parsed.delete(:template_id) do
243
+ raise ArgumentError.new("missing required path argument #{_1}")
244
+ end
245
+ notification_id =
246
+ parsed.delete(:notification_id) do
247
+ raise ArgumentError.new("missing required path argument #{_1}")
248
+ end
249
+ @client.request(
250
+ method: :put,
251
+ path: ["journeys/%1$s/templates/%2$s/locales/%3$s", template_id, notification_id, locale_id],
252
+ body: parsed,
253
+ model: Courier::NotificationContentMutationResponse,
254
+ options: options
255
+ )
256
+ end
257
+
183
258
  # Replace the journey-scoped notification template draft.
184
259
  #
185
260
  # @overload replace(notification_id, template_id:, notification:, state: nil, request_options: {})
@@ -212,6 +287,44 @@ module Courier
212
287
  )
213
288
  end
214
289
 
290
+ # Some parameter documentations has been truncated, see
291
+ # {Courier::Models::Journeys::TemplateRetrieveContentParams} for more details.
292
+ #
293
+ # Retrieve the elemental content of a journey-scoped notification template. The
294
+ # response contains the versioned elements along with their content checksums,
295
+ # which can be used to detect changes between versions. Pass `?version=draft`
296
+ # (default `published`) to retrieve the working draft, or `?version=vN` for a
297
+ # historical version.
298
+ #
299
+ # @overload retrieve_content(notification_id, template_id:, version: nil, request_options: {})
300
+ #
301
+ # @param notification_id [String] Path param: Notification template id
302
+ #
303
+ # @param template_id [String] Path param: Journey id
304
+ #
305
+ # @param version [String] Query param: Accepts `draft`, `published`, or a version string (e.g., `v001`). D
306
+ #
307
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
308
+ #
309
+ # @return [Courier::Models::NotificationContentGetResponse]
310
+ #
311
+ # @see Courier::Models::Journeys::TemplateRetrieveContentParams
312
+ def retrieve_content(notification_id, params)
313
+ parsed, options = Courier::Journeys::TemplateRetrieveContentParams.dump_request(params)
314
+ query = Courier::Internal::Util.encode_query_params(parsed)
315
+ template_id =
316
+ parsed.delete(:template_id) do
317
+ raise ArgumentError.new("missing required path argument #{_1}")
318
+ end
319
+ @client.request(
320
+ method: :get,
321
+ path: ["journeys/%1$s/templates/%2$s/content", template_id, notification_id],
322
+ query: query,
323
+ model: Courier::NotificationContentGetResponse,
324
+ options: options
325
+ )
326
+ end
327
+
215
328
  # @api private
216
329
  #
217
330
  # @param client [Courier::Client]