knockapi 1.4.0 → 1.6.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/README.md +1 -1
- data/lib/knockapi/internal/type/enum.rb +6 -3
- data/lib/knockapi/internal/type/union.rb +5 -2
- data/lib/knockapi/internal/util.rb +8 -9
- data/lib/knockapi/models/objects/bulk_set_params.rb +46 -3
- data/lib/knockapi/models/schedule_create_params.rb +19 -9
- data/lib/knockapi/models/schedule_list_params.rb +4 -4
- data/lib/knockapi/models/schedule_repeat_rule.rb +9 -9
- data/lib/knockapi/models/tenant_set_params.rb +1 -11
- data/lib/knockapi/models/user_list_subscriptions_params.rb +4 -4
- data/lib/knockapi/models.rb +4 -4
- data/lib/knockapi/resources/objects/bulk.rb +1 -1
- data/lib/knockapi/resources/schedules.rb +6 -4
- data/lib/knockapi/resources/tenants.rb +1 -3
- data/lib/knockapi/resources/users.rb +1 -1
- data/lib/knockapi/version.rb +1 -1
- data/rbi/knockapi/internal/util.rbi +2 -0
- data/rbi/knockapi/models/objects/bulk_set_params.rbi +117 -3
- data/rbi/knockapi/models/schedule_create_params.rbi +49 -8
- data/rbi/knockapi/models/schedule_list_params.rbi +33 -6
- data/rbi/knockapi/models/schedule_repeat_rule.rbi +11 -8
- data/rbi/knockapi/models/tenant_set_params.rbi +0 -21
- data/rbi/knockapi/models/user_list_subscriptions_params.rbi +33 -6
- data/rbi/knockapi/resources/objects/bulk.rbi +1 -1
- data/rbi/knockapi/resources/schedules.rbi +23 -5
- data/rbi/knockapi/resources/tenants.rbi +0 -9
- data/rbi/knockapi/resources/users.rbi +8 -2
- data/sig/knockapi/models/objects/bulk_set_params.rbs +36 -4
- data/sig/knockapi/models/schedule_create_params.rbs +14 -5
- data/sig/knockapi/models/schedule_list_params.rbs +7 -5
- data/sig/knockapi/models/schedule_repeat_rule.rbs +7 -5
- data/sig/knockapi/models/tenant_set_params.rbs +0 -5
- data/sig/knockapi/models/user_list_subscriptions_params.rbs +7 -5
- data/sig/knockapi/resources/objects/bulk.rbs +1 -1
- data/sig/knockapi/resources/schedules.rbs +3 -2
- data/sig/knockapi/resources/tenants.rbs +0 -1
- data/sig/knockapi/resources/users.rbs +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88bed516b45f927d1fbb308a5772702f01c0730f771aa9beb5fd109cca94c737
|
4
|
+
data.tar.gz: 274df112dda80229e94e280b8a6254722b2a61a50137dbfbd6fd53c108e58077
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32ef82b2c71ec00d58d059d53603022eee35219d9eb27478f5616c4d29dd229d08e7f6c2ef4b868c1030cc48e80953ca3c16d9538f0fbafab2f14a0d8d4346df
|
7
|
+
data.tar.gz: 4050f90d2fe88af42d1fe64e760d41d0d43b8671050277eaf254fda2cd618b0c5c39f0a6150bd10d75cdf015d653cca4cd4ff28e1eada6e599aaa6e6911d469d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,31 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.6.0 (2025-06-06)
|
4
|
+
|
5
|
+
Full Changelog: [v1.5.0...v1.6.0](https://github.com/knocklabs/knock-ruby/compare/v1.5.0...v1.6.0)
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
* **api:** api update ([53aa9c9](https://github.com/knocklabs/knock-ruby/commit/53aa9c9ebd4a8e7be2fd5bdf08a4b749f6b9d116))
|
10
|
+
|
11
|
+
|
12
|
+
### Bug Fixes
|
13
|
+
|
14
|
+
* default content-type for text in multi-part formdata uploads should be text/plain ([de655f0](https://github.com/knocklabs/knock-ruby/commit/de655f0dd9194b4c30d7ad26e2da98f6cba51a0f))
|
15
|
+
|
16
|
+
## 1.5.0 (2025-06-04)
|
17
|
+
|
18
|
+
Full Changelog: [v1.4.0...v1.5.0](https://github.com/knocklabs/knock-ruby/compare/v1.4.0...v1.5.0)
|
19
|
+
|
20
|
+
### Features
|
21
|
+
|
22
|
+
* **api:** api update ([b4a8a6f](https://github.com/knocklabs/knock-ruby/commit/b4a8a6f6bd5451fb68be75c19b5b08b7629543cc))
|
23
|
+
|
24
|
+
|
25
|
+
### Bug Fixes
|
26
|
+
|
27
|
+
* `to_sorbet_type` should not return branded types ([2fe0597](https://github.com/knocklabs/knock-ruby/commit/2fe05973673d02ced0a04abc32f0ea079ff9313f))
|
28
|
+
|
3
29
|
## 1.4.0 (2025-05-29)
|
4
30
|
|
5
31
|
Full Changelog: [v1.3.0...v1.4.0](https://github.com/knocklabs/knock-ruby/compare/v1.3.0...v1.4.0)
|
data/README.md
CHANGED
@@ -91,11 +91,14 @@ module Knockapi
|
|
91
91
|
#
|
92
92
|
# @return [Object]
|
93
93
|
def to_sorbet_type
|
94
|
-
|
94
|
+
types = values.map { Knockapi::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq
|
95
|
+
case types
|
95
96
|
in []
|
96
97
|
T.noreturn
|
97
|
-
in [
|
98
|
-
|
98
|
+
in [type]
|
99
|
+
type
|
100
|
+
else
|
101
|
+
T.any(*types)
|
99
102
|
end
|
100
103
|
end
|
101
104
|
|
@@ -206,11 +206,14 @@ module Knockapi
|
|
206
206
|
#
|
207
207
|
# @return [Object]
|
208
208
|
def to_sorbet_type
|
209
|
-
|
209
|
+
types = variants.map { Knockapi::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq
|
210
|
+
case types
|
210
211
|
in []
|
211
212
|
T.noreturn
|
213
|
+
in [type]
|
214
|
+
type
|
212
215
|
else
|
213
|
-
T.any(*
|
216
|
+
T.any(*types)
|
214
217
|
end
|
215
218
|
end
|
216
219
|
|
@@ -497,7 +497,7 @@ module Knockapi
|
|
497
497
|
# @param closing [Array<Proc>]
|
498
498
|
# @param content_type [String, nil]
|
499
499
|
private def write_multipart_content(y, val:, closing:, content_type: nil)
|
500
|
-
|
500
|
+
content_line = "Content-Type: %s\r\n\r\n"
|
501
501
|
|
502
502
|
case val
|
503
503
|
in Knockapi::FilePart
|
@@ -508,24 +508,21 @@ module Knockapi
|
|
508
508
|
content_type: val.content_type
|
509
509
|
)
|
510
510
|
in Pathname
|
511
|
-
y <<
|
511
|
+
y << format(content_line, content_type || "application/octet-stream")
|
512
512
|
io = val.open(binmode: true)
|
513
513
|
closing << io.method(:close)
|
514
514
|
IO.copy_stream(io, y)
|
515
515
|
in IO
|
516
|
-
y <<
|
516
|
+
y << format(content_line, content_type || "application/octet-stream")
|
517
517
|
IO.copy_stream(val, y)
|
518
518
|
in StringIO
|
519
|
-
y <<
|
519
|
+
y << format(content_line, content_type || "application/octet-stream")
|
520
520
|
y << val.string
|
521
|
-
in String
|
522
|
-
y << "Content-Type: #{content_type}\r\n\r\n"
|
523
|
-
y << val.to_s
|
524
521
|
in -> { primitive?(_1) }
|
525
|
-
y << "
|
522
|
+
y << format(content_line, content_type || "text/plain")
|
526
523
|
y << val.to_s
|
527
524
|
else
|
528
|
-
y << "
|
525
|
+
y << format(content_line, content_type || "application/json")
|
529
526
|
y << JSON.generate(val)
|
530
527
|
end
|
531
528
|
y << "\r\n"
|
@@ -563,6 +560,8 @@ module Knockapi
|
|
563
560
|
|
564
561
|
# @api private
|
565
562
|
#
|
563
|
+
# https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#special-considerations-for-multipart-content
|
564
|
+
#
|
566
565
|
# @param body [Object]
|
567
566
|
#
|
568
567
|
# @return [Array(String, Enumerable<String>)]
|
@@ -11,13 +11,56 @@ module Knockapi
|
|
11
11
|
# @!attribute objects
|
12
12
|
# A list of objects.
|
13
13
|
#
|
14
|
-
# @return [Array<Knockapi::Models::
|
15
|
-
required :objects, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::
|
14
|
+
# @return [Array<Knockapi::Models::Objects::BulkSetParams::Object>]
|
15
|
+
required :objects, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Objects::BulkSetParams::Object] }
|
16
16
|
|
17
17
|
# @!method initialize(objects:, request_options: {})
|
18
|
-
# @param objects [Array<Knockapi::Models::
|
18
|
+
# @param objects [Array<Knockapi::Models::Objects::BulkSetParams::Object>] A list of objects.
|
19
19
|
#
|
20
20
|
# @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}]
|
21
|
+
|
22
|
+
class Object < Knockapi::Internal::Type::BaseModel
|
23
|
+
# @!attribute id
|
24
|
+
# Unique identifier for the object.
|
25
|
+
#
|
26
|
+
# @return [String]
|
27
|
+
required :id, String
|
28
|
+
|
29
|
+
# @!attribute channel_data
|
30
|
+
# A request to set channel data for a type of channel inline.
|
31
|
+
#
|
32
|
+
# @return [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::OneSignalChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData}, nil]
|
33
|
+
optional :channel_data,
|
34
|
+
-> {
|
35
|
+
Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::InlineChannelDataRequestItem]
|
36
|
+
},
|
37
|
+
nil?: true
|
38
|
+
|
39
|
+
# @!attribute created_at
|
40
|
+
# Timestamp when the resource was created.
|
41
|
+
#
|
42
|
+
# @return [Time, nil]
|
43
|
+
optional :created_at, Time, nil?: true
|
44
|
+
|
45
|
+
# @!attribute preferences
|
46
|
+
# Inline set preferences for a recipient, where the key is the preference set id.
|
47
|
+
#
|
48
|
+
# @return [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil]
|
49
|
+
optional :preferences,
|
50
|
+
-> { Knockapi::Internal::Type::HashOf[Knockapi::Recipients::PreferenceSetRequest] },
|
51
|
+
nil?: true
|
52
|
+
|
53
|
+
# @!method initialize(id:, channel_data: nil, created_at: nil, preferences: nil)
|
54
|
+
# A custom [Object](/concepts/objects) entity which belongs to a collection.
|
55
|
+
#
|
56
|
+
# @param id [String] Unique identifier for the object.
|
57
|
+
#
|
58
|
+
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::OneSignalChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData}, nil] A request to set channel data for a type of channel inline.
|
59
|
+
#
|
60
|
+
# @param created_at [Time, nil] Timestamp when the resource was created.
|
61
|
+
#
|
62
|
+
# @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id.
|
63
|
+
end
|
21
64
|
end
|
22
65
|
end
|
23
66
|
end
|
@@ -13,18 +13,20 @@ module Knockapi
|
|
13
13
|
# @return [Array<String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest>]
|
14
14
|
required :recipients, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientRequest] }
|
15
15
|
|
16
|
-
# @!attribute repeats
|
17
|
-
# The repeat rule for the schedule.
|
18
|
-
#
|
19
|
-
# @return [Array<Knockapi::Models::ScheduleRepeatRule>]
|
20
|
-
required :repeats, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::ScheduleRepeatRule] }
|
21
|
-
|
22
16
|
# @!attribute workflow
|
23
17
|
# The key of the workflow.
|
24
18
|
#
|
25
19
|
# @return [String]
|
26
20
|
required :workflow, String
|
27
21
|
|
22
|
+
# @!attribute actor
|
23
|
+
# Specifies a recipient in a request. This can either be a user identifier
|
24
|
+
# (string), an inline user request (object), or an inline object request, which is
|
25
|
+
# determined by the presence of a `collection` property.
|
26
|
+
#
|
27
|
+
# @return [String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest, nil]
|
28
|
+
optional :actor, union: -> { Knockapi::RecipientRequest }, nil?: true
|
29
|
+
|
28
30
|
# @!attribute data
|
29
31
|
# An optional map of data to pass into the workflow execution. There is a 1024
|
30
32
|
# byte limit on the size of any single string value (with the exception of
|
@@ -40,6 +42,12 @@ module Knockapi
|
|
40
42
|
# @return [Time, nil]
|
41
43
|
optional :ending_at, Time, nil?: true
|
42
44
|
|
45
|
+
# @!attribute repeats
|
46
|
+
# The repeat rule for the schedule.
|
47
|
+
#
|
48
|
+
# @return [Array<Knockapi::Models::ScheduleRepeatRule>, nil]
|
49
|
+
optional :repeats, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::ScheduleRepeatRule] }
|
50
|
+
|
43
51
|
# @!attribute scheduled_at
|
44
52
|
# The starting date and time for the schedule.
|
45
53
|
#
|
@@ -52,20 +60,22 @@ module Knockapi
|
|
52
60
|
# @return [String, Knockapi::Models::TenantRequest, nil]
|
53
61
|
optional :tenant, union: -> { Knockapi::InlineTenantRequest }, nil?: true
|
54
62
|
|
55
|
-
# @!method initialize(recipients:,
|
63
|
+
# @!method initialize(recipients:, workflow:, actor: nil, data: nil, ending_at: nil, repeats: nil, scheduled_at: nil, tenant: nil, request_options: {})
|
56
64
|
# Some parameter documentations has been truncated, see
|
57
65
|
# {Knockapi::Models::ScheduleCreateParams} for more details.
|
58
66
|
#
|
59
67
|
# @param recipients [Array<String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest>] The recipients to set the schedule for. Limited to 100 recipients per request.
|
60
68
|
#
|
61
|
-
# @param repeats [Array<Knockapi::Models::ScheduleRepeatRule>] The repeat rule for the schedule.
|
62
|
-
#
|
63
69
|
# @param workflow [String] The key of the workflow.
|
64
70
|
#
|
71
|
+
# @param actor [String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest, nil] Specifies a recipient in a request. This can either be a user identifier (string
|
72
|
+
#
|
65
73
|
# @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 1024 byt
|
66
74
|
#
|
67
75
|
# @param ending_at [Time, nil] The ending date and time for the schedule.
|
68
76
|
#
|
77
|
+
# @param repeats [Array<Knockapi::Models::ScheduleRepeatRule>] The repeat rule for the schedule.
|
78
|
+
#
|
69
79
|
# @param scheduled_at [Time, nil] The starting date and time for the schedule.
|
70
80
|
#
|
71
81
|
# @param tenant [String, Knockapi::Models::TenantRequest, nil] An request to set a tenant inline.
|
@@ -32,10 +32,10 @@ module Knockapi
|
|
32
32
|
optional :page_size, Integer
|
33
33
|
|
34
34
|
# @!attribute recipients
|
35
|
-
# Filter by recipient
|
35
|
+
# Filter by recipient references.
|
36
36
|
#
|
37
|
-
# @return [Array<String>, nil]
|
38
|
-
optional :recipients, Knockapi::Internal::Type::ArrayOf[
|
37
|
+
# @return [Array<String, Knockapi::Models::RecipientReference::ObjectReference>, nil]
|
38
|
+
optional :recipients, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference] }
|
39
39
|
|
40
40
|
# @!attribute tenant
|
41
41
|
# Filter by tenant ID.
|
@@ -52,7 +52,7 @@ module Knockapi
|
|
52
52
|
#
|
53
53
|
# @param page_size [Integer] The number of items per page.
|
54
54
|
#
|
55
|
-
# @param recipients [Array<String>] Filter by recipient
|
55
|
+
# @param recipients [Array<String, Knockapi::Models::RecipientReference::ObjectReference>] Filter by recipient references.
|
56
56
|
#
|
57
57
|
# @param tenant [String] Filter by tenant ID.
|
58
58
|
#
|
@@ -3,18 +3,18 @@
|
|
3
3
|
module Knockapi
|
4
4
|
module Models
|
5
5
|
class ScheduleRepeatRule < Knockapi::Internal::Type::BaseModel
|
6
|
-
# @!attribute _typename
|
7
|
-
# The typename of the schema.
|
8
|
-
#
|
9
|
-
# @return [String]
|
10
|
-
required :_typename, String, api_name: :__typename
|
11
|
-
|
12
6
|
# @!attribute frequency
|
13
7
|
# The frequency of the schedule.
|
14
8
|
#
|
15
9
|
# @return [Symbol, Knockapi::Models::ScheduleRepeatRule::Frequency]
|
16
10
|
required :frequency, enum: -> { Knockapi::ScheduleRepeatRule::Frequency }
|
17
11
|
|
12
|
+
# @!attribute _typename
|
13
|
+
# The typename of the schema.
|
14
|
+
#
|
15
|
+
# @return [String, nil]
|
16
|
+
optional :_typename, String, api_name: :__typename
|
17
|
+
|
18
18
|
# @!attribute day_of_month
|
19
19
|
# The day of the month to repeat the schedule.
|
20
20
|
#
|
@@ -47,13 +47,13 @@ module Knockapi
|
|
47
47
|
# @return [Integer, nil]
|
48
48
|
optional :minutes, Integer, nil?: true
|
49
49
|
|
50
|
-
# @!method initialize(
|
50
|
+
# @!method initialize(frequency:, _typename: nil, day_of_month: nil, days: nil, hours: nil, interval: nil, minutes: nil)
|
51
51
|
# The repeat rule for the schedule.
|
52
52
|
#
|
53
|
-
# @param _typename [String] The typename of the schema.
|
54
|
-
#
|
55
53
|
# @param frequency [Symbol, Knockapi::Models::ScheduleRepeatRule::Frequency] The frequency of the schedule.
|
56
54
|
#
|
55
|
+
# @param _typename [String] The typename of the schema.
|
56
|
+
#
|
57
57
|
# @param day_of_month [Integer, nil] The day of the month to repeat the schedule.
|
58
58
|
#
|
59
59
|
# @param days [Array<Symbol, Knockapi::Models::ScheduleRepeatRule::Day>, nil] The days of the week to repeat the schedule.
|
@@ -17,25 +17,15 @@ module Knockapi
|
|
17
17
|
},
|
18
18
|
nil?: true
|
19
19
|
|
20
|
-
# @!attribute preferences
|
21
|
-
# Inline set preferences for a recipient, where the key is the preference set id.
|
22
|
-
#
|
23
|
-
# @return [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil]
|
24
|
-
optional :preferences,
|
25
|
-
-> { Knockapi::Internal::Type::HashOf[Knockapi::Recipients::PreferenceSetRequest] },
|
26
|
-
nil?: true
|
27
|
-
|
28
20
|
# @!attribute settings
|
29
21
|
# The settings for the tenant. Includes branding and preference set.
|
30
22
|
#
|
31
23
|
# @return [Knockapi::Models::TenantSetParams::Settings, nil]
|
32
24
|
optional :settings, -> { Knockapi::TenantSetParams::Settings }
|
33
25
|
|
34
|
-
# @!method initialize(channel_data: nil,
|
26
|
+
# @!method initialize(channel_data: nil, settings: nil, request_options: {})
|
35
27
|
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::OneSignalChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData}, nil] A request to set channel data for a type of channel inline.
|
36
28
|
#
|
37
|
-
# @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id.
|
38
|
-
#
|
39
29
|
# @param settings [Knockapi::Models::TenantSetParams::Settings] The settings for the tenant. Includes branding and preference set.
|
40
30
|
#
|
41
31
|
# @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}]
|
@@ -27,10 +27,10 @@ module Knockapi
|
|
27
27
|
-> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::UserListSubscriptionsParams::Include] }
|
28
28
|
|
29
29
|
# @!attribute objects
|
30
|
-
# Only returns subscriptions for the specified object
|
30
|
+
# Only returns subscriptions for the specified object references.
|
31
31
|
#
|
32
|
-
# @return [Array<String>, nil]
|
33
|
-
optional :objects, Knockapi::Internal::Type::ArrayOf[
|
32
|
+
# @return [Array<String, Knockapi::Models::RecipientReference::ObjectReference>, nil]
|
33
|
+
optional :objects, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference] }
|
34
34
|
|
35
35
|
# @!attribute page_size
|
36
36
|
# The number of items per page.
|
@@ -45,7 +45,7 @@ module Knockapi
|
|
45
45
|
#
|
46
46
|
# @param include [Array<Symbol, Knockapi::Models::UserListSubscriptionsParams::Include>] Associated resources to include in the response.
|
47
47
|
#
|
48
|
-
# @param objects [Array<String>] Only returns subscriptions for the specified object
|
48
|
+
# @param objects [Array<String, Knockapi::Models::RecipientReference::ObjectReference>] Only returns subscriptions for the specified object references.
|
49
49
|
#
|
50
50
|
# @param page_size [Integer] The number of items per page.
|
51
51
|
#
|
data/lib/knockapi/models.rb
CHANGED
@@ -11,16 +11,16 @@ module Knockapi
|
|
11
11
|
mod.constants.each do |name|
|
12
12
|
case mod.const_get(name)
|
13
13
|
in true | false
|
14
|
-
mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T
|
14
|
+
mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T::Boolean } }
|
15
15
|
mod.define_sorbet_constant!(:OrBoolean) { T.type_alias { T::Boolean } }
|
16
16
|
in Integer
|
17
|
-
mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias {
|
17
|
+
mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias { Integer } }
|
18
18
|
mod.define_sorbet_constant!(:OrInteger) { T.type_alias { Integer } }
|
19
19
|
in Float
|
20
|
-
mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias {
|
20
|
+
mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias { Float } }
|
21
21
|
mod.define_sorbet_constant!(:OrFloat) { T.type_alias { Float } }
|
22
22
|
in Symbol
|
23
|
-
mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias {
|
23
|
+
mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { Symbol } }
|
24
24
|
mod.define_sorbet_constant!(:OrSymbol) { T.type_alias { T.any(Symbol, String) } }
|
25
25
|
else
|
26
26
|
end
|
@@ -62,7 +62,7 @@ module Knockapi
|
|
62
62
|
#
|
63
63
|
# @param collection [String] The collection this object belongs to.
|
64
64
|
#
|
65
|
-
# @param objects [Array<Knockapi::Models::
|
65
|
+
# @param objects [Array<Knockapi::Models::Objects::BulkSetParams::Object>] A list of objects.
|
66
66
|
#
|
67
67
|
# @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil]
|
68
68
|
#
|
@@ -15,18 +15,20 @@ module Knockapi
|
|
15
15
|
# [inline identifications](/managing-recipients/identifying-recipients#inline-identifying-recipients)
|
16
16
|
# for the `actor`, `recipient`, and `tenant` fields.
|
17
17
|
#
|
18
|
-
# @overload create(recipients:,
|
18
|
+
# @overload create(recipients:, workflow:, actor: nil, data: nil, ending_at: nil, repeats: nil, scheduled_at: nil, tenant: nil, request_options: {})
|
19
19
|
#
|
20
20
|
# @param recipients [Array<String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest>] The recipients to set the schedule for. Limited to 100 recipients per request.
|
21
21
|
#
|
22
|
-
# @param repeats [Array<Knockapi::Models::ScheduleRepeatRule>] The repeat rule for the schedule.
|
23
|
-
#
|
24
22
|
# @param workflow [String] The key of the workflow.
|
25
23
|
#
|
24
|
+
# @param actor [String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest, nil] Specifies a recipient in a request. This can either be a user identifier (string
|
25
|
+
#
|
26
26
|
# @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 1024 byt
|
27
27
|
#
|
28
28
|
# @param ending_at [Time, nil] The ending date and time for the schedule.
|
29
29
|
#
|
30
|
+
# @param repeats [Array<Knockapi::Models::ScheduleRepeatRule>] The repeat rule for the schedule.
|
31
|
+
#
|
30
32
|
# @param scheduled_at [Time, nil] The starting date and time for the schedule.
|
31
33
|
#
|
32
34
|
# @param tenant [String, Knockapi::Models::TenantRequest, nil] An request to set a tenant inline.
|
@@ -101,7 +103,7 @@ module Knockapi
|
|
101
103
|
#
|
102
104
|
# @param page_size [Integer] The number of items per page.
|
103
105
|
#
|
104
|
-
# @param recipients [Array<String>] Filter by recipient
|
106
|
+
# @param recipients [Array<String, Knockapi::Models::RecipientReference::ObjectReference>] Filter by recipient references.
|
105
107
|
#
|
106
108
|
# @param tenant [String] Filter by tenant ID.
|
107
109
|
#
|
@@ -80,14 +80,12 @@ module Knockapi
|
|
80
80
|
# Sets a tenant within an environment, performing an upsert operation. Any
|
81
81
|
# existing properties will be merged with the incoming properties.
|
82
82
|
#
|
83
|
-
# @overload set(id, channel_data: nil,
|
83
|
+
# @overload set(id, channel_data: nil, settings: nil, request_options: {})
|
84
84
|
#
|
85
85
|
# @param id [String] The unique identifier for the tenant.
|
86
86
|
#
|
87
87
|
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::OneSignalChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData}, nil] A request to set channel data for a type of channel inline.
|
88
88
|
#
|
89
|
-
# @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id.
|
90
|
-
#
|
91
89
|
# @param settings [Knockapi::Models::TenantSetParams::Settings] The settings for the tenant. Includes branding and preference set.
|
92
90
|
#
|
93
91
|
# @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil]
|
@@ -298,7 +298,7 @@ module Knockapi
|
|
298
298
|
#
|
299
299
|
# @param include [Array<Symbol, Knockapi::Models::UserListSubscriptionsParams::Include>] Associated resources to include in the response.
|
300
300
|
#
|
301
|
-
# @param objects [Array<String>] Only returns subscriptions for the specified object
|
301
|
+
# @param objects [Array<String, Knockapi::Models::RecipientReference::ObjectReference>] Only returns subscriptions for the specified object references.
|
302
302
|
#
|
303
303
|
# @param page_size [Integer] The number of items per page.
|
304
304
|
#
|
data/lib/knockapi/version.rb
CHANGED
@@ -332,6 +332,8 @@ module Knockapi
|
|
332
332
|
end
|
333
333
|
|
334
334
|
# @api private
|
335
|
+
#
|
336
|
+
# https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#special-considerations-for-multipart-content
|
335
337
|
sig do
|
336
338
|
params(body: T.anything).returns([String, T::Enumerable[String]])
|
337
339
|
end
|
@@ -13,12 +13,12 @@ module Knockapi
|
|
13
13
|
end
|
14
14
|
|
15
15
|
# A list of objects.
|
16
|
-
sig { returns(T::Array[Knockapi::
|
16
|
+
sig { returns(T::Array[Knockapi::Objects::BulkSetParams::Object]) }
|
17
17
|
attr_accessor :objects
|
18
18
|
|
19
19
|
sig do
|
20
20
|
params(
|
21
|
-
objects: T::Array[Knockapi::
|
21
|
+
objects: T::Array[Knockapi::Objects::BulkSetParams::Object::OrHash],
|
22
22
|
request_options: Knockapi::RequestOptions::OrHash
|
23
23
|
).returns(T.attached_class)
|
24
24
|
end
|
@@ -32,13 +32,127 @@ module Knockapi
|
|
32
32
|
sig do
|
33
33
|
override.returns(
|
34
34
|
{
|
35
|
-
objects: T::Array[Knockapi::
|
35
|
+
objects: T::Array[Knockapi::Objects::BulkSetParams::Object],
|
36
36
|
request_options: Knockapi::RequestOptions
|
37
37
|
}
|
38
38
|
)
|
39
39
|
end
|
40
40
|
def to_hash
|
41
41
|
end
|
42
|
+
|
43
|
+
class Object < Knockapi::Internal::Type::BaseModel
|
44
|
+
OrHash =
|
45
|
+
T.type_alias do
|
46
|
+
T.any(
|
47
|
+
Knockapi::Objects::BulkSetParams::Object,
|
48
|
+
Knockapi::Internal::AnyHash
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Unique identifier for the object.
|
53
|
+
sig { returns(String) }
|
54
|
+
attr_accessor :id
|
55
|
+
|
56
|
+
# A request to set channel data for a type of channel inline.
|
57
|
+
sig do
|
58
|
+
returns(
|
59
|
+
T.nilable(
|
60
|
+
T::Hash[
|
61
|
+
Symbol,
|
62
|
+
T.any(
|
63
|
+
Knockapi::Recipients::PushChannelData,
|
64
|
+
Knockapi::Recipients::OneSignalChannelData,
|
65
|
+
Knockapi::Recipients::SlackChannelData,
|
66
|
+
Knockapi::Recipients::MsTeamsChannelData,
|
67
|
+
Knockapi::Recipients::DiscordChannelData
|
68
|
+
)
|
69
|
+
]
|
70
|
+
)
|
71
|
+
)
|
72
|
+
end
|
73
|
+
attr_accessor :channel_data
|
74
|
+
|
75
|
+
# Timestamp when the resource was created.
|
76
|
+
sig { returns(T.nilable(Time)) }
|
77
|
+
attr_accessor :created_at
|
78
|
+
|
79
|
+
# Inline set preferences for a recipient, where the key is the preference set id.
|
80
|
+
sig do
|
81
|
+
returns(
|
82
|
+
T.nilable(
|
83
|
+
T::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest]
|
84
|
+
)
|
85
|
+
)
|
86
|
+
end
|
87
|
+
attr_accessor :preferences
|
88
|
+
|
89
|
+
# A custom [Object](/concepts/objects) entity which belongs to a collection.
|
90
|
+
sig do
|
91
|
+
params(
|
92
|
+
id: String,
|
93
|
+
channel_data:
|
94
|
+
T.nilable(
|
95
|
+
T::Hash[
|
96
|
+
Symbol,
|
97
|
+
T.any(
|
98
|
+
Knockapi::Recipients::PushChannelData::OrHash,
|
99
|
+
Knockapi::Recipients::OneSignalChannelData::OrHash,
|
100
|
+
Knockapi::Recipients::SlackChannelData::OrHash,
|
101
|
+
Knockapi::Recipients::MsTeamsChannelData::OrHash,
|
102
|
+
Knockapi::Recipients::DiscordChannelData::OrHash
|
103
|
+
)
|
104
|
+
]
|
105
|
+
),
|
106
|
+
created_at: T.nilable(Time),
|
107
|
+
preferences:
|
108
|
+
T.nilable(
|
109
|
+
T::Hash[
|
110
|
+
Symbol,
|
111
|
+
Knockapi::Recipients::PreferenceSetRequest::OrHash
|
112
|
+
]
|
113
|
+
)
|
114
|
+
).returns(T.attached_class)
|
115
|
+
end
|
116
|
+
def self.new(
|
117
|
+
# Unique identifier for the object.
|
118
|
+
id:,
|
119
|
+
# A request to set channel data for a type of channel inline.
|
120
|
+
channel_data: nil,
|
121
|
+
# Timestamp when the resource was created.
|
122
|
+
created_at: nil,
|
123
|
+
# Inline set preferences for a recipient, where the key is the preference set id.
|
124
|
+
preferences: nil
|
125
|
+
)
|
126
|
+
end
|
127
|
+
|
128
|
+
sig do
|
129
|
+
override.returns(
|
130
|
+
{
|
131
|
+
id: String,
|
132
|
+
channel_data:
|
133
|
+
T.nilable(
|
134
|
+
T::Hash[
|
135
|
+
Symbol,
|
136
|
+
T.any(
|
137
|
+
Knockapi::Recipients::PushChannelData,
|
138
|
+
Knockapi::Recipients::OneSignalChannelData,
|
139
|
+
Knockapi::Recipients::SlackChannelData,
|
140
|
+
Knockapi::Recipients::MsTeamsChannelData,
|
141
|
+
Knockapi::Recipients::DiscordChannelData
|
142
|
+
)
|
143
|
+
]
|
144
|
+
),
|
145
|
+
created_at: T.nilable(Time),
|
146
|
+
preferences:
|
147
|
+
T.nilable(
|
148
|
+
T::Hash[Symbol, Knockapi::Recipients::PreferenceSetRequest]
|
149
|
+
)
|
150
|
+
}
|
151
|
+
)
|
152
|
+
end
|
153
|
+
def to_hash
|
154
|
+
end
|
155
|
+
end
|
42
156
|
end
|
43
157
|
end
|
44
158
|
end
|