imagekitio 4.10.0 → 4.12.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 +37 -0
- data/README.md +28 -1
- data/lib/imagekitio/client.rb +4 -0
- data/lib/imagekitio/internal/tag_cursor.rb +86 -0
- data/lib/imagekitio/models/accounts/contract_get_params.rb +16 -0
- data/lib/imagekitio/models/accounts/contract_get_response.rb +82 -0
- data/lib/imagekitio/models/accounts/contract_units.rb +42 -0
- data/lib/imagekitio/models/accounts/url_endpoint_request.rb +17 -1
- data/lib/imagekitio/models/accounts/url_endpoint_response.rb +17 -1
- data/lib/imagekitio/models/accounts/webhook.rb +81 -0
- data/lib/imagekitio/models/accounts/webhook_create_params.rb +47 -0
- data/lib/imagekitio/models/accounts/webhook_delete_params.rb +24 -0
- data/lib/imagekitio/models/accounts/webhook_event_type.rb +32 -0
- data/lib/imagekitio/models/accounts/webhook_get_params.rb +24 -0
- data/lib/imagekitio/models/accounts/webhook_list_params.rb +16 -0
- data/lib/imagekitio/models/accounts/webhook_list_response.rb +10 -0
- data/lib/imagekitio/models/accounts/webhook_update_params.rb +54 -0
- data/lib/imagekitio/models/asset_list_params.rb +18 -0
- data/lib/imagekitio/models/beta/v2/file_upload_params.rb +5 -1
- data/lib/imagekitio/models/custom_metadata_field.rb +16 -3
- data/lib/imagekitio/models/custom_metadata_field_create_params.rb +4 -0
- data/lib/imagekitio/models/file_upload_params.rb +5 -1
- data/lib/imagekitio/models/folder.rb +33 -1
- data/lib/imagekitio/models/folder_create_event.rb +35 -0
- data/lib/imagekitio/models/folder_delete_event.rb +47 -0
- data/lib/imagekitio/models/folder_update_event.rb +35 -0
- data/lib/imagekitio/models/tag.rb +52 -0
- data/lib/imagekitio/models/tag_list_params.rb +143 -0
- data/lib/imagekitio/models/unsafe_unwrap_webhook_event.rb +10 -1
- data/lib/imagekitio/models/unwrap_webhook_event.rb +10 -1
- data/lib/imagekitio/models/update_file_request.rb +5 -0
- data/lib/imagekitio/models.rb +10 -0
- data/lib/imagekitio/resources/accounts/contract.rb +47 -0
- data/lib/imagekitio/resources/accounts/webhooks.rb +146 -0
- data/lib/imagekitio/resources/accounts.rb +8 -0
- data/lib/imagekitio/resources/custom_metadata_fields.rb +2 -2
- data/lib/imagekitio/resources/files/versions.rb +2 -2
- data/lib/imagekitio/resources/files.rb +4 -16
- data/lib/imagekitio/resources/folders.rb +2 -8
- data/lib/imagekitio/resources/tags.rb +65 -0
- data/lib/imagekitio/resources/webhooks.rb +2 -2
- data/lib/imagekitio/version.rb +1 -1
- data/lib/imagekitio.rb +20 -5
- data/rbi/imagekitio/client.rbi +3 -0
- data/rbi/imagekitio/internal/tag_cursor.rbi +22 -0
- data/rbi/imagekitio/models/accounts/contract_get_params.rbi +34 -0
- data/rbi/imagekitio/models/accounts/contract_get_response.rbi +126 -0
- data/rbi/imagekitio/models/accounts/contract_units.rbi +66 -0
- data/rbi/imagekitio/models/accounts/url_endpoint_request.rbi +19 -1
- data/rbi/imagekitio/models/accounts/url_endpoint_response.rbi +19 -1
- data/rbi/imagekitio/models/accounts/webhook.rbi +109 -0
- data/rbi/imagekitio/models/accounts/webhook_create_params.rbi +78 -0
- data/rbi/imagekitio/models/accounts/webhook_delete_params.rbi +45 -0
- data/rbi/imagekitio/models/accounts/webhook_event_type.rbi +101 -0
- data/rbi/imagekitio/models/accounts/webhook_get_params.rbi +45 -0
- data/rbi/imagekitio/models/accounts/webhook_list_params.rbi +34 -0
- data/rbi/imagekitio/models/accounts/webhook_list_response.rbi +13 -0
- data/rbi/imagekitio/models/accounts/webhook_update_params.rbi +98 -0
- data/rbi/imagekitio/models/asset_list_params.rbi +27 -0
- data/rbi/imagekitio/models/beta/v2/file_upload_params.rbi +10 -2
- data/rbi/imagekitio/models/custom_metadata_field.rbi +30 -4
- data/rbi/imagekitio/models/custom_metadata_field_create_params.rbi +8 -0
- data/rbi/imagekitio/models/file_upload_params.rbi +10 -2
- data/rbi/imagekitio/models/folder.rbi +49 -0
- data/rbi/imagekitio/models/folder_create_event.rbi +53 -0
- data/rbi/imagekitio/models/folder_delete_event.rbi +83 -0
- data/rbi/imagekitio/models/folder_update_event.rbi +53 -0
- data/rbi/imagekitio/models/tag.rbi +71 -0
- data/rbi/imagekitio/models/tag_list_params.rbi +236 -0
- data/rbi/imagekitio/models/unsafe_unwrap_webhook_event.rbi +4 -1
- data/rbi/imagekitio/models/unwrap_webhook_event.rbi +4 -1
- data/rbi/imagekitio/models/update_file_request.rbi +10 -0
- data/rbi/imagekitio/models.rbi +10 -0
- data/rbi/imagekitio/resources/accounts/contract.rbi +36 -0
- data/rbi/imagekitio/resources/accounts/webhooks.rbi +113 -0
- data/rbi/imagekitio/resources/accounts.rbi +6 -0
- data/rbi/imagekitio/resources/assets.rbi +9 -0
- data/rbi/imagekitio/resources/beta/v2/files.rbi +5 -1
- data/rbi/imagekitio/resources/custom_metadata_fields.rbi +5 -1
- data/rbi/imagekitio/resources/files/versions.rbi +1 -1
- data/rbi/imagekitio/resources/files.rbi +7 -3
- data/rbi/imagekitio/resources/folders.rbi +1 -1
- data/rbi/imagekitio/resources/tags.rbi +74 -0
- data/rbi/imagekitio/resources/webhooks.rbi +8 -2
- data/sig/imagekitio/client.rbs +2 -0
- data/sig/imagekitio/internal/tag_cursor.rbs +13 -0
- data/sig/imagekitio/models/accounts/contract_get_params.rbs +17 -0
- data/sig/imagekitio/models/accounts/contract_get_response.rbs +73 -0
- data/sig/imagekitio/models/accounts/contract_units.rbs +37 -0
- data/sig/imagekitio/models/accounts/url_endpoint_request.rbs +12 -2
- data/sig/imagekitio/models/accounts/url_endpoint_response.rbs +12 -2
- data/sig/imagekitio/models/accounts/webhook.rbs +52 -0
- data/sig/imagekitio/models/accounts/webhook_create_params.rbs +40 -0
- data/sig/imagekitio/models/accounts/webhook_delete_params.rbs +25 -0
- data/sig/imagekitio/models/accounts/webhook_event_type.rbs +44 -0
- data/sig/imagekitio/models/accounts/webhook_get_params.rbs +25 -0
- data/sig/imagekitio/models/accounts/webhook_list_params.rbs +17 -0
- data/sig/imagekitio/models/accounts/webhook_list_response.rbs +9 -0
- data/sig/imagekitio/models/accounts/webhook_update_params.rbs +51 -0
- data/sig/imagekitio/models/folder.rbs +32 -5
- data/sig/imagekitio/models/folder_create_event.rbs +32 -0
- data/sig/imagekitio/models/folder_delete_event.rbs +48 -0
- data/sig/imagekitio/models/folder_update_event.rbs +32 -0
- data/sig/imagekitio/models/tag.rbs +30 -0
- data/sig/imagekitio/models/tag_list_params.rbs +114 -0
- data/sig/imagekitio/models/unsafe_unwrap_webhook_event.rbs +3 -0
- data/sig/imagekitio/models/unwrap_webhook_event.rbs +3 -0
- data/sig/imagekitio/models.rbs +10 -0
- data/sig/imagekitio/resources/accounts/contract.rbs +13 -0
- data/sig/imagekitio/resources/accounts/webhooks.rbs +38 -0
- data/sig/imagekitio/resources/accounts.rbs +4 -0
- data/sig/imagekitio/resources/custom_metadata_fields.rbs +1 -4
- data/sig/imagekitio/resources/files/versions.rbs +1 -1
- data/sig/imagekitio/resources/files.rbs +2 -2
- data/sig/imagekitio/resources/folders.rbs +1 -1
- data/sig/imagekitio/resources/tags.rbs +18 -0
- data/sig/imagekitio/resources/webhooks.rbs +8 -2
- metadata +62 -17
- data/lib/imagekitio/models/custom_metadata_field_delete_response.rb +0 -10
- data/lib/imagekitio/models/file_copy_response.rb +0 -10
- data/lib/imagekitio/models/file_move_response.rb +0 -10
- data/lib/imagekitio/models/files/version_delete_response.rb +0 -12
- data/lib/imagekitio/models/folder_delete_response.rb +0 -10
- data/rbi/imagekitio/models/custom_metadata_field_delete_response.rbi +0 -23
- data/rbi/imagekitio/models/file_copy_response.rbi +0 -23
- data/rbi/imagekitio/models/file_move_response.rbi +0 -23
- data/rbi/imagekitio/models/files/version_delete_response.rbi +0 -25
- data/rbi/imagekitio/models/folder_delete_response.rbi +0 -23
- data/sig/imagekitio/models/custom_metadata_field_delete_response.rbs +0 -11
- data/sig/imagekitio/models/file_copy_response.rbs +0 -11
- data/sig/imagekitio/models/file_move_response.rbs +0 -11
- data/sig/imagekitio/models/files/version_delete_response.rbs +0 -13
- data/sig/imagekitio/models/folder_delete_response.rbs +0 -11
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
class ContractGetResponse < Imagekitio::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
Imagekitio::Models::Accounts::ContractGetResponse,
|
|
11
|
+
Imagekitio::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Whether the account has an active contract. The other fields are present only
|
|
16
|
+
# when it does.
|
|
17
|
+
sig { returns(T::Boolean) }
|
|
18
|
+
attr_accessor :has_contract
|
|
19
|
+
|
|
20
|
+
# When `consumed` was last computed. `null` if it has not been computed for the
|
|
21
|
+
# contract yet; `consumed` is then all zeros.
|
|
22
|
+
sig { returns(T.nilable(Time)) }
|
|
23
|
+
attr_accessor :as_of
|
|
24
|
+
|
|
25
|
+
# Usage consumed in the current contract term. For an agency account, this
|
|
26
|
+
# includes the child accounts billed to it.
|
|
27
|
+
sig { returns(T.nilable(Imagekitio::Accounts::ContractUnits)) }
|
|
28
|
+
attr_reader :consumed
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
params(consumed: Imagekitio::Accounts::ContractUnits::OrHash).void
|
|
32
|
+
end
|
|
33
|
+
attr_writer :consumed
|
|
34
|
+
|
|
35
|
+
# Length of each contract term in months.
|
|
36
|
+
sig { returns(T.nilable(Integer)) }
|
|
37
|
+
attr_reader :contract_months
|
|
38
|
+
|
|
39
|
+
sig { params(contract_months: Integer).void }
|
|
40
|
+
attr_writer :contract_months
|
|
41
|
+
|
|
42
|
+
# End date of the current contract term.
|
|
43
|
+
sig { returns(T.nilable(Date)) }
|
|
44
|
+
attr_reader :effective_contract_end_date
|
|
45
|
+
|
|
46
|
+
sig { params(effective_contract_end_date: Date).void }
|
|
47
|
+
attr_writer :effective_contract_end_date
|
|
48
|
+
|
|
49
|
+
# Start date of the current contract term. It moves forward when the contract
|
|
50
|
+
# renews.
|
|
51
|
+
sig { returns(T.nilable(Date)) }
|
|
52
|
+
attr_reader :effective_contract_start_date
|
|
53
|
+
|
|
54
|
+
sig { params(effective_contract_start_date: Date).void }
|
|
55
|
+
attr_writer :effective_contract_start_date
|
|
56
|
+
|
|
57
|
+
# Start date of the first contract term.
|
|
58
|
+
sig { returns(T.nilable(Date)) }
|
|
59
|
+
attr_reader :original_contract_start_date
|
|
60
|
+
|
|
61
|
+
sig { params(original_contract_start_date: Date).void }
|
|
62
|
+
attr_writer :original_contract_start_date
|
|
63
|
+
|
|
64
|
+
# Usage included in the current contract term.
|
|
65
|
+
sig { returns(T.nilable(Imagekitio::Accounts::ContractUnits)) }
|
|
66
|
+
attr_reader :quota
|
|
67
|
+
|
|
68
|
+
sig { params(quota: Imagekitio::Accounts::ContractUnits::OrHash).void }
|
|
69
|
+
attr_writer :quota
|
|
70
|
+
|
|
71
|
+
sig do
|
|
72
|
+
params(
|
|
73
|
+
has_contract: T::Boolean,
|
|
74
|
+
as_of: T.nilable(Time),
|
|
75
|
+
consumed: Imagekitio::Accounts::ContractUnits::OrHash,
|
|
76
|
+
contract_months: Integer,
|
|
77
|
+
effective_contract_end_date: Date,
|
|
78
|
+
effective_contract_start_date: Date,
|
|
79
|
+
original_contract_start_date: Date,
|
|
80
|
+
quota: Imagekitio::Accounts::ContractUnits::OrHash
|
|
81
|
+
).returns(T.attached_class)
|
|
82
|
+
end
|
|
83
|
+
def self.new(
|
|
84
|
+
# Whether the account has an active contract. The other fields are present only
|
|
85
|
+
# when it does.
|
|
86
|
+
has_contract:,
|
|
87
|
+
# When `consumed` was last computed. `null` if it has not been computed for the
|
|
88
|
+
# contract yet; `consumed` is then all zeros.
|
|
89
|
+
as_of: nil,
|
|
90
|
+
# Usage consumed in the current contract term. For an agency account, this
|
|
91
|
+
# includes the child accounts billed to it.
|
|
92
|
+
consumed: nil,
|
|
93
|
+
# Length of each contract term in months.
|
|
94
|
+
contract_months: nil,
|
|
95
|
+
# End date of the current contract term.
|
|
96
|
+
effective_contract_end_date: nil,
|
|
97
|
+
# Start date of the current contract term. It moves forward when the contract
|
|
98
|
+
# renews.
|
|
99
|
+
effective_contract_start_date: nil,
|
|
100
|
+
# Start date of the first contract term.
|
|
101
|
+
original_contract_start_date: nil,
|
|
102
|
+
# Usage included in the current contract term.
|
|
103
|
+
quota: nil
|
|
104
|
+
)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
sig do
|
|
108
|
+
override.returns(
|
|
109
|
+
{
|
|
110
|
+
has_contract: T::Boolean,
|
|
111
|
+
as_of: T.nilable(Time),
|
|
112
|
+
consumed: Imagekitio::Accounts::ContractUnits,
|
|
113
|
+
contract_months: Integer,
|
|
114
|
+
effective_contract_end_date: Date,
|
|
115
|
+
effective_contract_start_date: Date,
|
|
116
|
+
original_contract_start_date: Date,
|
|
117
|
+
quota: Imagekitio::Accounts::ContractUnits
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
end
|
|
121
|
+
def to_hash
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
class ContractUnits < Imagekitio::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
Imagekitio::Accounts::ContractUnits,
|
|
11
|
+
Imagekitio::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Bandwidth in bytes.
|
|
16
|
+
sig { returns(Integer) }
|
|
17
|
+
attr_accessor :bandwidth_bytes
|
|
18
|
+
|
|
19
|
+
# Number of extension units.
|
|
20
|
+
sig { returns(Integer) }
|
|
21
|
+
attr_accessor :extension_units_count
|
|
22
|
+
|
|
23
|
+
# Number of purge cache requests.
|
|
24
|
+
sig { returns(Integer) }
|
|
25
|
+
attr_accessor :purge_cache_requests
|
|
26
|
+
|
|
27
|
+
# Number of video processing units.
|
|
28
|
+
sig { returns(Integer) }
|
|
29
|
+
attr_accessor :video_processing_units_count
|
|
30
|
+
|
|
31
|
+
sig do
|
|
32
|
+
params(
|
|
33
|
+
bandwidth_bytes: Integer,
|
|
34
|
+
extension_units_count: Integer,
|
|
35
|
+
purge_cache_requests: Integer,
|
|
36
|
+
video_processing_units_count: Integer
|
|
37
|
+
).returns(T.attached_class)
|
|
38
|
+
end
|
|
39
|
+
def self.new(
|
|
40
|
+
# Bandwidth in bytes.
|
|
41
|
+
bandwidth_bytes:,
|
|
42
|
+
# Number of extension units.
|
|
43
|
+
extension_units_count:,
|
|
44
|
+
# Number of purge cache requests.
|
|
45
|
+
purge_cache_requests:,
|
|
46
|
+
# Number of video processing units.
|
|
47
|
+
video_processing_units_count:
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
sig do
|
|
52
|
+
override.returns(
|
|
53
|
+
{
|
|
54
|
+
bandwidth_bytes: Integer,
|
|
55
|
+
extension_units_count: Integer,
|
|
56
|
+
purge_cache_requests: Integer,
|
|
57
|
+
video_processing_units_count: Integer
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
def to_hash
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
@@ -138,22 +138,40 @@ module Imagekitio
|
|
|
138
138
|
sig { params(preserve_asset_delivery_types: T::Boolean).void }
|
|
139
139
|
attr_writer :preserve_asset_delivery_types
|
|
140
140
|
|
|
141
|
+
# Whether to always rewrite Cloudinary layers to the improved ImageKit layer
|
|
142
|
+
# specification (`l-image`, `l-text`, ..., `l-end`). When `false` or omitted, the
|
|
143
|
+
# improved specification is used only for transformations that require it.
|
|
144
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
145
|
+
attr_reader :use_improved_layer_spec
|
|
146
|
+
|
|
147
|
+
sig { params(use_improved_layer_spec: T::Boolean).void }
|
|
148
|
+
attr_writer :use_improved_layer_spec
|
|
149
|
+
|
|
141
150
|
sig do
|
|
142
151
|
params(
|
|
143
152
|
preserve_asset_delivery_types: T::Boolean,
|
|
153
|
+
use_improved_layer_spec: T::Boolean,
|
|
144
154
|
type: Symbol
|
|
145
155
|
).returns(T.attached_class)
|
|
146
156
|
end
|
|
147
157
|
def self.new(
|
|
148
158
|
# Whether to preserve `<asset_type>/<delivery_type>` in the rewritten URL.
|
|
149
159
|
preserve_asset_delivery_types: nil,
|
|
160
|
+
# Whether to always rewrite Cloudinary layers to the improved ImageKit layer
|
|
161
|
+
# specification (`l-image`, `l-text`, ..., `l-end`). When `false` or omitted, the
|
|
162
|
+
# improved specification is used only for transformations that require it.
|
|
163
|
+
use_improved_layer_spec: nil,
|
|
150
164
|
type: :CLOUDINARY
|
|
151
165
|
)
|
|
152
166
|
end
|
|
153
167
|
|
|
154
168
|
sig do
|
|
155
169
|
override.returns(
|
|
156
|
-
{
|
|
170
|
+
{
|
|
171
|
+
type: Symbol,
|
|
172
|
+
preserve_asset_delivery_types: T::Boolean,
|
|
173
|
+
use_improved_layer_spec: T::Boolean
|
|
174
|
+
}
|
|
157
175
|
)
|
|
158
176
|
end
|
|
159
177
|
def to_hash
|
|
@@ -133,22 +133,40 @@ module Imagekitio
|
|
|
133
133
|
sig { returns(Symbol) }
|
|
134
134
|
attr_accessor :type
|
|
135
135
|
|
|
136
|
+
# Whether to always rewrite Cloudinary layers to the improved ImageKit layer
|
|
137
|
+
# specification (`l-image`, `l-text`, ..., `l-end`). When `false` or omitted, the
|
|
138
|
+
# improved specification is used only for transformations that require it.
|
|
139
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
140
|
+
attr_reader :use_improved_layer_spec
|
|
141
|
+
|
|
142
|
+
sig { params(use_improved_layer_spec: T::Boolean).void }
|
|
143
|
+
attr_writer :use_improved_layer_spec
|
|
144
|
+
|
|
136
145
|
sig do
|
|
137
146
|
params(
|
|
138
147
|
preserve_asset_delivery_types: T::Boolean,
|
|
148
|
+
use_improved_layer_spec: T::Boolean,
|
|
139
149
|
type: Symbol
|
|
140
150
|
).returns(T.attached_class)
|
|
141
151
|
end
|
|
142
152
|
def self.new(
|
|
143
153
|
# Whether to preserve `<asset_type>/<delivery_type>` in the rewritten URL.
|
|
144
154
|
preserve_asset_delivery_types:,
|
|
155
|
+
# Whether to always rewrite Cloudinary layers to the improved ImageKit layer
|
|
156
|
+
# specification (`l-image`, `l-text`, ..., `l-end`). When `false` or omitted, the
|
|
157
|
+
# improved specification is used only for transformations that require it.
|
|
158
|
+
use_improved_layer_spec: nil,
|
|
145
159
|
type: :CLOUDINARY
|
|
146
160
|
)
|
|
147
161
|
end
|
|
148
162
|
|
|
149
163
|
sig do
|
|
150
164
|
override.returns(
|
|
151
|
-
{
|
|
165
|
+
{
|
|
166
|
+
preserve_asset_delivery_types: T::Boolean,
|
|
167
|
+
type: Symbol,
|
|
168
|
+
use_improved_layer_spec: T::Boolean
|
|
169
|
+
}
|
|
152
170
|
)
|
|
153
171
|
end
|
|
154
172
|
def to_hash
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
class Webhook < Imagekitio::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(Imagekitio::Accounts::Webhook, Imagekitio::Internal::AnyHash)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# Unique identifier for a webhook.
|
|
13
|
+
sig { returns(String) }
|
|
14
|
+
attr_accessor :id
|
|
15
|
+
|
|
16
|
+
# ISO 8601 timestamp of when the webhook was created.
|
|
17
|
+
sig { returns(Time) }
|
|
18
|
+
attr_accessor :created_at
|
|
19
|
+
|
|
20
|
+
# Whether the webhook is enabled. When `false`, ImageKit doesn't send any events
|
|
21
|
+
# to the `endpoint`.
|
|
22
|
+
sig { returns(T::Boolean) }
|
|
23
|
+
attr_accessor :enabled
|
|
24
|
+
|
|
25
|
+
# The URL where ImageKit sends webhook events as `POST` requests. Must use the
|
|
26
|
+
# `http` or `https` protocol, and must be unique across all webhooks for your
|
|
27
|
+
# account.
|
|
28
|
+
sig { returns(String) }
|
|
29
|
+
attr_accessor :endpoint
|
|
30
|
+
|
|
31
|
+
# The event types this webhook is subscribed to. ImageKit sends a request to the
|
|
32
|
+
# `endpoint` only for these events.
|
|
33
|
+
sig do
|
|
34
|
+
returns(
|
|
35
|
+
T::Array[Imagekitio::Accounts::WebhookEventType::TaggedSymbol]
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
attr_accessor :events
|
|
39
|
+
|
|
40
|
+
# Signing secret generated by ImageKit, used to verify that webhook requests come
|
|
41
|
+
# from ImageKit. Starts with `whsec_`. This value can't be set or changed through
|
|
42
|
+
# the API. Learn more about
|
|
43
|
+
# [verifying webhook signatures](https://imagekit.io/docs/webhooks#verify-webhook-signature).
|
|
44
|
+
sig { returns(String) }
|
|
45
|
+
attr_accessor :secret
|
|
46
|
+
|
|
47
|
+
# ISO 8601 timestamp of when the webhook was last updated.
|
|
48
|
+
sig { returns(Time) }
|
|
49
|
+
attr_accessor :updated_at
|
|
50
|
+
|
|
51
|
+
# A webhook is an HTTP endpoint that ImageKit notifies when subscribed events
|
|
52
|
+
# occur in your account. Learn more about
|
|
53
|
+
# [webhooks](https://imagekit.io/docs/webhooks).
|
|
54
|
+
sig do
|
|
55
|
+
params(
|
|
56
|
+
id: String,
|
|
57
|
+
created_at: Time,
|
|
58
|
+
enabled: T::Boolean,
|
|
59
|
+
endpoint: String,
|
|
60
|
+
events: T::Array[Imagekitio::Accounts::WebhookEventType::OrSymbol],
|
|
61
|
+
secret: String,
|
|
62
|
+
updated_at: Time
|
|
63
|
+
).returns(T.attached_class)
|
|
64
|
+
end
|
|
65
|
+
def self.new(
|
|
66
|
+
# Unique identifier for a webhook.
|
|
67
|
+
id:,
|
|
68
|
+
# ISO 8601 timestamp of when the webhook was created.
|
|
69
|
+
created_at:,
|
|
70
|
+
# Whether the webhook is enabled. When `false`, ImageKit doesn't send any events
|
|
71
|
+
# to the `endpoint`.
|
|
72
|
+
enabled:,
|
|
73
|
+
# The URL where ImageKit sends webhook events as `POST` requests. Must use the
|
|
74
|
+
# `http` or `https` protocol, and must be unique across all webhooks for your
|
|
75
|
+
# account.
|
|
76
|
+
endpoint:,
|
|
77
|
+
# The event types this webhook is subscribed to. ImageKit sends a request to the
|
|
78
|
+
# `endpoint` only for these events.
|
|
79
|
+
events:,
|
|
80
|
+
# Signing secret generated by ImageKit, used to verify that webhook requests come
|
|
81
|
+
# from ImageKit. Starts with `whsec_`. This value can't be set or changed through
|
|
82
|
+
# the API. Learn more about
|
|
83
|
+
# [verifying webhook signatures](https://imagekit.io/docs/webhooks#verify-webhook-signature).
|
|
84
|
+
secret:,
|
|
85
|
+
# ISO 8601 timestamp of when the webhook was last updated.
|
|
86
|
+
updated_at:
|
|
87
|
+
)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
sig do
|
|
91
|
+
override.returns(
|
|
92
|
+
{
|
|
93
|
+
id: String,
|
|
94
|
+
created_at: Time,
|
|
95
|
+
enabled: T::Boolean,
|
|
96
|
+
endpoint: String,
|
|
97
|
+
events:
|
|
98
|
+
T::Array[Imagekitio::Accounts::WebhookEventType::TaggedSymbol],
|
|
99
|
+
secret: String,
|
|
100
|
+
updated_at: Time
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
end
|
|
104
|
+
def to_hash
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
class WebhookCreateParams < Imagekitio::Internal::Type::BaseModel
|
|
7
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Imagekitio::Accounts::WebhookCreateParams,
|
|
14
|
+
Imagekitio::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# The URL where ImageKit sends webhook events as `POST` requests. Must use the
|
|
19
|
+
# `http` or `https` protocol, and must be unique across all webhooks for your
|
|
20
|
+
# account.
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :endpoint
|
|
23
|
+
|
|
24
|
+
# The event types this webhook is subscribed to. ImageKit sends a request to the
|
|
25
|
+
# `endpoint` only for these events.
|
|
26
|
+
sig do
|
|
27
|
+
returns(T::Array[Imagekitio::Accounts::WebhookEventType::OrSymbol])
|
|
28
|
+
end
|
|
29
|
+
attr_accessor :events
|
|
30
|
+
|
|
31
|
+
# Whether the webhook is enabled. When `false`, ImageKit doesn't send any events
|
|
32
|
+
# to the `endpoint`.
|
|
33
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
34
|
+
attr_reader :enabled
|
|
35
|
+
|
|
36
|
+
sig { params(enabled: T::Boolean).void }
|
|
37
|
+
attr_writer :enabled
|
|
38
|
+
|
|
39
|
+
sig do
|
|
40
|
+
params(
|
|
41
|
+
endpoint: String,
|
|
42
|
+
events: T::Array[Imagekitio::Accounts::WebhookEventType::OrSymbol],
|
|
43
|
+
enabled: T::Boolean,
|
|
44
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
45
|
+
).returns(T.attached_class)
|
|
46
|
+
end
|
|
47
|
+
def self.new(
|
|
48
|
+
# The URL where ImageKit sends webhook events as `POST` requests. Must use the
|
|
49
|
+
# `http` or `https` protocol, and must be unique across all webhooks for your
|
|
50
|
+
# account.
|
|
51
|
+
endpoint:,
|
|
52
|
+
# The event types this webhook is subscribed to. ImageKit sends a request to the
|
|
53
|
+
# `endpoint` only for these events.
|
|
54
|
+
events:,
|
|
55
|
+
# Whether the webhook is enabled. When `false`, ImageKit doesn't send any events
|
|
56
|
+
# to the `endpoint`.
|
|
57
|
+
enabled: nil,
|
|
58
|
+
request_options: {}
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
sig do
|
|
63
|
+
override.returns(
|
|
64
|
+
{
|
|
65
|
+
endpoint: String,
|
|
66
|
+
events:
|
|
67
|
+
T::Array[Imagekitio::Accounts::WebhookEventType::OrSymbol],
|
|
68
|
+
enabled: T::Boolean,
|
|
69
|
+
request_options: Imagekitio::RequestOptions
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
def to_hash
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
class WebhookDeleteParams < Imagekitio::Internal::Type::BaseModel
|
|
7
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Imagekitio::Accounts::WebhookDeleteParams,
|
|
14
|
+
Imagekitio::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Unique identifier for a webhook.
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
sig do
|
|
23
|
+
params(
|
|
24
|
+
id: String,
|
|
25
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
26
|
+
).returns(T.attached_class)
|
|
27
|
+
end
|
|
28
|
+
def self.new(
|
|
29
|
+
# Unique identifier for a webhook.
|
|
30
|
+
id:,
|
|
31
|
+
request_options: {}
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
sig do
|
|
36
|
+
override.returns(
|
|
37
|
+
{ id: String, request_options: Imagekitio::RequestOptions }
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
def to_hash
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
# A webhook event type. Learn more about the payload of each
|
|
7
|
+
# [webhook event](https://imagekit.io/docs/webhooks#list-of-events).
|
|
8
|
+
module WebhookEventType
|
|
9
|
+
extend Imagekitio::Internal::Type::Enum
|
|
10
|
+
|
|
11
|
+
TaggedSymbol =
|
|
12
|
+
T.type_alias { T.all(Symbol, Imagekitio::Accounts::WebhookEventType) }
|
|
13
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
14
|
+
|
|
15
|
+
VIDEO_TRANSFORMATION_ACCEPTED =
|
|
16
|
+
T.let(
|
|
17
|
+
:"video.transformation.accepted",
|
|
18
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
19
|
+
)
|
|
20
|
+
VIDEO_TRANSFORMATION_READY =
|
|
21
|
+
T.let(
|
|
22
|
+
:"video.transformation.ready",
|
|
23
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
24
|
+
)
|
|
25
|
+
VIDEO_TRANSFORMATION_ERROR =
|
|
26
|
+
T.let(
|
|
27
|
+
:"video.transformation.error",
|
|
28
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
29
|
+
)
|
|
30
|
+
UPLOAD_PRE_TRANSFORM_SUCCESS =
|
|
31
|
+
T.let(
|
|
32
|
+
:"upload.pre-transform.success",
|
|
33
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
34
|
+
)
|
|
35
|
+
UPLOAD_PRE_TRANSFORM_ERROR =
|
|
36
|
+
T.let(
|
|
37
|
+
:"upload.pre-transform.error",
|
|
38
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
39
|
+
)
|
|
40
|
+
UPLOAD_POST_TRANSFORM_SUCCESS =
|
|
41
|
+
T.let(
|
|
42
|
+
:"upload.post-transform.success",
|
|
43
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
44
|
+
)
|
|
45
|
+
UPLOAD_POST_TRANSFORM_ERROR =
|
|
46
|
+
T.let(
|
|
47
|
+
:"upload.post-transform.error",
|
|
48
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
49
|
+
)
|
|
50
|
+
FILE_CREATED =
|
|
51
|
+
T.let(
|
|
52
|
+
:"file.created",
|
|
53
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
54
|
+
)
|
|
55
|
+
FILE_UPDATED =
|
|
56
|
+
T.let(
|
|
57
|
+
:"file.updated",
|
|
58
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
59
|
+
)
|
|
60
|
+
FILE_DELETED =
|
|
61
|
+
T.let(
|
|
62
|
+
:"file.deleted",
|
|
63
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
64
|
+
)
|
|
65
|
+
FILE_VERSION_CREATED =
|
|
66
|
+
T.let(
|
|
67
|
+
:"file-version.created",
|
|
68
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
69
|
+
)
|
|
70
|
+
FILE_VERSION_DELETED =
|
|
71
|
+
T.let(
|
|
72
|
+
:"file-version.deleted",
|
|
73
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
74
|
+
)
|
|
75
|
+
FOLDER_CREATED =
|
|
76
|
+
T.let(
|
|
77
|
+
:"folder.created",
|
|
78
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
79
|
+
)
|
|
80
|
+
FOLDER_UPDATED =
|
|
81
|
+
T.let(
|
|
82
|
+
:"folder.updated",
|
|
83
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
84
|
+
)
|
|
85
|
+
FOLDER_DELETED =
|
|
86
|
+
T.let(
|
|
87
|
+
:"folder.deleted",
|
|
88
|
+
Imagekitio::Accounts::WebhookEventType::TaggedSymbol
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
sig do
|
|
92
|
+
override.returns(
|
|
93
|
+
T::Array[Imagekitio::Accounts::WebhookEventType::TaggedSymbol]
|
|
94
|
+
)
|
|
95
|
+
end
|
|
96
|
+
def self.values
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
class WebhookGetParams < Imagekitio::Internal::Type::BaseModel
|
|
7
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Imagekitio::Accounts::WebhookGetParams,
|
|
14
|
+
Imagekitio::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Unique identifier for a webhook.
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
sig do
|
|
23
|
+
params(
|
|
24
|
+
id: String,
|
|
25
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
26
|
+
).returns(T.attached_class)
|
|
27
|
+
end
|
|
28
|
+
def self.new(
|
|
29
|
+
# Unique identifier for a webhook.
|
|
30
|
+
id:,
|
|
31
|
+
request_options: {}
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
sig do
|
|
36
|
+
override.returns(
|
|
37
|
+
{ id: String, request_options: Imagekitio::RequestOptions }
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
def to_hash
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
class WebhookListParams < Imagekitio::Internal::Type::BaseModel
|
|
7
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Imagekitio::Accounts::WebhookListParams,
|
|
14
|
+
Imagekitio::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig do
|
|
19
|
+
params(request_options: Imagekitio::RequestOptions::OrHash).returns(
|
|
20
|
+
T.attached_class
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
def self.new(request_options: {})
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
sig do
|
|
27
|
+
override.returns({ request_options: Imagekitio::RequestOptions })
|
|
28
|
+
end
|
|
29
|
+
def to_hash
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|