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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 425a67eafb2d65176f5a8ec57e0d6e8a2581334cc6d0aaa1bd77c13ad1489d3b
|
|
4
|
+
data.tar.gz: abab5f7bac6a4454e4a8d34b608b245a419843dc37a718b57e62d450890e8fe3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a4bb7581cbe9a754e1495b3e5afe797843ec62f707fba51650f161441b1a8a42b39365375ed808dcef08a04eb904d7ac5c6d53ca0e402a15d49cbc72e3a2230
|
|
7
|
+
data.tar.gz: 69a6ad2f87957b2d6e945a3268498aecdbe28d534af684a287c3a787994f05f692d4dae06cb7e549cc9ee4d6375f696b9727328010dbda1ae9fff1b37c6fe42e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.12.0](https://github.com/imagekit-developer/imagekit-ruby/compare/v4.11.0...v4.12.0) (2026-11-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add GET /v1/tags to list media library tags ([e1a42da](https://github.com/imagekit-developer/imagekit-ruby/commit/e1a42da77bb7da5541197d121437e36ef8d50216))
|
|
9
|
+
* **api:** add accounts.contract.get() for contract consumption ([c80613e](https://github.com/imagekit-developer/imagekit-ruby/commit/c80613eab38b19ecebdfa21574fa31efa9e82033))
|
|
10
|
+
* **api:** add useImprovedLayerSpec to the Cloudinary URL rewriter ([c80613e](https://github.com/imagekit-developer/imagekit-ruby/commit/c80613eab38b19ecebdfa21574fa31efa9e82033))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Documentation
|
|
14
|
+
|
|
15
|
+
* add pagination example ([e77d60d](https://github.com/imagekit-developer/imagekit-ruby/commit/e77d60d1fc979b8c781298b7b6a64421c5033b6d))
|
|
16
|
+
|
|
17
|
+
## [4.11.0](https://github.com/imagekit-developer/imagekit-ruby/compare/v4.10.0...v4.11.0) (2026-10-19)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* webhook crud api ([a3fb0a0](https://github.com/imagekit-developer/imagekit-ruby/commit/a3fb0a0e157c5b9d815b54a5e7adf2f3c9b5b8b5))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* don't parse empty 204 responses for copy, move and delete methods ([0e04d20](https://github.com/imagekit-developer/imagekit-ruby/commit/0e04d2029befbcd689b7c01699c6675cc1c93af8))
|
|
28
|
+
* **openapi:** reference shared CustomMetadata schema from FolderDetail ([56c04d2](https://github.com/imagekit-developer/imagekit-ruby/commit/56c04d2f29703ed1cf613f097162622ec34dd37b))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Chores
|
|
32
|
+
|
|
33
|
+
* pin next release ([68b9912](https://github.com/imagekit-developer/imagekit-ruby/commit/68b9912fbf73117ddb2c7966d2100c3a63384573))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Documentation
|
|
37
|
+
|
|
38
|
+
* describe reserved original creation date field ([b7512b8](https://github.com/imagekit-developer/imagekit-ruby/commit/b7512b8bced102a82f256d674e1eaf2bdf9d1722))
|
|
39
|
+
|
|
3
40
|
## [4.10.0](https://github.com/imagekit-developer/imagekit-ruby/compare/v4.9.0...v4.10.0) (2026-09-16)
|
|
4
41
|
|
|
5
42
|
|
data/README.md
CHANGED
|
@@ -13,6 +13,7 @@ If you're using Ruby on Rails, the [ImageKit Rails gem](https://github.com/image
|
|
|
13
13
|
- [Documentation](#documentation)
|
|
14
14
|
- [Installation](#installation)
|
|
15
15
|
- [Usage](#usage)
|
|
16
|
+
- [Pagination](#pagination)
|
|
16
17
|
- [File uploads](#file-uploads)
|
|
17
18
|
- [URL Generation](#url-generation)
|
|
18
19
|
- [Basic URL generation](#basic-url-generation)
|
|
@@ -46,7 +47,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
46
47
|
<!-- x-release-please-start-version -->
|
|
47
48
|
|
|
48
49
|
```ruby
|
|
49
|
-
gem "imagekitio", "~> 4.
|
|
50
|
+
gem "imagekitio", "~> 4.12.0"
|
|
50
51
|
```
|
|
51
52
|
|
|
52
53
|
<!-- x-release-please-end -->
|
|
@@ -68,6 +69,32 @@ response = image_kit.files.upload(
|
|
|
68
69
|
puts(response.file_id)
|
|
69
70
|
```
|
|
70
71
|
|
|
72
|
+
### Pagination
|
|
73
|
+
|
|
74
|
+
The `tags.list` method is paginated. This library provides auto-paginating iterators, so you do not have to request successive pages manually:
|
|
75
|
+
|
|
76
|
+
```ruby
|
|
77
|
+
page = image_kit.tags.list
|
|
78
|
+
|
|
79
|
+
# Fetch single item from page.
|
|
80
|
+
tag = page.tags[0]
|
|
81
|
+
puts(tag.asset_count)
|
|
82
|
+
|
|
83
|
+
# Automatically fetches more pages as needed.
|
|
84
|
+
page.auto_paging_each do |tag|
|
|
85
|
+
puts(tag.asset_count)
|
|
86
|
+
end
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Alternatively, you can use the `#next_page?` and `#next_page` methods for more granular control working with pages.
|
|
90
|
+
|
|
91
|
+
```ruby
|
|
92
|
+
if page.next_page?
|
|
93
|
+
new_page = page.next_page
|
|
94
|
+
puts(new_page.tags[0].asset_count)
|
|
95
|
+
end
|
|
96
|
+
```
|
|
97
|
+
|
|
71
98
|
### File uploads
|
|
72
99
|
|
|
73
100
|
Request parameters that correspond to file uploads can be passed as raw contents, a [`Pathname`](https://rubyapi.org/3.2/o/pathname) instance, or an `IO` stream.
|
data/lib/imagekitio/client.rb
CHANGED
|
@@ -47,6 +47,9 @@ module Imagekitio
|
|
|
47
47
|
# @return [Imagekitio::Resources::Assets]
|
|
48
48
|
attr_reader :assets
|
|
49
49
|
|
|
50
|
+
# @return [Imagekitio::Resources::Tags]
|
|
51
|
+
attr_reader :tags
|
|
52
|
+
|
|
50
53
|
# @return [Imagekitio::Resources::Cache]
|
|
51
54
|
attr_reader :cache
|
|
52
55
|
|
|
@@ -154,6 +157,7 @@ module Imagekitio
|
|
|
154
157
|
@saved_extensions = Imagekitio::Resources::SavedExtensions.new(client: self)
|
|
155
158
|
@named_transformations = Imagekitio::Resources::NamedTransformations.new(client: self)
|
|
156
159
|
@assets = Imagekitio::Resources::Assets.new(client: self)
|
|
160
|
+
@tags = Imagekitio::Resources::Tags.new(client: self)
|
|
157
161
|
@cache = Imagekitio::Resources::Cache.new(client: self)
|
|
158
162
|
@folders = Imagekitio::Resources::Folders.new(client: self)
|
|
159
163
|
@accounts = Imagekitio::Resources::Accounts.new(client: self)
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Internal
|
|
5
|
+
# @generic Elem
|
|
6
|
+
#
|
|
7
|
+
# @example
|
|
8
|
+
# if tag_cursor.has_next?
|
|
9
|
+
# tag_cursor = tag_cursor.next_page
|
|
10
|
+
# end
|
|
11
|
+
#
|
|
12
|
+
# @example
|
|
13
|
+
# tag_cursor.auto_paging_each do |tag|
|
|
14
|
+
# puts(tag)
|
|
15
|
+
# end
|
|
16
|
+
class TagCursor
|
|
17
|
+
include Imagekitio::Internal::Type::BasePage
|
|
18
|
+
|
|
19
|
+
# @return [Array<generic<Elem>>, nil]
|
|
20
|
+
attr_accessor :tags
|
|
21
|
+
|
|
22
|
+
# @return [String, nil]
|
|
23
|
+
attr_accessor :next_cursor
|
|
24
|
+
|
|
25
|
+
# @return [Boolean]
|
|
26
|
+
def next_page?
|
|
27
|
+
!tags.to_a.empty? && !next_cursor.to_s.empty?
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# @raise [Imagekitio::HTTP::Error]
|
|
31
|
+
# @return [self]
|
|
32
|
+
def next_page
|
|
33
|
+
unless next_page?
|
|
34
|
+
message = "No more pages available. Please check #next_page? before calling ##{__method__}"
|
|
35
|
+
raise RuntimeError.new(message)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
req = Imagekitio::Internal::Util.deep_merge(@req, {query: {cursor: next_cursor}})
|
|
39
|
+
@client.request(req)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# @param blk [Proc]
|
|
43
|
+
#
|
|
44
|
+
# @yieldparam [generic<Elem>]
|
|
45
|
+
def auto_paging_each(&blk)
|
|
46
|
+
unless block_given?
|
|
47
|
+
raise ArgumentError.new("A block must be given to ##{__method__}")
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
page = self
|
|
51
|
+
loop do
|
|
52
|
+
page.tags&.each(&blk)
|
|
53
|
+
|
|
54
|
+
break unless page.next_page?
|
|
55
|
+
page = page.next_page
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# @api private
|
|
60
|
+
#
|
|
61
|
+
# @param client [Imagekitio::Internal::Transport::BaseClient]
|
|
62
|
+
# @param req [Hash{Symbol=>Object}]
|
|
63
|
+
# @param headers [Hash{String=>String}]
|
|
64
|
+
# @param page_data [Hash{Symbol=>Object}]
|
|
65
|
+
def initialize(client:, req:, headers:, page_data:)
|
|
66
|
+
super
|
|
67
|
+
|
|
68
|
+
case page_data
|
|
69
|
+
in {tags: Array => tags}
|
|
70
|
+
@tags = tags.map { Imagekitio::Internal::Type::Converter.coerce(@model, _1) }
|
|
71
|
+
else
|
|
72
|
+
end
|
|
73
|
+
@next_cursor = page_data[:nextCursor]
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# @api private
|
|
77
|
+
#
|
|
78
|
+
# @return [String]
|
|
79
|
+
def inspect
|
|
80
|
+
model = Imagekitio::Internal::Type::Converter.inspect(@model, depth: 1)
|
|
81
|
+
|
|
82
|
+
"#<#{self.class}[#{model}]:0x#{object_id.to_s(16)} next_cursor=#{next_cursor.inspect}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
# @see Imagekitio::Resources::Accounts::Contract#get
|
|
7
|
+
class ContractGetParams < Imagekitio::Internal::Type::BaseModel
|
|
8
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!method initialize(request_options: {})
|
|
12
|
+
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
# @see Imagekitio::Resources::Accounts::Contract#get
|
|
7
|
+
class ContractGetResponse < Imagekitio::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute has_contract
|
|
9
|
+
# Whether the account has an active contract. The other fields are present only
|
|
10
|
+
# when it does.
|
|
11
|
+
#
|
|
12
|
+
# @return [Boolean]
|
|
13
|
+
required :has_contract, Imagekitio::Internal::Type::Boolean, api_name: :hasContract
|
|
14
|
+
|
|
15
|
+
# @!attribute as_of
|
|
16
|
+
# When `consumed` was last computed. `null` if it has not been computed for the
|
|
17
|
+
# contract yet; `consumed` is then all zeros.
|
|
18
|
+
#
|
|
19
|
+
# @return [Time, nil]
|
|
20
|
+
optional :as_of, Time, api_name: :asOf, nil?: true
|
|
21
|
+
|
|
22
|
+
# @!attribute consumed
|
|
23
|
+
# Usage consumed in the current contract term. For an agency account, this
|
|
24
|
+
# includes the child accounts billed to it.
|
|
25
|
+
#
|
|
26
|
+
# @return [Imagekitio::Models::Accounts::ContractUnits, nil]
|
|
27
|
+
optional :consumed, -> { Imagekitio::Accounts::ContractUnits }
|
|
28
|
+
|
|
29
|
+
# @!attribute contract_months
|
|
30
|
+
# Length of each contract term in months.
|
|
31
|
+
#
|
|
32
|
+
# @return [Integer, nil]
|
|
33
|
+
optional :contract_months, Integer, api_name: :contractMonths
|
|
34
|
+
|
|
35
|
+
# @!attribute effective_contract_end_date
|
|
36
|
+
# End date of the current contract term.
|
|
37
|
+
#
|
|
38
|
+
# @return [Date, nil]
|
|
39
|
+
optional :effective_contract_end_date, Date, api_name: :effectiveContractEndDate
|
|
40
|
+
|
|
41
|
+
# @!attribute effective_contract_start_date
|
|
42
|
+
# Start date of the current contract term. It moves forward when the contract
|
|
43
|
+
# renews.
|
|
44
|
+
#
|
|
45
|
+
# @return [Date, nil]
|
|
46
|
+
optional :effective_contract_start_date, Date, api_name: :effectiveContractStartDate
|
|
47
|
+
|
|
48
|
+
# @!attribute original_contract_start_date
|
|
49
|
+
# Start date of the first contract term.
|
|
50
|
+
#
|
|
51
|
+
# @return [Date, nil]
|
|
52
|
+
optional :original_contract_start_date, Date, api_name: :originalContractStartDate
|
|
53
|
+
|
|
54
|
+
# @!attribute quota
|
|
55
|
+
# Usage included in the current contract term.
|
|
56
|
+
#
|
|
57
|
+
# @return [Imagekitio::Models::Accounts::ContractUnits, nil]
|
|
58
|
+
optional :quota, -> { Imagekitio::Accounts::ContractUnits }
|
|
59
|
+
|
|
60
|
+
# @!method initialize(has_contract:, as_of: nil, consumed: nil, contract_months: nil, effective_contract_end_date: nil, effective_contract_start_date: nil, original_contract_start_date: nil, quota: nil)
|
|
61
|
+
# Some parameter documentations has been truncated, see
|
|
62
|
+
# {Imagekitio::Models::Accounts::ContractGetResponse} for more details.
|
|
63
|
+
#
|
|
64
|
+
# @param has_contract [Boolean] Whether the account has an active contract. The other fields are present only wh
|
|
65
|
+
#
|
|
66
|
+
# @param as_of [Time, nil] When `consumed` was last computed. `null` if it has not been computed for the co
|
|
67
|
+
#
|
|
68
|
+
# @param consumed [Imagekitio::Models::Accounts::ContractUnits] Usage consumed in the current contract term. For an agency account, this include
|
|
69
|
+
#
|
|
70
|
+
# @param contract_months [Integer] Length of each contract term in months.
|
|
71
|
+
#
|
|
72
|
+
# @param effective_contract_end_date [Date] End date of the current contract term.
|
|
73
|
+
#
|
|
74
|
+
# @param effective_contract_start_date [Date] Start date of the current contract term. It moves forward when the contract rene
|
|
75
|
+
#
|
|
76
|
+
# @param original_contract_start_date [Date] Start date of the first contract term.
|
|
77
|
+
#
|
|
78
|
+
# @param quota [Imagekitio::Models::Accounts::ContractUnits] Usage included in the current contract term.
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
class ContractUnits < Imagekitio::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute bandwidth_bytes
|
|
8
|
+
# Bandwidth in bytes.
|
|
9
|
+
#
|
|
10
|
+
# @return [Integer]
|
|
11
|
+
required :bandwidth_bytes, Integer, api_name: :bandwidthBytes
|
|
12
|
+
|
|
13
|
+
# @!attribute extension_units_count
|
|
14
|
+
# Number of extension units.
|
|
15
|
+
#
|
|
16
|
+
# @return [Integer]
|
|
17
|
+
required :extension_units_count, Integer, api_name: :extensionUnitsCount
|
|
18
|
+
|
|
19
|
+
# @!attribute purge_cache_requests
|
|
20
|
+
# Number of purge cache requests.
|
|
21
|
+
#
|
|
22
|
+
# @return [Integer]
|
|
23
|
+
required :purge_cache_requests, Integer, api_name: :purgeCacheRequests
|
|
24
|
+
|
|
25
|
+
# @!attribute video_processing_units_count
|
|
26
|
+
# Number of video processing units.
|
|
27
|
+
#
|
|
28
|
+
# @return [Integer]
|
|
29
|
+
required :video_processing_units_count, Integer, api_name: :videoProcessingUnitsCount
|
|
30
|
+
|
|
31
|
+
# @!method initialize(bandwidth_bytes:, extension_units_count:, purge_cache_requests:, video_processing_units_count:)
|
|
32
|
+
# @param bandwidth_bytes [Integer] Bandwidth in bytes.
|
|
33
|
+
#
|
|
34
|
+
# @param extension_units_count [Integer] Number of extension units.
|
|
35
|
+
#
|
|
36
|
+
# @param purge_cache_requests [Integer] Number of purge cache requests.
|
|
37
|
+
#
|
|
38
|
+
# @param video_processing_units_count [Integer] Number of video processing units.
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -75,9 +75,25 @@ module Imagekitio
|
|
|
75
75
|
Imagekitio::Internal::Type::Boolean,
|
|
76
76
|
api_name: :preserveAssetDeliveryTypes
|
|
77
77
|
|
|
78
|
-
# @!
|
|
78
|
+
# @!attribute use_improved_layer_spec
|
|
79
|
+
# Whether to always rewrite Cloudinary layers to the improved ImageKit layer
|
|
80
|
+
# specification (`l-image`, `l-text`, ..., `l-end`). When `false` or omitted, the
|
|
81
|
+
# improved specification is used only for transformations that require it.
|
|
82
|
+
#
|
|
83
|
+
# @return [Boolean, nil]
|
|
84
|
+
optional :use_improved_layer_spec,
|
|
85
|
+
Imagekitio::Internal::Type::Boolean,
|
|
86
|
+
api_name: :useImprovedLayerSpec
|
|
87
|
+
|
|
88
|
+
# @!method initialize(preserve_asset_delivery_types: nil, use_improved_layer_spec: nil, type: :CLOUDINARY)
|
|
89
|
+
# Some parameter documentations has been truncated, see
|
|
90
|
+
# {Imagekitio::Models::Accounts::URLEndpointRequest::URLRewriter::Cloudinary} for
|
|
91
|
+
# more details.
|
|
92
|
+
#
|
|
79
93
|
# @param preserve_asset_delivery_types [Boolean] Whether to preserve `<asset_type>/<delivery_type>` in the rewritten URL.
|
|
80
94
|
#
|
|
95
|
+
# @param use_improved_layer_spec [Boolean] Whether to always rewrite Cloudinary layers to the improved ImageKit layer speci
|
|
96
|
+
#
|
|
81
97
|
# @param type [Symbol, :CLOUDINARY]
|
|
82
98
|
end
|
|
83
99
|
|
|
@@ -88,9 +88,25 @@ module Imagekitio
|
|
|
88
88
|
# @return [Symbol, :CLOUDINARY]
|
|
89
89
|
required :type, const: :CLOUDINARY
|
|
90
90
|
|
|
91
|
-
# @!
|
|
91
|
+
# @!attribute use_improved_layer_spec
|
|
92
|
+
# Whether to always rewrite Cloudinary layers to the improved ImageKit layer
|
|
93
|
+
# specification (`l-image`, `l-text`, ..., `l-end`). When `false` or omitted, the
|
|
94
|
+
# improved specification is used only for transformations that require it.
|
|
95
|
+
#
|
|
96
|
+
# @return [Boolean, nil]
|
|
97
|
+
optional :use_improved_layer_spec,
|
|
98
|
+
Imagekitio::Internal::Type::Boolean,
|
|
99
|
+
api_name: :useImprovedLayerSpec
|
|
100
|
+
|
|
101
|
+
# @!method initialize(preserve_asset_delivery_types:, use_improved_layer_spec: nil, type: :CLOUDINARY)
|
|
102
|
+
# Some parameter documentations has been truncated, see
|
|
103
|
+
# {Imagekitio::Models::Accounts::URLEndpointResponse::URLRewriter::Cloudinary} for
|
|
104
|
+
# more details.
|
|
105
|
+
#
|
|
92
106
|
# @param preserve_asset_delivery_types [Boolean] Whether to preserve `<asset_type>/<delivery_type>` in the rewritten URL.
|
|
93
107
|
#
|
|
108
|
+
# @param use_improved_layer_spec [Boolean] Whether to always rewrite Cloudinary layers to the improved ImageKit layer speci
|
|
109
|
+
#
|
|
94
110
|
# @param type [Symbol, :CLOUDINARY]
|
|
95
111
|
end
|
|
96
112
|
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
# @see Imagekitio::Resources::Accounts::Webhooks#create
|
|
7
|
+
class Webhook < Imagekitio::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute id
|
|
9
|
+
# Unique identifier for a webhook.
|
|
10
|
+
#
|
|
11
|
+
# @return [String]
|
|
12
|
+
required :id, String
|
|
13
|
+
|
|
14
|
+
# @!attribute created_at
|
|
15
|
+
# ISO 8601 timestamp of when the webhook was created.
|
|
16
|
+
#
|
|
17
|
+
# @return [Time]
|
|
18
|
+
required :created_at, Time, api_name: :createdAt
|
|
19
|
+
|
|
20
|
+
# @!attribute enabled
|
|
21
|
+
# Whether the webhook is enabled. When `false`, ImageKit doesn't send any events
|
|
22
|
+
# to the `endpoint`.
|
|
23
|
+
#
|
|
24
|
+
# @return [Boolean]
|
|
25
|
+
required :enabled, Imagekitio::Internal::Type::Boolean
|
|
26
|
+
|
|
27
|
+
# @!attribute endpoint
|
|
28
|
+
# The URL where ImageKit sends webhook events as `POST` requests. Must use the
|
|
29
|
+
# `http` or `https` protocol, and must be unique across all webhooks for your
|
|
30
|
+
# account.
|
|
31
|
+
#
|
|
32
|
+
# @return [String]
|
|
33
|
+
required :endpoint, String
|
|
34
|
+
|
|
35
|
+
# @!attribute events
|
|
36
|
+
# The event types this webhook is subscribed to. ImageKit sends a request to the
|
|
37
|
+
# `endpoint` only for these events.
|
|
38
|
+
#
|
|
39
|
+
# @return [Array<Symbol, Imagekitio::Models::Accounts::WebhookEventType>]
|
|
40
|
+
required :events, -> { Imagekitio::Internal::Type::ArrayOf[enum: Imagekitio::Accounts::WebhookEventType] }
|
|
41
|
+
|
|
42
|
+
# @!attribute secret
|
|
43
|
+
# Signing secret generated by ImageKit, used to verify that webhook requests come
|
|
44
|
+
# from ImageKit. Starts with `whsec_`. This value can't be set or changed through
|
|
45
|
+
# the API. Learn more about
|
|
46
|
+
# [verifying webhook signatures](https://imagekit.io/docs/webhooks#verify-webhook-signature).
|
|
47
|
+
#
|
|
48
|
+
# @return [String]
|
|
49
|
+
required :secret, String
|
|
50
|
+
|
|
51
|
+
# @!attribute updated_at
|
|
52
|
+
# ISO 8601 timestamp of when the webhook was last updated.
|
|
53
|
+
#
|
|
54
|
+
# @return [Time]
|
|
55
|
+
required :updated_at, Time, api_name: :updatedAt
|
|
56
|
+
|
|
57
|
+
# @!method initialize(id:, created_at:, enabled:, endpoint:, events:, secret:, updated_at:)
|
|
58
|
+
# Some parameter documentations has been truncated, see
|
|
59
|
+
# {Imagekitio::Models::Accounts::Webhook} for more details.
|
|
60
|
+
#
|
|
61
|
+
# A webhook is an HTTP endpoint that ImageKit notifies when subscribed events
|
|
62
|
+
# occur in your account. Learn more about
|
|
63
|
+
# [webhooks](https://imagekit.io/docs/webhooks).
|
|
64
|
+
#
|
|
65
|
+
# @param id [String] Unique identifier for a webhook.
|
|
66
|
+
#
|
|
67
|
+
# @param created_at [Time] ISO 8601 timestamp of when the webhook was created.
|
|
68
|
+
#
|
|
69
|
+
# @param enabled [Boolean] Whether the webhook is enabled. When `false`, ImageKit doesn't send any events t
|
|
70
|
+
#
|
|
71
|
+
# @param endpoint [String] The URL where ImageKit sends webhook events as `POST` requests. Must use the `ht
|
|
72
|
+
#
|
|
73
|
+
# @param events [Array<Symbol, Imagekitio::Models::Accounts::WebhookEventType>] The event types this webhook is subscribed to. ImageKit sends a request to the `
|
|
74
|
+
#
|
|
75
|
+
# @param secret [String] Signing secret generated by ImageKit, used to verify that webhook requests come
|
|
76
|
+
#
|
|
77
|
+
# @param updated_at [Time] ISO 8601 timestamp of when the webhook was last updated.
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
# @see Imagekitio::Resources::Accounts::Webhooks#create
|
|
7
|
+
class WebhookCreateParams < Imagekitio::Internal::Type::BaseModel
|
|
8
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute endpoint
|
|
12
|
+
# The URL where ImageKit sends webhook events as `POST` requests. Must use the
|
|
13
|
+
# `http` or `https` protocol, and must be unique across all webhooks for your
|
|
14
|
+
# account.
|
|
15
|
+
#
|
|
16
|
+
# @return [String]
|
|
17
|
+
required :endpoint, String
|
|
18
|
+
|
|
19
|
+
# @!attribute events
|
|
20
|
+
# The event types this webhook is subscribed to. ImageKit sends a request to the
|
|
21
|
+
# `endpoint` only for these events.
|
|
22
|
+
#
|
|
23
|
+
# @return [Array<Symbol, Imagekitio::Models::Accounts::WebhookEventType>]
|
|
24
|
+
required :events, -> { Imagekitio::Internal::Type::ArrayOf[enum: Imagekitio::Accounts::WebhookEventType] }
|
|
25
|
+
|
|
26
|
+
# @!attribute enabled
|
|
27
|
+
# Whether the webhook is enabled. When `false`, ImageKit doesn't send any events
|
|
28
|
+
# to the `endpoint`.
|
|
29
|
+
#
|
|
30
|
+
# @return [Boolean, nil]
|
|
31
|
+
optional :enabled, Imagekitio::Internal::Type::Boolean
|
|
32
|
+
|
|
33
|
+
# @!method initialize(endpoint:, events:, enabled: nil, request_options: {})
|
|
34
|
+
# Some parameter documentations has been truncated, see
|
|
35
|
+
# {Imagekitio::Models::Accounts::WebhookCreateParams} for more details.
|
|
36
|
+
#
|
|
37
|
+
# @param endpoint [String] The URL where ImageKit sends webhook events as `POST` requests. Must use the `ht
|
|
38
|
+
#
|
|
39
|
+
# @param events [Array<Symbol, Imagekitio::Models::Accounts::WebhookEventType>] The event types this webhook is subscribed to. ImageKit sends a request to the `
|
|
40
|
+
#
|
|
41
|
+
# @param enabled [Boolean] Whether the webhook is enabled. When `false`, ImageKit doesn't send any events t
|
|
42
|
+
#
|
|
43
|
+
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
# @see Imagekitio::Resources::Accounts::Webhooks#delete
|
|
7
|
+
class WebhookDeleteParams < Imagekitio::Internal::Type::BaseModel
|
|
8
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute id
|
|
12
|
+
# Unique identifier for a webhook.
|
|
13
|
+
#
|
|
14
|
+
# @return [String]
|
|
15
|
+
required :id, String
|
|
16
|
+
|
|
17
|
+
# @!method initialize(id:, request_options: {})
|
|
18
|
+
# @param id [String] Unique identifier for a webhook.
|
|
19
|
+
#
|
|
20
|
+
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
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
|
+
VIDEO_TRANSFORMATION_ACCEPTED = :"video.transformation.accepted"
|
|
12
|
+
VIDEO_TRANSFORMATION_READY = :"video.transformation.ready"
|
|
13
|
+
VIDEO_TRANSFORMATION_ERROR = :"video.transformation.error"
|
|
14
|
+
UPLOAD_PRE_TRANSFORM_SUCCESS = :"upload.pre-transform.success"
|
|
15
|
+
UPLOAD_PRE_TRANSFORM_ERROR = :"upload.pre-transform.error"
|
|
16
|
+
UPLOAD_POST_TRANSFORM_SUCCESS = :"upload.post-transform.success"
|
|
17
|
+
UPLOAD_POST_TRANSFORM_ERROR = :"upload.post-transform.error"
|
|
18
|
+
FILE_CREATED = :"file.created"
|
|
19
|
+
FILE_UPDATED = :"file.updated"
|
|
20
|
+
FILE_DELETED = :"file.deleted"
|
|
21
|
+
FILE_VERSION_CREATED = :"file-version.created"
|
|
22
|
+
FILE_VERSION_DELETED = :"file-version.deleted"
|
|
23
|
+
FOLDER_CREATED = :"folder.created"
|
|
24
|
+
FOLDER_UPDATED = :"folder.updated"
|
|
25
|
+
FOLDER_DELETED = :"folder.deleted"
|
|
26
|
+
|
|
27
|
+
# @!method self.values
|
|
28
|
+
# @return [Array<Symbol>]
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
# @see Imagekitio::Resources::Accounts::Webhooks#get
|
|
7
|
+
class WebhookGetParams < Imagekitio::Internal::Type::BaseModel
|
|
8
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute id
|
|
12
|
+
# Unique identifier for a webhook.
|
|
13
|
+
#
|
|
14
|
+
# @return [String]
|
|
15
|
+
required :id, String
|
|
16
|
+
|
|
17
|
+
# @!method initialize(id:, request_options: {})
|
|
18
|
+
# @param id [String] Unique identifier for a webhook.
|
|
19
|
+
#
|
|
20
|
+
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
# @see Imagekitio::Resources::Accounts::Webhooks#list
|
|
7
|
+
class WebhookListParams < Imagekitio::Internal::Type::BaseModel
|
|
8
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!method initialize(request_options: {})
|
|
12
|
+
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|