trycourier 4.17.0 → 4.17.1

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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/lib/courier/client.rb +3 -3
  4. data/lib/courier/models/publish_preferences_response.rb +1 -1
  5. data/lib/courier/models/{preference_section_archive_params.rb → workspace_preference_archive_params.rb} +2 -2
  6. data/lib/courier/models/{preference_section_create_params.rb → workspace_preference_create_params.rb} +2 -2
  7. data/lib/courier/models/{preference_section_create_request.rb → workspace_preference_create_request.rb} +8 -8
  8. data/lib/courier/models/{preference_section_get_response.rb → workspace_preference_get_response.rb} +15 -15
  9. data/lib/courier/models/{preference_section_list_params.rb → workspace_preference_list_params.rb} +2 -2
  10. data/lib/courier/models/workspace_preference_list_response.rb +18 -0
  11. data/lib/courier/models/{preference_section_publish_params.rb → workspace_preference_publish_params.rb} +2 -2
  12. data/lib/courier/models/{preference_section_replace_params.rb → workspace_preference_replace_params.rb} +2 -2
  13. data/lib/courier/models/{preference_section_replace_request.rb → workspace_preference_replace_request.rb} +8 -8
  14. data/lib/courier/models/{preference_section_retrieve_params.rb → workspace_preference_retrieve_params.rb} +2 -2
  15. data/lib/courier/models/{preference_topic_create_request.rb → workspace_preference_topic_create_request.rb} +9 -9
  16. data/lib/courier/models/{preference_topic_get_response.rb → workspace_preference_topic_get_response.rb} +8 -8
  17. data/lib/courier/models/workspace_preference_topic_list_response.rb +17 -0
  18. data/lib/courier/models/{preference_topic_replace_request.rb → workspace_preference_topic_replace_request.rb} +8 -8
  19. data/lib/courier/models/{preference_sections → workspace_preferences}/topic_archive_params.rb +2 -2
  20. data/lib/courier/models/{preference_sections → workspace_preferences}/topic_create_params.rb +3 -3
  21. data/lib/courier/models/{preference_sections → workspace_preferences}/topic_list_params.rb +2 -2
  22. data/lib/courier/models/{preference_sections → workspace_preferences}/topic_replace_params.rb +3 -3
  23. data/lib/courier/models/{preference_sections → workspace_preferences}/topic_retrieve_params.rb +2 -2
  24. data/lib/courier/models.rb +30 -30
  25. data/lib/courier/resources/notifications/checks.rb +3 -3
  26. data/lib/courier/resources/{preference_sections → workspace_preferences}/topics.rb +40 -37
  27. data/lib/courier/resources/{preference_sections.rb → workspace_preferences.rb} +40 -40
  28. data/lib/courier/version.rb +1 -1
  29. data/lib/courier.rb +21 -21
  30. data/rbi/courier/client.rbi +2 -2
  31. data/rbi/courier/models/{preference_section_retrieve_params.rbi → workspace_preference_archive_params.rbi} +2 -2
  32. data/rbi/courier/models/{preference_section_create_params.rbi → workspace_preference_create_params.rbi} +2 -2
  33. data/rbi/courier/models/{preference_section_create_request.rbi → workspace_preference_create_request.rbi} +9 -9
  34. data/rbi/courier/models/{preference_section_get_response.rbi → workspace_preference_get_response.rbi} +17 -16
  35. data/rbi/courier/models/{preference_section_list_params.rbi → workspace_preference_list_params.rbi} +2 -2
  36. data/rbi/courier/models/{preference_topic_list_response.rbi → workspace_preference_list_response.rbi} +6 -6
  37. data/rbi/courier/models/{preference_section_publish_params.rbi → workspace_preference_publish_params.rbi} +2 -2
  38. data/rbi/courier/models/{preference_section_replace_params.rbi → workspace_preference_replace_params.rbi} +2 -2
  39. data/rbi/courier/models/{preference_section_replace_request.rbi → workspace_preference_replace_request.rbi} +9 -9
  40. data/rbi/courier/models/{preference_section_archive_params.rbi → workspace_preference_retrieve_params.rbi} +2 -2
  41. data/rbi/courier/models/{preference_topic_create_request.rbi → workspace_preference_topic_create_request.rbi} +22 -17
  42. data/rbi/courier/models/{preference_topic_get_response.rbi → workspace_preference_topic_get_response.rbi} +23 -17
  43. data/rbi/courier/models/workspace_preference_topic_list_response.rbi +36 -0
  44. data/rbi/courier/models/{preference_topic_replace_request.rbi → workspace_preference_topic_replace_request.rbi} +22 -17
  45. data/rbi/courier/models/{preference_sections → workspace_preferences}/topic_archive_params.rbi +2 -2
  46. data/rbi/courier/models/{preference_sections → workspace_preferences}/topic_create_params.rbi +3 -3
  47. data/rbi/courier/models/{preference_sections → workspace_preferences}/topic_list_params.rbi +2 -2
  48. data/rbi/courier/models/{preference_sections → workspace_preferences}/topic_replace_params.rbi +3 -3
  49. data/rbi/courier/models/{preference_sections → workspace_preferences}/topic_retrieve_params.rbi +2 -2
  50. data/rbi/courier/models.rbi +43 -36
  51. data/rbi/courier/resources/notifications/checks.rbi +3 -3
  52. data/rbi/courier/resources/{preference_sections → workspace_preferences}/topics.rbi +25 -22
  53. data/rbi/courier/resources/{preference_sections.rbi → workspace_preferences.rbi} +27 -27
  54. data/sig/courier/client.rbs +1 -1
  55. data/sig/courier/models/{preference_section_retrieve_params.rbs → workspace_preference_archive_params.rbs} +2 -2
  56. data/sig/courier/models/{preference_section_create_params.rbs → workspace_preference_create_params.rbs} +2 -2
  57. data/sig/courier/models/{preference_section_replace_request.rbs → workspace_preference_create_request.rbs} +2 -2
  58. data/sig/courier/models/{preference_section_get_response.rbs → workspace_preference_get_response.rbs} +6 -6
  59. data/sig/courier/models/{preference_section_list_params.rbs → workspace_preference_list_params.rbs} +2 -2
  60. data/sig/courier/models/workspace_preference_list_response.rbs +18 -0
  61. data/sig/courier/models/{preference_section_publish_params.rbs → workspace_preference_publish_params.rbs} +2 -2
  62. data/sig/courier/models/{preference_section_replace_params.rbs → workspace_preference_replace_params.rbs} +2 -2
  63. data/sig/courier/models/{preference_section_create_request.rbs → workspace_preference_replace_request.rbs} +2 -2
  64. data/sig/courier/models/{preference_section_archive_params.rbs → workspace_preference_retrieve_params.rbs} +2 -2
  65. data/sig/courier/models/{preference_topic_create_request.rbs → workspace_preference_topic_create_request.rbs} +12 -12
  66. data/sig/courier/models/{preference_topic_get_response.rbs → workspace_preference_topic_get_response.rbs} +12 -12
  67. data/sig/courier/models/workspace_preference_topic_list_response.rbs +18 -0
  68. data/sig/courier/models/{preference_topic_replace_request.rbs → workspace_preference_topic_replace_request.rbs} +12 -12
  69. data/sig/courier/models/{preference_sections → workspace_preferences}/topic_archive_params.rbs +1 -1
  70. data/sig/courier/models/{preference_sections → workspace_preferences}/topic_create_params.rbs +2 -2
  71. data/sig/courier/models/{preference_sections → workspace_preferences}/topic_list_params.rbs +1 -1
  72. data/sig/courier/models/{preference_sections → workspace_preferences}/topic_replace_params.rbs +2 -2
  73. data/sig/courier/models/{preference_sections → workspace_preferences}/topic_retrieve_params.rbs +1 -1
  74. data/sig/courier/models.rbs +30 -30
  75. data/sig/courier/resources/{preference_sections → workspace_preferences}/topics.rbs +9 -9
  76. data/sig/courier/resources/{preference_sections.rbs → workspace_preferences.rbs} +6 -6
  77. metadata +65 -65
  78. data/lib/courier/models/preference_section_list_response.rb +0 -18
  79. data/lib/courier/models/preference_topic_list_response.rb +0 -17
  80. data/rbi/courier/models/preference_section_list_response.rbi +0 -35
  81. data/sig/courier/models/preference_section_list_response.rbs +0 -18
  82. data/sig/courier/models/preference_topic_list_response.rbs +0 -16
@@ -4,7 +4,7 @@ module Courier
4
4
  module Resources
5
5
  class Notifications
6
6
  class Checks
7
- # Replace the checks for a notification template submission.
7
+ # Replace the submission checks for a notification template.
8
8
  #
9
9
  # @overload update(submission_id, id:, checks:, request_options: {})
10
10
  #
@@ -34,7 +34,7 @@ module Courier
34
34
  )
35
35
  end
36
36
 
37
- # Retrieve the checks for a notification template submission.
37
+ # Retrieve the submission checks for a notification template.
38
38
  #
39
39
  # @overload list(submission_id, id:, request_options: {})
40
40
  #
@@ -61,7 +61,7 @@ module Courier
61
61
  )
62
62
  end
63
63
 
64
- # Cancel a notification template submission.
64
+ # Cancel a submission for a notification template.
65
65
  #
66
66
  # @overload delete(submission_id, id:, request_options: {})
67
67
  #
@@ -2,23 +2,24 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
- class PreferenceSections
5
+ class WorkspacePreferences
6
6
  class Topics
7
7
  # Some parameter documentations has been truncated, see
8
- # {Courier::Models::PreferenceSections::TopicCreateParams} for more details.
8
+ # {Courier::Models::WorkspacePreferences::TopicCreateParams} for more details.
9
9
  #
10
- # Create a subscription preference topic inside a section. Fails with 404 if the
11
- # section does not exist. The topic id is generated and returned.
10
+ # Create a subscription preference topic inside a workspace preference. Fails with
11
+ # 404 if the workspace preference does not exist. The topic id is generated and
12
+ # returned.
12
13
  #
13
14
  # @overload create(section_id, default_status:, name:, allowed_preferences: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil, request_options: {})
14
15
  #
15
- # @param section_id [String] Id of the preference section to create the topic in.
16
+ # @param section_id [String] Id of the workspace preference to create the topic in.
16
17
  #
17
- # @param default_status [Symbol, Courier::Models::PreferenceTopicCreateRequest::DefaultStatus] The default subscription status applied when a recipient has not set their own.
18
+ # @param default_status [Symbol, Courier::Models::WorkspacePreferenceTopicCreateRequest::DefaultStatus] The default subscription status applied when a recipient has not set their own.
18
19
  #
19
20
  # @param name [String] Human-readable name for the preference topic.
20
21
  #
21
- # @param allowed_preferences [Array<Symbol, Courier::Models::PreferenceTopicCreateRequest::AllowedPreference>, nil] Preference controls a recipient may customize for this topic. Defaults to empty
22
+ # @param allowed_preferences [Array<Symbol, Courier::Models::WorkspacePreferenceTopicCreateRequest::AllowedPreference>, nil] Preference controls a recipient may customize for this topic. Defaults to empty
22
23
  #
23
24
  # @param include_unsubscribe_header [Boolean, nil] Whether to include a list-unsubscribe header on emails for this topic.
24
25
  #
@@ -28,36 +29,37 @@ module Courier
28
29
  #
29
30
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
30
31
  #
31
- # @return [Courier::Models::PreferenceTopicGetResponse]
32
+ # @return [Courier::Models::WorkspacePreferenceTopicGetResponse]
32
33
  #
33
- # @see Courier::Models::PreferenceSections::TopicCreateParams
34
+ # @see Courier::Models::WorkspacePreferences::TopicCreateParams
34
35
  def create(section_id, params)
35
- parsed, options = Courier::PreferenceSections::TopicCreateParams.dump_request(params)
36
+ parsed, options = Courier::WorkspacePreferences::TopicCreateParams.dump_request(params)
36
37
  @client.request(
37
38
  method: :post,
38
39
  path: ["preferences/sections/%1$s/topics", section_id],
39
40
  body: parsed,
40
- model: Courier::PreferenceTopicGetResponse,
41
+ model: Courier::WorkspacePreferenceTopicGetResponse,
41
42
  options: options
42
43
  )
43
44
  end
44
45
 
45
- # Retrieve a topic within a section. Returns 404 if the section does not exist,
46
- # the topic does not exist, or the topic belongs to a different section.
46
+ # Retrieve a topic within a workspace preference. Returns 404 if the workspace
47
+ # preference does not exist, the topic does not exist, or the topic belongs to a
48
+ # different workspace preference.
47
49
  #
48
50
  # @overload retrieve(topic_id, section_id:, request_options: {})
49
51
  #
50
52
  # @param topic_id [String] Id of the subscription preference topic.
51
53
  #
52
- # @param section_id [String] Id of the preference section.
54
+ # @param section_id [String] Id of the workspace preference.
53
55
  #
54
56
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
55
57
  #
56
- # @return [Courier::Models::PreferenceTopicGetResponse]
58
+ # @return [Courier::Models::WorkspacePreferenceTopicGetResponse]
57
59
  #
58
- # @see Courier::Models::PreferenceSections::TopicRetrieveParams
60
+ # @see Courier::Models::WorkspacePreferences::TopicRetrieveParams
59
61
  def retrieve(topic_id, params)
60
- parsed, options = Courier::PreferenceSections::TopicRetrieveParams.dump_request(params)
62
+ parsed, options = Courier::WorkspacePreferences::TopicRetrieveParams.dump_request(params)
61
63
  section_id =
62
64
  parsed.delete(:section_id) do
63
65
  raise ArgumentError.new("missing required path argument #{_1}")
@@ -65,46 +67,47 @@ module Courier
65
67
  @client.request(
66
68
  method: :get,
67
69
  path: ["preferences/sections/%1$s/topics/%2$s", section_id, topic_id],
68
- model: Courier::PreferenceTopicGetResponse,
70
+ model: Courier::WorkspacePreferenceTopicGetResponse,
69
71
  options: options
70
72
  )
71
73
  end
72
74
 
73
- # List the topics in a preference section.
75
+ # List the topics in a workspace preference.
74
76
  #
75
77
  # @overload list(section_id, request_options: {})
76
78
  #
77
- # @param section_id [String] Id of the preference section.
79
+ # @param section_id [String] Id of the workspace preference.
78
80
  #
79
81
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
80
82
  #
81
- # @return [Courier::Models::PreferenceTopicListResponse]
83
+ # @return [Courier::Models::WorkspacePreferenceTopicListResponse]
82
84
  #
83
- # @see Courier::Models::PreferenceSections::TopicListParams
85
+ # @see Courier::Models::WorkspacePreferences::TopicListParams
84
86
  def list(section_id, params = {})
85
87
  @client.request(
86
88
  method: :get,
87
89
  path: ["preferences/sections/%1$s/topics", section_id],
88
- model: Courier::PreferenceTopicListResponse,
90
+ model: Courier::WorkspacePreferenceTopicListResponse,
89
91
  options: params[:request_options]
90
92
  )
91
93
  end
92
94
 
93
- # Archive a topic and remove it from its section. Same 404 rules as GET.
95
+ # Archive a topic and remove it from its workspace preference. Same 404 rules as
96
+ # GET.
94
97
  #
95
98
  # @overload archive(topic_id, section_id:, request_options: {})
96
99
  #
97
100
  # @param topic_id [String] Id of the subscription preference topic.
98
101
  #
99
- # @param section_id [String] Id of the preference section.
102
+ # @param section_id [String] Id of the workspace preference.
100
103
  #
101
104
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
102
105
  #
103
106
  # @return [nil]
104
107
  #
105
- # @see Courier::Models::PreferenceSections::TopicArchiveParams
108
+ # @see Courier::Models::WorkspacePreferences::TopicArchiveParams
106
109
  def archive(topic_id, params)
107
- parsed, options = Courier::PreferenceSections::TopicArchiveParams.dump_request(params)
110
+ parsed, options = Courier::WorkspacePreferences::TopicArchiveParams.dump_request(params)
108
111
  section_id =
109
112
  parsed.delete(:section_id) do
110
113
  raise ArgumentError.new("missing required path argument #{_1}")
@@ -118,22 +121,22 @@ module Courier
118
121
  end
119
122
 
120
123
  # Some parameter documentations has been truncated, see
121
- # {Courier::Models::PreferenceSections::TopicReplaceParams} for more details.
124
+ # {Courier::Models::WorkspacePreferences::TopicReplaceParams} for more details.
122
125
  #
123
- # Replace a topic within a section. Full document replacement; missing optional
124
- # fields are cleared. Same 404 rules as GET.
126
+ # Replace a topic within a workspace preference. Full document replacement;
127
+ # missing optional fields are cleared. Same 404 rules as GET.
125
128
  #
126
129
  # @overload replace(topic_id, section_id:, default_status:, name:, allowed_preferences: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil, request_options: {})
127
130
  #
128
131
  # @param topic_id [String] Path param: Id of the subscription preference topic.
129
132
  #
130
- # @param section_id [String] Path param: Id of the preference section.
133
+ # @param section_id [String] Path param: Id of the workspace preference.
131
134
  #
132
- # @param default_status [Symbol, Courier::Models::PreferenceTopicReplaceRequest::DefaultStatus] Body param: The default subscription status applied when a recipient has not set
135
+ # @param default_status [Symbol, Courier::Models::WorkspacePreferenceTopicReplaceRequest::DefaultStatus] Body param: The default subscription status applied when a recipient has not set
133
136
  #
134
137
  # @param name [String] Body param: Human-readable name for the preference topic.
135
138
  #
136
- # @param allowed_preferences [Array<Symbol, Courier::Models::PreferenceTopicReplaceRequest::AllowedPreference>, nil] Body param: Preference controls a recipient may customize. Omit to clear.
139
+ # @param allowed_preferences [Array<Symbol, Courier::Models::WorkspacePreferenceTopicReplaceRequest::AllowedPreference>, nil] Body param: Preference controls a recipient may customize. Omit to clear.
137
140
  #
138
141
  # @param include_unsubscribe_header [Boolean, nil] Body param: Whether to include a list-unsubscribe header on emails for this topi
139
142
  #
@@ -143,11 +146,11 @@ module Courier
143
146
  #
144
147
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
145
148
  #
146
- # @return [Courier::Models::PreferenceTopicGetResponse]
149
+ # @return [Courier::Models::WorkspacePreferenceTopicGetResponse]
147
150
  #
148
- # @see Courier::Models::PreferenceSections::TopicReplaceParams
151
+ # @see Courier::Models::WorkspacePreferences::TopicReplaceParams
149
152
  def replace(topic_id, params)
150
- parsed, options = Courier::PreferenceSections::TopicReplaceParams.dump_request(params)
153
+ parsed, options = Courier::WorkspacePreferences::TopicReplaceParams.dump_request(params)
151
154
  section_id =
152
155
  parsed.delete(:section_id) do
153
156
  raise ArgumentError.new("missing required path argument #{_1}")
@@ -156,7 +159,7 @@ module Courier
156
159
  method: :put,
157
160
  path: ["preferences/sections/%1$s/topics/%2$s", section_id, topic_id],
158
161
  body: parsed,
159
- model: Courier::PreferenceTopicGetResponse,
162
+ model: Courier::WorkspacePreferenceTopicGetResponse,
160
163
  options: options
161
164
  )
162
165
  end
@@ -2,89 +2,89 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
- class PreferenceSections
6
- # @return [Courier::Resources::PreferenceSections::Topics]
5
+ class WorkspacePreferences
6
+ # @return [Courier::Resources::WorkspacePreferences::Topics]
7
7
  attr_reader :topics
8
8
 
9
- # Create a preference section in your workspace. The section id is generated and
10
- # returned. Topics are created inside a section via POST
9
+ # Create a workspace preference. The workspace preference id is generated and
10
+ # returned. Topics are created inside a workspace preference via POST
11
11
  # /preferences/sections/{section_id}/topics.
12
12
  #
13
13
  # @overload create(name:, has_custom_routing: nil, routing_options: nil, request_options: {})
14
14
  #
15
- # @param name [String] Human-readable name for the section.
15
+ # @param name [String] Human-readable name for the workspace preference.
16
16
  #
17
- # @param has_custom_routing [Boolean, nil] Whether the section defines custom routing for its topics.
17
+ # @param has_custom_routing [Boolean, nil] Whether the workspace preference defines custom routing for its topics.
18
18
  #
19
- # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels for the section. Defaults to empty if omitted.
19
+ # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels for the workspace preference. Defaults to empty if omitted.
20
20
  #
21
21
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
22
22
  #
23
- # @return [Courier::Models::PreferenceSectionGetResponse]
23
+ # @return [Courier::Models::WorkspacePreferenceGetResponse]
24
24
  #
25
- # @see Courier::Models::PreferenceSectionCreateParams
25
+ # @see Courier::Models::WorkspacePreferenceCreateParams
26
26
  def create(params)
27
- parsed, options = Courier::PreferenceSectionCreateParams.dump_request(params)
27
+ parsed, options = Courier::WorkspacePreferenceCreateParams.dump_request(params)
28
28
  @client.request(
29
29
  method: :post,
30
30
  path: "preferences/sections",
31
31
  body: parsed,
32
- model: Courier::PreferenceSectionGetResponse,
32
+ model: Courier::WorkspacePreferenceGetResponse,
33
33
  options: options
34
34
  )
35
35
  end
36
36
 
37
- # Retrieve a preference section by id, including its topics.
37
+ # Retrieve a workspace preference by id, including its topics.
38
38
  #
39
39
  # @overload retrieve(section_id, request_options: {})
40
40
  #
41
- # @param section_id [String] Id of the preference section.
41
+ # @param section_id [String] Id of the workspace preference.
42
42
  #
43
43
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
44
44
  #
45
- # @return [Courier::Models::PreferenceSectionGetResponse]
45
+ # @return [Courier::Models::WorkspacePreferenceGetResponse]
46
46
  #
47
- # @see Courier::Models::PreferenceSectionRetrieveParams
47
+ # @see Courier::Models::WorkspacePreferenceRetrieveParams
48
48
  def retrieve(section_id, params = {})
49
49
  @client.request(
50
50
  method: :get,
51
51
  path: ["preferences/sections/%1$s", section_id],
52
- model: Courier::PreferenceSectionGetResponse,
52
+ model: Courier::WorkspacePreferenceGetResponse,
53
53
  options: params[:request_options]
54
54
  )
55
55
  end
56
56
 
57
- # List the workspace's preference sections. Each section embeds its topics. Scoped
58
- # to the workspace of the API key.
57
+ # List the workspace's preferences. Each workspace preference embeds its topics.
58
+ # Scoped to the workspace of the API key.
59
59
  #
60
60
  # @overload list(request_options: {})
61
61
  #
62
62
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
63
63
  #
64
- # @return [Courier::Models::PreferenceSectionListResponse]
64
+ # @return [Courier::Models::WorkspacePreferenceListResponse]
65
65
  #
66
- # @see Courier::Models::PreferenceSectionListParams
66
+ # @see Courier::Models::WorkspacePreferenceListParams
67
67
  def list(params = {})
68
68
  @client.request(
69
69
  method: :get,
70
70
  path: "preferences/sections",
71
- model: Courier::PreferenceSectionListResponse,
71
+ model: Courier::WorkspacePreferenceListResponse,
72
72
  options: params[:request_options]
73
73
  )
74
74
  end
75
75
 
76
- # Archive a preference section. The section must be empty: delete its topics
77
- # first, otherwise the request fails with 409.
76
+ # Archive a workspace preference. The workspace preference must be empty: delete
77
+ # its topics first, otherwise the request fails with 409.
78
78
  #
79
79
  # @overload archive(section_id, request_options: {})
80
80
  #
81
- # @param section_id [String] Id of the preference section.
81
+ # @param section_id [String] Id of the workspace preference.
82
82
  #
83
83
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
84
84
  #
85
85
  # @return [nil]
86
86
  #
87
- # @see Courier::Models::PreferenceSectionArchiveParams
87
+ # @see Courier::Models::WorkspacePreferenceArchiveParams
88
88
  def archive(section_id, params = {})
89
89
  @client.request(
90
90
  method: :delete,
@@ -94,9 +94,9 @@ module Courier
94
94
  )
95
95
  end
96
96
 
97
- # Publish the workspace's preferences page. Takes a snapshot of every section with
98
- # its topics under a new published version, making the current state visible on
99
- # the hosted preferences page (non-draft).
97
+ # Publish the workspace's preferences page. Takes a snapshot of every workspace
98
+ # preference with its topics under a new published version, making the current
99
+ # state visible on the hosted preferences page (non-draft).
100
100
  #
101
101
  # @overload publish(request_options: {})
102
102
  #
@@ -104,7 +104,7 @@ module Courier
104
104
  #
105
105
  # @return [Courier::Models::PublishPreferencesResponse]
106
106
  #
107
- # @see Courier::Models::PreferenceSectionPublishParams
107
+ # @see Courier::Models::WorkspacePreferencePublishParams
108
108
  def publish(params = {})
109
109
  @client.request(
110
110
  method: :post,
@@ -114,31 +114,31 @@ module Courier
114
114
  )
115
115
  end
116
116
 
117
- # Replace a preference section. Full document replacement; missing optional fields
118
- # are cleared. Topics attached to the section are unaffected.
117
+ # Replace a workspace preference. Full document replacement; missing optional
118
+ # fields are cleared. Topics attached to the workspace preference are unaffected.
119
119
  #
120
120
  # @overload replace(section_id, name:, has_custom_routing: nil, routing_options: nil, request_options: {})
121
121
  #
122
- # @param section_id [String] Id of the preference section.
122
+ # @param section_id [String] Id of the workspace preference.
123
123
  #
124
- # @param name [String] Human-readable name for the section.
124
+ # @param name [String] Human-readable name for the workspace preference.
125
125
  #
126
- # @param has_custom_routing [Boolean, nil] Whether the section defines custom routing for its topics.
126
+ # @param has_custom_routing [Boolean, nil] Whether the workspace preference defines custom routing for its topics.
127
127
  #
128
- # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels for the section. Omit to clear.
128
+ # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels for the workspace preference. Omit to clear.
129
129
  #
130
130
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
131
131
  #
132
- # @return [Courier::Models::PreferenceSectionGetResponse]
132
+ # @return [Courier::Models::WorkspacePreferenceGetResponse]
133
133
  #
134
- # @see Courier::Models::PreferenceSectionReplaceParams
134
+ # @see Courier::Models::WorkspacePreferenceReplaceParams
135
135
  def replace(section_id, params)
136
- parsed, options = Courier::PreferenceSectionReplaceParams.dump_request(params)
136
+ parsed, options = Courier::WorkspacePreferenceReplaceParams.dump_request(params)
137
137
  @client.request(
138
138
  method: :put,
139
139
  path: ["preferences/sections/%1$s", section_id],
140
140
  body: parsed,
141
- model: Courier::PreferenceSectionGetResponse,
141
+ model: Courier::WorkspacePreferenceGetResponse,
142
142
  options: options
143
143
  )
144
144
  end
@@ -148,7 +148,7 @@ module Courier
148
148
  # @param client [Courier::Client]
149
149
  def initialize(client:)
150
150
  @client = client
151
- @topics = Courier::Resources::PreferenceSections::Topics.new(client: client)
151
+ @topics = Courier::Resources::WorkspacePreferences::Topics.new(client: client)
152
152
  end
153
153
  end
154
154
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Courier
4
- VERSION = "4.17.0"
4
+ VERSION = "4.17.1"
5
5
  end
data/lib/courier.rb CHANGED
@@ -72,16 +72,16 @@ require_relative "courier/models/notification_template_publish_request"
72
72
  require_relative "courier/models/notification_element_put_request"
73
73
  require_relative "courier/models/notification_template_update_request"
74
74
  require_relative "courier/models/notification_template_payload"
75
- require_relative "courier/models/preference_section_create_request"
76
- require_relative "courier/models/preference_section_replace_request"
77
- require_relative "courier/models/preference_topic_create_request"
78
- require_relative "courier/models/preference_topic_replace_request"
79
75
  require_relative "courier/models/routing_strategy_create_request"
80
76
  require_relative "courier/models/routing_strategy_replace_request"
81
77
  require_relative "courier/models/base_template_tenant_association"
82
78
  require_relative "courier/models/post_tenant_template_publish_request"
83
79
  require_relative "courier/models/put_tenant_template_request"
84
80
  require_relative "courier/models/users/user_token"
81
+ require_relative "courier/models/workspace_preference_create_request"
82
+ require_relative "courier/models/workspace_preference_replace_request"
83
+ require_relative "courier/models/workspace_preference_topic_create_request"
84
+ require_relative "courier/models/workspace_preference_topic_replace_request"
85
85
  require_relative "courier/models/airship_profile"
86
86
  require_relative "courier/models/airship_profile_audience"
87
87
  require_relative "courier/models/alignment"
@@ -279,22 +279,7 @@ require_relative "courier/models/pagerduty_recipient"
279
279
  require_relative "courier/models/paging"
280
280
  require_relative "courier/models/post_tenant_template_publish_response"
281
281
  require_relative "courier/models/preference"
282
- require_relative "courier/models/preference_section_archive_params"
283
- require_relative "courier/models/preference_section_create_params"
284
- require_relative "courier/models/preference_section_get_response"
285
- require_relative "courier/models/preference_section_list_params"
286
- require_relative "courier/models/preference_section_list_response"
287
- require_relative "courier/models/preference_section_publish_params"
288
- require_relative "courier/models/preference_section_replace_params"
289
- require_relative "courier/models/preference_section_retrieve_params"
290
- require_relative "courier/models/preference_sections/topic_archive_params"
291
- require_relative "courier/models/preference_sections/topic_create_params"
292
- require_relative "courier/models/preference_sections/topic_list_params"
293
- require_relative "courier/models/preference_sections/topic_replace_params"
294
- require_relative "courier/models/preference_sections/topic_retrieve_params"
295
282
  require_relative "courier/models/preference_status"
296
- require_relative "courier/models/preference_topic_get_response"
297
- require_relative "courier/models/preference_topic_list_response"
298
283
  require_relative "courier/models/profile_create_params"
299
284
  require_relative "courier/models/profile_create_response"
300
285
  require_relative "courier/models/profile_delete_params"
@@ -410,6 +395,21 @@ require_relative "courier/models/webhook_profile"
410
395
  require_relative "courier/models/webhook_profile_type"
411
396
  require_relative "courier/models/webhook_recipient"
412
397
  require_relative "courier/models/widget_background"
398
+ require_relative "courier/models/workspace_preference_archive_params"
399
+ require_relative "courier/models/workspace_preference_create_params"
400
+ require_relative "courier/models/workspace_preference_get_response"
401
+ require_relative "courier/models/workspace_preference_list_params"
402
+ require_relative "courier/models/workspace_preference_list_response"
403
+ require_relative "courier/models/workspace_preference_publish_params"
404
+ require_relative "courier/models/workspace_preference_replace_params"
405
+ require_relative "courier/models/workspace_preference_retrieve_params"
406
+ require_relative "courier/models/workspace_preferences/topic_archive_params"
407
+ require_relative "courier/models/workspace_preferences/topic_create_params"
408
+ require_relative "courier/models/workspace_preferences/topic_list_params"
409
+ require_relative "courier/models/workspace_preferences/topic_replace_params"
410
+ require_relative "courier/models/workspace_preferences/topic_retrieve_params"
411
+ require_relative "courier/models/workspace_preference_topic_get_response"
412
+ require_relative "courier/models/workspace_preference_topic_list_response"
413
413
  require_relative "courier/models"
414
414
  require_relative "courier/resources/audiences"
415
415
  require_relative "courier/resources/audit_events"
@@ -428,8 +428,6 @@ require_relative "courier/resources/lists/subscriptions"
428
428
  require_relative "courier/resources/messages"
429
429
  require_relative "courier/resources/notifications"
430
430
  require_relative "courier/resources/notifications/checks"
431
- require_relative "courier/resources/preference_sections"
432
- require_relative "courier/resources/preference_sections/topics"
433
431
  require_relative "courier/resources/profiles"
434
432
  require_relative "courier/resources/profiles/lists"
435
433
  require_relative "courier/resources/providers"
@@ -447,3 +445,5 @@ require_relative "courier/resources/users"
447
445
  require_relative "courier/resources/users/preferences"
448
446
  require_relative "courier/resources/users/tenants"
449
447
  require_relative "courier/resources/users/tokens"
448
+ require_relative "courier/resources/workspace_preferences"
449
+ require_relative "courier/resources/workspace_preferences/topics"
@@ -61,8 +61,8 @@ module Courier
61
61
  sig { returns(Courier::Resources::RoutingStrategies) }
62
62
  attr_reader :routing_strategies
63
63
 
64
- sig { returns(Courier::Resources::PreferenceSections) }
65
- attr_reader :preference_sections
64
+ sig { returns(Courier::Resources::WorkspacePreferences) }
65
+ attr_reader :workspace_preferences
66
66
 
67
67
  sig { returns(Courier::Resources::Profiles) }
68
68
  attr_reader :profiles
@@ -2,14 +2,14 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- class PreferenceSectionRetrieveParams < Courier::Internal::Type::BaseModel
5
+ class WorkspacePreferenceArchiveParams < Courier::Internal::Type::BaseModel
6
6
  extend Courier::Internal::Type::RequestParameters::Converter
7
7
  include Courier::Internal::Type::RequestParameters
8
8
 
9
9
  OrHash =
10
10
  T.type_alias do
11
11
  T.any(
12
- Courier::PreferenceSectionRetrieveParams,
12
+ Courier::WorkspacePreferenceArchiveParams,
13
13
  Courier::Internal::AnyHash
14
14
  )
15
15
  end
@@ -2,14 +2,14 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- class PreferenceSectionCreateParams < Courier::Models::PreferenceSectionCreateRequest
5
+ class WorkspacePreferenceCreateParams < Courier::Models::WorkspacePreferenceCreateRequest
6
6
  extend Courier::Internal::Type::RequestParameters::Converter
7
7
  include Courier::Internal::Type::RequestParameters
8
8
 
9
9
  OrHash =
10
10
  T.type_alias do
11
11
  T.any(
12
- Courier::PreferenceSectionCreateParams,
12
+ Courier::WorkspacePreferenceCreateParams,
13
13
  Courier::Internal::AnyHash
14
14
  )
15
15
  end
@@ -2,30 +2,30 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- class PreferenceSectionCreateRequest < Courier::Internal::Type::BaseModel
5
+ class WorkspacePreferenceCreateRequest < Courier::Internal::Type::BaseModel
6
6
  OrHash =
7
7
  T.type_alias do
8
8
  T.any(
9
- Courier::PreferenceSectionCreateRequest,
9
+ Courier::WorkspacePreferenceCreateRequest,
10
10
  Courier::Internal::AnyHash
11
11
  )
12
12
  end
13
13
 
14
- # Human-readable name for the section.
14
+ # Human-readable name for the workspace preference.
15
15
  sig { returns(String) }
16
16
  attr_accessor :name
17
17
 
18
- # Whether the section defines custom routing for its topics.
18
+ # Whether the workspace preference defines custom routing for its topics.
19
19
  sig { returns(T.nilable(T::Boolean)) }
20
20
  attr_accessor :has_custom_routing
21
21
 
22
- # Default channels for the section. Defaults to empty if omitted.
22
+ # Default channels for the workspace preference. Defaults to empty if omitted.
23
23
  sig do
24
24
  returns(T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]))
25
25
  end
26
26
  attr_accessor :routing_options
27
27
 
28
- # Request body for creating a preference section.
28
+ # Request body for creating a workspace preference.
29
29
  sig do
30
30
  params(
31
31
  name: String,
@@ -35,11 +35,11 @@ module Courier
35
35
  ).returns(T.attached_class)
36
36
  end
37
37
  def self.new(
38
- # Human-readable name for the section.
38
+ # Human-readable name for the workspace preference.
39
39
  name:,
40
- # Whether the section defines custom routing for its topics.
40
+ # Whether the workspace preference defines custom routing for its topics.
41
41
  has_custom_routing: nil,
42
- # Default channels for the section. Defaults to empty if omitted.
42
+ # Default channels for the workspace preference. Defaults to empty if omitted.
43
43
  routing_options: nil
44
44
  )
45
45
  end