trycourier 6.10.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 (93) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -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/preview_archive_device_set_params.rb +20 -0
  21. data/lib/courier/models/preview_create_device_set_params.rb +14 -0
  22. data/lib/courier/models/preview_device.rb +125 -0
  23. data/lib/courier/models/preview_device_list_response.rb +18 -0
  24. data/lib/courier/models/preview_list_device_sets_params.rb +14 -0
  25. data/lib/courier/models/preview_list_devices_params.rb +14 -0
  26. data/lib/courier/models/preview_retrieve_device_set_params.rb +20 -0
  27. data/lib/courier/models/preview_update_device_set_params.rb +20 -0
  28. data/lib/courier/models.rb +22 -0
  29. data/lib/courier/resources/notifications/previews/runs.rb +148 -0
  30. data/lib/courier/resources/notifications/previews.rb +22 -0
  31. data/lib/courier/resources/notifications.rb +4 -0
  32. data/lib/courier/resources/previews.rb +153 -0
  33. data/lib/courier/version.rb +1 -1
  34. data/lib/courier.rb +26 -0
  35. data/rbi/courier/client.rbi +5 -0
  36. data/rbi/courier/models/create_device_set_request.rbi +39 -0
  37. data/rbi/courier/models/device_set.rbi +81 -0
  38. data/rbi/courier/models/device_set_list_response.rbi +28 -0
  39. data/rbi/courier/models/notifications/previews/create_preview_run_request.rbi +110 -0
  40. data/rbi/courier/models/notifications/previews/preview_result.rbi +117 -0
  41. data/rbi/courier/models/notifications/previews/preview_result_failure_reason.rbi +44 -0
  42. data/rbi/courier/models/notifications/previews/preview_result_status.rbi +69 -0
  43. data/rbi/courier/models/notifications/previews/preview_run.rbi +134 -0
  44. data/rbi/courier/models/notifications/previews/preview_run_detail.rbi +148 -0
  45. data/rbi/courier/models/notifications/previews/preview_run_failure_reason.rbi +64 -0
  46. data/rbi/courier/models/notifications/previews/preview_run_list_response.rbi +54 -0
  47. data/rbi/courier/models/notifications/previews/preview_run_status.rbi +61 -0
  48. data/rbi/courier/models/notifications/previews/run_create_params.rbi +66 -0
  49. data/rbi/courier/models/notifications/previews/run_list_params.rbi +67 -0
  50. data/rbi/courier/models/notifications/previews/run_retrieve_params.rbi +50 -0
  51. data/rbi/courier/models/preview_archive_device_set_params.rbi +38 -0
  52. data/rbi/courier/models/preview_create_device_set_params.rbi +30 -0
  53. data/rbi/courier/models/preview_device.rbi +168 -0
  54. data/rbi/courier/models/preview_device_list_response.rbi +28 -0
  55. data/rbi/courier/models/preview_list_device_sets_params.rbi +30 -0
  56. data/rbi/courier/models/preview_list_devices_params.rbi +27 -0
  57. data/rbi/courier/models/preview_retrieve_device_set_params.rbi +38 -0
  58. data/rbi/courier/models/preview_update_device_set_params.rbi +38 -0
  59. data/rbi/courier/models.rbi +23 -0
  60. data/rbi/courier/resources/notifications/previews/runs.rbi +136 -0
  61. data/rbi/courier/resources/notifications/previews.rbi +19 -0
  62. data/rbi/courier/resources/notifications.rbi +3 -0
  63. data/rbi/courier/resources/previews.rbi +106 -0
  64. data/sig/courier/client.rbs +2 -0
  65. data/sig/courier/models/create_device_set_request.rbs +16 -0
  66. data/sig/courier/models/device_set.rbs +47 -0
  67. data/sig/courier/models/device_set_list_response.rbs +13 -0
  68. data/sig/courier/models/notifications/previews/create_preview_run_request.rbs +54 -0
  69. data/sig/courier/models/notifications/previews/preview_result.rbs +50 -0
  70. data/sig/courier/models/notifications/previews/preview_result_failure_reason.rbs +19 -0
  71. data/sig/courier/models/notifications/previews/preview_result_status.rbs +30 -0
  72. data/sig/courier/models/notifications/previews/preview_run.rbs +62 -0
  73. data/sig/courier/models/notifications/previews/preview_run_detail.rbs +67 -0
  74. data/sig/courier/models/notifications/previews/preview_run_failure_reason.rbs +28 -0
  75. data/sig/courier/models/notifications/previews/preview_run_list_response.rbs +31 -0
  76. data/sig/courier/models/notifications/previews/preview_run_status.rbs +24 -0
  77. data/sig/courier/models/notifications/previews/run_create_params.rbs +46 -0
  78. data/sig/courier/models/notifications/previews/run_list_params.rbs +38 -0
  79. data/sig/courier/models/notifications/previews/run_retrieve_params.rbs +32 -0
  80. data/sig/courier/models/preview_archive_device_set_params.rbs +23 -0
  81. data/sig/courier/models/preview_create_device_set_params.rbs +15 -0
  82. data/sig/courier/models/preview_device.rbs +83 -0
  83. data/sig/courier/models/preview_device_list_response.rbs +14 -0
  84. data/sig/courier/models/preview_list_device_sets_params.rbs +15 -0
  85. data/sig/courier/models/preview_list_devices_params.rbs +15 -0
  86. data/sig/courier/models/preview_retrieve_device_set_params.rbs +23 -0
  87. data/sig/courier/models/preview_update_device_set_params.rbs +25 -0
  88. data/sig/courier/models.rbs +22 -0
  89. data/sig/courier/resources/notifications/previews/runs.rbs +36 -0
  90. data/sig/courier/resources/notifications/previews.rbs +11 -0
  91. data/sig/courier/resources/notifications.rbs +2 -0
  92. data/sig/courier/resources/previews.rbs +38 -0
  93. metadata +79 -1
@@ -0,0 +1,69 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Notifications
6
+ PreviewResultStatus = Previews::PreviewResultStatus
7
+
8
+ module Previews
9
+ # One device's outcome. `COMPLETED` means the screenshot exists and its URLs are
10
+ # populated. `UNSUPPORTED`, `TIMED_OUT` and `FAILED` are all terminal, and none
11
+ # stands in for another — `UNSUPPORTED` means the device was retired at the
12
+ # vendor, `TIMED_OUT` means it did not report in time.
13
+ module PreviewResultStatus
14
+ extend Courier::Internal::Type::Enum
15
+
16
+ TaggedSymbol =
17
+ T.type_alias do
18
+ T.all(
19
+ Symbol,
20
+ Courier::Notifications::Previews::PreviewResultStatus
21
+ )
22
+ end
23
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
24
+
25
+ PENDING =
26
+ T.let(
27
+ :PENDING,
28
+ Courier::Notifications::Previews::PreviewResultStatus::TaggedSymbol
29
+ )
30
+ PROCESSING =
31
+ T.let(
32
+ :PROCESSING,
33
+ Courier::Notifications::Previews::PreviewResultStatus::TaggedSymbol
34
+ )
35
+ COMPLETED =
36
+ T.let(
37
+ :COMPLETED,
38
+ Courier::Notifications::Previews::PreviewResultStatus::TaggedSymbol
39
+ )
40
+ UNSUPPORTED =
41
+ T.let(
42
+ :UNSUPPORTED,
43
+ Courier::Notifications::Previews::PreviewResultStatus::TaggedSymbol
44
+ )
45
+ TIMED_OUT =
46
+ T.let(
47
+ :TIMED_OUT,
48
+ Courier::Notifications::Previews::PreviewResultStatus::TaggedSymbol
49
+ )
50
+ FAILED =
51
+ T.let(
52
+ :FAILED,
53
+ Courier::Notifications::Previews::PreviewResultStatus::TaggedSymbol
54
+ )
55
+
56
+ sig do
57
+ override.returns(
58
+ T::Array[
59
+ Courier::Notifications::Previews::PreviewResultStatus::TaggedSymbol
60
+ ]
61
+ )
62
+ end
63
+ def self.values
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,134 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Notifications
6
+ PreviewRun = Previews::PreviewRun
7
+
8
+ module Previews
9
+ class PreviewRun < Courier::Internal::Type::BaseModel
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Courier::Notifications::Previews::PreviewRun,
14
+ Courier::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ # Unique identifier for the preview run.
19
+ sig { returns(String) }
20
+ attr_accessor :id
21
+
22
+ # ISO-8601 timestamp of when the run was created.
23
+ sig { returns(String) }
24
+ attr_accessor :created_at
25
+
26
+ # The devices this run was submitted for, snapshotted when the run was created.
27
+ sig { returns(T::Array[String]) }
28
+ attr_accessor :device_ids
29
+
30
+ # Where the run itself has got to. `PENDING` and `RENDERED` mean Courier is still
31
+ # preparing the email, `SUBMITTED` means it is with the rendering service, and
32
+ # `COMPLETED` means every device has reported. `FAILED` is the run as a whole
33
+ # failing — an individual device failing never fails the run.
34
+ sig do
35
+ returns(
36
+ Courier::Notifications::Previews::PreviewRunStatus::TaggedSymbol
37
+ )
38
+ end
39
+ attr_accessor :status
40
+
41
+ # The template that was rendered.
42
+ sig { returns(String) }
43
+ attr_accessor :template_id
44
+
45
+ # Why the run failed, when `status` is `FAILED`. `NO_EMAIL_CHANNEL` and
46
+ # `TEMPLATE_NOT_SUPPORTED` mean there was nothing to render;
47
+ # `ALL_DEVICES_UNSUPPORTED` means every requested device has been retired and the
48
+ # request can be fixed by choosing others.
49
+ sig do
50
+ returns(
51
+ T.nilable(
52
+ Courier::Notifications::Previews::PreviewRunFailureReason::TaggedSymbol
53
+ )
54
+ )
55
+ end
56
+ attr_reader :failure_reason
57
+
58
+ sig do
59
+ params(
60
+ failure_reason:
61
+ Courier::Notifications::Previews::PreviewRunFailureReason::OrSymbol
62
+ ).void
63
+ end
64
+ attr_writer :failure_reason
65
+
66
+ # The version of the template that was rendered — `draft`, or a zero-padded
67
+ # published version such as `v002`. Absent until the render settles.
68
+ sig { returns(T.nilable(String)) }
69
+ attr_reader :template_version
70
+
71
+ sig { params(template_version: String).void }
72
+ attr_writer :template_version
73
+
74
+ # One render of a template across a set of devices. Billable.
75
+ sig do
76
+ params(
77
+ id: String,
78
+ created_at: String,
79
+ device_ids: T::Array[String],
80
+ status:
81
+ Courier::Notifications::Previews::PreviewRunStatus::OrSymbol,
82
+ template_id: String,
83
+ failure_reason:
84
+ Courier::Notifications::Previews::PreviewRunFailureReason::OrSymbol,
85
+ template_version: String
86
+ ).returns(T.attached_class)
87
+ end
88
+ def self.new(
89
+ # Unique identifier for the preview run.
90
+ id:,
91
+ # ISO-8601 timestamp of when the run was created.
92
+ created_at:,
93
+ # The devices this run was submitted for, snapshotted when the run was created.
94
+ device_ids:,
95
+ # Where the run itself has got to. `PENDING` and `RENDERED` mean Courier is still
96
+ # preparing the email, `SUBMITTED` means it is with the rendering service, and
97
+ # `COMPLETED` means every device has reported. `FAILED` is the run as a whole
98
+ # failing — an individual device failing never fails the run.
99
+ status:,
100
+ # The template that was rendered.
101
+ template_id:,
102
+ # Why the run failed, when `status` is `FAILED`. `NO_EMAIL_CHANNEL` and
103
+ # `TEMPLATE_NOT_SUPPORTED` mean there was nothing to render;
104
+ # `ALL_DEVICES_UNSUPPORTED` means every requested device has been retired and the
105
+ # request can be fixed by choosing others.
106
+ failure_reason: nil,
107
+ # The version of the template that was rendered — `draft`, or a zero-padded
108
+ # published version such as `v002`. Absent until the render settles.
109
+ template_version: nil
110
+ )
111
+ end
112
+
113
+ sig do
114
+ override.returns(
115
+ {
116
+ id: String,
117
+ created_at: String,
118
+ device_ids: T::Array[String],
119
+ status:
120
+ Courier::Notifications::Previews::PreviewRunStatus::TaggedSymbol,
121
+ template_id: String,
122
+ failure_reason:
123
+ Courier::Notifications::Previews::PreviewRunFailureReason::TaggedSymbol,
124
+ template_version: String
125
+ }
126
+ )
127
+ end
128
+ def to_hash
129
+ end
130
+ end
131
+ end
132
+ end
133
+ end
134
+ end
@@ -0,0 +1,148 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Notifications
6
+ PreviewRunDetail = Previews::PreviewRunDetail
7
+
8
+ module Previews
9
+ class PreviewRunDetail < Courier::Internal::Type::BaseModel
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Courier::Notifications::Previews::PreviewRunDetail,
14
+ Courier::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ # Unique identifier for the preview run.
19
+ sig { returns(String) }
20
+ attr_accessor :id
21
+
22
+ # ISO-8601 timestamp of when the run was created.
23
+ sig { returns(String) }
24
+ attr_accessor :created_at
25
+
26
+ # The devices this run was submitted for, snapshotted when the run was created.
27
+ sig { returns(T::Array[String]) }
28
+ attr_accessor :device_ids
29
+
30
+ # One entry per device in `device_ids`.
31
+ sig do
32
+ returns(T::Array[Courier::Notifications::Previews::PreviewResult])
33
+ end
34
+ attr_accessor :results
35
+
36
+ # Where the run itself has got to. `PENDING` and `RENDERED` mean Courier is still
37
+ # preparing the email, `SUBMITTED` means it is with the rendering service, and
38
+ # `COMPLETED` means every device has reported. `FAILED` is the run as a whole
39
+ # failing — an individual device failing never fails the run.
40
+ sig do
41
+ returns(
42
+ Courier::Notifications::Previews::PreviewRunStatus::TaggedSymbol
43
+ )
44
+ end
45
+ attr_accessor :status
46
+
47
+ # The template that was rendered.
48
+ sig { returns(String) }
49
+ attr_accessor :template_id
50
+
51
+ # Why the run failed, when `status` is `FAILED`. `NO_EMAIL_CHANNEL` and
52
+ # `TEMPLATE_NOT_SUPPORTED` mean there was nothing to render;
53
+ # `ALL_DEVICES_UNSUPPORTED` means every requested device has been retired and the
54
+ # request can be fixed by choosing others.
55
+ sig do
56
+ returns(
57
+ T.nilable(
58
+ Courier::Notifications::Previews::PreviewRunFailureReason::TaggedSymbol
59
+ )
60
+ )
61
+ end
62
+ attr_reader :failure_reason
63
+
64
+ sig do
65
+ params(
66
+ failure_reason:
67
+ Courier::Notifications::Previews::PreviewRunFailureReason::OrSymbol
68
+ ).void
69
+ end
70
+ attr_writer :failure_reason
71
+
72
+ # The version of the template that was rendered — `draft`, or a zero-padded
73
+ # published version such as `v002`. Absent until the render settles.
74
+ sig { returns(T.nilable(String)) }
75
+ attr_reader :template_version
76
+
77
+ sig { params(template_version: String).void }
78
+ attr_writer :template_version
79
+
80
+ # A preview run together with its per-device results.
81
+ sig do
82
+ params(
83
+ id: String,
84
+ created_at: String,
85
+ device_ids: T::Array[String],
86
+ results:
87
+ T::Array[
88
+ Courier::Notifications::Previews::PreviewResult::OrHash
89
+ ],
90
+ status:
91
+ Courier::Notifications::Previews::PreviewRunStatus::OrSymbol,
92
+ template_id: String,
93
+ failure_reason:
94
+ Courier::Notifications::Previews::PreviewRunFailureReason::OrSymbol,
95
+ template_version: String
96
+ ).returns(T.attached_class)
97
+ end
98
+ def self.new(
99
+ # Unique identifier for the preview run.
100
+ id:,
101
+ # ISO-8601 timestamp of when the run was created.
102
+ created_at:,
103
+ # The devices this run was submitted for, snapshotted when the run was created.
104
+ device_ids:,
105
+ # One entry per device in `device_ids`.
106
+ results:,
107
+ # Where the run itself has got to. `PENDING` and `RENDERED` mean Courier is still
108
+ # preparing the email, `SUBMITTED` means it is with the rendering service, and
109
+ # `COMPLETED` means every device has reported. `FAILED` is the run as a whole
110
+ # failing — an individual device failing never fails the run.
111
+ status:,
112
+ # The template that was rendered.
113
+ template_id:,
114
+ # Why the run failed, when `status` is `FAILED`. `NO_EMAIL_CHANNEL` and
115
+ # `TEMPLATE_NOT_SUPPORTED` mean there was nothing to render;
116
+ # `ALL_DEVICES_UNSUPPORTED` means every requested device has been retired and the
117
+ # request can be fixed by choosing others.
118
+ failure_reason: nil,
119
+ # The version of the template that was rendered — `draft`, or a zero-padded
120
+ # published version such as `v002`. Absent until the render settles.
121
+ template_version: nil
122
+ )
123
+ end
124
+
125
+ sig do
126
+ override.returns(
127
+ {
128
+ id: String,
129
+ created_at: String,
130
+ device_ids: T::Array[String],
131
+ results:
132
+ T::Array[Courier::Notifications::Previews::PreviewResult],
133
+ status:
134
+ Courier::Notifications::Previews::PreviewRunStatus::TaggedSymbol,
135
+ template_id: String,
136
+ failure_reason:
137
+ Courier::Notifications::Previews::PreviewRunFailureReason::TaggedSymbol,
138
+ template_version: String
139
+ }
140
+ )
141
+ end
142
+ def to_hash
143
+ end
144
+ end
145
+ end
146
+ end
147
+ end
148
+ end
@@ -0,0 +1,64 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Notifications
6
+ PreviewRunFailureReason = Previews::PreviewRunFailureReason
7
+
8
+ module Previews
9
+ # Why the run failed, when `status` is `FAILED`. `NO_EMAIL_CHANNEL` and
10
+ # `TEMPLATE_NOT_SUPPORTED` mean there was nothing to render;
11
+ # `ALL_DEVICES_UNSUPPORTED` means every requested device has been retired and the
12
+ # request can be fixed by choosing others.
13
+ module PreviewRunFailureReason
14
+ extend Courier::Internal::Type::Enum
15
+
16
+ TaggedSymbol =
17
+ T.type_alias do
18
+ T.all(
19
+ Symbol,
20
+ Courier::Notifications::Previews::PreviewRunFailureReason
21
+ )
22
+ end
23
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
24
+
25
+ TEMPLATE_NOT_SUPPORTED =
26
+ T.let(
27
+ :TEMPLATE_NOT_SUPPORTED,
28
+ Courier::Notifications::Previews::PreviewRunFailureReason::TaggedSymbol
29
+ )
30
+ NO_EMAIL_CHANNEL =
31
+ T.let(
32
+ :NO_EMAIL_CHANNEL,
33
+ Courier::Notifications::Previews::PreviewRunFailureReason::TaggedSymbol
34
+ )
35
+ RENDER_FAILED =
36
+ T.let(
37
+ :RENDER_FAILED,
38
+ Courier::Notifications::Previews::PreviewRunFailureReason::TaggedSymbol
39
+ )
40
+ ALL_DEVICES_UNSUPPORTED =
41
+ T.let(
42
+ :ALL_DEVICES_UNSUPPORTED,
43
+ Courier::Notifications::Previews::PreviewRunFailureReason::TaggedSymbol
44
+ )
45
+ VENDOR_ERROR =
46
+ T.let(
47
+ :VENDOR_ERROR,
48
+ Courier::Notifications::Previews::PreviewRunFailureReason::TaggedSymbol
49
+ )
50
+
51
+ sig do
52
+ override.returns(
53
+ T::Array[
54
+ Courier::Notifications::Previews::PreviewRunFailureReason::TaggedSymbol
55
+ ]
56
+ )
57
+ end
58
+ def self.values
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,54 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Notifications
6
+ PreviewRunListResponse = Previews::PreviewRunListResponse
7
+
8
+ module Previews
9
+ class PreviewRunListResponse < Courier::Internal::Type::BaseModel
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Courier::Notifications::Previews::PreviewRunListResponse,
14
+ Courier::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(Courier::Paging) }
19
+ attr_reader :paging
20
+
21
+ sig { params(paging: Courier::Paging::OrHash).void }
22
+ attr_writer :paging
23
+
24
+ sig do
25
+ returns(T::Array[Courier::Notifications::Previews::PreviewRun])
26
+ end
27
+ attr_accessor :results
28
+
29
+ # Paginated list of preview runs, newest first.
30
+ sig do
31
+ params(
32
+ paging: Courier::Paging::OrHash,
33
+ results:
34
+ T::Array[Courier::Notifications::Previews::PreviewRun::OrHash]
35
+ ).returns(T.attached_class)
36
+ end
37
+ def self.new(paging:, results:)
38
+ end
39
+
40
+ sig do
41
+ override.returns(
42
+ {
43
+ paging: Courier::Paging,
44
+ results: T::Array[Courier::Notifications::Previews::PreviewRun]
45
+ }
46
+ )
47
+ end
48
+ def to_hash
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,61 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Notifications
6
+ PreviewRunStatus = Previews::PreviewRunStatus
7
+
8
+ module Previews
9
+ # Where the run itself has got to. `PENDING` and `RENDERED` mean Courier is still
10
+ # preparing the email, `SUBMITTED` means it is with the rendering service, and
11
+ # `COMPLETED` means every device has reported. `FAILED` is the run as a whole
12
+ # failing — an individual device failing never fails the run.
13
+ module PreviewRunStatus
14
+ extend Courier::Internal::Type::Enum
15
+
16
+ TaggedSymbol =
17
+ T.type_alias do
18
+ T.all(Symbol, Courier::Notifications::Previews::PreviewRunStatus)
19
+ end
20
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
21
+
22
+ PENDING =
23
+ T.let(
24
+ :PENDING,
25
+ Courier::Notifications::Previews::PreviewRunStatus::TaggedSymbol
26
+ )
27
+ RENDERED =
28
+ T.let(
29
+ :RENDERED,
30
+ Courier::Notifications::Previews::PreviewRunStatus::TaggedSymbol
31
+ )
32
+ SUBMITTED =
33
+ T.let(
34
+ :SUBMITTED,
35
+ Courier::Notifications::Previews::PreviewRunStatus::TaggedSymbol
36
+ )
37
+ COMPLETED =
38
+ T.let(
39
+ :COMPLETED,
40
+ Courier::Notifications::Previews::PreviewRunStatus::TaggedSymbol
41
+ )
42
+ FAILED =
43
+ T.let(
44
+ :FAILED,
45
+ Courier::Notifications::Previews::PreviewRunStatus::TaggedSymbol
46
+ )
47
+
48
+ sig do
49
+ override.returns(
50
+ T::Array[
51
+ Courier::Notifications::Previews::PreviewRunStatus::TaggedSymbol
52
+ ]
53
+ )
54
+ end
55
+ def self.values
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,66 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Notifications
6
+ module Previews
7
+ class RunCreateParams < Courier::Models::Notifications::Previews::CreatePreviewRunRequest
8
+ extend Courier::Internal::Type::RequestParameters::Converter
9
+ include Courier::Internal::Type::RequestParameters
10
+
11
+ OrHash =
12
+ T.type_alias do
13
+ T.any(
14
+ Courier::Notifications::Previews::RunCreateParams,
15
+ Courier::Internal::AnyHash
16
+ )
17
+ end
18
+
19
+ sig { returns(String) }
20
+ attr_accessor :id
21
+
22
+ sig { returns(T.nilable(String)) }
23
+ attr_reader :idempotency_key
24
+
25
+ sig { params(idempotency_key: String).void }
26
+ attr_writer :idempotency_key
27
+
28
+ sig { returns(T.nilable(String)) }
29
+ attr_reader :x_idempotency_expiration
30
+
31
+ sig { params(x_idempotency_expiration: String).void }
32
+ attr_writer :x_idempotency_expiration
33
+
34
+ sig do
35
+ params(
36
+ id: String,
37
+ idempotency_key: String,
38
+ x_idempotency_expiration: String,
39
+ request_options: Courier::RequestOptions::OrHash
40
+ ).returns(T.attached_class)
41
+ end
42
+ def self.new(
43
+ id:,
44
+ idempotency_key: nil,
45
+ x_idempotency_expiration: nil,
46
+ request_options: {}
47
+ )
48
+ end
49
+
50
+ sig do
51
+ override.returns(
52
+ {
53
+ id: String,
54
+ idempotency_key: String,
55
+ x_idempotency_expiration: String,
56
+ request_options: Courier::RequestOptions
57
+ }
58
+ )
59
+ end
60
+ def to_hash
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,67 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Notifications
6
+ module Previews
7
+ class RunListParams < Courier::Internal::Type::BaseModel
8
+ extend Courier::Internal::Type::RequestParameters::Converter
9
+ include Courier::Internal::Type::RequestParameters
10
+
11
+ OrHash =
12
+ T.type_alias do
13
+ T.any(
14
+ Courier::Notifications::Previews::RunListParams,
15
+ Courier::Internal::AnyHash
16
+ )
17
+ end
18
+
19
+ sig { returns(String) }
20
+ attr_accessor :id
21
+
22
+ # Opaque pagination cursor from a previous response. Omit for the first page.
23
+ sig { returns(T.nilable(String)) }
24
+ attr_accessor :cursor
25
+
26
+ # Maximum number of results per page.
27
+ sig { returns(T.nilable(Integer)) }
28
+ attr_reader :limit
29
+
30
+ sig { params(limit: Integer).void }
31
+ attr_writer :limit
32
+
33
+ sig do
34
+ params(
35
+ id: String,
36
+ cursor: T.nilable(String),
37
+ limit: Integer,
38
+ request_options: Courier::RequestOptions::OrHash
39
+ ).returns(T.attached_class)
40
+ end
41
+ def self.new(
42
+ id:,
43
+ # Opaque pagination cursor from a previous response. Omit for the first page.
44
+ cursor: nil,
45
+ # Maximum number of results per page.
46
+ limit: nil,
47
+ request_options: {}
48
+ )
49
+ end
50
+
51
+ sig do
52
+ override.returns(
53
+ {
54
+ id: String,
55
+ cursor: T.nilable(String),
56
+ limit: Integer,
57
+ request_options: Courier::RequestOptions
58
+ }
59
+ )
60
+ end
61
+ def to_hash
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end