trycourier 6.9.0 → 6.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 (108) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/lib/courier/client.rb +6 -0
  5. data/lib/courier/models/create_device_set_request.rb +27 -0
  6. data/lib/courier/models/device_set.rb +63 -0
  7. data/lib/courier/models/device_set_list_response.rb +18 -0
  8. data/lib/courier/models/notifications/previews/create_preview_run_request.rb +68 -0
  9. data/lib/courier/models/notifications/previews/preview_result.rb +67 -0
  10. data/lib/courier/models/notifications/previews/preview_result_failure_reason.rb +24 -0
  11. data/lib/courier/models/notifications/previews/preview_result_status.rb +29 -0
  12. data/lib/courier/models/notifications/previews/preview_run.rb +84 -0
  13. data/lib/courier/models/notifications/previews/preview_run_detail.rb +93 -0
  14. data/lib/courier/models/notifications/previews/preview_run_failure_reason.rb +28 -0
  15. data/lib/courier/models/notifications/previews/preview_run_list_response.rb +30 -0
  16. data/lib/courier/models/notifications/previews/preview_run_status.rb +28 -0
  17. data/lib/courier/models/notifications/previews/run_create_params.rb +36 -0
  18. data/lib/courier/models/notifications/previews/run_list_params.rb +41 -0
  19. data/lib/courier/models/notifications/previews/run_retrieve_params.rb +30 -0
  20. data/lib/courier/models/preference_change_log_entry.rb +94 -0
  21. data/lib/courier/models/preference_change_log_value.rb +32 -0
  22. data/lib/courier/models/preference_logs_list_response.rb +24 -0
  23. data/lib/courier/models/preview_archive_device_set_params.rb +20 -0
  24. data/lib/courier/models/preview_create_device_set_params.rb +14 -0
  25. data/lib/courier/models/preview_device.rb +125 -0
  26. data/lib/courier/models/preview_device_list_response.rb +18 -0
  27. data/lib/courier/models/preview_list_device_sets_params.rb +14 -0
  28. data/lib/courier/models/preview_list_devices_params.rb +14 -0
  29. data/lib/courier/models/preview_retrieve_device_set_params.rb +20 -0
  30. data/lib/courier/models/preview_update_device_set_params.rb +20 -0
  31. data/lib/courier/models/workspace_preference_list_logs_params.rb +61 -0
  32. data/lib/courier/models.rb +30 -0
  33. data/lib/courier/resources/notifications/previews/runs.rb +148 -0
  34. data/lib/courier/resources/notifications/previews.rb +22 -0
  35. data/lib/courier/resources/notifications.rb +4 -0
  36. data/lib/courier/resources/previews.rb +153 -0
  37. data/lib/courier/resources/workspace_preferences.rb +37 -0
  38. data/lib/courier/version.rb +1 -1
  39. data/lib/courier.rb +30 -0
  40. data/rbi/courier/client.rbi +5 -0
  41. data/rbi/courier/models/create_device_set_request.rbi +39 -0
  42. data/rbi/courier/models/device_set.rbi +81 -0
  43. data/rbi/courier/models/device_set_list_response.rbi +28 -0
  44. data/rbi/courier/models/notifications/previews/create_preview_run_request.rbi +110 -0
  45. data/rbi/courier/models/notifications/previews/preview_result.rbi +117 -0
  46. data/rbi/courier/models/notifications/previews/preview_result_failure_reason.rbi +44 -0
  47. data/rbi/courier/models/notifications/previews/preview_result_status.rbi +69 -0
  48. data/rbi/courier/models/notifications/previews/preview_run.rbi +134 -0
  49. data/rbi/courier/models/notifications/previews/preview_run_detail.rbi +148 -0
  50. data/rbi/courier/models/notifications/previews/preview_run_failure_reason.rbi +64 -0
  51. data/rbi/courier/models/notifications/previews/preview_run_list_response.rbi +54 -0
  52. data/rbi/courier/models/notifications/previews/preview_run_status.rbi +61 -0
  53. data/rbi/courier/models/notifications/previews/run_create_params.rbi +66 -0
  54. data/rbi/courier/models/notifications/previews/run_list_params.rbi +67 -0
  55. data/rbi/courier/models/notifications/previews/run_retrieve_params.rbi +50 -0
  56. data/rbi/courier/models/preference_change_log_entry.rbi +122 -0
  57. data/rbi/courier/models/preference_change_log_value.rbi +54 -0
  58. data/rbi/courier/models/preference_logs_list_response.rbi +46 -0
  59. data/rbi/courier/models/preview_archive_device_set_params.rbi +38 -0
  60. data/rbi/courier/models/preview_create_device_set_params.rbi +30 -0
  61. data/rbi/courier/models/preview_device.rbi +168 -0
  62. data/rbi/courier/models/preview_device_list_response.rbi +28 -0
  63. data/rbi/courier/models/preview_list_device_sets_params.rbi +30 -0
  64. data/rbi/courier/models/preview_list_devices_params.rbi +27 -0
  65. data/rbi/courier/models/preview_retrieve_device_set_params.rbi +38 -0
  66. data/rbi/courier/models/preview_update_device_set_params.rbi +38 -0
  67. data/rbi/courier/models/workspace_preference_list_logs_params.rbi +101 -0
  68. data/rbi/courier/models.rbi +32 -0
  69. data/rbi/courier/resources/notifications/previews/runs.rbi +136 -0
  70. data/rbi/courier/resources/notifications/previews.rbi +19 -0
  71. data/rbi/courier/resources/notifications.rbi +3 -0
  72. data/rbi/courier/resources/previews.rbi +106 -0
  73. data/rbi/courier/resources/workspace_preferences.rbi +33 -0
  74. data/sig/courier/client.rbs +2 -0
  75. data/sig/courier/models/create_device_set_request.rbs +16 -0
  76. data/sig/courier/models/device_set.rbs +47 -0
  77. data/sig/courier/models/device_set_list_response.rbs +13 -0
  78. data/sig/courier/models/notifications/previews/create_preview_run_request.rbs +54 -0
  79. data/sig/courier/models/notifications/previews/preview_result.rbs +50 -0
  80. data/sig/courier/models/notifications/previews/preview_result_failure_reason.rbs +19 -0
  81. data/sig/courier/models/notifications/previews/preview_result_status.rbs +30 -0
  82. data/sig/courier/models/notifications/previews/preview_run.rbs +62 -0
  83. data/sig/courier/models/notifications/previews/preview_run_detail.rbs +67 -0
  84. data/sig/courier/models/notifications/previews/preview_run_failure_reason.rbs +28 -0
  85. data/sig/courier/models/notifications/previews/preview_run_list_response.rbs +31 -0
  86. data/sig/courier/models/notifications/previews/preview_run_status.rbs +24 -0
  87. data/sig/courier/models/notifications/previews/run_create_params.rbs +46 -0
  88. data/sig/courier/models/notifications/previews/run_list_params.rbs +38 -0
  89. data/sig/courier/models/notifications/previews/run_retrieve_params.rbs +32 -0
  90. data/sig/courier/models/preference_change_log_entry.rbs +71 -0
  91. data/sig/courier/models/preference_change_log_value.rbs +30 -0
  92. data/sig/courier/models/preference_logs_list_response.rbs +25 -0
  93. data/sig/courier/models/preview_archive_device_set_params.rbs +23 -0
  94. data/sig/courier/models/preview_create_device_set_params.rbs +15 -0
  95. data/sig/courier/models/preview_device.rbs +83 -0
  96. data/sig/courier/models/preview_device_list_response.rbs +14 -0
  97. data/sig/courier/models/preview_list_device_sets_params.rbs +15 -0
  98. data/sig/courier/models/preview_list_devices_params.rbs +15 -0
  99. data/sig/courier/models/preview_retrieve_device_set_params.rbs +23 -0
  100. data/sig/courier/models/preview_update_device_set_params.rbs +25 -0
  101. data/sig/courier/models/workspace_preference_list_logs_params.rbs +56 -0
  102. data/sig/courier/models.rbs +30 -0
  103. data/sig/courier/resources/notifications/previews/runs.rbs +36 -0
  104. data/sig/courier/resources/notifications/previews.rbs +11 -0
  105. data/sig/courier/resources/notifications.rbs +2 -0
  106. data/sig/courier/resources/previews.rbs +38 -0
  107. data/sig/courier/resources/workspace_preferences.rbs +9 -0
  108. metadata +91 -1
@@ -0,0 +1,168 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class PreviewDevice < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::PreviewDevice, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ # The device's identifier, used in `device_ids` when creating a device set or a
12
+ # run.
13
+ sig { returns(String) }
14
+ attr_accessor :id
15
+
16
+ # The mail app. For webmail it is the service (`outlook_com`, `gmail_com`); for
17
+ # mobile the app (`apple_mail`, `gmail`); for desktop the app together with the
18
+ # version it is sold under (`outlook_2019`, `outlook_microsoft_365`,
19
+ # `apple_mail_16`), because that version is what separates one desktop Outlook
20
+ # from another.
21
+ sig { returns(String) }
22
+ attr_accessor :app
23
+
24
+ # Where the app runs.
25
+ sig { returns(Courier::PreviewDevice::Category::TaggedSymbol) }
26
+ attr_accessor :category
27
+
28
+ # Display name. Render it as-is rather than parsing it. It is also what separates
29
+ # the two 120-dpi Outlook renders from their 100% siblings, which are otherwise
30
+ # identical field for field.
31
+ sig { returns(String) }
32
+ attr_accessor :name
33
+
34
+ # The operating system.
35
+ sig { returns(String) }
36
+ attr_accessor :os
37
+
38
+ # The operating system's version. Always set.
39
+ sig { returns(String) }
40
+ attr_accessor :os_version
41
+
42
+ # What the app runs on — the browser for webmail (`chrome`, `edge`, `firefox`),
43
+ # the phone for mobile (`iphone`, `pixel`). Null for desktop, where the app runs
44
+ # on nothing but the OS.
45
+ sig { returns(T.nilable(String)) }
46
+ attr_accessor :platform
47
+
48
+ # Which one of the platform — the phone model for mobile (`15_pro_max`, `10`).
49
+ # Null for webmail, which always renders in the current browser, and for desktop.
50
+ sig { returns(T.nilable(String)) }
51
+ attr_accessor :platform_version
52
+
53
+ # Whether the email is rendered in light or dark mode.
54
+ sig { returns(Courier::PreviewDevice::Theme::TaggedSymbol) }
55
+ attr_accessor :theme
56
+
57
+ # One mail app on one platform, operating system and theme that a preview can be
58
+ # rendered on. Reference data, identical for every workspace. Every field is
59
+ # always present; `platform` and `platform_version` are null where they do not
60
+ # apply.
61
+ sig do
62
+ params(
63
+ id: String,
64
+ app: String,
65
+ category: Courier::PreviewDevice::Category::OrSymbol,
66
+ name: String,
67
+ os: String,
68
+ os_version: String,
69
+ platform: T.nilable(String),
70
+ platform_version: T.nilable(String),
71
+ theme: Courier::PreviewDevice::Theme::OrSymbol
72
+ ).returns(T.attached_class)
73
+ end
74
+ def self.new(
75
+ # The device's identifier, used in `device_ids` when creating a device set or a
76
+ # run.
77
+ id:,
78
+ # The mail app. For webmail it is the service (`outlook_com`, `gmail_com`); for
79
+ # mobile the app (`apple_mail`, `gmail`); for desktop the app together with the
80
+ # version it is sold under (`outlook_2019`, `outlook_microsoft_365`,
81
+ # `apple_mail_16`), because that version is what separates one desktop Outlook
82
+ # from another.
83
+ app:,
84
+ # Where the app runs.
85
+ category:,
86
+ # Display name. Render it as-is rather than parsing it. It is also what separates
87
+ # the two 120-dpi Outlook renders from their 100% siblings, which are otherwise
88
+ # identical field for field.
89
+ name:,
90
+ # The operating system.
91
+ os:,
92
+ # The operating system's version. Always set.
93
+ os_version:,
94
+ # What the app runs on — the browser for webmail (`chrome`, `edge`, `firefox`),
95
+ # the phone for mobile (`iphone`, `pixel`). Null for desktop, where the app runs
96
+ # on nothing but the OS.
97
+ platform:,
98
+ # Which one of the platform — the phone model for mobile (`15_pro_max`, `10`).
99
+ # Null for webmail, which always renders in the current browser, and for desktop.
100
+ platform_version:,
101
+ # Whether the email is rendered in light or dark mode.
102
+ theme:
103
+ )
104
+ end
105
+
106
+ sig do
107
+ override.returns(
108
+ {
109
+ id: String,
110
+ app: String,
111
+ category: Courier::PreviewDevice::Category::TaggedSymbol,
112
+ name: String,
113
+ os: String,
114
+ os_version: String,
115
+ platform: T.nilable(String),
116
+ platform_version: T.nilable(String),
117
+ theme: Courier::PreviewDevice::Theme::TaggedSymbol
118
+ }
119
+ )
120
+ end
121
+ def to_hash
122
+ end
123
+
124
+ # Where the app runs.
125
+ module Category
126
+ extend Courier::Internal::Type::Enum
127
+
128
+ TaggedSymbol =
129
+ T.type_alias { T.all(Symbol, Courier::PreviewDevice::Category) }
130
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
131
+
132
+ WEBMAIL =
133
+ T.let(:webmail, Courier::PreviewDevice::Category::TaggedSymbol)
134
+ MOBILE = T.let(:mobile, Courier::PreviewDevice::Category::TaggedSymbol)
135
+ DESKTOP =
136
+ T.let(:desktop, Courier::PreviewDevice::Category::TaggedSymbol)
137
+
138
+ sig do
139
+ override.returns(
140
+ T::Array[Courier::PreviewDevice::Category::TaggedSymbol]
141
+ )
142
+ end
143
+ def self.values
144
+ end
145
+ end
146
+
147
+ # Whether the email is rendered in light or dark mode.
148
+ module Theme
149
+ extend Courier::Internal::Type::Enum
150
+
151
+ TaggedSymbol =
152
+ T.type_alias { T.all(Symbol, Courier::PreviewDevice::Theme) }
153
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
154
+
155
+ LIGHT = T.let(:light, Courier::PreviewDevice::Theme::TaggedSymbol)
156
+ DARK = T.let(:dark, Courier::PreviewDevice::Theme::TaggedSymbol)
157
+
158
+ sig do
159
+ override.returns(
160
+ T::Array[Courier::PreviewDevice::Theme::TaggedSymbol]
161
+ )
162
+ end
163
+ def self.values
164
+ end
165
+ end
166
+ end
167
+ end
168
+ end
@@ -0,0 +1,28 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class PreviewDeviceListResponse < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::PreviewDeviceListResponse, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(T::Array[Courier::PreviewDevice]) }
12
+ attr_accessor :results
13
+
14
+ # The full catalog of renderable devices. Not paginated.
15
+ sig do
16
+ params(results: T::Array[Courier::PreviewDevice::OrHash]).returns(
17
+ T.attached_class
18
+ )
19
+ end
20
+ def self.new(results:)
21
+ end
22
+
23
+ sig { override.returns({ results: T::Array[Courier::PreviewDevice] }) }
24
+ def to_hash
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,30 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class PreviewListDeviceSetsParams < Courier::Internal::Type::BaseModel
6
+ extend Courier::Internal::Type::RequestParameters::Converter
7
+ include Courier::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ Courier::PreviewListDeviceSetsParams,
13
+ Courier::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig do
18
+ params(request_options: Courier::RequestOptions::OrHash).returns(
19
+ T.attached_class
20
+ )
21
+ end
22
+ def self.new(request_options: {})
23
+ end
24
+
25
+ sig { override.returns({ request_options: Courier::RequestOptions }) }
26
+ def to_hash
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,27 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class PreviewListDevicesParams < Courier::Internal::Type::BaseModel
6
+ extend Courier::Internal::Type::RequestParameters::Converter
7
+ include Courier::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Courier::PreviewListDevicesParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ sig do
15
+ params(request_options: Courier::RequestOptions::OrHash).returns(
16
+ T.attached_class
17
+ )
18
+ end
19
+ def self.new(request_options: {})
20
+ end
21
+
22
+ sig { override.returns({ request_options: Courier::RequestOptions }) }
23
+ def to_hash
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,38 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class PreviewRetrieveDeviceSetParams < Courier::Internal::Type::BaseModel
6
+ extend Courier::Internal::Type::RequestParameters::Converter
7
+ include Courier::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ Courier::PreviewRetrieveDeviceSetParams,
13
+ Courier::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :device_set_id
19
+
20
+ sig do
21
+ params(
22
+ device_set_id: String,
23
+ request_options: Courier::RequestOptions::OrHash
24
+ ).returns(T.attached_class)
25
+ end
26
+ def self.new(device_set_id:, request_options: {})
27
+ end
28
+
29
+ sig do
30
+ override.returns(
31
+ { device_set_id: String, request_options: Courier::RequestOptions }
32
+ )
33
+ end
34
+ def to_hash
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,38 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class PreviewUpdateDeviceSetParams < Courier::Models::CreateDeviceSetRequest
6
+ extend Courier::Internal::Type::RequestParameters::Converter
7
+ include Courier::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ Courier::PreviewUpdateDeviceSetParams,
13
+ Courier::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :device_set_id
19
+
20
+ sig do
21
+ params(
22
+ device_set_id: String,
23
+ request_options: Courier::RequestOptions::OrHash
24
+ ).returns(T.attached_class)
25
+ end
26
+ def self.new(device_set_id:, request_options: {})
27
+ end
28
+
29
+ sig do
30
+ override.returns(
31
+ { device_set_id: String, request_options: Courier::RequestOptions }
32
+ )
33
+ end
34
+ def to_hash
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,101 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class WorkspacePreferenceListLogsParams < Courier::Internal::Type::BaseModel
6
+ extend Courier::Internal::Type::RequestParameters::Converter
7
+ include Courier::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ Courier::WorkspacePreferenceListLogsParams,
13
+ Courier::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # A cursor from a previous response's paging.cursor. Continue only while
18
+ # paging.more is true; the cursor is omitted on the last page.
19
+ sig { returns(T.nilable(String)) }
20
+ attr_reader :cursor
21
+
22
+ sig { params(cursor: String).void }
23
+ attr_writer :cursor
24
+
25
+ # How many entries to return. Defaults to 25.
26
+ sig { returns(T.nilable(Integer)) }
27
+ attr_reader :limit
28
+
29
+ sig { params(limit: Integer).void }
30
+ attr_writer :limit
31
+
32
+ # Return only changes at or after this time, as an ISO-8601 date or date-time. A
33
+ # date alone is read as the start of that day in UTC.
34
+ sig { returns(T.nilable(String)) }
35
+ attr_reader :since
36
+
37
+ sig { params(since: String).void }
38
+ attr_writer :since
39
+
40
+ # Narrow to the changes this user made in one tenant context. Only valid together
41
+ # with user_id.
42
+ sig { returns(T.nilable(String)) }
43
+ attr_reader :tenant_id
44
+
45
+ sig { params(tenant_id: String).void }
46
+ attr_writer :tenant_id
47
+
48
+ # Return only this user's changes. Omit it to read every change in the
49
+ # environment.
50
+ sig { returns(T.nilable(String)) }
51
+ attr_reader :user_id
52
+
53
+ sig { params(user_id: String).void }
54
+ attr_writer :user_id
55
+
56
+ sig do
57
+ params(
58
+ cursor: String,
59
+ limit: Integer,
60
+ since: String,
61
+ tenant_id: String,
62
+ user_id: String,
63
+ request_options: Courier::RequestOptions::OrHash
64
+ ).returns(T.attached_class)
65
+ end
66
+ def self.new(
67
+ # A cursor from a previous response's paging.cursor. Continue only while
68
+ # paging.more is true; the cursor is omitted on the last page.
69
+ cursor: nil,
70
+ # How many entries to return. Defaults to 25.
71
+ limit: nil,
72
+ # Return only changes at or after this time, as an ISO-8601 date or date-time. A
73
+ # date alone is read as the start of that day in UTC.
74
+ since: nil,
75
+ # Narrow to the changes this user made in one tenant context. Only valid together
76
+ # with user_id.
77
+ tenant_id: nil,
78
+ # Return only this user's changes. Omit it to read every change in the
79
+ # environment.
80
+ user_id: nil,
81
+ request_options: {}
82
+ )
83
+ end
84
+
85
+ sig do
86
+ override.returns(
87
+ {
88
+ cursor: String,
89
+ limit: Integer,
90
+ since: String,
91
+ tenant_id: String,
92
+ user_id: String,
93
+ request_options: Courier::RequestOptions
94
+ }
95
+ )
96
+ end
97
+ def to_hash
98
+ end
99
+ end
100
+ end
101
+ end
@@ -144,10 +144,16 @@ module Courier
144
144
 
145
145
  CreateBroadcastRequest = Courier::Models::CreateBroadcastRequest
146
146
 
147
+ CreateDeviceSetRequest = Courier::Models::CreateDeviceSetRequest
148
+
147
149
  CreateJourneyRequest = Courier::Models::CreateJourneyRequest
148
150
 
149
151
  DefaultPreferences = Courier::Models::DefaultPreferences
150
152
 
153
+ DeviceSet = Courier::Models::DeviceSet
154
+
155
+ DeviceSetListResponse = Courier::Models::DeviceSetListResponse
156
+
151
157
  DeviceType = Courier::Models::DeviceType
152
158
 
153
159
  DigestCategory = Courier::Models::DigestCategory
@@ -495,8 +501,31 @@ module Courier
495
501
 
496
502
  Preference = Courier::Models::Preference
497
503
 
504
+ PreferenceChangeLogEntry = Courier::Models::PreferenceChangeLogEntry
505
+
506
+ PreferenceChangeLogValue = Courier::Models::PreferenceChangeLogValue
507
+
508
+ PreferenceLogsListResponse = Courier::Models::PreferenceLogsListResponse
509
+
498
510
  PreferenceStatus = Courier::Models::PreferenceStatus
499
511
 
512
+ PreviewArchiveDeviceSetParams = Courier::Models::PreviewArchiveDeviceSetParams
513
+
514
+ PreviewCreateDeviceSetParams = Courier::Models::PreviewCreateDeviceSetParams
515
+
516
+ PreviewDevice = Courier::Models::PreviewDevice
517
+
518
+ PreviewDeviceListResponse = Courier::Models::PreviewDeviceListResponse
519
+
520
+ PreviewListDeviceSetsParams = Courier::Models::PreviewListDeviceSetsParams
521
+
522
+ PreviewListDevicesParams = Courier::Models::PreviewListDevicesParams
523
+
524
+ PreviewRetrieveDeviceSetParams =
525
+ Courier::Models::PreviewRetrieveDeviceSetParams
526
+
527
+ PreviewUpdateDeviceSetParams = Courier::Models::PreviewUpdateDeviceSetParams
528
+
500
529
  ProfileCreateParams = Courier::Models::ProfileCreateParams
501
530
 
502
531
  ProfileDeleteParams = Courier::Models::ProfileDeleteParams
@@ -682,6 +711,9 @@ module Courier
682
711
  WorkspacePreferenceGetResponse =
683
712
  Courier::Models::WorkspacePreferenceGetResponse
684
713
 
714
+ WorkspacePreferenceListLogsParams =
715
+ Courier::Models::WorkspacePreferenceListLogsParams
716
+
685
717
  WorkspacePreferenceListParams = Courier::Models::WorkspacePreferenceListParams
686
718
 
687
719
  WorkspacePreferenceListResponse =
@@ -0,0 +1,136 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Resources
5
+ class Notifications
6
+ class Previews
7
+ # Render a template's email content on real email clients and read back the
8
+ # screenshots, so you can check how it looks before you send it.
9
+ class Runs
10
+ # Render this template's email content on each of the requested devices.
11
+ #
12
+ # Returns as soon as the run exists and its render is queued — the screenshots are
13
+ # produced asynchronously. Poll
14
+ # `GET /notifications/{id}/previews/runs/{previewRunId}` until every result
15
+ # reaches a terminal status.
16
+ #
17
+ # Name the devices either with `device_set_id`, for a saved set, or with
18
+ # `device_ids`, for a one-off list. Exactly one of the two is required. Inline
19
+ # `device_ids` must be ids listed by `GET /previews/devices`; any other id is a
20
+ # 422, refused before the run exists or is billed.
21
+ #
22
+ # A template that does not exist is a 404. One that exists but cannot be previewed
23
+ # — not a Design Studio template, no email channel, or no such `template_version`
24
+ # — is a 422, also refused before the run exists or is billed.
25
+ #
26
+ # Preview runs are a metered add-on. A workspace without it, or with its billing
27
+ # suspended, receives a 402.
28
+ sig do
29
+ params(
30
+ id: String,
31
+ data: T::Hash[Symbol, T.anything],
32
+ device_ids: T::Array[String],
33
+ device_set_id: String,
34
+ locale: String,
35
+ template_version: String,
36
+ idempotency_key: String,
37
+ x_idempotency_expiration: String,
38
+ request_options: Courier::RequestOptions::OrHash
39
+ ).returns(Courier::Notifications::Previews::PreviewRun)
40
+ end
41
+ def create(
42
+ # Path param: Template ID (nt\_ prefix). Must be a Design Studio template.
43
+ id,
44
+ # Body param: Template variables to render with, the same shape as the `data`
45
+ # object on a send.
46
+ data: nil,
47
+ # Body param: The devices to render on, by `PreviewDevice.id`, for a one-off run.
48
+ # Mutually exclusive with `device_set_id`.
49
+ device_ids: nil,
50
+ # Body param: A saved device set naming the devices to render on. Mutually
51
+ # exclusive with `device_ids`.
52
+ device_set_id: nil,
53
+ # Body param: Render the template's content for this locale, e.g. "fr-FR".
54
+ locale: nil,
55
+ # Body param: Which version of the template to render. Omit for the latest saved
56
+ # draft, which always exists and is what the editor shows. `published` renders the
57
+ # live version; a zero-padded `v002` renders that specific publish. Versions are
58
+ # 1-based, so `v000` is not a version, and the unpadded `v2` is rejected — that
59
+ # spelling belongs to journeys' AutomationVersionId, a different scheme in which
60
+ # `v0` means published.
61
+ template_version: nil,
62
+ # Header param: A unique key that makes this request idempotent. If Courier
63
+ # receives another request with the same `Idempotency-Key`, it returns the stored
64
+ # response from the first request without performing the operation again
65
+ # (including the original status code and any error). Use it to safely retry
66
+ # `POST` requests after network failures without risking duplicate sends. The key
67
+ # is scoped to this endpoint.
68
+ idempotency_key: nil,
69
+ # Header param: How long the idempotency key remains valid, as a Unix epoch
70
+ # timestamp in seconds or an ISO 8601 date string. Only applies when
71
+ # `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
72
+ # maximum is 1 year.
73
+ x_idempotency_expiration: nil,
74
+ request_options: {}
75
+ )
76
+ end
77
+
78
+ # Retrieve one of this template's preview runs together with its per-device
79
+ # results.
80
+ #
81
+ # A run is only readable under the template it previewed: under any other template
82
+ # it is a 404, the same as a run that does not exist.
83
+ #
84
+ # `thumbnail_url` and `screenshot_url` are short-lived signed URLs, re-signed on
85
+ # every read. Fetch them now rather than storing them. Both are null until
86
+ # Courier's own copy of the image exists, which is what `status: COMPLETED` on a
87
+ # result means.
88
+ sig do
89
+ params(
90
+ preview_run_id: String,
91
+ id: String,
92
+ request_options: Courier::RequestOptions::OrHash
93
+ ).returns(Courier::Notifications::Previews::PreviewRunDetail)
94
+ end
95
+ def retrieve(
96
+ # The preview run to retrieve, identified by the `id` returned when it was
97
+ # created.
98
+ preview_run_id,
99
+ # Template ID (nt\_ prefix).
100
+ id:,
101
+ request_options: {}
102
+ )
103
+ end
104
+
105
+ # List this template's preview runs, newest first. Cursor-paginated.
106
+ #
107
+ # A template that does not exist is a 404, the same as every other
108
+ # `/notifications/{id}` route.
109
+ sig do
110
+ params(
111
+ id: String,
112
+ cursor: T.nilable(String),
113
+ limit: Integer,
114
+ request_options: Courier::RequestOptions::OrHash
115
+ ).returns(Courier::Notifications::Previews::PreviewRunListResponse)
116
+ end
117
+ def list(
118
+ # Template ID (nt\_ prefix).
119
+ id,
120
+ # Opaque pagination cursor from a previous response. Omit for the first page.
121
+ cursor: nil,
122
+ # Maximum number of results per page.
123
+ limit: nil,
124
+ request_options: {}
125
+ )
126
+ end
127
+
128
+ # @api private
129
+ sig { params(client: Courier::Client).returns(T.attached_class) }
130
+ def self.new(client:)
131
+ end
132
+ end
133
+ end
134
+ end
135
+ end
136
+ end
@@ -0,0 +1,19 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Resources
5
+ class Notifications
6
+ class Previews
7
+ # Render a template's email content on real email clients and read back the
8
+ # screenshots, so you can check how it looks before you send it.
9
+ sig { returns(Courier::Resources::Notifications::Previews::Runs) }
10
+ attr_reader :runs
11
+
12
+ # @api private
13
+ sig { params(client: Courier::Client).returns(T.attached_class) }
14
+ def self.new(client:)
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -10,6 +10,9 @@ module Courier
10
10
  sig { returns(Courier::Resources::Notifications::Checks) }
11
11
  attr_reader :checks
12
12
 
13
+ sig { returns(Courier::Resources::Notifications::Previews) }
14
+ attr_reader :previews
15
+
13
16
  # Create a notification template. Requires all fields in the notification object.
14
17
  # Templates are created in draft state by default.
15
18
  #