imagekitio 4.11.0 → 4.13.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 +22 -0
- data/README.md +28 -1
- data/lib/imagekitio/client.rb +4 -0
- data/lib/imagekitio/helpers/helper.rb +18 -4
- data/lib/imagekitio/helpers/transformation_utils.rb +1 -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/folder_delete_event.rb +13 -1
- data/lib/imagekitio/models/folder_update_event.rb +30 -3
- data/lib/imagekitio/models/tag.rb +52 -0
- data/lib/imagekitio/models/tag_list_params.rb +143 -0
- data/lib/imagekitio/models/transformation.rb +13 -1
- data/lib/imagekitio/models/unsafe_unwrap_webhook_event.rb +1 -1
- data/lib/imagekitio/models/unwrap_webhook_event.rb +1 -1
- data/lib/imagekitio/models.rb +4 -0
- data/lib/imagekitio/resources/accounts/contract.rb +47 -0
- data/lib/imagekitio/resources/accounts.rb +4 -0
- data/lib/imagekitio/resources/tags.rb +65 -0
- data/lib/imagekitio/version.rb +1 -1
- data/lib/imagekitio.rb +8 -0
- 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/folder_delete_event.rbi +18 -3
- data/rbi/imagekitio/models/folder_update_event.rbi +50 -3
- data/rbi/imagekitio/models/tag.rbi +71 -0
- data/rbi/imagekitio/models/tag_list_params.rbi +236 -0
- data/rbi/imagekitio/models/transformation.rbi +19 -0
- data/rbi/imagekitio/models.rbi +4 -0
- data/rbi/imagekitio/resources/accounts/contract.rbi +36 -0
- data/rbi/imagekitio/resources/accounts.rbi +3 -0
- data/rbi/imagekitio/resources/tags.rbi +74 -0
- 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/folder_delete_event.rbs +7 -3
- data/sig/imagekitio/models/folder_update_event.rbs +25 -2
- data/sig/imagekitio/models/tag.rbs +30 -0
- data/sig/imagekitio/models/tag_list_params.rbs +114 -0
- data/sig/imagekitio/models/transformation.rbs +7 -0
- data/sig/imagekitio/models.rbs +4 -0
- data/sig/imagekitio/resources/accounts/contract.rbs +13 -0
- data/sig/imagekitio/resources/accounts.rbs +2 -0
- data/sig/imagekitio/resources/tags.rbs +18 -0
- metadata +26 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 44f21e327dc4c1d2b2bed8c273f84f5455917c0784f6a795861364f379d1e312
|
|
4
|
+
data.tar.gz: bd87588fa306bb68d1f6df783e65f76cf85864f5c501708d3d46ad17e1883f34
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 25470054024768ca6a5933a3a483766c81519fe01132d16ae941062c43e002039e5e4686290d348b4844d84eacf6b92d41652c46a1c8a00b7d2ca8037c3291c1
|
|
7
|
+
data.tar.gz: 4eb1b076c1e53ba3c2878a1e9376cfd0091f7b9399db5383fafc8518671331604fcdee0c180a39b1ce33135b4abe59f37a8e81d5f907bbb1fe085af14f2d7509
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.13.0](https://github.com/imagekit-developer/imagekit-ruby/compare/v4.12.0...v4.13.0) (2026-11-16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **transformation:** add saturation and encode negative numbers with the N prefix in URL generation ([512b775](https://github.com/imagekit-developer/imagekit-ruby/commit/512b77500a76de41b5a7b3ce8f9b09f5daffdc02))
|
|
9
|
+
* **webhooks:** add folder paths to folder.deleted and folder.updated events ([7a9b990](https://github.com/imagekit-developer/imagekit-ruby/commit/7a9b9904fe4459e8dd48932f3c5f8d742dceb538))
|
|
10
|
+
|
|
11
|
+
## [4.12.0](https://github.com/imagekit-developer/imagekit-ruby/compare/v4.11.0...v4.12.0) (2026-11-02)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* add GET /v1/tags to list media library tags ([e1a42da](https://github.com/imagekit-developer/imagekit-ruby/commit/e1a42da77bb7da5541197d121437e36ef8d50216))
|
|
17
|
+
* **api:** add accounts.contract.get() for contract consumption ([c80613e](https://github.com/imagekit-developer/imagekit-ruby/commit/c80613eab38b19ecebdfa21574fa31efa9e82033))
|
|
18
|
+
* **api:** add useImprovedLayerSpec to the Cloudinary URL rewriter ([c80613e](https://github.com/imagekit-developer/imagekit-ruby/commit/c80613eab38b19ecebdfa21574fa31efa9e82033))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Documentation
|
|
22
|
+
|
|
23
|
+
* add pagination example ([e77d60d](https://github.com/imagekit-developer/imagekit-ruby/commit/e77d60d1fc979b8c781298b7b6a64421c5033b6d))
|
|
24
|
+
|
|
3
25
|
## [4.11.0](https://github.com/imagekit-developer/imagekit-ruby/compare/v4.10.0...v4.11.0) (2026-10-19)
|
|
4
26
|
|
|
5
27
|
|
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.13.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)
|
|
@@ -209,6 +209,8 @@ module Imagekitio
|
|
|
209
209
|
value = value.to_i if value == value.to_i
|
|
210
210
|
end
|
|
211
211
|
|
|
212
|
+
value = encode_negative_number(value) if %w[rt x y e-saturation].include?(transform_key)
|
|
213
|
+
|
|
212
214
|
parsed_transform_step << "#{transform_key}#{Imagekitio::TransformationUtils.get_transform_key_value_delimiter}#{value}"
|
|
213
215
|
end
|
|
214
216
|
# rubocop:enable Metrics/BlockLength
|
|
@@ -410,6 +412,16 @@ module Imagekitio
|
|
|
410
412
|
str.chomp("/")
|
|
411
413
|
end
|
|
412
414
|
|
|
415
|
+
# Encode a negative number with the N prefix, because "-" separates a key from its value in the URL.
|
|
416
|
+
# For example, -40 becomes "N40". Other values are returned as is.
|
|
417
|
+
def encode_negative_number(value)
|
|
418
|
+
return value unless value.is_a?(Numeric) && value.negative?
|
|
419
|
+
|
|
420
|
+
magnitude = value.abs
|
|
421
|
+
magnitude = magnitude.to_i if magnitude == magnitude.to_i
|
|
422
|
+
"N#{magnitude}"
|
|
423
|
+
end
|
|
424
|
+
|
|
413
425
|
# Remove leading slash from string
|
|
414
426
|
def remove_leading_slash(str)
|
|
415
427
|
return str unless str.is_a?(String) && str.start_with?("/")
|
|
@@ -633,6 +645,8 @@ module Imagekitio
|
|
|
633
645
|
# Add position properties
|
|
634
646
|
position = safe_get(overlay, :position)
|
|
635
647
|
if position
|
|
648
|
+
# Read raw values: the typed accessors raise for strings that are not numeric, such as "N20" or "bw_mul_0.4".
|
|
649
|
+
position = position.to_h if position.respond_to?(:to_h)
|
|
636
650
|
x = safe_get(position, :x)
|
|
637
651
|
y = safe_get(position, :y_)
|
|
638
652
|
x_center = safe_get(position, :x_center)
|
|
@@ -640,10 +654,10 @@ module Imagekitio
|
|
|
640
654
|
focus = safe_get(position, :focus)
|
|
641
655
|
anchor_point = safe_get(position, :anchor_point)
|
|
642
656
|
|
|
643
|
-
parts << "lx-#{x}" if x
|
|
644
|
-
parts << "ly-#{y}" if y
|
|
645
|
-
parts << "lxc-#{x_center}" if x_center
|
|
646
|
-
parts << "lyc-#{y_center}" if y_center
|
|
657
|
+
parts << "lx-#{encode_negative_number(x)}" if x
|
|
658
|
+
parts << "ly-#{encode_negative_number(y)}" if y
|
|
659
|
+
parts << "lxc-#{encode_negative_number(x_center)}" if x_center
|
|
660
|
+
parts << "lyc-#{encode_negative_number(y_center)}" if y_center
|
|
647
661
|
parts << "lfo-#{focus}" if focus
|
|
648
662
|
parts << "lap-#{anchor_point}" if anchor_point
|
|
649
663
|
end
|
|
@@ -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
|
|
|
@@ -39,8 +39,20 @@ module Imagekitio
|
|
|
39
39
|
# @return [String]
|
|
40
40
|
required :folder_id, String, api_name: :folderId
|
|
41
41
|
|
|
42
|
-
# @!
|
|
42
|
+
# @!attribute folder_path
|
|
43
|
+
# Path of the deleted folder. For a moved folder, this is its path before the
|
|
44
|
+
# move.
|
|
45
|
+
#
|
|
46
|
+
# @return [String, nil]
|
|
47
|
+
optional :folder_path, String, api_name: :folderPath
|
|
48
|
+
|
|
49
|
+
# @!method initialize(folder_id:, folder_path: nil)
|
|
50
|
+
# Some parameter documentations has been truncated, see
|
|
51
|
+
# {Imagekitio::Models::FolderDeleteEvent::Data} for more details.
|
|
52
|
+
#
|
|
43
53
|
# @param folder_id [String] The unique `folderId` of the deleted folder.
|
|
54
|
+
#
|
|
55
|
+
# @param folder_path [String] Path of the deleted folder. For a moved folder, this is its path before the move
|
|
44
56
|
end
|
|
45
57
|
end
|
|
46
58
|
end
|
|
@@ -20,16 +20,43 @@ module Imagekitio
|
|
|
20
20
|
# @return [Symbol, :"folder.updated"]
|
|
21
21
|
required :type, const: :"folder.updated"
|
|
22
22
|
|
|
23
|
-
# @!
|
|
23
|
+
# @!attribute previous
|
|
24
|
+
# Present only when the folder or one of its parent folders was renamed. Contains
|
|
25
|
+
# the folder's path before the rename.
|
|
26
|
+
#
|
|
27
|
+
# @return [Imagekitio::Models::FolderUpdateEvent::Previous, nil]
|
|
28
|
+
optional :previous, -> { Imagekitio::FolderUpdateEvent::Previous }
|
|
29
|
+
|
|
30
|
+
# @!method initialize(created_at:, data:, previous: nil, type: :"folder.updated")
|
|
31
|
+
# Some parameter documentations has been truncated, see
|
|
32
|
+
# {Imagekitio::Models::FolderUpdateEvent} for more details.
|
|
33
|
+
#
|
|
24
34
|
# Triggered when a folder is updated, for example when its custom metadata changes
|
|
25
|
-
# or it is renamed. Renaming a folder sends one event per folder in the tree
|
|
26
|
-
#
|
|
35
|
+
# or it is renamed. Renaming a folder sends one event per folder in the tree. In
|
|
36
|
+
# each of these events, `data.folderPath` is the folder's new path and
|
|
37
|
+
# `previous.folderPath` is its path before the rename.
|
|
27
38
|
#
|
|
28
39
|
# @param created_at [Time] Timestamp of when the event occurred in ISO8601 format.
|
|
29
40
|
#
|
|
30
41
|
# @param data [Imagekitio::Models::Folder]
|
|
31
42
|
#
|
|
43
|
+
# @param previous [Imagekitio::Models::FolderUpdateEvent::Previous] Present only when the folder or one of its parent folders was renamed. Contains
|
|
44
|
+
#
|
|
32
45
|
# @param type [Symbol, :"folder.updated"] Type of the webhook event.
|
|
46
|
+
|
|
47
|
+
class Previous < Imagekitio::Internal::Type::BaseModel
|
|
48
|
+
# @!attribute folder_path
|
|
49
|
+
# Path of the folder before it was renamed.
|
|
50
|
+
#
|
|
51
|
+
# @return [String]
|
|
52
|
+
required :folder_path, String, api_name: :folderPath
|
|
53
|
+
|
|
54
|
+
# @!method initialize(folder_path:)
|
|
55
|
+
# Present only when the folder or one of its parent folders was renamed. Contains
|
|
56
|
+
# the folder's path before the rename.
|
|
57
|
+
#
|
|
58
|
+
# @param folder_path [String] Path of the folder before it was renamed.
|
|
59
|
+
end
|
|
33
60
|
end
|
|
34
61
|
end
|
|
35
62
|
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
# @see Imagekitio::Resources::Tags#list
|
|
6
|
+
class Tag < Imagekitio::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute asset_count
|
|
8
|
+
# The number of assets carrying the tag, counted across both tag sources
|
|
9
|
+
# (user-generated tags and AI-generated tags) and all file types regardless of the
|
|
10
|
+
# request's filters.
|
|
11
|
+
#
|
|
12
|
+
# @return [Integer]
|
|
13
|
+
required :asset_count, Integer, api_name: :assetCount
|
|
14
|
+
|
|
15
|
+
# @!attribute label
|
|
16
|
+
# The tag as it was spelled when it was last applied to any asset. Use it for
|
|
17
|
+
# display.
|
|
18
|
+
#
|
|
19
|
+
# @return [String]
|
|
20
|
+
required :label, String
|
|
21
|
+
|
|
22
|
+
# @!attribute last_used_at
|
|
23
|
+
# When the tag was last applied to an asset matching the `tagSource` and
|
|
24
|
+
# `fileType` filters of the request, in ISO 8601 format.
|
|
25
|
+
#
|
|
26
|
+
# @return [Time]
|
|
27
|
+
required :last_used_at, Time, api_name: :lastUsedAt
|
|
28
|
+
|
|
29
|
+
# @!attribute name
|
|
30
|
+
# The tag in lowercase. Tags are case-insensitive, so this is the unique key of
|
|
31
|
+
# the tag within your account.
|
|
32
|
+
#
|
|
33
|
+
# @return [String]
|
|
34
|
+
required :name, String
|
|
35
|
+
|
|
36
|
+
# @!method initialize(asset_count:, label:, last_used_at:, name:)
|
|
37
|
+
# Some parameter documentations has been truncated, see {Imagekitio::Models::Tag}
|
|
38
|
+
# for more details.
|
|
39
|
+
#
|
|
40
|
+
# A tag in use in your media library, aggregated case-insensitively across the
|
|
41
|
+
# assets that carry it.
|
|
42
|
+
#
|
|
43
|
+
# @param asset_count [Integer] The number of assets carrying the tag, counted across both tag sources (user-gen
|
|
44
|
+
#
|
|
45
|
+
# @param label [String] The tag as it was spelled when it was last applied to any asset. Use it for disp
|
|
46
|
+
#
|
|
47
|
+
# @param last_used_at [Time] When the tag was last applied to an asset matching the `tagSource` and `fileType
|
|
48
|
+
#
|
|
49
|
+
# @param name [String] The tag in lowercase. Tags are case-insensitive, so this is the unique key of th
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|