trycourier 6.10.0 → 6.11.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 (93) 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/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,106 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Resources
5
+ # Render a template's email content on real email clients and read back the
6
+ # screenshots, so you can check how it looks before you send it.
7
+ class Previews
8
+ # Archive a device set. This is a soft delete — the archived set is returned and
9
+ # no longer appears in list results. Runs already created against it keep their
10
+ # own copy of the device list and are unaffected. The Courier-provided default set
11
+ # cannot be archived and returns 409.
12
+ sig do
13
+ params(
14
+ device_set_id: String,
15
+ request_options: Courier::RequestOptions::OrHash
16
+ ).returns(Courier::DeviceSet)
17
+ end
18
+ def archive_device_set(
19
+ # The preview set to archive.
20
+ device_set_id,
21
+ request_options: {}
22
+ )
23
+ end
24
+
25
+ # Create a named, reusable set of preview devices. Every id must be one listed by
26
+ # `GET /previews/devices`; any other is a 422.
27
+ sig do
28
+ params(
29
+ device_ids: T::Array[String],
30
+ name: String,
31
+ request_options: Courier::RequestOptions::OrHash
32
+ ).returns(Courier::DeviceSet)
33
+ end
34
+ def create_device_set(
35
+ # The devices the set contains, by `PreviewDevice.id`. At least one is required.
36
+ device_ids:,
37
+ # Human-readable name.
38
+ name:,
39
+ request_options: {}
40
+ )
41
+ end
42
+
43
+ # List the workspace's preview sets. Archived sets are not returned.
44
+ sig do
45
+ params(request_options: Courier::RequestOptions::OrHash).returns(
46
+ Courier::DeviceSetListResponse
47
+ )
48
+ end
49
+ def list_device_sets(request_options: {})
50
+ end
51
+
52
+ # List the devices a preview can be rendered on. Reference data, identical for
53
+ # every workspace — these ids are what a device set is built from and what a run
54
+ # reports results for.
55
+ sig do
56
+ params(request_options: Courier::RequestOptions::OrHash).returns(
57
+ Courier::PreviewDeviceListResponse
58
+ )
59
+ end
60
+ def list_devices(request_options: {})
61
+ end
62
+
63
+ # Retrieve a preview set by ID. Archived sets return 404.
64
+ sig do
65
+ params(
66
+ device_set_id: String,
67
+ request_options: Courier::RequestOptions::OrHash
68
+ ).returns(Courier::DeviceSet)
69
+ end
70
+ def retrieve_device_set(
71
+ # The preview set to retrieve, identified by the `id` returned when it was
72
+ # created.
73
+ device_set_id,
74
+ request_options: {}
75
+ )
76
+ end
77
+
78
+ # Replace a device set. This is a full replace, not a patch — both the name and
79
+ # the device list are always written. The Courier-provided default set cannot be
80
+ # changed and returns 409.
81
+ sig do
82
+ params(
83
+ device_set_id: String,
84
+ device_ids: T::Array[String],
85
+ name: String,
86
+ request_options: Courier::RequestOptions::OrHash
87
+ ).returns(Courier::DeviceSet)
88
+ end
89
+ def update_device_set(
90
+ # The preview set to replace.
91
+ device_set_id,
92
+ # The devices the set contains, by `PreviewDevice.id`. At least one is required.
93
+ device_ids:,
94
+ # Human-readable name.
95
+ name:,
96
+ request_options: {}
97
+ )
98
+ end
99
+
100
+ # @api private
101
+ sig { params(client: Courier::Client).returns(T.attached_class) }
102
+ def self.new(client:)
103
+ end
104
+ end
105
+ end
106
+ end
@@ -26,6 +26,8 @@ module Courier
26
26
 
27
27
  attr_reader broadcasts: Courier::Resources::Broadcasts
28
28
 
29
+ attr_reader previews: Courier::Resources::Previews
30
+
29
31
  attr_reader bulk: Courier::Resources::Bulk
30
32
 
31
33
  attr_reader brands: Courier::Resources::Brands
@@ -0,0 +1,16 @@
1
+ module Courier
2
+ module Models
3
+ type create_device_set_request =
4
+ { device_ids: ::Array[String], name: String }
5
+
6
+ class CreateDeviceSetRequest < Courier::Internal::Type::BaseModel
7
+ attr_accessor device_ids: ::Array[String]
8
+
9
+ attr_accessor name: String
10
+
11
+ def initialize: (device_ids: ::Array[String], name: String) -> void
12
+
13
+ def to_hash: -> { device_ids: ::Array[String], name: String }
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,47 @@
1
+ module Courier
2
+ module Models
3
+ type device_set =
4
+ {
5
+ id: String,
6
+ created_at: String,
7
+ device_ids: ::Array[String],
8
+ name: String,
9
+ updated_at: String,
10
+ archived_at: String
11
+ }
12
+
13
+ class DeviceSet < Courier::Internal::Type::BaseModel
14
+ attr_accessor id: String
15
+
16
+ attr_accessor created_at: String
17
+
18
+ attr_accessor device_ids: ::Array[String]
19
+
20
+ attr_accessor name: String
21
+
22
+ attr_accessor updated_at: String
23
+
24
+ attr_reader archived_at: String?
25
+
26
+ def archived_at=: (String) -> String
27
+
28
+ def initialize: (
29
+ id: String,
30
+ created_at: String,
31
+ device_ids: ::Array[String],
32
+ name: String,
33
+ updated_at: String,
34
+ ?archived_at: String
35
+ ) -> void
36
+
37
+ def to_hash: -> {
38
+ id: String,
39
+ created_at: String,
40
+ device_ids: ::Array[String],
41
+ name: String,
42
+ updated_at: String,
43
+ archived_at: String
44
+ }
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,13 @@
1
+ module Courier
2
+ module Models
3
+ type device_set_list_response = { results: ::Array[Courier::DeviceSet] }
4
+
5
+ class DeviceSetListResponse < Courier::Internal::Type::BaseModel
6
+ attr_accessor results: ::Array[Courier::DeviceSet]
7
+
8
+ def initialize: (results: ::Array[Courier::DeviceSet]) -> void
9
+
10
+ def to_hash: -> { results: ::Array[Courier::DeviceSet] }
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,54 @@
1
+ module Courier
2
+ module Models
3
+ module Notifications
4
+ module Previews
5
+ type create_preview_run_request =
6
+ {
7
+ data: ::Hash[Symbol, top],
8
+ device_ids: ::Array[String],
9
+ device_set_id: String,
10
+ locale: String,
11
+ template_version: String
12
+ }
13
+
14
+ class CreatePreviewRunRequest < Courier::Internal::Type::BaseModel
15
+ attr_reader data: ::Hash[Symbol, top]?
16
+
17
+ def data=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
18
+
19
+ attr_reader device_ids: ::Array[String]?
20
+
21
+ def device_ids=: (::Array[String]) -> ::Array[String]
22
+
23
+ attr_reader device_set_id: String?
24
+
25
+ def device_set_id=: (String) -> String
26
+
27
+ attr_reader locale: String?
28
+
29
+ def locale=: (String) -> String
30
+
31
+ attr_reader template_version: String?
32
+
33
+ def template_version=: (String) -> String
34
+
35
+ def initialize: (
36
+ ?data: ::Hash[Symbol, top],
37
+ ?device_ids: ::Array[String],
38
+ ?device_set_id: String,
39
+ ?locale: String,
40
+ ?template_version: String
41
+ ) -> void
42
+
43
+ def to_hash: -> {
44
+ data: ::Hash[Symbol, top],
45
+ device_ids: ::Array[String],
46
+ device_set_id: String,
47
+ locale: String,
48
+ template_version: String
49
+ }
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,50 @@
1
+ module Courier
2
+ module Models
3
+ module Notifications
4
+ class PreviewResult = Previews::PreviewResult
5
+
6
+ module Previews
7
+ type preview_result =
8
+ {
9
+ device_id: String,
10
+ screenshot_url: String?,
11
+ status: Courier::Models::Notifications::Previews::preview_result_status,
12
+ thumbnail_url: String?,
13
+ failure_reason: Courier::Models::Notifications::Previews::preview_result_failure_reason
14
+ }
15
+
16
+ class PreviewResult < Courier::Internal::Type::BaseModel
17
+ attr_accessor device_id: String
18
+
19
+ attr_accessor screenshot_url: String?
20
+
21
+ attr_accessor status: Courier::Models::Notifications::Previews::preview_result_status
22
+
23
+ attr_accessor thumbnail_url: String?
24
+
25
+ attr_reader failure_reason: Courier::Models::Notifications::Previews::preview_result_failure_reason?
26
+
27
+ def failure_reason=: (
28
+ Courier::Models::Notifications::Previews::preview_result_failure_reason
29
+ ) -> Courier::Models::Notifications::Previews::preview_result_failure_reason
30
+
31
+ def initialize: (
32
+ device_id: String,
33
+ screenshot_url: String?,
34
+ status: Courier::Models::Notifications::Previews::preview_result_status,
35
+ thumbnail_url: String?,
36
+ ?failure_reason: Courier::Models::Notifications::Previews::preview_result_failure_reason
37
+ ) -> void
38
+
39
+ def to_hash: -> {
40
+ device_id: String,
41
+ screenshot_url: String?,
42
+ status: Courier::Models::Notifications::Previews::preview_result_status,
43
+ thumbnail_url: String?,
44
+ failure_reason: Courier::Models::Notifications::Previews::preview_result_failure_reason
45
+ }
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,19 @@
1
+ module Courier
2
+ module Models
3
+ module Notifications
4
+ module PreviewResultFailureReason = Previews::PreviewResultFailureReason
5
+
6
+ module Previews
7
+ type preview_result_failure_reason = :DELIVERY_FAILED
8
+
9
+ module PreviewResultFailureReason
10
+ extend Courier::Internal::Type::Enum
11
+
12
+ DELIVERY_FAILED: :DELIVERY_FAILED
13
+
14
+ def self?.values: -> ::Array[Courier::Models::Notifications::Previews::preview_result_failure_reason]
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,30 @@
1
+ module Courier
2
+ module Models
3
+ module Notifications
4
+ module PreviewResultStatus = Previews::PreviewResultStatus
5
+
6
+ module Previews
7
+ type preview_result_status =
8
+ :PENDING
9
+ | :PROCESSING
10
+ | :COMPLETED
11
+ | :UNSUPPORTED
12
+ | :TIMED_OUT
13
+ | :FAILED
14
+
15
+ module PreviewResultStatus
16
+ extend Courier::Internal::Type::Enum
17
+
18
+ PENDING: :PENDING
19
+ PROCESSING: :PROCESSING
20
+ COMPLETED: :COMPLETED
21
+ UNSUPPORTED: :UNSUPPORTED
22
+ TIMED_OUT: :TIMED_OUT
23
+ FAILED: :FAILED
24
+
25
+ def self?.values: -> ::Array[Courier::Models::Notifications::Previews::preview_result_status]
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,62 @@
1
+ module Courier
2
+ module Models
3
+ module Notifications
4
+ class PreviewRun = Previews::PreviewRun
5
+
6
+ module Previews
7
+ type preview_run =
8
+ {
9
+ id: String,
10
+ created_at: String,
11
+ device_ids: ::Array[String],
12
+ status: Courier::Models::Notifications::Previews::preview_run_status,
13
+ template_id: String,
14
+ failure_reason: Courier::Models::Notifications::Previews::preview_run_failure_reason,
15
+ template_version: String
16
+ }
17
+
18
+ class PreviewRun < Courier::Internal::Type::BaseModel
19
+ attr_accessor id: String
20
+
21
+ attr_accessor created_at: String
22
+
23
+ attr_accessor device_ids: ::Array[String]
24
+
25
+ attr_accessor status: Courier::Models::Notifications::Previews::preview_run_status
26
+
27
+ attr_accessor template_id: String
28
+
29
+ attr_reader failure_reason: Courier::Models::Notifications::Previews::preview_run_failure_reason?
30
+
31
+ def failure_reason=: (
32
+ Courier::Models::Notifications::Previews::preview_run_failure_reason
33
+ ) -> Courier::Models::Notifications::Previews::preview_run_failure_reason
34
+
35
+ attr_reader template_version: String?
36
+
37
+ def template_version=: (String) -> String
38
+
39
+ def initialize: (
40
+ id: String,
41
+ created_at: String,
42
+ device_ids: ::Array[String],
43
+ status: Courier::Models::Notifications::Previews::preview_run_status,
44
+ template_id: String,
45
+ ?failure_reason: Courier::Models::Notifications::Previews::preview_run_failure_reason,
46
+ ?template_version: String
47
+ ) -> void
48
+
49
+ def to_hash: -> {
50
+ id: String,
51
+ created_at: String,
52
+ device_ids: ::Array[String],
53
+ status: Courier::Models::Notifications::Previews::preview_run_status,
54
+ template_id: String,
55
+ failure_reason: Courier::Models::Notifications::Previews::preview_run_failure_reason,
56
+ template_version: String
57
+ }
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,67 @@
1
+ module Courier
2
+ module Models
3
+ module Notifications
4
+ class PreviewRunDetail = Previews::PreviewRunDetail
5
+
6
+ module Previews
7
+ type preview_run_detail =
8
+ {
9
+ id: String,
10
+ created_at: String,
11
+ device_ids: ::Array[String],
12
+ results: ::Array[Courier::Notifications::Previews::PreviewResult],
13
+ status: Courier::Models::Notifications::Previews::preview_run_status,
14
+ template_id: String,
15
+ failure_reason: Courier::Models::Notifications::Previews::preview_run_failure_reason,
16
+ template_version: String
17
+ }
18
+
19
+ class PreviewRunDetail < Courier::Internal::Type::BaseModel
20
+ attr_accessor id: String
21
+
22
+ attr_accessor created_at: String
23
+
24
+ attr_accessor device_ids: ::Array[String]
25
+
26
+ attr_accessor results: ::Array[Courier::Notifications::Previews::PreviewResult]
27
+
28
+ attr_accessor status: Courier::Models::Notifications::Previews::preview_run_status
29
+
30
+ attr_accessor template_id: String
31
+
32
+ attr_reader failure_reason: Courier::Models::Notifications::Previews::preview_run_failure_reason?
33
+
34
+ def failure_reason=: (
35
+ Courier::Models::Notifications::Previews::preview_run_failure_reason
36
+ ) -> Courier::Models::Notifications::Previews::preview_run_failure_reason
37
+
38
+ attr_reader template_version: String?
39
+
40
+ def template_version=: (String) -> String
41
+
42
+ def initialize: (
43
+ id: String,
44
+ created_at: String,
45
+ device_ids: ::Array[String],
46
+ results: ::Array[Courier::Notifications::Previews::PreviewResult],
47
+ status: Courier::Models::Notifications::Previews::preview_run_status,
48
+ template_id: String,
49
+ ?failure_reason: Courier::Models::Notifications::Previews::preview_run_failure_reason,
50
+ ?template_version: String
51
+ ) -> void
52
+
53
+ def to_hash: -> {
54
+ id: String,
55
+ created_at: String,
56
+ device_ids: ::Array[String],
57
+ results: ::Array[Courier::Notifications::Previews::PreviewResult],
58
+ status: Courier::Models::Notifications::Previews::preview_run_status,
59
+ template_id: String,
60
+ failure_reason: Courier::Models::Notifications::Previews::preview_run_failure_reason,
61
+ template_version: String
62
+ }
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,28 @@
1
+ module Courier
2
+ module Models
3
+ module Notifications
4
+ module PreviewRunFailureReason = Previews::PreviewRunFailureReason
5
+
6
+ module Previews
7
+ type preview_run_failure_reason =
8
+ :TEMPLATE_NOT_SUPPORTED
9
+ | :NO_EMAIL_CHANNEL
10
+ | :RENDER_FAILED
11
+ | :ALL_DEVICES_UNSUPPORTED
12
+ | :VENDOR_ERROR
13
+
14
+ module PreviewRunFailureReason
15
+ extend Courier::Internal::Type::Enum
16
+
17
+ TEMPLATE_NOT_SUPPORTED: :TEMPLATE_NOT_SUPPORTED
18
+ NO_EMAIL_CHANNEL: :NO_EMAIL_CHANNEL
19
+ RENDER_FAILED: :RENDER_FAILED
20
+ ALL_DEVICES_UNSUPPORTED: :ALL_DEVICES_UNSUPPORTED
21
+ VENDOR_ERROR: :VENDOR_ERROR
22
+
23
+ def self?.values: -> ::Array[Courier::Models::Notifications::Previews::preview_run_failure_reason]
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,31 @@
1
+ module Courier
2
+ module Models
3
+ module Notifications
4
+ class PreviewRunListResponse = Previews::PreviewRunListResponse
5
+
6
+ module Previews
7
+ type preview_run_list_response =
8
+ {
9
+ paging: Courier::Paging,
10
+ results: ::Array[Courier::Notifications::Previews::PreviewRun]
11
+ }
12
+
13
+ class PreviewRunListResponse < Courier::Internal::Type::BaseModel
14
+ attr_accessor paging: Courier::Paging
15
+
16
+ attr_accessor results: ::Array[Courier::Notifications::Previews::PreviewRun]
17
+
18
+ def initialize: (
19
+ paging: Courier::Paging,
20
+ results: ::Array[Courier::Notifications::Previews::PreviewRun]
21
+ ) -> void
22
+
23
+ def to_hash: -> {
24
+ paging: Courier::Paging,
25
+ results: ::Array[Courier::Notifications::Previews::PreviewRun]
26
+ }
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,24 @@
1
+ module Courier
2
+ module Models
3
+ module Notifications
4
+ module PreviewRunStatus = Previews::PreviewRunStatus
5
+
6
+ module Previews
7
+ type preview_run_status =
8
+ :PENDING | :RENDERED | :SUBMITTED | :COMPLETED | :FAILED
9
+
10
+ module PreviewRunStatus
11
+ extend Courier::Internal::Type::Enum
12
+
13
+ PENDING: :PENDING
14
+ RENDERED: :RENDERED
15
+ SUBMITTED: :SUBMITTED
16
+ COMPLETED: :COMPLETED
17
+ FAILED: :FAILED
18
+
19
+ def self?.values: -> ::Array[Courier::Models::Notifications::Previews::preview_run_status]
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,46 @@
1
+ module Courier
2
+ module Models
3
+ module Notifications
4
+ module Previews
5
+ type run_create_params =
6
+ {
7
+ id: String,
8
+ idempotency_key: String,
9
+ x_idempotency_expiration: String
10
+ }
11
+ & Courier::Internal::Type::request_parameters
12
+
13
+ class RunCreateParams < Courier::Models::Notifications::Previews::CreatePreviewRunRequest
14
+ extend Courier::Internal::Type::RequestParameters::Converter
15
+ include Courier::Internal::Type::RequestParameters
16
+
17
+ def id: -> String
18
+
19
+ def id=: (String _) -> String
20
+
21
+ def idempotency_key: -> String?
22
+
23
+ def idempotency_key=: (String _) -> String
24
+
25
+ def x_idempotency_expiration: -> String?
26
+
27
+ def x_idempotency_expiration=: (String _) -> String
28
+
29
+ def initialize: (
30
+ id: String,
31
+ ?idempotency_key: String,
32
+ ?x_idempotency_expiration: String,
33
+ ?request_options: Courier::request_opts
34
+ ) -> void
35
+
36
+ def to_hash: -> {
37
+ id: String,
38
+ idempotency_key: String,
39
+ x_idempotency_expiration: String,
40
+ request_options: Courier::RequestOptions
41
+ }
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,38 @@
1
+ module Courier
2
+ module Models
3
+ module Notifications
4
+ module Previews
5
+ type run_list_params =
6
+ { id: String, cursor: String?, limit: Integer }
7
+ & Courier::Internal::Type::request_parameters
8
+
9
+ class RunListParams < Courier::Internal::Type::BaseModel
10
+ extend Courier::Internal::Type::RequestParameters::Converter
11
+ include Courier::Internal::Type::RequestParameters
12
+
13
+ attr_accessor id: String
14
+
15
+ attr_accessor cursor: String?
16
+
17
+ attr_reader limit: Integer?
18
+
19
+ def limit=: (Integer) -> Integer
20
+
21
+ def initialize: (
22
+ id: String,
23
+ ?cursor: String?,
24
+ ?limit: Integer,
25
+ ?request_options: Courier::request_opts
26
+ ) -> void
27
+
28
+ def to_hash: -> {
29
+ id: String,
30
+ cursor: String?,
31
+ limit: Integer,
32
+ request_options: Courier::RequestOptions
33
+ }
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,32 @@
1
+ module Courier
2
+ module Models
3
+ module Notifications
4
+ module Previews
5
+ type run_retrieve_params =
6
+ { id: String, preview_run_id: String }
7
+ & Courier::Internal::Type::request_parameters
8
+
9
+ class RunRetrieveParams < Courier::Internal::Type::BaseModel
10
+ extend Courier::Internal::Type::RequestParameters::Converter
11
+ include Courier::Internal::Type::RequestParameters
12
+
13
+ attr_accessor id: String
14
+
15
+ attr_accessor preview_run_id: String
16
+
17
+ def initialize: (
18
+ id: String,
19
+ preview_run_id: String,
20
+ ?request_options: Courier::request_opts
21
+ ) -> void
22
+
23
+ def to_hash: -> {
24
+ id: String,
25
+ preview_run_id: String,
26
+ request_options: Courier::RequestOptions
27
+ }
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end