imagekitio 4.8.0 → 4.9.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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/README.md +2 -2
  4. data/lib/imagekitio/client.rb +4 -0
  5. data/lib/imagekitio/models/custom_metadata_field.rb +11 -1
  6. data/lib/imagekitio/models/custom_metadata_field_create_params.rb +11 -1
  7. data/lib/imagekitio/models/custom_metadata_field_update_params.rb +12 -1
  8. data/lib/imagekitio/models/named_transformation.rb +60 -0
  9. data/lib/imagekitio/models/named_transformation_create_params.rb +45 -0
  10. data/lib/imagekitio/models/named_transformation_delete_params.rb +22 -0
  11. data/lib/imagekitio/models/named_transformation_get_params.rb +22 -0
  12. data/lib/imagekitio/models/named_transformation_list_params.rb +14 -0
  13. data/lib/imagekitio/models/named_transformation_list_response.rb +9 -0
  14. data/lib/imagekitio/models/named_transformation_update_params.rb +53 -0
  15. data/lib/imagekitio/models.rb +12 -0
  16. data/lib/imagekitio/resources/custom_metadata_fields.rb +8 -3
  17. data/lib/imagekitio/resources/named_transformations.rb +151 -0
  18. data/lib/imagekitio/version.rb +1 -1
  19. data/lib/imagekitio.rb +8 -0
  20. data/rbi/imagekitio/client.rbi +3 -0
  21. data/rbi/imagekitio/models/custom_metadata_field.rbi +18 -3
  22. data/rbi/imagekitio/models/custom_metadata_field_create_params.rbi +15 -0
  23. data/rbi/imagekitio/models/custom_metadata_field_update_params.rbi +17 -0
  24. data/rbi/imagekitio/models/named_transformation.rbi +81 -0
  25. data/rbi/imagekitio/models/named_transformation_create_params.rbi +73 -0
  26. data/rbi/imagekitio/models/named_transformation_delete_params.rbi +43 -0
  27. data/rbi/imagekitio/models/named_transformation_get_params.rbi +43 -0
  28. data/rbi/imagekitio/models/named_transformation_list_params.rbi +30 -0
  29. data/rbi/imagekitio/models/named_transformation_list_response.rbi +11 -0
  30. data/rbi/imagekitio/models/named_transformation_update_params.rbi +87 -0
  31. data/rbi/imagekitio/models.rbi +17 -0
  32. data/rbi/imagekitio/resources/custom_metadata_fields.rbi +13 -1
  33. data/rbi/imagekitio/resources/named_transformations.rbi +119 -0
  34. data/sig/imagekitio/client.rbs +2 -0
  35. data/sig/imagekitio/models/custom_metadata_field.rbs +10 -3
  36. data/sig/imagekitio/models/custom_metadata_field_create_params.rbs +8 -1
  37. data/sig/imagekitio/models/custom_metadata_field_update_params.rbs +7 -0
  38. data/sig/imagekitio/models/named_transformation.rbs +40 -0
  39. data/sig/imagekitio/models/named_transformation_create_params.rbs +34 -0
  40. data/sig/imagekitio/models/named_transformation_delete_params.rbs +23 -0
  41. data/sig/imagekitio/models/named_transformation_get_params.rbs +23 -0
  42. data/sig/imagekitio/models/named_transformation_list_params.rbs +15 -0
  43. data/sig/imagekitio/models/named_transformation_list_response.rbs +8 -0
  44. data/sig/imagekitio/models/named_transformation_update_params.rbs +42 -0
  45. data/sig/imagekitio/models.rbs +12 -0
  46. data/sig/imagekitio/resources/custom_metadata_fields.rbs +2 -0
  47. data/sig/imagekitio/resources/named_transformations.rbs +33 -0
  48. metadata +26 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53589b5e387cc2e3919aaea2e515bc77f13f77d81cf9b244ba2b1749868acb8e
4
- data.tar.gz: 2b8701182074f45b8e43235229cff8d2112dfc6063a307e97431110a7419a19b
3
+ metadata.gz: e0425b66fb8987f249e1e4157d7fd10b1566c58991a8cb87e981f60a3538de16
4
+ data.tar.gz: df52e7f1f8d6cfafee7c2e214147a32f7f6cbb715255e6c9220ad8cffd015a11
5
5
  SHA512:
6
- metadata.gz: bc8f6b4f36557e0419313bdb688c243736a3139e9e1095300d0af2f8c2af339858881d51c67b92d41b1b2493d031cdbed69c116fd6a992ba8bacb54ab5f1bdfb
7
- data.tar.gz: b4033a82d0f7960904b513ccd4f01cb662698b0abbba368727889a3aee987438c6f78768efe30b577e35f3f249b4d4cde55bad1c3c27b1418030471f719463ac
6
+ metadata.gz: 29ac74104d1e46f88b0b641833da899ff84bc4c1da4d51b0136a61add69d21c21792a9ef968f10ef6adb7f55e7f6ea31c2048412d06c4b4b391b87e84f8dadce
7
+ data.tar.gz: d4909caff4e5459175ef690f70ccf9a28ec50967199a8b713a510e4314891c120b38b862788b06535b8855a95c8d2b924f13fcaaaba1aed47ce3fee532c681b1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.9.0](https://github.com/imagekit-developer/imagekit-ruby/compare/v4.8.0...v4.9.0) (2026-08-15)
4
+
5
+
6
+ ### Features
7
+
8
+ * add description field in custom metadata field api ([f86bf8e](https://github.com/imagekit-developer/imagekit-ruby/commit/f86bf8e78a5fc75323bfeb1a529b2e4045a62729))
9
+ * **api:** Named Transformations ([512b517](https://github.com/imagekit-developer/imagekit-ruby/commit/512b517e3c7c7fa22c9a20e0a20715f3381c66ac))
10
+
11
+
12
+ ### Chores
13
+
14
+ * change default branch name ([9b3e035](https://github.com/imagekit-developer/imagekit-ruby/commit/9b3e0352461524f45131bc23b5a466116cc26745))
15
+ * move to one repo structure ([c5b6c51](https://github.com/imagekit-developer/imagekit-ruby/commit/c5b6c513b4da32c2426a699c27f90225aae7e346))
16
+ * pin next release ([431111b](https://github.com/imagekit-developer/imagekit-ruby/commit/431111b97b244e213eb0ba6de36a9255c125cbfc))
17
+
3
18
  ## [4.8.0](https://github.com/imagekit-developer/imagekit-ruby/compare/v4.7.0...v4.8.0) (2026-07-14)
4
19
 
5
20
 
data/README.md CHANGED
@@ -46,7 +46,7 @@ To use this gem, install via Bundler by adding the following to your application
46
46
  <!-- x-release-please-start-version -->
47
47
 
48
48
  ```ruby
49
- gem "imagekitio", "~> 4.8.0"
49
+ gem "imagekitio", "~> 4.9.0"
50
50
  ```
51
51
 
52
52
  <!-- x-release-please-end -->
@@ -748,4 +748,4 @@ Ruby 3.2.0 or higher.
748
748
 
749
749
  ## Contributing
750
750
 
751
- See [the contributing documentation](https://github.com/imagekit-developer/imagekit-ruby/tree/master/CONTRIBUTING.md).
751
+ See [the contributing documentation](https://github.com/imagekit-developer/imagekit-ruby/tree/main/CONTRIBUTING.md).
@@ -41,6 +41,9 @@ module Imagekitio
41
41
  # @return [Imagekitio::Resources::SavedExtensions]
42
42
  attr_reader :saved_extensions
43
43
 
44
+ # @return [Imagekitio::Resources::NamedTransformations]
45
+ attr_reader :named_transformations
46
+
44
47
  # @return [Imagekitio::Resources::Assets]
45
48
  attr_reader :assets
46
49
 
@@ -149,6 +152,7 @@ module Imagekitio
149
152
  @custom_metadata_fields = Imagekitio::Resources::CustomMetadataFields.new(client: self)
150
153
  @files = Imagekitio::Resources::Files.new(client: self)
151
154
  @saved_extensions = Imagekitio::Resources::SavedExtensions.new(client: self)
155
+ @named_transformations = Imagekitio::Resources::NamedTransformations.new(client: self)
152
156
  @assets = Imagekitio::Resources::Assets.new(client: self)
153
157
  @cache = Imagekitio::Resources::Cache.new(client: self)
154
158
  @folders = Imagekitio::Resources::Folders.new(client: self)
@@ -31,7 +31,15 @@ module Imagekitio
31
31
  # @return [Imagekitio::Models::CustomMetadataField::Schema]
32
32
  required :schema, -> { Imagekitio::CustomMetadataField::Schema }
33
33
 
34
- # @!method initialize(id:, label:, name:, schema:)
34
+ # @!attribute description
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
+ #
39
+ # @return [String, nil]
40
+ optional :description, String
41
+
42
+ # @!method initialize(id:, label:, name:, schema:, description: nil)
35
43
  # Some parameter documentations has been truncated, see
36
44
  # {Imagekitio::Models::CustomMetadataField} for more details.
37
45
  #
@@ -44,6 +52,8 @@ module Imagekitio
44
52
  # @param name [String] API name of the custom metadata field. This becomes the key while setting `custo
45
53
  #
46
54
  # @param schema [Imagekitio::Models::CustomMetadataField::Schema] An object that describes the rules for the custom metadata field value.
55
+ #
56
+ # @param description [String] Optional description of the custom metadata field. Only present when a descripti
47
57
 
48
58
  # @see Imagekitio::Models::CustomMetadataField#schema
49
59
  class Schema < Imagekitio::Internal::Type::BaseModel
@@ -28,7 +28,15 @@ module Imagekitio
28
28
  # @return [Imagekitio::Models::CustomMetadataFieldCreateParams::Schema]
29
29
  required :schema, -> { Imagekitio::CustomMetadataFieldCreateParams::Schema }
30
30
 
31
- # @!method initialize(label:, name:, schema:, request_options: {})
31
+ # @!attribute description
32
+ # Optional description for the custom metadata field. Can be up to 500 characters.
33
+ # This is shown as a hint to the users while setting the field's value on an asset
34
+ # in the media library UI.
35
+ #
36
+ # @return [String, nil]
37
+ optional :description, String
38
+
39
+ # @!method initialize(label:, name:, schema:, description: nil, request_options: {})
32
40
  # Some parameter documentations has been truncated, see
33
41
  # {Imagekitio::Models::CustomMetadataFieldCreateParams} for more details.
34
42
  #
@@ -38,6 +46,8 @@ module Imagekitio
38
46
  #
39
47
  # @param schema [Imagekitio::Models::CustomMetadataFieldCreateParams::Schema]
40
48
  #
49
+ # @param description [String] Optional description for the custom metadata field. Can be up to 500 characters.
50
+ #
41
51
  # @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
42
52
 
43
53
  class Schema < Imagekitio::Internal::Type::BaseModel
@@ -12,6 +12,15 @@ module Imagekitio
12
12
  # @return [String]
13
13
  required :id, String
14
14
 
15
+ # @!attribute description
16
+ # Optional description for the custom metadata field. Can be up to 500 characters.
17
+ # Send an empty string to clear an existing description. This is shown as a hint
18
+ # to the users while setting the field's value on an asset in the media library
19
+ # UI.
20
+ #
21
+ # @return [String, nil]
22
+ optional :description, String
23
+
15
24
  # @!attribute label
16
25
  # Human readable name of the custom metadata field. This should be unique across
17
26
  # all non deleted custom metadata fields. This name is displayed as form field
@@ -30,12 +39,14 @@ module Imagekitio
30
39
  # @return [Imagekitio::Models::CustomMetadataFieldUpdateParams::Schema, nil]
31
40
  optional :schema, -> { Imagekitio::CustomMetadataFieldUpdateParams::Schema }
32
41
 
33
- # @!method initialize(id:, label: nil, schema: nil, request_options: {})
42
+ # @!method initialize(id:, description: nil, label: nil, schema: nil, request_options: {})
34
43
  # Some parameter documentations has been truncated, see
35
44
  # {Imagekitio::Models::CustomMetadataFieldUpdateParams} for more details.
36
45
  #
37
46
  # @param id [String]
38
47
  #
48
+ # @param description [String] Optional description for the custom metadata field. Can be up to 500 characters.
49
+ #
39
50
  # @param label [String] Human readable name of the custom metadata field. This should be unique across a
40
51
  #
41
52
  # @param schema [Imagekitio::Models::CustomMetadataFieldUpdateParams::Schema] An object that describes the rules for the custom metadata key. This parameter i
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Imagekitio
4
+ module Models
5
+ class NamedTransformation < Imagekitio::Internal::Type::BaseModel
6
+ # @!attribute id
7
+ # Unique identifier for a named transformation.
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute created_at
13
+ # ISO 8601 timestamp of when the named transformation was created.
14
+ #
15
+ # @return [Time]
16
+ required :created_at, Time, api_name: :createdAt
17
+
18
+ # @!attribute enabled
19
+ # Whether the named transformation is currently enabled. When set to `false`,
20
+ # requests using this named transformation fail at delivery time.
21
+ #
22
+ # @return [Boolean]
23
+ required :enabled, Imagekitio::Internal::Type::Boolean
24
+
25
+ # @!attribute name
26
+ # Alias for the transformation string, used in URLs as `tr:n-<name>`. This is
27
+ # case-sensitive, contains only alphanumeric characters or `_` (underscore), and
28
+ # is unique across all named transformations for your account.
29
+ #
30
+ # @return [String]
31
+ required :name, String
32
+
33
+ # @!attribute transformation
34
+ # The transformation string this named transformation refers to. Learn more about
35
+ # the [transformation string syntax](https://imagekit.io/docs/transformations).
36
+ #
37
+ # @return [String]
38
+ required :transformation, String
39
+
40
+ # @!method initialize(id:, created_at:, enabled:, name:, transformation:)
41
+ # Some parameter documentations has been truncated, see
42
+ # {Imagekitio::Models::NamedTransformation} for more details.
43
+ #
44
+ # A named transformation is an alias for a transformation string, letting you
45
+ # apply and later update complex transformations without changing your image or
46
+ # video URLs. Learn more about
47
+ # [named transformations](https://imagekit.io/docs/transformations#named-transformations).
48
+ #
49
+ # @param id [String] Unique identifier for a named transformation.
50
+ #
51
+ # @param created_at [Time] ISO 8601 timestamp of when the named transformation was created.
52
+ #
53
+ # @param enabled [Boolean] Whether the named transformation is currently enabled. When set to `false`, requ
54
+ #
55
+ # @param name [String] Alias for the transformation string, used in URLs as `tr:n-<name>`. This is case
56
+ #
57
+ # @param transformation [String] The transformation string this named transformation refers to. Learn more about
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Imagekitio
4
+ module Models
5
+ # @see Imagekitio::Resources::NamedTransformations#create
6
+ class NamedTransformationCreateParams < Imagekitio::Internal::Type::BaseModel
7
+ extend Imagekitio::Internal::Type::RequestParameters::Converter
8
+ include Imagekitio::Internal::Type::RequestParameters
9
+
10
+ # @!attribute name
11
+ # Alias for the transformation string, used in URLs as `tr:n-<name>`. This is
12
+ # case-sensitive, contains only alphanumeric characters or `_` (underscore), and
13
+ # is unique across all named transformations for your account.
14
+ #
15
+ # @return [String]
16
+ required :name, String
17
+
18
+ # @!attribute transformation
19
+ # The transformation string this named transformation refers to. Learn more about
20
+ # the [transformation string syntax](https://imagekit.io/docs/transformations).
21
+ #
22
+ # @return [String]
23
+ required :transformation, String
24
+
25
+ # @!attribute enabled
26
+ # Whether the named transformation is currently enabled. When set to `false`,
27
+ # requests using this named transformation fail at delivery time.
28
+ #
29
+ # @return [Boolean, nil]
30
+ optional :enabled, Imagekitio::Internal::Type::Boolean
31
+
32
+ # @!method initialize(name:, transformation:, enabled: nil, request_options: {})
33
+ # Some parameter documentations has been truncated, see
34
+ # {Imagekitio::Models::NamedTransformationCreateParams} for more details.
35
+ #
36
+ # @param name [String] Alias for the transformation string, used in URLs as `tr:n-<name>`. This is case
37
+ #
38
+ # @param transformation [String] The transformation string this named transformation refers to. Learn more about
39
+ #
40
+ # @param enabled [Boolean] Whether the named transformation is currently enabled. When set to `false`, requ
41
+ #
42
+ # @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Imagekitio
4
+ module Models
5
+ # @see Imagekitio::Resources::NamedTransformations#delete
6
+ class NamedTransformationDeleteParams < Imagekitio::Internal::Type::BaseModel
7
+ extend Imagekitio::Internal::Type::RequestParameters::Converter
8
+ include Imagekitio::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ # Unique identifier for a named transformation.
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!method initialize(id:, request_options: {})
17
+ # @param id [String] Unique identifier for a named transformation.
18
+ #
19
+ # @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Imagekitio
4
+ module Models
5
+ # @see Imagekitio::Resources::NamedTransformations#get
6
+ class NamedTransformationGetParams < Imagekitio::Internal::Type::BaseModel
7
+ extend Imagekitio::Internal::Type::RequestParameters::Converter
8
+ include Imagekitio::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ # Unique identifier for a named transformation.
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!method initialize(id:, request_options: {})
17
+ # @param id [String] Unique identifier for a named transformation.
18
+ #
19
+ # @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Imagekitio
4
+ module Models
5
+ # @see Imagekitio::Resources::NamedTransformations#list
6
+ class NamedTransformationListParams < Imagekitio::Internal::Type::BaseModel
7
+ extend Imagekitio::Internal::Type::RequestParameters::Converter
8
+ include Imagekitio::Internal::Type::RequestParameters
9
+
10
+ # @!method initialize(request_options: {})
11
+ # @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Imagekitio
4
+ module Models
5
+ # @type [Imagekitio::Internal::Type::Converter]
6
+ NamedTransformationListResponse =
7
+ Imagekitio::Internal::Type::ArrayOf[-> { Imagekitio::NamedTransformation }]
8
+ end
9
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Imagekitio
4
+ module Models
5
+ # @see Imagekitio::Resources::NamedTransformations#update
6
+ class NamedTransformationUpdateParams < Imagekitio::Internal::Type::BaseModel
7
+ extend Imagekitio::Internal::Type::RequestParameters::Converter
8
+ include Imagekitio::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ # Unique identifier for a named transformation.
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!attribute enabled
17
+ # Whether the named transformation is enabled. Omit to leave the current value
18
+ # unchanged.
19
+ #
20
+ # @return [Boolean, nil]
21
+ optional :enabled, Imagekitio::Internal::Type::Boolean
22
+
23
+ # @!attribute name
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
+ #
28
+ # @return [String, nil]
29
+ optional :name, String
30
+
31
+ # @!attribute transformation
32
+ # The transformation string this named transformation refers to. Learn more about
33
+ # the [transformation string syntax](https://imagekit.io/docs/transformations).
34
+ #
35
+ # @return [String, nil]
36
+ optional :transformation, String
37
+
38
+ # @!method initialize(id:, enabled: nil, name: nil, transformation: nil, request_options: {})
39
+ # Some parameter documentations has been truncated, see
40
+ # {Imagekitio::Models::NamedTransformationUpdateParams} for more details.
41
+ #
42
+ # @param id [String] Unique identifier for a named transformation.
43
+ #
44
+ # @param enabled [Boolean] Whether the named transformation is enabled. Omit to leave the current value unc
45
+ #
46
+ # @param name [String] Alias for the transformation string, used in URLs as `tr:n-<name>`. This is case
47
+ #
48
+ # @param transformation [String] The transformation string this named transformation refers to. Learn more about
49
+ #
50
+ # @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}]
51
+ end
52
+ end
53
+ end
@@ -124,6 +124,18 @@ module Imagekitio
124
124
 
125
125
  Metadata = Imagekitio::Models::Metadata
126
126
 
127
+ NamedTransformation = Imagekitio::Models::NamedTransformation
128
+
129
+ NamedTransformationCreateParams = Imagekitio::Models::NamedTransformationCreateParams
130
+
131
+ NamedTransformationDeleteParams = Imagekitio::Models::NamedTransformationDeleteParams
132
+
133
+ NamedTransformationGetParams = Imagekitio::Models::NamedTransformationGetParams
134
+
135
+ NamedTransformationListParams = Imagekitio::Models::NamedTransformationListParams
136
+
137
+ NamedTransformationUpdateParams = Imagekitio::Models::NamedTransformationUpdateParams
138
+
127
139
  Overlay = Imagekitio::Models::Overlay
128
140
 
129
141
  OverlayPosition = Imagekitio::Models::OverlayPosition
@@ -11,7 +11,7 @@ module Imagekitio
11
11
  # on the assets. The value of a field for an asset can be set using the media
12
12
  # library UI or programmatically through upload or update assets API.
13
13
  #
14
- # @overload create(label:, name:, schema:, request_options: {})
14
+ # @overload create(label:, name:, schema:, description: nil, request_options: {})
15
15
  #
16
16
  # @param label [String] Human readable name of the custom metadata field. This should be unique across a
17
17
  #
@@ -19,6 +19,8 @@ module Imagekitio
19
19
  #
20
20
  # @param schema [Imagekitio::Models::CustomMetadataFieldCreateParams::Schema]
21
21
  #
22
+ # @param description [String] Optional description for the custom metadata field. Can be up to 500 characters.
23
+ #
22
24
  # @param request_options [Imagekitio::RequestOptions, Hash{Symbol=>Object}, nil]
23
25
  #
24
26
  # @return [Imagekitio::Models::CustomMetadataField]
@@ -38,12 +40,15 @@ module Imagekitio
38
40
  # Some parameter documentations has been truncated, see
39
41
  # {Imagekitio::Models::CustomMetadataFieldUpdateParams} for more details.
40
42
  #
41
- # This API updates the label or schema of an existing custom metadata field.
43
+ # This API updates the label, description, or schema of an existing custom
44
+ # metadata field.
42
45
  #
43
- # @overload update(id, label: nil, schema: nil, request_options: {})
46
+ # @overload update(id, description: nil, label: nil, schema: nil, request_options: {})
44
47
  #
45
48
  # @param id [String] Should be a valid custom metadata field id.
46
49
  #
50
+ # @param description [String] Optional description for the custom metadata field. Can be up to 500 characters.
51
+ #
47
52
  # @param label [String] Human readable name of the custom metadata field. This should be unique across a
48
53
  #
49
54
  # @param schema [Imagekitio::Models::CustomMetadataFieldUpdateParams::Schema] An object that describes the rules for the custom metadata key. This parameter i
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Imagekitio
4
- VERSION = "4.8.0"
4
+ VERSION = "4.9.0"
5
5
  end
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"
@@ -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