trycourier 4.16.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 (77) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/lib/courier/client.rb +4 -0
  4. data/lib/courier/models/preference_section_archive_params.rb +20 -0
  5. data/lib/courier/models/preference_section_create_params.rb +14 -0
  6. data/lib/courier/models/preference_section_create_request.rb +36 -0
  7. data/lib/courier/models/preference_section_get_response.rb +83 -0
  8. data/lib/courier/models/preference_section_list_params.rb +14 -0
  9. data/lib/courier/models/preference_section_list_response.rb +18 -0
  10. data/lib/courier/models/preference_section_publish_params.rb +14 -0
  11. data/lib/courier/models/preference_section_replace_params.rb +20 -0
  12. data/lib/courier/models/preference_section_replace_request.rb +37 -0
  13. data/lib/courier/models/preference_section_retrieve_params.rb +20 -0
  14. data/lib/courier/models/preference_sections/topic_archive_params.rb +28 -0
  15. data/lib/courier/models/preference_sections/topic_create_params.rb +22 -0
  16. data/lib/courier/models/preference_sections/topic_list_params.rb +22 -0
  17. data/lib/courier/models/preference_sections/topic_replace_params.rb +28 -0
  18. data/lib/courier/models/preference_sections/topic_retrieve_params.rb +28 -0
  19. data/lib/courier/models/preference_topic_create_request.rb +93 -0
  20. data/lib/courier/models/preference_topic_get_response.rb +124 -0
  21. data/lib/courier/models/preference_topic_list_response.rb +17 -0
  22. data/lib/courier/models/preference_topic_replace_request.rb +90 -0
  23. data/lib/courier/models/publish_preferences_response.rb +51 -0
  24. data/lib/courier/models.rb +32 -0
  25. data/lib/courier/resources/preference_sections/topics.rb +173 -0
  26. data/lib/courier/resources/preference_sections.rb +155 -0
  27. data/lib/courier/version.rb +1 -1
  28. data/lib/courier.rb +22 -0
  29. data/rbi/courier/client.rbi +3 -0
  30. data/rbi/courier/models/preference_section_archive_params.rbi +38 -0
  31. data/rbi/courier/models/preference_section_create_params.rbi +30 -0
  32. data/rbi/courier/models/preference_section_create_request.rbi +61 -0
  33. data/rbi/courier/models/preference_section_get_response.rbi +106 -0
  34. data/rbi/courier/models/preference_section_list_params.rbi +30 -0
  35. data/rbi/courier/models/preference_section_list_response.rbi +35 -0
  36. data/rbi/courier/models/preference_section_publish_params.rbi +30 -0
  37. data/rbi/courier/models/preference_section_replace_params.rbi +38 -0
  38. data/rbi/courier/models/preference_section_replace_request.rbi +62 -0
  39. data/rbi/courier/models/preference_section_retrieve_params.rbi +38 -0
  40. data/rbi/courier/models/preference_sections/topic_archive_params.rbi +48 -0
  41. data/rbi/courier/models/preference_sections/topic_create_params.rbi +40 -0
  42. data/rbi/courier/models/preference_sections/topic_list_params.rbi +40 -0
  43. data/rbi/courier/models/preference_sections/topic_replace_params.rbi +48 -0
  44. data/rbi/courier/models/preference_sections/topic_retrieve_params.rbi +48 -0
  45. data/rbi/courier/models/preference_topic_create_request.rbi +181 -0
  46. data/rbi/courier/models/preference_topic_get_response.rbi +209 -0
  47. data/rbi/courier/models/preference_topic_list_response.rbi +35 -0
  48. data/rbi/courier/models/preference_topic_replace_request.rbi +180 -0
  49. data/rbi/courier/models/publish_preferences_response.rbi +70 -0
  50. data/rbi/courier/models.rbi +38 -0
  51. data/rbi/courier/resources/preference_sections/topics.rbi +149 -0
  52. data/rbi/courier/resources/preference_sections.rbi +113 -0
  53. data/sig/courier/client.rbs +2 -0
  54. data/sig/courier/models/preference_section_archive_params.rbs +23 -0
  55. data/sig/courier/models/preference_section_create_params.rbs +15 -0
  56. data/sig/courier/models/preference_section_create_request.rbs +30 -0
  57. data/sig/courier/models/preference_section_get_response.rbs +60 -0
  58. data/sig/courier/models/preference_section_list_params.rbs +15 -0
  59. data/sig/courier/models/preference_section_list_response.rbs +18 -0
  60. data/sig/courier/models/preference_section_publish_params.rbs +15 -0
  61. data/sig/courier/models/preference_section_replace_params.rbs +25 -0
  62. data/sig/courier/models/preference_section_replace_request.rbs +30 -0
  63. data/sig/courier/models/preference_section_retrieve_params.rbs +23 -0
  64. data/sig/courier/models/preference_sections/topic_archive_params.rbs +30 -0
  65. data/sig/courier/models/preference_sections/topic_create_params.rbs +27 -0
  66. data/sig/courier/models/preference_sections/topic_list_params.rbs +25 -0
  67. data/sig/courier/models/preference_sections/topic_replace_params.rbs +34 -0
  68. data/sig/courier/models/preference_sections/topic_retrieve_params.rbs +30 -0
  69. data/sig/courier/models/preference_topic_create_request.rbs +68 -0
  70. data/sig/courier/models/preference_topic_get_response.rbs +93 -0
  71. data/sig/courier/models/preference_topic_list_response.rbs +16 -0
  72. data/sig/courier/models/preference_topic_replace_request.rbs +68 -0
  73. data/sig/courier/models/publish_preferences_response.rbs +40 -0
  74. data/sig/courier/models.rbs +32 -0
  75. data/sig/courier/resources/preference_sections/topics.rbs +49 -0
  76. data/sig/courier/resources/preference_sections.rbs +42 -0
  77. metadata +68 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 76179334776f39db558748f8c3787c82edfee017d5a1a9eeb4a06593b1dd559e
4
- data.tar.gz: a42dc6fb130e7991fa52cbb683fc8d4d0a562ec06d8a79a647cdc15cbc15ff3b
3
+ metadata.gz: 1ebaf44c61a0ef71f4361dcc7d1c86fd966ef63dad937597e9aa3305eac0eb0c
4
+ data.tar.gz: 77043c6e894d91ae5bfcab16c10deebe37297817112069e094a88f0927452aa8
5
5
  SHA512:
6
- metadata.gz: 55b1ecd065e30b3c435d09df5f39a9237706ff4eb037a67d6e2ada6610187350403b17f446f0c2f3da9e59e2e0c3d4711303312e67258d3ccad3679f29cd8765
7
- data.tar.gz: af2d0c62c7146d14047ae2ca71c1f09c95e856708d223e6f32df0e67b64dfef667664d8ee9a7dc95c828a10f9d17bc12ba19d870ffaf218b8c381b66f152e539
6
+ metadata.gz: eada95e02ef63ffe5351c64ccbafa522e8a36d02b0ad84c15a250c493684b9676538c2c72d72ee6c613096bfb2de1e40b00cef51134af44de63229937ad22036
7
+ data.tar.gz: 1579153d043a077c6d4561276bfbbabbd986ddb115bea3552b5301717bb9e5c80855176573fc50789dc9293fd20970db74f5d003f1e3fe7e890128d236b4b65c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.17.0 (2026-06-24)
4
+
5
+ Full Changelog: [v4.16.0...v4.17.0](https://github.com/trycourier/courier-ruby/compare/v4.16.0...v4.17.0)
6
+
7
+ ### Features
8
+
9
+ * **preferences:** workspace preference sections & nested topics endpoints ([d53ac7b](https://github.com/trycourier/courier-ruby/commit/d53ac7b093745632465f9b8fc4136964e48ed88f))
10
+
3
11
  ## 4.16.0 (2026-06-23)
4
12
 
5
13
  Full Changelog: [v4.15.0...v4.16.0](https://github.com/trycourier/courier-ruby/compare/v4.15.0...v4.16.0)
@@ -66,6 +66,9 @@ module Courier
66
66
  # @return [Courier::Resources::RoutingStrategies]
67
67
  attr_reader :routing_strategies
68
68
 
69
+ # @return [Courier::Resources::PreferenceSections]
70
+ attr_reader :preference_sections
71
+
69
72
  # @return [Courier::Resources::Profiles]
70
73
  attr_reader :profiles
71
74
 
@@ -155,6 +158,7 @@ module Courier
155
158
  @requests = Courier::Resources::Requests.new(client: self)
156
159
  @notifications = Courier::Resources::Notifications.new(client: self)
157
160
  @routing_strategies = Courier::Resources::RoutingStrategies.new(client: self)
161
+ @preference_sections = Courier::Resources::PreferenceSections.new(client: self)
158
162
  @profiles = Courier::Resources::Profiles.new(client: self)
159
163
  @tenants = Courier::Resources::Tenants.new(client: self)
160
164
  @translations = Courier::Resources::Translations.new(client: self)
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::PreferenceSections#archive
6
+ class PreferenceSectionArchiveParams < Courier::Internal::Type::BaseModel
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ # @!attribute section_id
11
+ #
12
+ # @return [String]
13
+ required :section_id, String
14
+
15
+ # @!method initialize(section_id:, request_options: {})
16
+ # @param section_id [String]
17
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::PreferenceSections#create
6
+ class PreferenceSectionCreateParams < Courier::Models::PreferenceSectionCreateRequest
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ # @!method initialize(request_options: {})
11
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class PreferenceSectionCreateRequest < Courier::Internal::Type::BaseModel
6
+ # @!attribute name
7
+ # Human-readable name for the section.
8
+ #
9
+ # @return [String]
10
+ required :name, String
11
+
12
+ # @!attribute has_custom_routing
13
+ # Whether the section defines custom routing for its topics.
14
+ #
15
+ # @return [Boolean, nil]
16
+ optional :has_custom_routing, Courier::Internal::Type::Boolean, nil?: true
17
+
18
+ # @!attribute routing_options
19
+ # Default channels for the section. Defaults to empty if omitted.
20
+ #
21
+ # @return [Array<Symbol, Courier::Models::ChannelClassification>, nil]
22
+ optional :routing_options,
23
+ -> { Courier::Internal::Type::ArrayOf[enum: Courier::ChannelClassification] },
24
+ nil?: true
25
+
26
+ # @!method initialize(name:, has_custom_routing: nil, routing_options: nil)
27
+ # Request body for creating a preference section.
28
+ #
29
+ # @param name [String] Human-readable name for the section.
30
+ #
31
+ # @param has_custom_routing [Boolean, nil] Whether the section defines custom routing for its topics.
32
+ #
33
+ # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels for the section. Defaults to empty if omitted.
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::PreferenceSections#create
6
+ class PreferenceSectionGetResponse < Courier::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # The preference section id.
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute created
14
+ # ISO-8601 timestamp of when the section was created.
15
+ #
16
+ # @return [String]
17
+ required :created, String
18
+
19
+ # @!attribute has_custom_routing
20
+ # Whether the section defines custom routing for its topics.
21
+ #
22
+ # @return [Boolean]
23
+ required :has_custom_routing, Courier::Internal::Type::Boolean
24
+
25
+ # @!attribute name
26
+ # Human-readable name.
27
+ #
28
+ # @return [String]
29
+ required :name, String
30
+
31
+ # @!attribute routing_options
32
+ # Default channels for the section. May be empty.
33
+ #
34
+ # @return [Array<Symbol, Courier::Models::ChannelClassification>]
35
+ required :routing_options, -> { Courier::Internal::Type::ArrayOf[enum: Courier::ChannelClassification] }
36
+
37
+ # @!attribute topics
38
+ # The topics contained in this section.
39
+ #
40
+ # @return [Array<Courier::Models::PreferenceTopicGetResponse>]
41
+ required :topics, -> { Courier::Internal::Type::ArrayOf[Courier::PreferenceTopicGetResponse] }
42
+
43
+ # @!attribute creator
44
+ # Id of the creator.
45
+ #
46
+ # @return [String, nil]
47
+ optional :creator, String, nil?: true
48
+
49
+ # @!attribute updated
50
+ # ISO-8601 timestamp of the last update.
51
+ #
52
+ # @return [String, nil]
53
+ optional :updated, String, nil?: true
54
+
55
+ # @!attribute updater
56
+ # Id of the last updater.
57
+ #
58
+ # @return [String, nil]
59
+ optional :updater, String, nil?: true
60
+
61
+ # @!method initialize(id:, created:, has_custom_routing:, name:, routing_options:, topics:, creator: nil, updated: nil, updater: nil)
62
+ # A preference section in your workspace, including its topics.
63
+ #
64
+ # @param id [String] The preference section id.
65
+ #
66
+ # @param created [String] ISO-8601 timestamp of when the section was created.
67
+ #
68
+ # @param has_custom_routing [Boolean] Whether the section defines custom routing for its topics.
69
+ #
70
+ # @param name [String] Human-readable name.
71
+ #
72
+ # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>] Default channels for the section. May be empty.
73
+ #
74
+ # @param topics [Array<Courier::Models::PreferenceTopicGetResponse>] The topics contained in this section.
75
+ #
76
+ # @param creator [String, nil] Id of the creator.
77
+ #
78
+ # @param updated [String, nil] ISO-8601 timestamp of the last update.
79
+ #
80
+ # @param updater [String, nil] Id of the last updater.
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::PreferenceSections#list
6
+ class PreferenceSectionListParams < Courier::Internal::Type::BaseModel
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ # @!method initialize(request_options: {})
11
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::PreferenceSections#list
6
+ class PreferenceSectionListResponse < Courier::Internal::Type::BaseModel
7
+ # @!attribute results
8
+ #
9
+ # @return [Array<Courier::Models::PreferenceSectionGetResponse>]
10
+ required :results, -> { Courier::Internal::Type::ArrayOf[Courier::PreferenceSectionGetResponse] }
11
+
12
+ # @!method initialize(results:)
13
+ # The workspace's preference sections, each with its topics.
14
+ #
15
+ # @param results [Array<Courier::Models::PreferenceSectionGetResponse>]
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::PreferenceSections#publish
6
+ class PreferenceSectionPublishParams < Courier::Internal::Type::BaseModel
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ # @!method initialize(request_options: {})
11
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::PreferenceSections#replace
6
+ class PreferenceSectionReplaceParams < Courier::Models::PreferenceSectionReplaceRequest
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ # @!attribute section_id
11
+ #
12
+ # @return [String]
13
+ required :section_id, String
14
+
15
+ # @!method initialize(section_id:, request_options: {})
16
+ # @param section_id [String]
17
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class PreferenceSectionReplaceRequest < Courier::Internal::Type::BaseModel
6
+ # @!attribute name
7
+ # Human-readable name for the section.
8
+ #
9
+ # @return [String]
10
+ required :name, String
11
+
12
+ # @!attribute has_custom_routing
13
+ # Whether the section defines custom routing for its topics.
14
+ #
15
+ # @return [Boolean, nil]
16
+ optional :has_custom_routing, Courier::Internal::Type::Boolean, nil?: true
17
+
18
+ # @!attribute routing_options
19
+ # Default channels for the section. Omit to clear.
20
+ #
21
+ # @return [Array<Symbol, Courier::Models::ChannelClassification>, nil]
22
+ optional :routing_options,
23
+ -> { Courier::Internal::Type::ArrayOf[enum: Courier::ChannelClassification] },
24
+ nil?: true
25
+
26
+ # @!method initialize(name:, has_custom_routing: nil, routing_options: nil)
27
+ # Request body for replacing a preference section. Full document replacement;
28
+ # missing optional fields are cleared.
29
+ #
30
+ # @param name [String] Human-readable name for the section.
31
+ #
32
+ # @param has_custom_routing [Boolean, nil] Whether the section defines custom routing for its topics.
33
+ #
34
+ # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels for the section. Omit to clear.
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::PreferenceSections#retrieve
6
+ class PreferenceSectionRetrieveParams < Courier::Internal::Type::BaseModel
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ # @!attribute section_id
11
+ #
12
+ # @return [String]
13
+ required :section_id, String
14
+
15
+ # @!method initialize(section_id:, request_options: {})
16
+ # @param section_id [String]
17
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ module PreferenceSections
6
+ # @see Courier::Resources::PreferenceSections::Topics#archive
7
+ class TopicArchiveParams < Courier::Internal::Type::BaseModel
8
+ extend Courier::Internal::Type::RequestParameters::Converter
9
+ include Courier::Internal::Type::RequestParameters
10
+
11
+ # @!attribute section_id
12
+ #
13
+ # @return [String]
14
+ required :section_id, String
15
+
16
+ # @!attribute topic_id
17
+ #
18
+ # @return [String]
19
+ required :topic_id, String
20
+
21
+ # @!method initialize(section_id:, topic_id:, request_options: {})
22
+ # @param section_id [String]
23
+ # @param topic_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 PreferenceSections
6
+ # @see Courier::Resources::PreferenceSections::Topics#create
7
+ class TopicCreateParams < Courier::Models::PreferenceTopicCreateRequest
8
+ extend Courier::Internal::Type::RequestParameters::Converter
9
+ include Courier::Internal::Type::RequestParameters
10
+
11
+ # @!attribute section_id
12
+ #
13
+ # @return [String]
14
+ required :section_id, String
15
+
16
+ # @!method initialize(section_id:, request_options: {})
17
+ # @param section_id [String]
18
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ module PreferenceSections
6
+ # @see Courier::Resources::PreferenceSections::Topics#list
7
+ class TopicListParams < Courier::Internal::Type::BaseModel
8
+ extend Courier::Internal::Type::RequestParameters::Converter
9
+ include Courier::Internal::Type::RequestParameters
10
+
11
+ # @!attribute section_id
12
+ #
13
+ # @return [String]
14
+ required :section_id, String
15
+
16
+ # @!method initialize(section_id:, request_options: {})
17
+ # @param section_id [String]
18
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ module PreferenceSections
6
+ # @see Courier::Resources::PreferenceSections::Topics#replace
7
+ class TopicReplaceParams < Courier::Models::PreferenceTopicReplaceRequest
8
+ extend Courier::Internal::Type::RequestParameters::Converter
9
+ include Courier::Internal::Type::RequestParameters
10
+
11
+ # @!attribute section_id
12
+ #
13
+ # @return [String]
14
+ required :section_id, String
15
+
16
+ # @!attribute topic_id
17
+ #
18
+ # @return [String]
19
+ required :topic_id, String
20
+
21
+ # @!method initialize(section_id:, topic_id:, request_options: {})
22
+ # @param section_id [String]
23
+ # @param topic_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 PreferenceSections
6
+ # @see Courier::Resources::PreferenceSections::Topics#retrieve
7
+ class TopicRetrieveParams < Courier::Internal::Type::BaseModel
8
+ extend Courier::Internal::Type::RequestParameters::Converter
9
+ include Courier::Internal::Type::RequestParameters
10
+
11
+ # @!attribute section_id
12
+ #
13
+ # @return [String]
14
+ required :section_id, String
15
+
16
+ # @!attribute topic_id
17
+ #
18
+ # @return [String]
19
+ required :topic_id, String
20
+
21
+ # @!method initialize(section_id:, topic_id:, request_options: {})
22
+ # @param section_id [String]
23
+ # @param topic_id [String]
24
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
25
+ end
26
+ end
27
+ end
28
+ end
@@ -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