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
@@ -89,56 +89,56 @@ module Knockapi
89
89
  T.type_alias { T.all(Symbol, Knockapi::MessageEvent::Type) }
90
90
  OrSymbol = T.type_alias { T.any(Symbol, String) }
91
91
 
92
- MESSAGE_ARCHIVED =
93
- T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol)
94
- MESSAGE_BOUNCED =
95
- T.let(:"message.bounced", Knockapi::MessageEvent::Type::TaggedSymbol)
92
+ MESSAGE_READ =
93
+ T.let(:"message.read", Knockapi::MessageEvent::Type::TaggedSymbol)
94
+ MESSAGE_SENT =
95
+ T.let(:"message.sent", Knockapi::MessageEvent::Type::TaggedSymbol)
96
+ MESSAGE_SEEN =
97
+ T.let(:"message.seen", Knockapi::MessageEvent::Type::TaggedSymbol)
96
98
  MESSAGE_CREATED =
97
99
  T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol)
100
+ MESSAGE_QUEUED =
101
+ T.let(:"message.queued", Knockapi::MessageEvent::Type::TaggedSymbol)
98
102
  MESSAGE_DELIVERED =
99
103
  T.let(
100
104
  :"message.delivered",
101
105
  Knockapi::MessageEvent::Type::TaggedSymbol
102
106
  )
103
- MESSAGE_DELIVERY_ATTEMPTED =
107
+ MESSAGE_BOUNCED =
108
+ T.let(:"message.bounced", Knockapi::MessageEvent::Type::TaggedSymbol)
109
+ MESSAGE_UNDELIVERED =
104
110
  T.let(
105
- :"message.delivery_attempted",
111
+ :"message.undelivered",
106
112
  Knockapi::MessageEvent::Type::TaggedSymbol
107
113
  )
108
- MESSAGE_INTERACTED =
114
+ MESSAGE_NOT_SENT =
115
+ T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol)
116
+ MESSAGE_DELIVERY_ATTEMPTED =
109
117
  T.let(
110
- :"message.interacted",
118
+ :"message.delivery_attempted",
111
119
  Knockapi::MessageEvent::Type::TaggedSymbol
112
120
  )
121
+ MESSAGE_ARCHIVED =
122
+ T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol)
113
123
  MESSAGE_LINK_CLICKED =
114
124
  T.let(
115
125
  :"message.link_clicked",
116
126
  Knockapi::MessageEvent::Type::TaggedSymbol
117
127
  )
118
- MESSAGE_NOT_SENT =
119
- T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol)
120
- MESSAGE_QUEUED =
121
- T.let(:"message.queued", Knockapi::MessageEvent::Type::TaggedSymbol)
122
- MESSAGE_READ =
123
- T.let(:"message.read", Knockapi::MessageEvent::Type::TaggedSymbol)
124
- MESSAGE_SEEN =
125
- T.let(:"message.seen", Knockapi::MessageEvent::Type::TaggedSymbol)
126
- MESSAGE_SENT =
127
- T.let(:"message.sent", Knockapi::MessageEvent::Type::TaggedSymbol)
128
- MESSAGE_UNARCHIVED =
128
+ MESSAGE_INTERACTED =
129
129
  T.let(
130
- :"message.unarchived",
130
+ :"message.interacted",
131
131
  Knockapi::MessageEvent::Type::TaggedSymbol
132
132
  )
133
- MESSAGE_UNDELIVERED =
133
+ MESSAGE_UNSEEN =
134
+ T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol)
135
+ MESSAGE_UNREAD =
136
+ T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol)
137
+ MESSAGE_UNARCHIVED =
134
138
  T.let(
135
- :"message.undelivered",
139
+ :"message.unarchived",
136
140
  Knockapi::MessageEvent::Type::TaggedSymbol
137
141
  )
138
- MESSAGE_UNREAD =
139
- T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol)
140
- MESSAGE_UNSEEN =
141
- T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol)
142
142
 
143
143
  sig do
144
144
  override.returns(T::Array[Knockapi::MessageEvent::Type::TaggedSymbol])
@@ -0,0 +1,51 @@
1
+ # typed: strong
2
+
3
+ module Knockapi
4
+ module Models
5
+ class ObjectUnsetPreferencesParams < 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::ObjectUnsetPreferencesParams,
13
+ Knockapi::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :collection
19
+
20
+ sig { returns(String) }
21
+ attr_accessor :object_id_
22
+
23
+ sig { returns(String) }
24
+ attr_accessor :id
25
+
26
+ sig do
27
+ params(
28
+ collection: String,
29
+ object_id_: String,
30
+ id: String,
31
+ request_options: Knockapi::RequestOptions::OrHash
32
+ ).returns(T.attached_class)
33
+ end
34
+ def self.new(collection:, object_id_:, id:, request_options: {})
35
+ end
36
+
37
+ sig do
38
+ override.returns(
39
+ {
40
+ collection: String,
41
+ object_id_: String,
42
+ id: String,
43
+ request_options: Knockapi::RequestOptions
44
+ }
45
+ )
46
+ end
47
+ def to_hash
48
+ end
49
+ end
50
+ end
51
+ end
@@ -65,26 +65,40 @@ module Knockapi
65
65
  sig { returns(T::Boolean) }
66
66
  attr_accessor :ok
67
67
 
68
+ # The Microsoft Teams tenant ID for the connected tenant.
69
+ sig { returns(T.nilable(String)) }
70
+ attr_accessor :ms_teams_tenant_id
71
+
68
72
  # The reason for the Microsoft Teams connection if it is not valid.
69
73
  sig { returns(T.nilable(String)) }
70
74
  attr_accessor :reason
71
75
 
72
76
  # A Microsoft Teams connection object.
73
77
  sig do
74
- params(ok: T::Boolean, reason: T.nilable(String)).returns(
75
- T.attached_class
76
- )
78
+ params(
79
+ ok: T::Boolean,
80
+ ms_teams_tenant_id: T.nilable(String),
81
+ reason: T.nilable(String)
82
+ ).returns(T.attached_class)
77
83
  end
78
84
  def self.new(
79
85
  # Whether the Microsoft Teams connection is valid.
80
86
  ok:,
87
+ # The Microsoft Teams tenant ID for the connected tenant.
88
+ ms_teams_tenant_id: nil,
81
89
  # The reason for the Microsoft Teams connection if it is not valid.
82
90
  reason: nil
83
91
  )
84
92
  end
85
93
 
86
94
  sig do
87
- override.returns({ ok: T::Boolean, reason: T.nilable(String) })
95
+ override.returns(
96
+ {
97
+ ok: T::Boolean,
98
+ ms_teams_tenant_id: T.nilable(String),
99
+ reason: T.nilable(String)
100
+ }
101
+ )
88
102
  end
89
103
  def to_hash
90
104
  end
@@ -151,21 +151,71 @@ module Knockapi
151
151
  )
152
152
  end
153
153
 
154
- # The URL of the incoming webhook for a Slack connection.
155
- sig { returns(String) }
156
- attr_accessor :url
154
+ # A Slack connection incoming webhook.
155
+ sig do
156
+ returns(
157
+ Knockapi::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection::IncomingWebhook
158
+ )
159
+ end
160
+ attr_reader :incoming_webhook
161
+
162
+ sig do
163
+ params(
164
+ incoming_webhook:
165
+ Knockapi::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection::IncomingWebhook::OrHash
166
+ ).void
167
+ end
168
+ attr_writer :incoming_webhook
157
169
 
158
170
  # A Slack connection incoming webhook.
159
- sig { params(url: String).returns(T.attached_class) }
171
+ sig do
172
+ params(
173
+ incoming_webhook:
174
+ Knockapi::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection::IncomingWebhook::OrHash
175
+ ).returns(T.attached_class)
176
+ end
160
177
  def self.new(
161
- # The URL of the incoming webhook for a Slack connection.
162
- url:
178
+ # A Slack connection incoming webhook.
179
+ incoming_webhook:
163
180
  )
164
181
  end
165
182
 
166
- sig { override.returns({ url: String }) }
183
+ sig do
184
+ override.returns(
185
+ {
186
+ incoming_webhook:
187
+ Knockapi::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection::IncomingWebhook
188
+ }
189
+ )
190
+ end
167
191
  def to_hash
168
192
  end
193
+
194
+ class IncomingWebhook < Knockapi::Internal::Type::BaseModel
195
+ OrHash =
196
+ T.type_alias do
197
+ T.any(
198
+ Knockapi::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection::IncomingWebhook,
199
+ Knockapi::Internal::AnyHash
200
+ )
201
+ end
202
+
203
+ # The URL of the incoming webhook for a Slack connection.
204
+ sig { returns(String) }
205
+ attr_accessor :url
206
+
207
+ # A Slack connection incoming webhook.
208
+ sig { params(url: String).returns(T.attached_class) }
209
+ def self.new(
210
+ # The URL of the incoming webhook for a Slack connection.
211
+ url:
212
+ )
213
+ end
214
+
215
+ sig { override.returns({ url: String }) }
216
+ def to_hash
217
+ end
218
+ end
169
219
  end
170
220
 
171
221
  sig do
@@ -128,6 +128,24 @@ module Knockapi
128
128
  )
129
129
  end
130
130
 
131
+ # The icon URL for the tenant in dark mode. Falls back to `icon_url` if unset.
132
+ sig { returns(T.nilable(String)) }
133
+ attr_accessor :dark_icon_url
134
+
135
+ # The logo URL for the tenant in dark mode. Falls back to `logo_url` if unset.
136
+ sig { returns(T.nilable(String)) }
137
+ attr_accessor :dark_logo_url
138
+
139
+ # The primary color for the tenant in dark mode, provided as a hex value. Defaults
140
+ # to `#FFFFFF`.
141
+ sig { returns(T.nilable(String)) }
142
+ attr_accessor :dark_primary_color
143
+
144
+ # The primary color contrast for the tenant in dark mode, provided as a hex value.
145
+ # Defaults to `#000000`.
146
+ sig { returns(T.nilable(String)) }
147
+ attr_accessor :dark_primary_color_contrast
148
+
131
149
  # The icon URL for the tenant. Must point to a valid image with an image MIME
132
150
  # type.
133
151
  sig { returns(T.nilable(String)) }
@@ -149,6 +167,10 @@ module Knockapi
149
167
  # The branding for the tenant.
150
168
  sig do
151
169
  params(
170
+ dark_icon_url: T.nilable(String),
171
+ dark_logo_url: T.nilable(String),
172
+ dark_primary_color: T.nilable(String),
173
+ dark_primary_color_contrast: T.nilable(String),
152
174
  icon_url: T.nilable(String),
153
175
  logo_url: T.nilable(String),
154
176
  primary_color: T.nilable(String),
@@ -156,6 +178,16 @@ module Knockapi
156
178
  ).returns(T.attached_class)
157
179
  end
158
180
  def self.new(
181
+ # The icon URL for the tenant in dark mode. Falls back to `icon_url` if unset.
182
+ dark_icon_url: nil,
183
+ # The logo URL for the tenant in dark mode. Falls back to `logo_url` if unset.
184
+ dark_logo_url: nil,
185
+ # The primary color for the tenant in dark mode, provided as a hex value. Defaults
186
+ # to `#FFFFFF`.
187
+ dark_primary_color: nil,
188
+ # The primary color contrast for the tenant in dark mode, provided as a hex value.
189
+ # Defaults to `#000000`.
190
+ dark_primary_color_contrast: nil,
159
191
  # The icon URL for the tenant. Must point to a valid image with an image MIME
160
192
  # type.
161
193
  icon_url: nil,
@@ -172,6 +204,10 @@ module Knockapi
172
204
  sig do
173
205
  override.returns(
174
206
  {
207
+ dark_icon_url: T.nilable(String),
208
+ dark_logo_url: T.nilable(String),
209
+ dark_primary_color: T.nilable(String),
210
+ dark_primary_color_contrast: T.nilable(String),
175
211
  icon_url: T.nilable(String),
176
212
  logo_url: T.nilable(String),
177
213
  primary_color: T.nilable(String),
@@ -204,6 +204,24 @@ module Knockapi
204
204
  )
205
205
  end
206
206
 
207
+ # The icon URL for the tenant in dark mode. Falls back to `icon_url` if unset.
208
+ sig { returns(T.nilable(String)) }
209
+ attr_accessor :dark_icon_url
210
+
211
+ # The logo URL for the tenant in dark mode. Falls back to `logo_url` if unset.
212
+ sig { returns(T.nilable(String)) }
213
+ attr_accessor :dark_logo_url
214
+
215
+ # The primary color for the tenant in dark mode, provided as a hex value. Defaults
216
+ # to `#FFFFFF`.
217
+ sig { returns(T.nilable(String)) }
218
+ attr_accessor :dark_primary_color
219
+
220
+ # The primary color contrast for the tenant in dark mode, provided as a hex value.
221
+ # Defaults to `#000000`.
222
+ sig { returns(T.nilable(String)) }
223
+ attr_accessor :dark_primary_color_contrast
224
+
207
225
  # The icon URL for the tenant. Must point to a valid image with an image MIME
208
226
  # type.
209
227
  sig { returns(T.nilable(String)) }
@@ -225,6 +243,10 @@ module Knockapi
225
243
  # The branding for the tenant.
226
244
  sig do
227
245
  params(
246
+ dark_icon_url: T.nilable(String),
247
+ dark_logo_url: T.nilable(String),
248
+ dark_primary_color: T.nilable(String),
249
+ dark_primary_color_contrast: T.nilable(String),
228
250
  icon_url: T.nilable(String),
229
251
  logo_url: T.nilable(String),
230
252
  primary_color: T.nilable(String),
@@ -232,6 +254,16 @@ module Knockapi
232
254
  ).returns(T.attached_class)
233
255
  end
234
256
  def self.new(
257
+ # The icon URL for the tenant in dark mode. Falls back to `icon_url` if unset.
258
+ dark_icon_url: nil,
259
+ # The logo URL for the tenant in dark mode. Falls back to `logo_url` if unset.
260
+ dark_logo_url: nil,
261
+ # The primary color for the tenant in dark mode, provided as a hex value. Defaults
262
+ # to `#FFFFFF`.
263
+ dark_primary_color: nil,
264
+ # The primary color contrast for the tenant in dark mode, provided as a hex value.
265
+ # Defaults to `#000000`.
266
+ dark_primary_color_contrast: nil,
235
267
  # The icon URL for the tenant. Must point to a valid image with an image MIME
236
268
  # type.
237
269
  icon_url: nil,
@@ -248,6 +280,10 @@ module Knockapi
248
280
  sig do
249
281
  override.returns(
250
282
  {
283
+ dark_icon_url: T.nilable(String),
284
+ dark_logo_url: T.nilable(String),
285
+ dark_primary_color: T.nilable(String),
286
+ dark_primary_color_contrast: T.nilable(String),
251
287
  icon_url: T.nilable(String),
252
288
  logo_url: T.nilable(String),
253
289
  primary_color: T.nilable(String),
@@ -0,0 +1,46 @@
1
+ # typed: strong
2
+
3
+ module Knockapi
4
+ module Models
5
+ class UserUnsetPreferencesParams < 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::UserUnsetPreferencesParams,
13
+ Knockapi::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :user_id
19
+
20
+ sig { returns(String) }
21
+ attr_accessor :id
22
+
23
+ sig do
24
+ params(
25
+ user_id: String,
26
+ id: String,
27
+ request_options: Knockapi::RequestOptions::OrHash
28
+ ).returns(T.attached_class)
29
+ end
30
+ def self.new(user_id:, id:, request_options: {})
31
+ end
32
+
33
+ sig do
34
+ override.returns(
35
+ {
36
+ user_id: String,
37
+ id: String,
38
+ request_options: Knockapi::RequestOptions
39
+ }
40
+ )
41
+ end
42
+ def to_hash
43
+ end
44
+ end
45
+ end
46
+ end