knockapi 1.35.0 → 1.36.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 (84) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +63 -0
  3. data/README.md +1 -1
  4. data/lib/knockapi/client.rb +17 -0
  5. data/lib/knockapi/internal/transport/base_client.rb +5 -0
  6. data/lib/knockapi/internal/util.rb +21 -5
  7. data/lib/knockapi/models/condition.rb +1 -0
  8. data/lib/knockapi/models/message.rb +33 -1
  9. data/lib/knockapi/models/message_event.rb +11 -11
  10. data/lib/knockapi/models/object_unset_preferences_params.rb +32 -0
  11. data/lib/knockapi/models/providers/ms_team_check_auth_response.rb +9 -1
  12. data/lib/knockapi/models/recipients/slack_channel_data.rb +21 -6
  13. data/lib/knockapi/models/tenant.rb +35 -1
  14. data/lib/knockapi/models/tenant_request.rb +35 -1
  15. data/lib/knockapi/models/user_unset_preferences_params.rb +26 -0
  16. data/lib/knockapi/models/users/bulk_set_preferences_params.rb +221 -4
  17. data/lib/knockapi/models/users/guide_get_channel_response.rb +9 -1
  18. data/lib/knockapi/models/workflow_cancel_params.rb +6 -6
  19. data/lib/knockapi/models/workflow_recipient_run.rb +193 -0
  20. data/lib/knockapi/models/workflow_recipient_run_detail.rb +19 -0
  21. data/lib/knockapi/models/workflow_recipient_run_event.rb +99 -0
  22. data/lib/knockapi/models/workflow_recipient_run_get_params.rb +20 -0
  23. data/lib/knockapi/models/workflow_recipient_run_list_params.rb +112 -0
  24. data/lib/knockapi/models/workflow_trigger_params.rb +42 -7
  25. data/lib/knockapi/models.rb +14 -0
  26. data/lib/knockapi/resources/objects.rb +24 -0
  27. data/lib/knockapi/resources/users/bulk.rb +4 -1
  28. data/lib/knockapi/resources/users.rb +22 -0
  29. data/lib/knockapi/resources/workflow_recipient_runs.rb +81 -0
  30. data/lib/knockapi/resources/workflows.rb +5 -3
  31. data/lib/knockapi/version.rb +1 -1
  32. data/lib/knockapi.rb +8 -0
  33. data/rbi/knockapi/client.rbi +5 -0
  34. data/rbi/knockapi/internal/util.rbi +8 -0
  35. data/rbi/knockapi/models/condition.rbi +2 -0
  36. data/rbi/knockapi/models/message.rbi +59 -0
  37. data/rbi/knockapi/models/message_event.rbi +26 -26
  38. data/rbi/knockapi/models/object_unset_preferences_params.rbi +51 -0
  39. data/rbi/knockapi/models/providers/ms_team_check_auth_response.rbi +18 -4
  40. data/rbi/knockapi/models/recipients/slack_channel_data.rbi +57 -7
  41. data/rbi/knockapi/models/tenant.rbi +36 -0
  42. data/rbi/knockapi/models/tenant_request.rbi +36 -0
  43. data/rbi/knockapi/models/user_unset_preferences_params.rbi +46 -0
  44. data/rbi/knockapi/models/users/bulk_set_preferences_params.rbi +527 -6
  45. data/rbi/knockapi/models/users/guide_get_channel_response.rbi +11 -0
  46. data/rbi/knockapi/models/workflow_cancel_params.rbi +10 -10
  47. data/rbi/knockapi/models/workflow_recipient_run.rbi +318 -0
  48. data/rbi/knockapi/models/workflow_recipient_run_detail.rbi +39 -0
  49. data/rbi/knockapi/models/workflow_recipient_run_event.rbi +137 -0
  50. data/rbi/knockapi/models/workflow_recipient_run_get_params.rbi +38 -0
  51. data/rbi/knockapi/models/workflow_recipient_run_list_params.rbi +229 -0
  52. data/rbi/knockapi/models/workflow_trigger_params.rbi +76 -10
  53. data/rbi/knockapi/models.rbi +16 -0
  54. data/rbi/knockapi/resources/objects.rbi +20 -0
  55. data/rbi/knockapi/resources/users/bulk.rbi +4 -2
  56. data/rbi/knockapi/resources/users.rbi +17 -0
  57. data/rbi/knockapi/resources/workflow_recipient_runs.rbi +79 -0
  58. data/rbi/knockapi/resources/workflows.rbi +14 -10
  59. data/sig/knockapi/client.rbs +2 -0
  60. data/sig/knockapi/internal/util.rbs +4 -0
  61. data/sig/knockapi/models/condition.rbs +2 -0
  62. data/sig/knockapi/models/message.rbs +19 -0
  63. data/sig/knockapi/models/message_event.rbs +22 -22
  64. data/sig/knockapi/models/object_unset_preferences_params.rbs +32 -0
  65. data/sig/knockapi/models/providers/ms_team_check_auth_response.rbs +15 -4
  66. data/sig/knockapi/models/recipients/slack_channel_data.rbs +21 -4
  67. data/sig/knockapi/models/tenant.rbs +20 -0
  68. data/sig/knockapi/models/tenant_request.rbs +20 -0
  69. data/sig/knockapi/models/user_unset_preferences_params.rbs +28 -0
  70. data/sig/knockapi/models/users/bulk_set_preferences_params.rbs +149 -4
  71. data/sig/knockapi/models/users/guide_get_channel_response.rbs +7 -0
  72. data/sig/knockapi/models/workflow_recipient_run.rbs +146 -0
  73. data/sig/knockapi/models/workflow_recipient_run_detail.rbs +20 -0
  74. data/sig/knockapi/models/workflow_recipient_run_event.rbs +73 -0
  75. data/sig/knockapi/models/workflow_recipient_run_get_params.rbs +20 -0
  76. data/sig/knockapi/models/workflow_recipient_run_list_params.rbs +109 -0
  77. data/sig/knockapi/models/workflow_trigger_params.rbs +17 -0
  78. data/sig/knockapi/models.rbs +14 -0
  79. data/sig/knockapi/resources/objects.rbs +7 -0
  80. data/sig/knockapi/resources/users/bulk.rbs +1 -1
  81. data/sig/knockapi/resources/users.rbs +6 -0
  82. data/sig/knockapi/resources/workflow_recipient_runs.rbs +26 -0
  83. data/sig/knockapi/resources/workflows.rbs +1 -0
  84. metadata +26 -2
@@ -0,0 +1,229 @@
1
+ # typed: strong
2
+
3
+ module Knockapi
4
+ module Models
5
+ class WorkflowRecipientRunListParams < Knockapi::Internal::Type::BaseModel
6
+ extend Knockapi::Internal::Type::RequestParameters::Converter
7
+ include Knockapi::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ Knockapi::WorkflowRecipientRunListParams,
13
+ Knockapi::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # The cursor to fetch entries after.
18
+ sig { returns(T.nilable(String)) }
19
+ attr_reader :after
20
+
21
+ sig { params(after: String).void }
22
+ attr_writer :after
23
+
24
+ # The cursor to fetch entries before.
25
+ sig { returns(T.nilable(String)) }
26
+ attr_reader :before
27
+
28
+ sig { params(before: String).void }
29
+ attr_writer :before
30
+
31
+ # Limits the results to workflow recipient runs started before the given date.
32
+ sig { returns(T.nilable(Time)) }
33
+ attr_reader :ending_at
34
+
35
+ sig { params(ending_at: Time).void }
36
+ attr_writer :ending_at
37
+
38
+ # Limits the results to workflow recipient runs that have errors.
39
+ sig { returns(T.nilable(T::Boolean)) }
40
+ attr_reader :has_errors
41
+
42
+ sig { params(has_errors: T::Boolean).void }
43
+ attr_writer :has_errors
44
+
45
+ # The number of items per page (defaults to 50).
46
+ sig { returns(T.nilable(Integer)) }
47
+ attr_reader :page_size
48
+
49
+ sig { params(page_size: Integer).void }
50
+ attr_writer :page_size
51
+
52
+ # Limits the results to workflow recipient runs for the given recipient. Accepts a
53
+ # user ID string or an object reference with `id` and `collection`.
54
+ sig do
55
+ returns(
56
+ T.nilable(
57
+ T.any(String, Knockapi::RecipientReference::ObjectReference)
58
+ )
59
+ )
60
+ end
61
+ attr_reader :recipient
62
+
63
+ sig do
64
+ params(
65
+ recipient:
66
+ T.any(String, Knockapi::RecipientReference::ObjectReference::OrHash)
67
+ ).void
68
+ end
69
+ attr_writer :recipient
70
+
71
+ # Limits the results to workflow recipient runs started after the given date.
72
+ sig { returns(T.nilable(Time)) }
73
+ attr_reader :starting_at
74
+
75
+ sig { params(starting_at: Time).void }
76
+ attr_writer :starting_at
77
+
78
+ # Limits the results to workflow recipient runs with the given status.
79
+ sig do
80
+ returns(
81
+ T.nilable(
82
+ T::Array[Knockapi::WorkflowRecipientRunListParams::Status::OrSymbol]
83
+ )
84
+ )
85
+ end
86
+ attr_reader :status
87
+
88
+ sig do
89
+ params(
90
+ status:
91
+ T::Array[Knockapi::WorkflowRecipientRunListParams::Status::OrSymbol]
92
+ ).void
93
+ end
94
+ attr_writer :status
95
+
96
+ # Limits the results to workflow recipient runs for the given tenant.
97
+ sig { returns(T.nilable(String)) }
98
+ attr_reader :tenant
99
+
100
+ sig { params(tenant: String).void }
101
+ attr_writer :tenant
102
+
103
+ # Limits the results to workflow recipient runs for the given workflow key.
104
+ sig { returns(T.nilable(String)) }
105
+ attr_reader :workflow
106
+
107
+ sig { params(workflow: String).void }
108
+ attr_writer :workflow
109
+
110
+ sig do
111
+ params(
112
+ after: String,
113
+ before: String,
114
+ ending_at: Time,
115
+ has_errors: T::Boolean,
116
+ page_size: Integer,
117
+ recipient:
118
+ T.any(
119
+ String,
120
+ Knockapi::RecipientReference::ObjectReference::OrHash
121
+ ),
122
+ starting_at: Time,
123
+ status:
124
+ T::Array[
125
+ Knockapi::WorkflowRecipientRunListParams::Status::OrSymbol
126
+ ],
127
+ tenant: String,
128
+ workflow: String,
129
+ request_options: Knockapi::RequestOptions::OrHash
130
+ ).returns(T.attached_class)
131
+ end
132
+ def self.new(
133
+ # The cursor to fetch entries after.
134
+ after: nil,
135
+ # The cursor to fetch entries before.
136
+ before: nil,
137
+ # Limits the results to workflow recipient runs started before the given date.
138
+ ending_at: nil,
139
+ # Limits the results to workflow recipient runs that have errors.
140
+ has_errors: nil,
141
+ # The number of items per page (defaults to 50).
142
+ page_size: nil,
143
+ # Limits the results to workflow recipient runs for the given recipient. Accepts a
144
+ # user ID string or an object reference with `id` and `collection`.
145
+ recipient: nil,
146
+ # Limits the results to workflow recipient runs started after the given date.
147
+ starting_at: nil,
148
+ # Limits the results to workflow recipient runs with the given status.
149
+ status: nil,
150
+ # Limits the results to workflow recipient runs for the given tenant.
151
+ tenant: nil,
152
+ # Limits the results to workflow recipient runs for the given workflow key.
153
+ workflow: nil,
154
+ request_options: {}
155
+ )
156
+ end
157
+
158
+ sig do
159
+ override.returns(
160
+ {
161
+ after: String,
162
+ before: String,
163
+ ending_at: Time,
164
+ has_errors: T::Boolean,
165
+ page_size: Integer,
166
+ recipient:
167
+ T.any(String, Knockapi::RecipientReference::ObjectReference),
168
+ starting_at: Time,
169
+ status:
170
+ T::Array[
171
+ Knockapi::WorkflowRecipientRunListParams::Status::OrSymbol
172
+ ],
173
+ tenant: String,
174
+ workflow: String,
175
+ request_options: Knockapi::RequestOptions
176
+ }
177
+ )
178
+ end
179
+ def to_hash
180
+ end
181
+
182
+ module Status
183
+ extend Knockapi::Internal::Type::Enum
184
+
185
+ TaggedSymbol =
186
+ T.type_alias do
187
+ T.all(Symbol, Knockapi::WorkflowRecipientRunListParams::Status)
188
+ end
189
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
190
+
191
+ QUEUED =
192
+ T.let(
193
+ :queued,
194
+ Knockapi::WorkflowRecipientRunListParams::Status::TaggedSymbol
195
+ )
196
+ PROCESSING =
197
+ T.let(
198
+ :processing,
199
+ Knockapi::WorkflowRecipientRunListParams::Status::TaggedSymbol
200
+ )
201
+ PAUSED =
202
+ T.let(
203
+ :paused,
204
+ Knockapi::WorkflowRecipientRunListParams::Status::TaggedSymbol
205
+ )
206
+ COMPLETED =
207
+ T.let(
208
+ :completed,
209
+ Knockapi::WorkflowRecipientRunListParams::Status::TaggedSymbol
210
+ )
211
+ CANCELLED =
212
+ T.let(
213
+ :cancelled,
214
+ Knockapi::WorkflowRecipientRunListParams::Status::TaggedSymbol
215
+ )
216
+
217
+ sig do
218
+ override.returns(
219
+ T::Array[
220
+ Knockapi::WorkflowRecipientRunListParams::Status::TaggedSymbol
221
+ ]
222
+ )
223
+ end
224
+ def self.values
225
+ end
226
+ end
227
+ end
228
+ end
229
+ end
@@ -45,11 +45,11 @@ module Knockapi
45
45
  end
46
46
  attr_accessor :actor
47
47
 
48
- # An optional key that is used to reference a specific workflow trigger request
49
- # when issuing a [workflow cancellation](/send-notifications/canceling-workflows)
50
- # request. Must be provided while triggering a workflow in order to enable
51
- # subsequent cancellation. Should be unique across trigger requests to avoid
52
- # unintentional cancellations.
48
+ # A key that is used to reference a specific workflow trigger request when issuing
49
+ # a [workflow cancellation](/send-notifications/canceling-workflows) request. Must
50
+ # be provided while triggering a workflow in order to enable subsequent
51
+ # cancellation. Should be unique across trigger requests to avoid unintentional
52
+ # cancellations.
53
53
  sig { returns(T.nilable(String)) }
54
54
  attr_accessor :cancellation_key
55
55
 
@@ -60,6 +60,17 @@ module Knockapi
60
60
  sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
61
61
  attr_accessor :data
62
62
 
63
+ # Optional settings that control how this workflow trigger is executed.
64
+ sig { returns(T.nilable(Knockapi::WorkflowTriggerParams::Settings)) }
65
+ attr_reader :settings
66
+
67
+ sig do
68
+ params(
69
+ settings: T.nilable(Knockapi::WorkflowTriggerParams::Settings::OrHash)
70
+ ).void
71
+ end
72
+ attr_writer :settings
73
+
63
74
  # An request to set a tenant inline.
64
75
  sig { returns(T.nilable(T.any(String, Knockapi::TenantRequest))) }
65
76
  attr_accessor :tenant
@@ -85,6 +96,8 @@ module Knockapi
85
96
  ),
86
97
  cancellation_key: T.nilable(String),
87
98
  data: T.nilable(T::Hash[Symbol, T.anything]),
99
+ settings:
100
+ T.nilable(Knockapi::WorkflowTriggerParams::Settings::OrHash),
88
101
  tenant: T.nilable(T.any(String, Knockapi::TenantRequest::OrHash)),
89
102
  request_options: Knockapi::RequestOptions::OrHash
90
103
  ).returns(T.attached_class)
@@ -98,17 +111,19 @@ module Knockapi
98
111
  # (string), an inline user request (object), or an inline object request, which is
99
112
  # determined by the presence of a `collection` property.
100
113
  actor: nil,
101
- # An optional key that is used to reference a specific workflow trigger request
102
- # when issuing a [workflow cancellation](/send-notifications/canceling-workflows)
103
- # request. Must be provided while triggering a workflow in order to enable
104
- # subsequent cancellation. Should be unique across trigger requests to avoid
105
- # unintentional cancellations.
114
+ # A key that is used to reference a specific workflow trigger request when issuing
115
+ # a [workflow cancellation](/send-notifications/canceling-workflows) request. Must
116
+ # be provided while triggering a workflow in order to enable subsequent
117
+ # cancellation. Should be unique across trigger requests to avoid unintentional
118
+ # cancellations.
106
119
  cancellation_key: nil,
107
120
  # An optional map of data to pass into the workflow execution. There is a 10MB
108
121
  # limit on the size of the full `data` payload. Any individual string value
109
122
  # greater than 1024 bytes in length will be
110
123
  # [truncated](/developer-tools/api-logs#log-truncation) in your logs.
111
124
  data: nil,
125
+ # Optional settings that control how this workflow trigger is executed.
126
+ settings: nil,
112
127
  # An request to set a tenant inline.
113
128
  tenant: nil,
114
129
  request_options: {}
@@ -137,6 +152,7 @@ module Knockapi
137
152
  ),
138
153
  cancellation_key: T.nilable(String),
139
154
  data: T.nilable(T::Hash[Symbol, T.anything]),
155
+ settings: T.nilable(Knockapi::WorkflowTriggerParams::Settings),
140
156
  tenant: T.nilable(T.any(String, Knockapi::TenantRequest)),
141
157
  request_options: Knockapi::RequestOptions
142
158
  }
@@ -144,6 +160,56 @@ module Knockapi
144
160
  end
145
161
  def to_hash
146
162
  end
163
+
164
+ class Settings < Knockapi::Internal::Type::BaseModel
165
+ OrHash =
166
+ T.type_alias do
167
+ T.any(
168
+ Knockapi::WorkflowTriggerParams::Settings,
169
+ Knockapi::Internal::AnyHash
170
+ )
171
+ end
172
+
173
+ # When set to true, overrides the sandbox mode for all channels in this workflow
174
+ # run, messages are not delivered to the underlying providers. If false or not
175
+ # set, the workflow delivers messages normally.
176
+ sig { returns(T.nilable(T::Boolean)) }
177
+ attr_accessor :sandbox_mode
178
+
179
+ # When set to true, skips all delay steps in the workflow for this trigger
180
+ # request. If false or not set, delay steps execute normally.
181
+ sig { returns(T.nilable(T::Boolean)) }
182
+ attr_accessor :skip_delay
183
+
184
+ # Optional settings that control how this workflow trigger is executed.
185
+ sig do
186
+ params(
187
+ sandbox_mode: T.nilable(T::Boolean),
188
+ skip_delay: T.nilable(T::Boolean)
189
+ ).returns(T.attached_class)
190
+ end
191
+ def self.new(
192
+ # When set to true, overrides the sandbox mode for all channels in this workflow
193
+ # run, messages are not delivered to the underlying providers. If false or not
194
+ # set, the workflow delivers messages normally.
195
+ sandbox_mode: nil,
196
+ # When set to true, skips all delay steps in the workflow for this trigger
197
+ # request. If false or not set, delay steps execute normally.
198
+ skip_delay: nil
199
+ )
200
+ end
201
+
202
+ sig do
203
+ override.returns(
204
+ {
205
+ sandbox_mode: T.nilable(T::Boolean),
206
+ skip_delay: T.nilable(T::Boolean)
207
+ }
208
+ )
209
+ end
210
+ def to_hash
211
+ end
212
+ end
147
213
  end
148
214
  end
149
215
  end
@@ -101,6 +101,8 @@ module Knockapi
101
101
 
102
102
  ObjectUnsetChannelDataParams = Knockapi::Models::ObjectUnsetChannelDataParams
103
103
 
104
+ ObjectUnsetPreferencesParams = Knockapi::Models::ObjectUnsetPreferencesParams
105
+
104
106
  PageInfo = Knockapi::Models::PageInfo
105
107
 
106
108
  Providers = Knockapi::Models::Providers
@@ -171,9 +173,23 @@ module Knockapi
171
173
 
172
174
  UserUnsetChannelDataParams = Knockapi::Models::UserUnsetChannelDataParams
173
175
 
176
+ UserUnsetPreferencesParams = Knockapi::Models::UserUnsetPreferencesParams
177
+
174
178
  UserUpdateParams = Knockapi::Models::UserUpdateParams
175
179
 
176
180
  WorkflowCancelParams = Knockapi::Models::WorkflowCancelParams
177
181
 
182
+ WorkflowRecipientRun = Knockapi::Models::WorkflowRecipientRun
183
+
184
+ WorkflowRecipientRunDetail = Knockapi::Models::WorkflowRecipientRunDetail
185
+
186
+ WorkflowRecipientRunEvent = Knockapi::Models::WorkflowRecipientRunEvent
187
+
188
+ WorkflowRecipientRunGetParams =
189
+ Knockapi::Models::WorkflowRecipientRunGetParams
190
+
191
+ WorkflowRecipientRunListParams =
192
+ Knockapi::Models::WorkflowRecipientRunListParams
193
+
178
194
  WorkflowTriggerParams = Knockapi::Models::WorkflowTriggerParams
179
195
  end
@@ -532,6 +532,26 @@ module Knockapi
532
532
  )
533
533
  end
534
534
 
535
+ # Unsets the preference set for the object, removing it entirely.
536
+ sig do
537
+ params(
538
+ collection: String,
539
+ object_id_: String,
540
+ id: String,
541
+ request_options: Knockapi::RequestOptions::OrHash
542
+ ).void
543
+ end
544
+ def unset_preferences(
545
+ # The collection this object belongs to.
546
+ collection,
547
+ # Unique identifier for the object.
548
+ object_id_,
549
+ # Unique identifier for the preference set.
550
+ id,
551
+ request_options: {}
552
+ )
553
+ end
554
+
535
555
  # @api private
536
556
  sig { params(client: Knockapi::Client).returns(T.attached_class) }
537
557
  def self.new(client:)
@@ -43,13 +43,15 @@ module Knockapi
43
43
  # the preferences sent.
44
44
  sig do
45
45
  params(
46
- preferences: Knockapi::Recipients::PreferenceSetRequest::OrHash,
46
+ preferences:
47
+ Knockapi::Users::BulkSetPreferencesParams::Preferences::OrHash,
47
48
  user_ids: T::Array[String],
48
49
  request_options: Knockapi::RequestOptions::OrHash
49
50
  ).returns(Knockapi::BulkOperation)
50
51
  end
51
52
  def set_preferences(
52
- # A request to set a preference set for a recipient.
53
+ # A preference set to apply in a bulk operation. Always replaces existing
54
+ # preferences for the specified set.
53
55
  preferences:,
54
56
  # A list of user IDs.
55
57
  user_ids:,
@@ -464,6 +464,23 @@ module Knockapi
464
464
  )
465
465
  end
466
466
 
467
+ # Unsets the preference set for the user, removing it entirely.
468
+ sig do
469
+ params(
470
+ user_id: String,
471
+ id: String,
472
+ request_options: Knockapi::RequestOptions::OrHash
473
+ ).void
474
+ end
475
+ def unset_preferences(
476
+ # The unique identifier of the user.
477
+ user_id,
478
+ # Unique identifier for the preference set.
479
+ id,
480
+ request_options: {}
481
+ )
482
+ end
483
+
467
484
  # @api private
468
485
  sig { params(client: Knockapi::Client).returns(T.attached_class) }
469
486
  def self.new(client:)
@@ -0,0 +1,79 @@
1
+ # typed: strong
2
+
3
+ module Knockapi
4
+ module Resources
5
+ # A workflow run represents an individual execution of a workflow for a specific
6
+ # recipient.
7
+ class WorkflowRecipientRuns
8
+ # Returns a paginated list of workflow recipient runs for the current environment.
9
+ sig do
10
+ params(
11
+ after: String,
12
+ before: String,
13
+ ending_at: Time,
14
+ has_errors: T::Boolean,
15
+ page_size: Integer,
16
+ recipient:
17
+ T.any(
18
+ String,
19
+ Knockapi::RecipientReference::ObjectReference::OrHash
20
+ ),
21
+ starting_at: Time,
22
+ status:
23
+ T::Array[
24
+ Knockapi::WorkflowRecipientRunListParams::Status::OrSymbol
25
+ ],
26
+ tenant: String,
27
+ workflow: String,
28
+ request_options: Knockapi::RequestOptions::OrHash
29
+ ).returns(
30
+ Knockapi::Internal::ItemsCursor[Knockapi::WorkflowRecipientRun]
31
+ )
32
+ end
33
+ def list(
34
+ # The cursor to fetch entries after.
35
+ after: nil,
36
+ # The cursor to fetch entries before.
37
+ before: nil,
38
+ # Limits the results to workflow recipient runs started before the given date.
39
+ ending_at: nil,
40
+ # Limits the results to workflow recipient runs that have errors.
41
+ has_errors: nil,
42
+ # The number of items per page (defaults to 50).
43
+ page_size: nil,
44
+ # Limits the results to workflow recipient runs for the given recipient. Accepts a
45
+ # user ID string or an object reference with `id` and `collection`.
46
+ recipient: nil,
47
+ # Limits the results to workflow recipient runs started after the given date.
48
+ starting_at: nil,
49
+ # Limits the results to workflow recipient runs with the given status.
50
+ status: nil,
51
+ # Limits the results to workflow recipient runs for the given tenant.
52
+ tenant: nil,
53
+ # Limits the results to workflow recipient runs for the given workflow key.
54
+ workflow: nil,
55
+ request_options: {}
56
+ )
57
+ end
58
+
59
+ # Returns a single workflow recipient run with its associated events.
60
+ sig do
61
+ params(
62
+ id: String,
63
+ request_options: Knockapi::RequestOptions::OrHash
64
+ ).returns(Knockapi::WorkflowRecipientRunDetail)
65
+ end
66
+ def get(
67
+ # The unique identifier for the workflow recipient run (per-recipient).
68
+ id,
69
+ request_options: {}
70
+ )
71
+ end
72
+
73
+ # @api private
74
+ sig { params(client: Knockapi::Client).returns(T.attached_class) }
75
+ def self.new(client:)
76
+ end
77
+ end
78
+ end
79
+ end
@@ -27,11 +27,11 @@ module Knockapi
27
27
  def cancel(
28
28
  # The key of the workflow to cancel.
29
29
  key,
30
- # An optional key that is used to reference a specific workflow trigger request
31
- # when issuing a [workflow cancellation](/send-notifications/canceling-workflows)
32
- # request. Must be provided while triggering a workflow in order to enable
33
- # subsequent cancellation. Should be unique across trigger requests to avoid
34
- # unintentional cancellations.
30
+ # A key that is used to reference a specific workflow trigger request when issuing
31
+ # a [workflow cancellation](/send-notifications/canceling-workflows) request. Must
32
+ # be provided while triggering a workflow in order to enable subsequent
33
+ # cancellation. Should be unique across trigger requests to avoid unintentional
34
+ # cancellations.
35
35
  cancellation_key:,
36
36
  # A list of recipients to cancel the notification for. If omitted, cancels for all
37
37
  # recipients associated with the cancellation key.
@@ -66,6 +66,8 @@ module Knockapi
66
66
  ),
67
67
  cancellation_key: T.nilable(String),
68
68
  data: T.nilable(T::Hash[Symbol, T.anything]),
69
+ settings:
70
+ T.nilable(Knockapi::WorkflowTriggerParams::Settings::OrHash),
69
71
  tenant: T.nilable(T.any(String, Knockapi::TenantRequest::OrHash)),
70
72
  request_options: Knockapi::RequestOptions::OrHash
71
73
  ).returns(Knockapi::Models::WorkflowTriggerResponse)
@@ -80,17 +82,19 @@ module Knockapi
80
82
  # (string), an inline user request (object), or an inline object request, which is
81
83
  # determined by the presence of a `collection` property.
82
84
  actor: nil,
83
- # An optional key that is used to reference a specific workflow trigger request
84
- # when issuing a [workflow cancellation](/send-notifications/canceling-workflows)
85
- # request. Must be provided while triggering a workflow in order to enable
86
- # subsequent cancellation. Should be unique across trigger requests to avoid
87
- # unintentional cancellations.
85
+ # A key that is used to reference a specific workflow trigger request when issuing
86
+ # a [workflow cancellation](/send-notifications/canceling-workflows) request. Must
87
+ # be provided while triggering a workflow in order to enable subsequent
88
+ # cancellation. Should be unique across trigger requests to avoid unintentional
89
+ # cancellations.
88
90
  cancellation_key: nil,
89
91
  # An optional map of data to pass into the workflow execution. There is a 10MB
90
92
  # limit on the size of the full `data` payload. Any individual string value
91
93
  # greater than 1024 bytes in length will be
92
94
  # [truncated](/developer-tools/api-logs#log-truncation) in your logs.
93
95
  data: nil,
96
+ # Optional settings that control how this workflow trigger is executed.
97
+ settings: nil,
94
98
  # An request to set a tenant inline.
95
99
  tenant: nil,
96
100
  request_options: {}
@@ -30,6 +30,8 @@ module Knockapi
30
30
 
31
31
  attr_reader workflows: Knockapi::Resources::Workflows
32
32
 
33
+ attr_reader workflow_recipient_runs: Knockapi::Resources::WorkflowRecipientRuns
34
+
33
35
  attr_reader schedules: Knockapi::Resources::Schedules
34
36
 
35
37
  attr_reader channels: Knockapi::Resources::Channels
@@ -45,8 +45,12 @@ module Knockapi
45
45
  -> top?
46
46
  } -> top?
47
47
 
48
+ RFC_3986_NOT_PCHARS: Regexp
49
+
48
50
  def self?.uri_origin: (URI::Generic uri) -> String
49
51
 
52
+ def self?.encode_path: (String | Integer path) -> String
53
+
50
54
  def self?.interpolate_path: (String | ::Array[String] path) -> String
51
55
 
52
56
  def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]]
@@ -40,6 +40,7 @@ module Knockapi
40
40
  | :exists
41
41
  | :not_exists
42
42
  | :contains_all
43
+ | :not_contains_all
43
44
  | :is_timestamp
44
45
  | :is_not_timestamp
45
46
  | :is_timestamp_on_or_after
@@ -67,6 +68,7 @@ module Knockapi
67
68
  EXISTS: :exists
68
69
  NOT_EXISTS: :not_exists
69
70
  CONTAINS_ALL: :contains_all
71
+ NOT_CONTAINS_ALL: :not_contains_all
70
72
  IS_TIMESTAMP: :is_timestamp
71
73
  IS_NOT_TIMESTAMP: :is_not_timestamp
72
74
  IS_TIMESTAMP_ON_OR_AFTER: :is_timestamp_on_or_after
@@ -20,6 +20,7 @@ module Knockapi
20
20
  link_clicked_at: Time?,
21
21
  metadata: ::Hash[Symbol, top]?,
22
22
  read_at: Time?,
23
+ recipient_snapshot: Knockapi::Message::RecipientSnapshot?,
23
24
  scheduled_at: Time?,
24
25
  seen_at: Time?,
25
26
  tenant: String?,
@@ -69,6 +70,8 @@ module Knockapi
69
70
 
70
71
  attr_accessor read_at: Time?
71
72
 
73
+ attr_accessor recipient_snapshot: Knockapi::Message::RecipientSnapshot?
74
+
72
75
  attr_accessor scheduled_at: Time?
73
76
 
74
77
  attr_accessor seen_at: Time?
@@ -96,6 +99,7 @@ module Knockapi
96
99
  ?link_clicked_at: Time?,
97
100
  ?metadata: ::Hash[Symbol, top]?,
98
101
  ?read_at: Time?,
102
+ ?recipient_snapshot: Knockapi::Message::RecipientSnapshot?,
99
103
  ?scheduled_at: Time?,
100
104
  ?seen_at: Time?,
101
105
  ?tenant: String?,
@@ -121,6 +125,7 @@ module Knockapi
121
125
  link_clicked_at: Time?,
122
126
  metadata: ::Hash[Symbol, top]?,
123
127
  read_at: Time?,
128
+ recipient_snapshot: Knockapi::Message::RecipientSnapshot?,
124
129
  scheduled_at: Time?,
125
130
  seen_at: Time?,
126
131
  tenant: String?,
@@ -304,6 +309,20 @@ module Knockapi
304
309
  def self?.values: -> ::Array[Knockapi::Models::Message::Channel::type_]
305
310
  end
306
311
  end
312
+
313
+ type recipient_snapshot = { email: String, name: String? }
314
+
315
+ class RecipientSnapshot < Knockapi::Internal::Type::BaseModel
316
+ attr_reader email: String?
317
+
318
+ def email=: (String) -> String
319
+
320
+ attr_accessor name: String?
321
+
322
+ def initialize: (?email: String, ?name: String?) -> void
323
+
324
+ def to_hash: -> { email: String, name: String? }
325
+ end
307
326
  end
308
327
  end
309
328
  end