imagekitio 4.8.0 → 4.10.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 +2 -2
- data/lib/imagekitio/client.rb +4 -0
- data/lib/imagekitio/helpers/transformation_utils.rb +1 -0
- data/lib/imagekitio/models/asset_list_params.rb +4 -0
- data/lib/imagekitio/models/custom_metadata_field.rb +20 -1
- data/lib/imagekitio/models/custom_metadata_field_create_params.rb +11 -1
- data/lib/imagekitio/models/custom_metadata_field_update_params.rb +12 -1
- data/lib/imagekitio/models/named_transformation.rb +60 -0
- data/lib/imagekitio/models/named_transformation_create_params.rb +45 -0
- data/lib/imagekitio/models/named_transformation_delete_params.rb +22 -0
- data/lib/imagekitio/models/named_transformation_get_params.rb +22 -0
- data/lib/imagekitio/models/named_transformation_list_params.rb +14 -0
- data/lib/imagekitio/models/named_transformation_list_response.rb +9 -0
- data/lib/imagekitio/models/named_transformation_update_params.rb +53 -0
- data/lib/imagekitio/models/transformation.rb +33 -1
- data/lib/imagekitio/models.rb +12 -0
- data/lib/imagekitio/resources/custom_metadata_fields.rb +8 -3
- data/lib/imagekitio/resources/named_transformations.rb +151 -0
- data/lib/imagekitio/version.rb +1 -1
- data/lib/imagekitio.rb +8 -0
- data/rbi/imagekitio/client.rbi +3 -0
- data/rbi/imagekitio/models/asset_list_params.rbi +14 -0
- data/rbi/imagekitio/models/custom_metadata_field.rbi +31 -3
- data/rbi/imagekitio/models/custom_metadata_field_create_params.rbi +15 -0
- data/rbi/imagekitio/models/custom_metadata_field_update_params.rbi +17 -0
- data/rbi/imagekitio/models/named_transformation.rbi +81 -0
- data/rbi/imagekitio/models/named_transformation_create_params.rbi +73 -0
- data/rbi/imagekitio/models/named_transformation_delete_params.rbi +43 -0
- data/rbi/imagekitio/models/named_transformation_get_params.rbi +43 -0
- data/rbi/imagekitio/models/named_transformation_list_params.rbi +30 -0
- data/rbi/imagekitio/models/named_transformation_list_response.rbi +11 -0
- data/rbi/imagekitio/models/named_transformation_update_params.rbi +87 -0
- data/rbi/imagekitio/models/transformation.rbi +43 -0
- data/rbi/imagekitio/models.rbi +17 -0
- data/rbi/imagekitio/resources/custom_metadata_fields.rbi +13 -1
- data/rbi/imagekitio/resources/named_transformations.rbi +119 -0
- data/sig/imagekitio/client.rbs +2 -0
- data/sig/imagekitio/models/asset_list_params.rbs +8 -0
- data/sig/imagekitio/models/custom_metadata_field.rbs +17 -3
- data/sig/imagekitio/models/custom_metadata_field_create_params.rbs +8 -1
- data/sig/imagekitio/models/custom_metadata_field_update_params.rbs +7 -0
- data/sig/imagekitio/models/named_transformation.rbs +40 -0
- data/sig/imagekitio/models/named_transformation_create_params.rbs +34 -0
- data/sig/imagekitio/models/named_transformation_delete_params.rbs +23 -0
- data/sig/imagekitio/models/named_transformation_get_params.rbs +23 -0
- data/sig/imagekitio/models/named_transformation_list_params.rbs +15 -0
- data/sig/imagekitio/models/named_transformation_list_response.rbs +8 -0
- data/sig/imagekitio/models/named_transformation_update_params.rbs +42 -0
- data/sig/imagekitio/models/transformation.rbs +17 -0
- data/sig/imagekitio/models.rbs +12 -0
- data/sig/imagekitio/resources/custom_metadata_fields.rbs +2 -0
- data/sig/imagekitio/resources/named_transformations.rbs +33 -0
- metadata +26 -2
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Resources
|
|
5
|
+
class NamedTransformations
|
|
6
|
+
# Some parameter documentations has been truncated, see
|
|
7
|
+
# {Imagekitio::Models::NamedTransformationCreateParams} for more details.
|
|
8
|
+
#
|
|
9
|
+
# Creates a new named transformation and returns the created object.
|
|
10
|
+
#
|
|
11
|
+
# A named transformation is a short, reusable name for a transformation string.
|
|
12
|
+
# Use it in image and video URLs as `tr:n-<name>`, and update the underlying
|
|
13
|
+
# transformation later without changing existing URLs. Learn more about
|
|
14
|
+
# [named transformations](https://imagekit.io/docs/transformations#named-transformations).
|
|
15
|
+
#
|
|
16
|
+
# You can create up to 250 named transformations per account.
|
|
17
|
+
#
|
|
18
|
+
# @overload create(name:, transformation:, enabled: nil, request_options: {})
|
|
19
|
+
#
|
|
20
|
+
# @param name [String] Alias for the transformation string, used in URLs as `tr:n-<name>`. This is case
|
|
21
|
+
#
|
|
22
|
+
# @param transformation [String] The transformation string this named transformation refers to. Learn more about
|
|
23
|
+
#
|
|
24
|
+
# @param enabled [Boolean] Whether the named transformation is currently enabled. When set to `false`, requ
|
|
25
|
+
#
|
|
26
|
+
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
27
|
+
#
|
|
28
|
+
# @return [Imagekitio::Models::NamedTransformation]
|
|
29
|
+
#
|
|
30
|
+
# @see Imagekitio::Models::NamedTransformationCreateParams
|
|
31
|
+
def create(params)
|
|
32
|
+
parsed, options = Imagekitio::NamedTransformationCreateParams.dump_request(params)
|
|
33
|
+
@client.request(
|
|
34
|
+
method: :post,
|
|
35
|
+
path: "v1/named-transformations",
|
|
36
|
+
body: parsed,
|
|
37
|
+
model: Imagekitio::NamedTransformation,
|
|
38
|
+
options: options
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Some parameter documentations has been truncated, see
|
|
43
|
+
# {Imagekitio::Models::NamedTransformationUpdateParams} for more details.
|
|
44
|
+
#
|
|
45
|
+
# Updates the named transformation identified by `id` and returns the updated
|
|
46
|
+
# object. Only the fields present in the request body are updated; other fields
|
|
47
|
+
# stay unchanged.
|
|
48
|
+
#
|
|
49
|
+
# Renaming or disabling a named transformation fails with a `409` error if it is
|
|
50
|
+
# still referenced (via the `n-<name>` token) by an upload pre-transformation or
|
|
51
|
+
# post-transformation setting. This check is best-effort and can't detect
|
|
52
|
+
# references in your own application code or in previously generated URLs.
|
|
53
|
+
#
|
|
54
|
+
# @overload update(id, enabled: nil, name: nil, transformation: nil, request_options: {})
|
|
55
|
+
#
|
|
56
|
+
# @param id [String] Unique identifier for a named transformation.
|
|
57
|
+
#
|
|
58
|
+
# @param enabled [Boolean] Whether the named transformation is enabled. Omit to leave the current value unc
|
|
59
|
+
#
|
|
60
|
+
# @param name [String] Alias for the transformation string, used in URLs as `tr:n-<name>`. This is case
|
|
61
|
+
#
|
|
62
|
+
# @param transformation [String] The transformation string this named transformation refers to. Learn more about
|
|
63
|
+
#
|
|
64
|
+
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
65
|
+
#
|
|
66
|
+
# @return [Imagekitio::Models::NamedTransformation]
|
|
67
|
+
#
|
|
68
|
+
# @see Imagekitio::Models::NamedTransformationUpdateParams
|
|
69
|
+
def update(id, params = {})
|
|
70
|
+
parsed, options = Imagekitio::NamedTransformationUpdateParams.dump_request(params)
|
|
71
|
+
@client.request(
|
|
72
|
+
method: :patch,
|
|
73
|
+
path: ["v1/named-transformations/%1$s", id],
|
|
74
|
+
body: parsed,
|
|
75
|
+
model: Imagekitio::NamedTransformation,
|
|
76
|
+
options: options
|
|
77
|
+
)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Returns an array of all named transformations configured for your account.
|
|
81
|
+
#
|
|
82
|
+
# @overload list(request_options: {})
|
|
83
|
+
#
|
|
84
|
+
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
85
|
+
#
|
|
86
|
+
# @return [Array<Imagekitio::Models::NamedTransformation>]
|
|
87
|
+
#
|
|
88
|
+
# @see Imagekitio::Models::NamedTransformationListParams
|
|
89
|
+
def list(params = {})
|
|
90
|
+
@client.request(
|
|
91
|
+
method: :get,
|
|
92
|
+
path: "v1/named-transformations",
|
|
93
|
+
model: Imagekitio::Internal::Type::ArrayOf[Imagekitio::NamedTransformation],
|
|
94
|
+
options: params[:request_options]
|
|
95
|
+
)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Permanently deletes the named transformation identified by `id`.
|
|
99
|
+
#
|
|
100
|
+
# Deletion fails with a `409` error if the named transformation is still
|
|
101
|
+
# referenced (via the `n-<name>` token) by an upload pre-transformation or
|
|
102
|
+
# post-transformation setting. This check is best-effort and can't detect
|
|
103
|
+
# references in your own application code or in previously generated URLs.
|
|
104
|
+
#
|
|
105
|
+
# @overload delete(id, request_options: {})
|
|
106
|
+
#
|
|
107
|
+
# @param id [String] Unique identifier for a named transformation.
|
|
108
|
+
#
|
|
109
|
+
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
110
|
+
#
|
|
111
|
+
# @return [nil]
|
|
112
|
+
#
|
|
113
|
+
# @see Imagekitio::Models::NamedTransformationDeleteParams
|
|
114
|
+
def delete(id, params = {})
|
|
115
|
+
@client.request(
|
|
116
|
+
method: :delete,
|
|
117
|
+
path: ["v1/named-transformations/%1$s", id],
|
|
118
|
+
model: NilClass,
|
|
119
|
+
options: params[:request_options]
|
|
120
|
+
)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Retrieves the named transformation identified by `id`.
|
|
124
|
+
#
|
|
125
|
+
# @overload get(id, request_options: {})
|
|
126
|
+
#
|
|
127
|
+
# @param id [String] Unique identifier for a named transformation.
|
|
128
|
+
#
|
|
129
|
+
# @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
130
|
+
#
|
|
131
|
+
# @return [Imagekitio::Models::NamedTransformation]
|
|
132
|
+
#
|
|
133
|
+
# @see Imagekitio::Models::NamedTransformationGetParams
|
|
134
|
+
def get(id, params = {})
|
|
135
|
+
@client.request(
|
|
136
|
+
method: :get,
|
|
137
|
+
path: ["v1/named-transformations/%1$s", id],
|
|
138
|
+
model: Imagekitio::NamedTransformation,
|
|
139
|
+
options: params[:request_options]
|
|
140
|
+
)
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# @api private
|
|
144
|
+
#
|
|
145
|
+
# @param client [Imagekitio::Client]
|
|
146
|
+
def initialize(client:)
|
|
147
|
+
@client = client
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
data/lib/imagekitio/version.rb
CHANGED
data/lib/imagekitio.rb
CHANGED
|
@@ -149,6 +149,13 @@ require_relative "imagekitio/models/folders/job_get_response"
|
|
|
149
149
|
require_relative "imagekitio/models/get_image_attributes_options"
|
|
150
150
|
require_relative "imagekitio/models/image_overlay"
|
|
151
151
|
require_relative "imagekitio/models/metadata"
|
|
152
|
+
require_relative "imagekitio/models/named_transformation"
|
|
153
|
+
require_relative "imagekitio/models/named_transformation_create_params"
|
|
154
|
+
require_relative "imagekitio/models/named_transformation_delete_params"
|
|
155
|
+
require_relative "imagekitio/models/named_transformation_get_params"
|
|
156
|
+
require_relative "imagekitio/models/named_transformation_list_params"
|
|
157
|
+
require_relative "imagekitio/models/named_transformation_list_response"
|
|
158
|
+
require_relative "imagekitio/models/named_transformation_update_params"
|
|
152
159
|
require_relative "imagekitio/models/overlay"
|
|
153
160
|
require_relative "imagekitio/models/overlay_position"
|
|
154
161
|
require_relative "imagekitio/models/overlay_timing"
|
|
@@ -202,6 +209,7 @@ require_relative "imagekitio/resources/files/metadata"
|
|
|
202
209
|
require_relative "imagekitio/resources/files/versions"
|
|
203
210
|
require_relative "imagekitio/resources/folders"
|
|
204
211
|
require_relative "imagekitio/resources/folders/job"
|
|
212
|
+
require_relative "imagekitio/resources/named_transformations"
|
|
205
213
|
require_relative "imagekitio/resources/saved_extensions"
|
|
206
214
|
require_relative "imagekitio/resources/webhooks"
|
|
207
215
|
require_relative "imagekitio/helpers/helper"
|
data/rbi/imagekitio/client.rbi
CHANGED
|
@@ -36,6 +36,9 @@ module Imagekitio
|
|
|
36
36
|
sig { returns(Imagekitio::Resources::SavedExtensions) }
|
|
37
37
|
attr_reader :saved_extensions
|
|
38
38
|
|
|
39
|
+
sig { returns(Imagekitio::Resources::NamedTransformations) }
|
|
40
|
+
attr_reader :named_transformations
|
|
41
|
+
|
|
39
42
|
sig { returns(Imagekitio::Resources::Assets) }
|
|
40
43
|
attr_reader :assets
|
|
41
44
|
|
|
@@ -236,6 +236,20 @@ module Imagekitio
|
|
|
236
236
|
:DESC_RELEVANCE,
|
|
237
237
|
Imagekitio::AssetListParams::Sort::TaggedSymbol
|
|
238
238
|
)
|
|
239
|
+
ASC_DURATION =
|
|
240
|
+
T.let(:ASC_DURATION, Imagekitio::AssetListParams::Sort::TaggedSymbol)
|
|
241
|
+
DESC_DURATION =
|
|
242
|
+
T.let(:DESC_DURATION, Imagekitio::AssetListParams::Sort::TaggedSymbol)
|
|
243
|
+
ASC_ORIGINAL_CREATION_DATE =
|
|
244
|
+
T.let(
|
|
245
|
+
:ASC_ORIGINAL_CREATION_DATE,
|
|
246
|
+
Imagekitio::AssetListParams::Sort::TaggedSymbol
|
|
247
|
+
)
|
|
248
|
+
DESC_ORIGINAL_CREATION_DATE =
|
|
249
|
+
T.let(
|
|
250
|
+
:DESC_ORIGINAL_CREATION_DATE,
|
|
251
|
+
Imagekitio::AssetListParams::Sort::TaggedSymbol
|
|
252
|
+
)
|
|
239
253
|
|
|
240
254
|
sig do
|
|
241
255
|
override.returns(
|
|
@@ -32,13 +32,32 @@ module Imagekitio
|
|
|
32
32
|
end
|
|
33
33
|
attr_writer :schema
|
|
34
34
|
|
|
35
|
+
# Optional description of the custom metadata field. Only present when a
|
|
36
|
+
# description has been set. Shown as a hint to the users while setting the field's
|
|
37
|
+
# value on an asset in the media library UI.
|
|
38
|
+
sig { returns(T.nilable(String)) }
|
|
39
|
+
attr_reader :description
|
|
40
|
+
|
|
41
|
+
sig { params(description: String).void }
|
|
42
|
+
attr_writer :description
|
|
43
|
+
|
|
44
|
+
# Present and set to `true` when the field is reserved. Omitted for regular
|
|
45
|
+
# fields. Reserved fields cannot be deleted.
|
|
46
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
47
|
+
attr_reader :reserved
|
|
48
|
+
|
|
49
|
+
sig { params(reserved: T::Boolean).void }
|
|
50
|
+
attr_writer :reserved
|
|
51
|
+
|
|
35
52
|
# Object containing details of a custom metadata field.
|
|
36
53
|
sig do
|
|
37
54
|
params(
|
|
38
55
|
id: String,
|
|
39
56
|
label: String,
|
|
40
57
|
name: String,
|
|
41
|
-
schema: Imagekitio::CustomMetadataField::Schema::OrHash
|
|
58
|
+
schema: Imagekitio::CustomMetadataField::Schema::OrHash,
|
|
59
|
+
description: String,
|
|
60
|
+
reserved: T::Boolean
|
|
42
61
|
).returns(T.attached_class)
|
|
43
62
|
end
|
|
44
63
|
def self.new(
|
|
@@ -52,7 +71,14 @@ module Imagekitio
|
|
|
52
71
|
# `customMetadata` (key-value object) for an asset using upload or update API.
|
|
53
72
|
name:,
|
|
54
73
|
# An object that describes the rules for the custom metadata field value.
|
|
55
|
-
schema
|
|
74
|
+
schema:,
|
|
75
|
+
# Optional description of the custom metadata field. Only present when a
|
|
76
|
+
# description has been set. Shown as a hint to the users while setting the field's
|
|
77
|
+
# value on an asset in the media library UI.
|
|
78
|
+
description: nil,
|
|
79
|
+
# Present and set to `true` when the field is reserved. Omitted for regular
|
|
80
|
+
# fields. Reserved fields cannot be deleted.
|
|
81
|
+
reserved: nil
|
|
56
82
|
)
|
|
57
83
|
end
|
|
58
84
|
|
|
@@ -62,7 +88,9 @@ module Imagekitio
|
|
|
62
88
|
id: String,
|
|
63
89
|
label: String,
|
|
64
90
|
name: String,
|
|
65
|
-
schema: Imagekitio::CustomMetadataField::Schema
|
|
91
|
+
schema: Imagekitio::CustomMetadataField::Schema,
|
|
92
|
+
description: String,
|
|
93
|
+
reserved: T::Boolean
|
|
66
94
|
}
|
|
67
95
|
)
|
|
68
96
|
end
|
|
@@ -36,11 +36,21 @@ module Imagekitio
|
|
|
36
36
|
end
|
|
37
37
|
attr_writer :schema
|
|
38
38
|
|
|
39
|
+
# Optional description for the custom metadata field. Can be up to 500 characters.
|
|
40
|
+
# This is shown as a hint to the users while setting the field's value on an asset
|
|
41
|
+
# in the media library UI.
|
|
42
|
+
sig { returns(T.nilable(String)) }
|
|
43
|
+
attr_reader :description
|
|
44
|
+
|
|
45
|
+
sig { params(description: String).void }
|
|
46
|
+
attr_writer :description
|
|
47
|
+
|
|
39
48
|
sig do
|
|
40
49
|
params(
|
|
41
50
|
label: String,
|
|
42
51
|
name: String,
|
|
43
52
|
schema: Imagekitio::CustomMetadataFieldCreateParams::Schema::OrHash,
|
|
53
|
+
description: String,
|
|
44
54
|
request_options: Imagekitio::RequestOptions::OrHash
|
|
45
55
|
).returns(T.attached_class)
|
|
46
56
|
end
|
|
@@ -54,6 +64,10 @@ module Imagekitio
|
|
|
54
64
|
# (including deleted) custom metadata fields.
|
|
55
65
|
name:,
|
|
56
66
|
schema:,
|
|
67
|
+
# Optional description for the custom metadata field. Can be up to 500 characters.
|
|
68
|
+
# This is shown as a hint to the users while setting the field's value on an asset
|
|
69
|
+
# in the media library UI.
|
|
70
|
+
description: nil,
|
|
57
71
|
request_options: {}
|
|
58
72
|
)
|
|
59
73
|
end
|
|
@@ -64,6 +78,7 @@ module Imagekitio
|
|
|
64
78
|
label: String,
|
|
65
79
|
name: String,
|
|
66
80
|
schema: Imagekitio::CustomMetadataFieldCreateParams::Schema,
|
|
81
|
+
description: String,
|
|
67
82
|
request_options: Imagekitio::RequestOptions
|
|
68
83
|
}
|
|
69
84
|
)
|
|
@@ -17,6 +17,16 @@ module Imagekitio
|
|
|
17
17
|
sig { returns(String) }
|
|
18
18
|
attr_accessor :id
|
|
19
19
|
|
|
20
|
+
# Optional description for the custom metadata field. Can be up to 500 characters.
|
|
21
|
+
# Send an empty string to clear an existing description. This is shown as a hint
|
|
22
|
+
# to the users while setting the field's value on an asset in the media library
|
|
23
|
+
# UI.
|
|
24
|
+
sig { returns(T.nilable(String)) }
|
|
25
|
+
attr_reader :description
|
|
26
|
+
|
|
27
|
+
sig { params(description: String).void }
|
|
28
|
+
attr_writer :description
|
|
29
|
+
|
|
20
30
|
# Human readable name of the custom metadata field. This should be unique across
|
|
21
31
|
# all non deleted custom metadata fields. This name is displayed as form field
|
|
22
32
|
# label to the users while setting field value on an asset in the media library
|
|
@@ -46,6 +56,7 @@ module Imagekitio
|
|
|
46
56
|
sig do
|
|
47
57
|
params(
|
|
48
58
|
id: String,
|
|
59
|
+
description: String,
|
|
49
60
|
label: String,
|
|
50
61
|
schema: Imagekitio::CustomMetadataFieldUpdateParams::Schema::OrHash,
|
|
51
62
|
request_options: Imagekitio::RequestOptions::OrHash
|
|
@@ -53,6 +64,11 @@ module Imagekitio
|
|
|
53
64
|
end
|
|
54
65
|
def self.new(
|
|
55
66
|
id:,
|
|
67
|
+
# Optional description for the custom metadata field. Can be up to 500 characters.
|
|
68
|
+
# Send an empty string to clear an existing description. This is shown as a hint
|
|
69
|
+
# to the users while setting the field's value on an asset in the media library
|
|
70
|
+
# UI.
|
|
71
|
+
description: nil,
|
|
56
72
|
# Human readable name of the custom metadata field. This should be unique across
|
|
57
73
|
# all non deleted custom metadata fields. This name is displayed as form field
|
|
58
74
|
# label to the users while setting field value on an asset in the media library
|
|
@@ -71,6 +87,7 @@ module Imagekitio
|
|
|
71
87
|
override.returns(
|
|
72
88
|
{
|
|
73
89
|
id: String,
|
|
90
|
+
description: String,
|
|
74
91
|
label: String,
|
|
75
92
|
schema: Imagekitio::CustomMetadataFieldUpdateParams::Schema,
|
|
76
93
|
request_options: Imagekitio::RequestOptions
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
class NamedTransformation < Imagekitio::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Imagekitio::NamedTransformation, Imagekitio::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Unique identifier for a named transformation.
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
attr_accessor :id
|
|
14
|
+
|
|
15
|
+
# ISO 8601 timestamp of when the named transformation was created.
|
|
16
|
+
sig { returns(Time) }
|
|
17
|
+
attr_accessor :created_at
|
|
18
|
+
|
|
19
|
+
# Whether the named transformation is currently enabled. When set to `false`,
|
|
20
|
+
# requests using this named transformation fail at delivery time.
|
|
21
|
+
sig { returns(T::Boolean) }
|
|
22
|
+
attr_accessor :enabled
|
|
23
|
+
|
|
24
|
+
# Alias for the transformation string, used in URLs as `tr:n-<name>`. This is
|
|
25
|
+
# case-sensitive, contains only alphanumeric characters or `_` (underscore), and
|
|
26
|
+
# is unique across all named transformations for your account.
|
|
27
|
+
sig { returns(String) }
|
|
28
|
+
attr_accessor :name
|
|
29
|
+
|
|
30
|
+
# The transformation string this named transformation refers to. Learn more about
|
|
31
|
+
# the [transformation string syntax](https://imagekit.io/docs/transformations).
|
|
32
|
+
sig { returns(String) }
|
|
33
|
+
attr_accessor :transformation
|
|
34
|
+
|
|
35
|
+
# A named transformation is an alias for a transformation string, letting you
|
|
36
|
+
# apply and later update complex transformations without changing your image or
|
|
37
|
+
# video URLs. Learn more about
|
|
38
|
+
# [named transformations](https://imagekit.io/docs/transformations#named-transformations).
|
|
39
|
+
sig do
|
|
40
|
+
params(
|
|
41
|
+
id: String,
|
|
42
|
+
created_at: Time,
|
|
43
|
+
enabled: T::Boolean,
|
|
44
|
+
name: String,
|
|
45
|
+
transformation: String
|
|
46
|
+
).returns(T.attached_class)
|
|
47
|
+
end
|
|
48
|
+
def self.new(
|
|
49
|
+
# Unique identifier for a named transformation.
|
|
50
|
+
id:,
|
|
51
|
+
# ISO 8601 timestamp of when the named transformation was created.
|
|
52
|
+
created_at:,
|
|
53
|
+
# Whether the named transformation is currently enabled. When set to `false`,
|
|
54
|
+
# requests using this named transformation fail at delivery time.
|
|
55
|
+
enabled:,
|
|
56
|
+
# Alias for the transformation string, used in URLs as `tr:n-<name>`. This is
|
|
57
|
+
# case-sensitive, contains only alphanumeric characters or `_` (underscore), and
|
|
58
|
+
# is unique across all named transformations for your account.
|
|
59
|
+
name:,
|
|
60
|
+
# The transformation string this named transformation refers to. Learn more about
|
|
61
|
+
# the [transformation string syntax](https://imagekit.io/docs/transformations).
|
|
62
|
+
transformation:
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
sig do
|
|
67
|
+
override.returns(
|
|
68
|
+
{
|
|
69
|
+
id: String,
|
|
70
|
+
created_at: Time,
|
|
71
|
+
enabled: T::Boolean,
|
|
72
|
+
name: String,
|
|
73
|
+
transformation: String
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
end
|
|
77
|
+
def to_hash
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
class NamedTransformationCreateParams < Imagekitio::Internal::Type::BaseModel
|
|
6
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Imagekitio::NamedTransformationCreateParams,
|
|
13
|
+
Imagekitio::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Alias for the transformation string, used in URLs as `tr:n-<name>`. This is
|
|
18
|
+
# case-sensitive, contains only alphanumeric characters or `_` (underscore), and
|
|
19
|
+
# is unique across all named transformations for your account.
|
|
20
|
+
sig { returns(String) }
|
|
21
|
+
attr_accessor :name
|
|
22
|
+
|
|
23
|
+
# The transformation string this named transformation refers to. Learn more about
|
|
24
|
+
# the [transformation string syntax](https://imagekit.io/docs/transformations).
|
|
25
|
+
sig { returns(String) }
|
|
26
|
+
attr_accessor :transformation
|
|
27
|
+
|
|
28
|
+
# Whether the named transformation is currently enabled. When set to `false`,
|
|
29
|
+
# requests using this named transformation fail at delivery time.
|
|
30
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
31
|
+
attr_reader :enabled
|
|
32
|
+
|
|
33
|
+
sig { params(enabled: T::Boolean).void }
|
|
34
|
+
attr_writer :enabled
|
|
35
|
+
|
|
36
|
+
sig do
|
|
37
|
+
params(
|
|
38
|
+
name: String,
|
|
39
|
+
transformation: String,
|
|
40
|
+
enabled: T::Boolean,
|
|
41
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
42
|
+
).returns(T.attached_class)
|
|
43
|
+
end
|
|
44
|
+
def self.new(
|
|
45
|
+
# Alias for the transformation string, used in URLs as `tr:n-<name>`. This is
|
|
46
|
+
# case-sensitive, contains only alphanumeric characters or `_` (underscore), and
|
|
47
|
+
# is unique across all named transformations for your account.
|
|
48
|
+
name:,
|
|
49
|
+
# The transformation string this named transformation refers to. Learn more about
|
|
50
|
+
# the [transformation string syntax](https://imagekit.io/docs/transformations).
|
|
51
|
+
transformation:,
|
|
52
|
+
# Whether the named transformation is currently enabled. When set to `false`,
|
|
53
|
+
# requests using this named transformation fail at delivery time.
|
|
54
|
+
enabled: nil,
|
|
55
|
+
request_options: {}
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
sig do
|
|
60
|
+
override.returns(
|
|
61
|
+
{
|
|
62
|
+
name: String,
|
|
63
|
+
transformation: String,
|
|
64
|
+
enabled: T::Boolean,
|
|
65
|
+
request_options: Imagekitio::RequestOptions
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
end
|
|
69
|
+
def to_hash
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
class NamedTransformationDeleteParams < Imagekitio::Internal::Type::BaseModel
|
|
6
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Imagekitio::NamedTransformationDeleteParams,
|
|
13
|
+
Imagekitio::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Unique identifier for a named transformation.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
sig do
|
|
22
|
+
params(
|
|
23
|
+
id: String,
|
|
24
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
25
|
+
).returns(T.attached_class)
|
|
26
|
+
end
|
|
27
|
+
def self.new(
|
|
28
|
+
# Unique identifier for a named transformation.
|
|
29
|
+
id:,
|
|
30
|
+
request_options: {}
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
override.returns(
|
|
36
|
+
{ id: String, request_options: Imagekitio::RequestOptions }
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
def to_hash
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
class NamedTransformationGetParams < Imagekitio::Internal::Type::BaseModel
|
|
6
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Imagekitio::NamedTransformationGetParams,
|
|
13
|
+
Imagekitio::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Unique identifier for a named transformation.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
sig do
|
|
22
|
+
params(
|
|
23
|
+
id: String,
|
|
24
|
+
request_options: Imagekitio::RequestOptions::OrHash
|
|
25
|
+
).returns(T.attached_class)
|
|
26
|
+
end
|
|
27
|
+
def self.new(
|
|
28
|
+
# Unique identifier for a named transformation.
|
|
29
|
+
id:,
|
|
30
|
+
request_options: {}
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
override.returns(
|
|
36
|
+
{ id: String, request_options: Imagekitio::RequestOptions }
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
def to_hash
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Imagekitio
|
|
4
|
+
module Models
|
|
5
|
+
class NamedTransformationListParams < Imagekitio::Internal::Type::BaseModel
|
|
6
|
+
extend Imagekitio::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Imagekitio::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Imagekitio::NamedTransformationListParams,
|
|
13
|
+
Imagekitio::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(request_options: Imagekitio::RequestOptions::OrHash).returns(
|
|
19
|
+
T.attached_class
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
def self.new(request_options: {})
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
sig { override.returns({ request_options: Imagekitio::RequestOptions }) }
|
|
26
|
+
def to_hash
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|