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
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
# @see Imagekitio::Resources::Tags#list
|
|
6
|
+
class TagListParams < Imagekitio::Internal::Type::BaseModel
|
|
7
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute cursor
|
|
11
|
+
# The `nextCursor` value from the previous response, to fetch the next page. A
|
|
12
|
+
# cursor is bound to the `tagSource`, `fileType`, `sort`, `search` and `prefix` it
|
|
13
|
+
# was issued with; sending it with different values returns a 400.
|
|
14
|
+
#
|
|
15
|
+
# @return [String, nil]
|
|
16
|
+
optional :cursor, String
|
|
17
|
+
|
|
18
|
+
# @!attribute file_type
|
|
19
|
+
# Filter tags by the type of asset they are applied to.
|
|
20
|
+
#
|
|
21
|
+
# - `image` — tags in use on images
|
|
22
|
+
# - `video` — tags in use on videos
|
|
23
|
+
# - `static` — tags in use on any other file, such as documents, scripts and
|
|
24
|
+
# stylesheets
|
|
25
|
+
# - `all` — tags in use on any asset
|
|
26
|
+
#
|
|
27
|
+
# @return [Symbol, Imagekitio::Models::TagListParams::FileType, nil]
|
|
28
|
+
optional :file_type, enum: -> { Imagekitio::TagListParams::FileType }
|
|
29
|
+
|
|
30
|
+
# @!attribute limit
|
|
31
|
+
# The maximum number of tags to return in response.
|
|
32
|
+
#
|
|
33
|
+
# @return [Integer, nil]
|
|
34
|
+
optional :limit, Integer
|
|
35
|
+
|
|
36
|
+
# @!attribute prefix
|
|
37
|
+
# Only return tags that begin with this value. Matching is case-insensitive.
|
|
38
|
+
#
|
|
39
|
+
# @return [String, nil]
|
|
40
|
+
optional :prefix, String
|
|
41
|
+
|
|
42
|
+
# @!attribute search
|
|
43
|
+
# Only return tags that contain this text. Every word in the value must appear in
|
|
44
|
+
# the tag and the last word may be incomplete, which suits search-as-you-type.
|
|
45
|
+
# Matching is case-insensitive.
|
|
46
|
+
#
|
|
47
|
+
# @return [String, nil]
|
|
48
|
+
optional :search, String
|
|
49
|
+
|
|
50
|
+
# @!attribute sort
|
|
51
|
+
# Sort the results.
|
|
52
|
+
#
|
|
53
|
+
# - `ASC_NAME` / `DESC_NAME` — by `name`
|
|
54
|
+
# - `ASC_LAST_USED` / `DESC_LAST_USED` — by `lastUsedAt` within the requested
|
|
55
|
+
# `tagSource` and `fileType`, ties broken by `name`
|
|
56
|
+
#
|
|
57
|
+
# @return [Symbol, Imagekitio::Models::TagListParams::Sort, nil]
|
|
58
|
+
optional :sort, enum: -> { Imagekitio::TagListParams::Sort }
|
|
59
|
+
|
|
60
|
+
# @!attribute tag_source
|
|
61
|
+
# Filter tags by who added them.
|
|
62
|
+
#
|
|
63
|
+
# - `user` — tags added by users through the dashboard or the API
|
|
64
|
+
# - `ai` — tags added by AI auto-tagging extensions
|
|
65
|
+
# - `all` — both
|
|
66
|
+
#
|
|
67
|
+
# @return [Symbol, Imagekitio::Models::TagListParams::TagSource, nil]
|
|
68
|
+
optional :tag_source, enum: -> { Imagekitio::TagListParams::TagSource }
|
|
69
|
+
|
|
70
|
+
# @!method initialize(cursor: nil, file_type: nil, limit: nil, prefix: nil, search: nil, sort: nil, tag_source: nil, request_options: {})
|
|
71
|
+
# Some parameter documentations has been truncated, see
|
|
72
|
+
# {Imagekitio::Models::TagListParams} for more details.
|
|
73
|
+
#
|
|
74
|
+
# @param cursor [String] The `nextCursor` value from the previous response, to fetch the next page. A cur
|
|
75
|
+
#
|
|
76
|
+
# @param file_type [Symbol, Imagekitio::Models::TagListParams::FileType] Filter tags by the type of asset they are applied to.
|
|
77
|
+
#
|
|
78
|
+
# @param limit [Integer] The maximum number of tags to return in response.
|
|
79
|
+
#
|
|
80
|
+
# @param prefix [String] Only return tags that begin with this value. Matching is case-insensitive.
|
|
81
|
+
#
|
|
82
|
+
# @param search [String] Only return tags that contain this text. Every word in the value must appear in
|
|
83
|
+
#
|
|
84
|
+
# @param sort [Symbol, Imagekitio::Models::TagListParams::Sort] Sort the results.
|
|
85
|
+
#
|
|
86
|
+
# @param tag_source [Symbol, Imagekitio::Models::TagListParams::TagSource] Filter tags by who added them.
|
|
87
|
+
#
|
|
88
|
+
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
|
|
89
|
+
|
|
90
|
+
# Filter tags by the type of asset they are applied to.
|
|
91
|
+
#
|
|
92
|
+
# - `image` — tags in use on images
|
|
93
|
+
# - `video` — tags in use on videos
|
|
94
|
+
# - `static` — tags in use on any other file, such as documents, scripts and
|
|
95
|
+
# stylesheets
|
|
96
|
+
# - `all` — tags in use on any asset
|
|
97
|
+
module FileType
|
|
98
|
+
extend Imagekitio::Internal::Type::Enum
|
|
99
|
+
|
|
100
|
+
IMAGE = :image
|
|
101
|
+
VIDEO = :video
|
|
102
|
+
STATIC = :static
|
|
103
|
+
ALL = :all
|
|
104
|
+
|
|
105
|
+
# @!method self.values
|
|
106
|
+
# @return [Array<Symbol>]
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Sort the results.
|
|
110
|
+
#
|
|
111
|
+
# - `ASC_NAME` / `DESC_NAME` — by `name`
|
|
112
|
+
# - `ASC_LAST_USED` / `DESC_LAST_USED` — by `lastUsedAt` within the requested
|
|
113
|
+
# `tagSource` and `fileType`, ties broken by `name`
|
|
114
|
+
module Sort
|
|
115
|
+
extend Imagekitio::Internal::Type::Enum
|
|
116
|
+
|
|
117
|
+
ASC_NAME = :ASC_NAME
|
|
118
|
+
DESC_NAME = :DESC_NAME
|
|
119
|
+
ASC_LAST_USED = :ASC_LAST_USED
|
|
120
|
+
DESC_LAST_USED = :DESC_LAST_USED
|
|
121
|
+
|
|
122
|
+
# @!method self.values
|
|
123
|
+
# @return [Array<Symbol>]
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Filter tags by who added them.
|
|
127
|
+
#
|
|
128
|
+
# - `user` — tags added by users through the dashboard or the API
|
|
129
|
+
# - `ai` — tags added by AI auto-tagging extensions
|
|
130
|
+
# - `all` — both
|
|
131
|
+
module TagSource
|
|
132
|
+
extend Imagekitio::Internal::Type::Enum
|
|
133
|
+
|
|
134
|
+
USER = :user
|
|
135
|
+
AI = :ai
|
|
136
|
+
ALL = :all
|
|
137
|
+
|
|
138
|
+
# @!method self.values
|
|
139
|
+
# @return [Array<Symbol>]
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
end
|
|
@@ -416,6 +416,16 @@ module Imagekitio
|
|
|
416
416
|
# @return [Float, String, nil]
|
|
417
417
|
optional :rotation, union: -> { Imagekitio::Transformation::Rotation }
|
|
418
418
|
|
|
419
|
+
# @!attribute saturation
|
|
420
|
+
# Adjusts the color saturation of the image. Accepts an integer from -100 to 100.
|
|
421
|
+
# Negative values desaturate (`-100` is fully gray), positive values increase
|
|
422
|
+
# saturation, and `0` leaves the image unchanged. Supported inside image overlays.
|
|
423
|
+
# Not supported for animated images. See
|
|
424
|
+
# [Saturation](https://imagekit.io/docs/effects-and-enhancements#saturation---e-saturation).
|
|
425
|
+
#
|
|
426
|
+
# @return [Integer, nil]
|
|
427
|
+
optional :saturation, Integer
|
|
428
|
+
|
|
419
429
|
# @!attribute shadow
|
|
420
430
|
# Adds a shadow beneath solid objects in an image with a transparent background.
|
|
421
431
|
# For AI-based drop shadows, refer to aiDropShadow. Pass `true` for a default
|
|
@@ -521,7 +531,7 @@ module Imagekitio
|
|
|
521
531
|
# @return [Float, nil]
|
|
522
532
|
optional :zoom, Float
|
|
523
533
|
|
|
524
|
-
# @!method initialize(ai_change_background: nil, ai_drop_shadow: nil, ai_edit: nil, ai_remove_background: nil, ai_remove_background_external: nil, ai_retouch: nil, ai_upscale: nil, ai_variation: nil, aspect_ratio: nil, audio_codec: nil, background: nil, blur: nil, border: nil, colorize: nil, color_profile: nil, color_replace: nil, contrast_stretch: nil, crop: nil, crop_mode: nil, default_image: nil, density: nil, distort: nil, dpr: nil, duration: nil, end_offset: nil, flip: nil, focus: nil, format_: nil, gradient: nil, grayscale: nil, height: nil, lossless: nil, metadata: nil, named: nil, opacity: nil, original: nil, overlay: nil, page: nil, progressive: nil, quality: nil, radius: nil, raw: nil, rotation: nil, shadow: nil, sharpen: nil, start_offset: nil, streaming_resolutions: nil, trim: nil, unsharp_mask: nil, video_codec: nil, width: nil, x: nil, x_center: nil, y_: nil, y_center: nil, zoom: nil)
|
|
534
|
+
# @!method initialize(ai_change_background: nil, ai_drop_shadow: nil, ai_edit: nil, ai_remove_background: nil, ai_remove_background_external: nil, ai_retouch: nil, ai_upscale: nil, ai_variation: nil, aspect_ratio: nil, audio_codec: nil, background: nil, blur: nil, border: nil, colorize: nil, color_profile: nil, color_replace: nil, contrast_stretch: nil, crop: nil, crop_mode: nil, default_image: nil, density: nil, distort: nil, dpr: nil, duration: nil, end_offset: nil, flip: nil, focus: nil, format_: nil, gradient: nil, grayscale: nil, height: nil, lossless: nil, metadata: nil, named: nil, opacity: nil, original: nil, overlay: nil, page: nil, progressive: nil, quality: nil, radius: nil, raw: nil, rotation: nil, saturation: nil, shadow: nil, sharpen: nil, start_offset: nil, streaming_resolutions: nil, trim: nil, unsharp_mask: nil, video_codec: nil, width: nil, x: nil, x_center: nil, y_: nil, y_center: nil, zoom: nil)
|
|
525
535
|
# Some parameter documentations has been truncated, see
|
|
526
536
|
# {Imagekitio::Models::Transformation} for more details.
|
|
527
537
|
#
|
|
@@ -618,6 +628,8 @@ module Imagekitio
|
|
|
618
628
|
#
|
|
619
629
|
# @param rotation [Float, String] Specifies the rotation angle in degrees. Positive values rotate the image clockw
|
|
620
630
|
#
|
|
631
|
+
# @param saturation [Integer] Adjusts the color saturation of the image. Accepts an integer from -100 to 100.
|
|
632
|
+
#
|
|
621
633
|
# @param shadow [Boolean, true, String] Adds a shadow beneath solid objects in an image with a transparent background.
|
|
622
634
|
#
|
|
623
635
|
# @param sharpen [Boolean, true, Float] Sharpens the input image, highlighting edges and finer details.
|
|
@@ -49,7 +49,7 @@ module Imagekitio
|
|
|
49
49
|
# Triggered when a folder is created, whether explicitly, by copying or moving a folder, or implicitly when an upload creates missing parent folders. Copying or moving a folder tree sends one event per folder in the tree.
|
|
50
50
|
variant -> { Imagekitio::FolderCreateEvent }
|
|
51
51
|
|
|
52
|
-
# Triggered when a folder is updated, for example when its custom metadata changes or it is renamed. Renaming a folder sends one event per folder in the tree
|
|
52
|
+
# Triggered when a folder is updated, for example when its custom metadata changes or it is renamed. Renaming a folder sends one event per folder in the tree. In each of these events, `data.folderPath` is the folder's new path and `previous.folderPath` is its path before the rename.
|
|
53
53
|
variant -> { Imagekitio::FolderUpdateEvent }
|
|
54
54
|
|
|
55
55
|
# Triggered when a folder is deleted. Deleting a folder tree sends one event per folder in the tree; the files inside it send `file.deleted` events and their versions send `file-version.deleted` events. Moving a folder sends this event for the old `folderId` and `folder.created` for the new one.
|
|
@@ -49,7 +49,7 @@ module Imagekitio
|
|
|
49
49
|
# Triggered when a folder is created, whether explicitly, by copying or moving a folder, or implicitly when an upload creates missing parent folders. Copying or moving a folder tree sends one event per folder in the tree.
|
|
50
50
|
variant -> { Imagekitio::FolderCreateEvent }
|
|
51
51
|
|
|
52
|
-
# Triggered when a folder is updated, for example when its custom metadata changes or it is renamed. Renaming a folder sends one event per folder in the tree
|
|
52
|
+
# Triggered when a folder is updated, for example when its custom metadata changes or it is renamed. Renaming a folder sends one event per folder in the tree. In each of these events, `data.folderPath` is the folder's new path and `previous.folderPath` is its path before the rename.
|
|
53
53
|
variant -> { Imagekitio::FolderUpdateEvent }
|
|
54
54
|
|
|
55
55
|
# Triggered when a folder is deleted. Deleting a folder tree sends one event per folder in the tree; the files inside it send `file.deleted` events and their versions send `file-version.deleted` events. Moving a folder sends this event for the old `folderId` and `folder.created` for the new one.
|
data/lib/imagekitio/models.rb
CHANGED
|
@@ -179,6 +179,10 @@ module Imagekitio
|
|
|
179
179
|
|
|
180
180
|
SubtitleOverlayTransformation = Imagekitio::Models::SubtitleOverlayTransformation
|
|
181
181
|
|
|
182
|
+
Tag = Imagekitio::Models::Tag
|
|
183
|
+
|
|
184
|
+
TagListParams = Imagekitio::Models::TagListParams
|
|
185
|
+
|
|
182
186
|
TextOverlay = Imagekitio::Models::TextOverlay
|
|
183
187
|
|
|
184
188
|
TextOverlayTransformation = Imagekitio::Models::TextOverlayTransformation
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Resources
|
|
5
|
+
class Accounts
|
|
6
|
+
class Contract
|
|
7
|
+
# Get the account's contract terms and the usage consumed against them in the
|
|
8
|
+
# current contract term. Bandwidth is in bytes; video processing units, extension
|
|
9
|
+
# units and purge cache requests are counts.
|
|
10
|
+
#
|
|
11
|
+
# For an agency account, consumption includes the child accounts billed to it. A
|
|
12
|
+
# child account billed to its parent cannot call this endpoint; call it with the
|
|
13
|
+
# parent account's credentials instead.
|
|
14
|
+
#
|
|
15
|
+
# Contract terms are read live; consumption is refreshed periodically, not on
|
|
16
|
+
# every request. Use `asOf` to check how fresh it is. Contracts of one month or
|
|
17
|
+
# less are reported as `hasContract: false`. The response is cached for 5 minutes
|
|
18
|
+
# per account.
|
|
19
|
+
#
|
|
20
|
+
# Requires an API key with account management access.
|
|
21
|
+
#
|
|
22
|
+
# @overload get(request_options: {})
|
|
23
|
+
#
|
|
24
|
+
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
25
|
+
#
|
|
26
|
+
# @return [Imagekitio::Models::Accounts::ContractGetResponse]
|
|
27
|
+
#
|
|
28
|
+
# @see Imagekitio::Models::Accounts::ContractGetParams
|
|
29
|
+
def get(params = {})
|
|
30
|
+
@client.request(
|
|
31
|
+
method: :get,
|
|
32
|
+
path: "v1/accounts/contract",
|
|
33
|
+
model: Imagekitio::Models::Accounts::ContractGetResponse,
|
|
34
|
+
options: params[:request_options]
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# @api private
|
|
39
|
+
#
|
|
40
|
+
# @param client [Imagekitio::Client]
|
|
41
|
+
def initialize(client:)
|
|
42
|
+
@client = client
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -9,6 +9,9 @@ module Imagekitio
|
|
|
9
9
|
# @return [Imagekitio::Resources::Accounts::UsageAnalytics]
|
|
10
10
|
attr_reader :usage_analytics
|
|
11
11
|
|
|
12
|
+
# @return [Imagekitio::Resources::Accounts::Contract]
|
|
13
|
+
attr_reader :contract
|
|
14
|
+
|
|
12
15
|
# @return [Imagekitio::Resources::Accounts::Origins]
|
|
13
16
|
attr_reader :origins
|
|
14
17
|
|
|
@@ -25,6 +28,7 @@ module Imagekitio
|
|
|
25
28
|
@client = client
|
|
26
29
|
@usage = Imagekitio::Resources::Accounts::Usage.new(client: client)
|
|
27
30
|
@usage_analytics = Imagekitio::Resources::Accounts::UsageAnalytics.new(client: client)
|
|
31
|
+
@contract = Imagekitio::Resources::Accounts::Contract.new(client: client)
|
|
28
32
|
@origins = Imagekitio::Resources::Accounts::Origins.new(client: client)
|
|
29
33
|
@url_endpoints = Imagekitio::Resources::Accounts::URLEndpoints.new(client: client)
|
|
30
34
|
@webhooks = Imagekitio::Resources::Accounts::Webhooks.new(client: client)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Resources
|
|
5
|
+
class Tags
|
|
6
|
+
# Some parameter documentations has been truncated, see
|
|
7
|
+
# {Imagekitio::Models::TagListParams} for more details.
|
|
8
|
+
#
|
|
9
|
+
# This API lists the distinct tags in use across your media library, with the
|
|
10
|
+
# number of assets each tag is applied to and when it was last used. Tags are
|
|
11
|
+
# matched case-insensitively, so `Summer` and `summer` are one entry: `name` is
|
|
12
|
+
# the lowercased form and `label` is the spelling that was used most recently.
|
|
13
|
+
#
|
|
14
|
+
# Use `tagSource` and `fileType` to list only the tags in use on matching assets.
|
|
15
|
+
# `lastUsedAt` and the `ASC_LAST_USED` / `DESC_LAST_USED` sorts follow those
|
|
16
|
+
# filters, while `assetCount` always counts every asset carrying the tag. Use
|
|
17
|
+
# `search` or `prefix` to narrow the listing and `cursor` to page through it.
|
|
18
|
+
#
|
|
19
|
+
# Tag counts are updated asynchronously. Changes to a file's tags usually appear
|
|
20
|
+
# in this list within about a minute, but can take longer during heavy tagging
|
|
21
|
+
# activity, so a tag you just added or removed may not be reflected immediately.
|
|
22
|
+
#
|
|
23
|
+
# @overload list(cursor: nil, file_type: nil, limit: nil, prefix: nil, search: nil, sort: nil, tag_source: nil, request_options: {})
|
|
24
|
+
#
|
|
25
|
+
# @param cursor [String] The `nextCursor` value from the previous response, to fetch the next page. A cur
|
|
26
|
+
#
|
|
27
|
+
# @param file_type [Symbol, Imagekitio::Models::TagListParams::FileType] Filter tags by the type of asset they are applied to.
|
|
28
|
+
#
|
|
29
|
+
# @param limit [Integer] The maximum number of tags to return in response.
|
|
30
|
+
#
|
|
31
|
+
# @param prefix [String] Only return tags that begin with this value. Matching is case-insensitive.
|
|
32
|
+
#
|
|
33
|
+
# @param search [String] Only return tags that contain this text. Every word in the value must appear in
|
|
34
|
+
#
|
|
35
|
+
# @param sort [Symbol, Imagekitio::Models::TagListParams::Sort] Sort the results.
|
|
36
|
+
#
|
|
37
|
+
# @param tag_source [Symbol, Imagekitio::Models::TagListParams::TagSource] Filter tags by who added them.
|
|
38
|
+
#
|
|
39
|
+
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
40
|
+
#
|
|
41
|
+
# @return [Imagekitio::Internal::TagCursor<Imagekitio::Models::Tag>]
|
|
42
|
+
#
|
|
43
|
+
# @see Imagekitio::Models::TagListParams
|
|
44
|
+
def list(params = {})
|
|
45
|
+
parsed, options = Imagekitio::TagListParams.dump_request(params)
|
|
46
|
+
query = Imagekitio::Internal::Util.encode_query_params(parsed)
|
|
47
|
+
@client.request(
|
|
48
|
+
method: :get,
|
|
49
|
+
path: "v1/tags",
|
|
50
|
+
query: query.transform_keys(file_type: "fileType", tag_source: "tagSource"),
|
|
51
|
+
page: Imagekitio::Internal::TagCursor,
|
|
52
|
+
model: Imagekitio::Tag,
|
|
53
|
+
options: options
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# @api private
|
|
58
|
+
#
|
|
59
|
+
# @param client [Imagekitio::Client]
|
|
60
|
+
def initialize(client:)
|
|
61
|
+
@client = client
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
data/lib/imagekitio/version.rb
CHANGED
data/lib/imagekitio.rb
CHANGED
|
@@ -53,6 +53,7 @@ require_relative "imagekitio/errors"
|
|
|
53
53
|
require_relative "imagekitio/internal/transport/base_client"
|
|
54
54
|
require_relative "imagekitio/internal/transport/pooled_net_requester"
|
|
55
55
|
require_relative "imagekitio/client"
|
|
56
|
+
require_relative "imagekitio/internal/tag_cursor"
|
|
56
57
|
require_relative "imagekitio/models/accounts/origin_request"
|
|
57
58
|
require_relative "imagekitio/models/accounts/url_endpoint_request"
|
|
58
59
|
require_relative "imagekitio/models/accounts/request_bandwidth_entry"
|
|
@@ -61,6 +62,9 @@ require_relative "imagekitio/models/update_file_request"
|
|
|
61
62
|
require_relative "imagekitio/models/file"
|
|
62
63
|
require_relative "imagekitio/models/src_options"
|
|
63
64
|
require_relative "imagekitio/models/base_overlay"
|
|
65
|
+
require_relative "imagekitio/models/accounts/contract_get_params"
|
|
66
|
+
require_relative "imagekitio/models/accounts/contract_get_response"
|
|
67
|
+
require_relative "imagekitio/models/accounts/contract_units"
|
|
64
68
|
require_relative "imagekitio/models/accounts/origin_create_params"
|
|
65
69
|
require_relative "imagekitio/models/accounts/origin_delete_params"
|
|
66
70
|
require_relative "imagekitio/models/accounts/origin_get_params"
|
|
@@ -179,6 +183,8 @@ require_relative "imagekitio/models/solid_color_overlay_transformation"
|
|
|
179
183
|
require_relative "imagekitio/models/streaming_resolution"
|
|
180
184
|
require_relative "imagekitio/models/subtitle_overlay"
|
|
181
185
|
require_relative "imagekitio/models/subtitle_overlay_transformation"
|
|
186
|
+
require_relative "imagekitio/models/tag"
|
|
187
|
+
require_relative "imagekitio/models/tag_list_params"
|
|
182
188
|
require_relative "imagekitio/models/text_overlay"
|
|
183
189
|
require_relative "imagekitio/models/text_overlay_transformation"
|
|
184
190
|
require_relative "imagekitio/models/transformation"
|
|
@@ -198,6 +204,7 @@ require_relative "imagekitio/models/webhook_unsafe_unwrap_params"
|
|
|
198
204
|
require_relative "imagekitio/models/webhook_unwrap_params"
|
|
199
205
|
require_relative "imagekitio/models"
|
|
200
206
|
require_relative "imagekitio/resources/accounts"
|
|
207
|
+
require_relative "imagekitio/resources/accounts/contract"
|
|
201
208
|
require_relative "imagekitio/resources/accounts/origins"
|
|
202
209
|
require_relative "imagekitio/resources/accounts/url_endpoints"
|
|
203
210
|
require_relative "imagekitio/resources/accounts/usage"
|
|
@@ -218,5 +225,6 @@ require_relative "imagekitio/resources/folders"
|
|
|
218
225
|
require_relative "imagekitio/resources/folders/job"
|
|
219
226
|
require_relative "imagekitio/resources/named_transformations"
|
|
220
227
|
require_relative "imagekitio/resources/saved_extensions"
|
|
228
|
+
require_relative "imagekitio/resources/tags"
|
|
221
229
|
require_relative "imagekitio/resources/webhooks"
|
|
222
230
|
require_relative "imagekitio/helpers/helper"
|
data/rbi/imagekitio/client.rbi
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Internal
|
|
5
|
+
class TagCursor
|
|
6
|
+
include Imagekitio::Internal::Type::BasePage
|
|
7
|
+
|
|
8
|
+
Elem = type_member
|
|
9
|
+
|
|
10
|
+
sig { returns(T.nilable(T::Array[Elem])) }
|
|
11
|
+
attr_accessor :tags
|
|
12
|
+
|
|
13
|
+
sig { returns(T.nilable(String)) }
|
|
14
|
+
attr_accessor :next_cursor
|
|
15
|
+
|
|
16
|
+
# @api private
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
def inspect
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
module Accounts
|
|
6
|
+
class ContractGetParams < 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::ContractGetParams,
|
|
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
|
|
@@ -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
|