Class: Imagekitio::Resources::SavedExtensions
- Inherits:
-
Object
- Object
- Imagekitio::Resources::SavedExtensions
- Defined in:
- lib/imagekitio/resources/saved_extensions.rb
Instance Method Summary collapse
-
#create(config:, description:, name:, request_options: {}) ⇒ Imagekitio::Models::SavedExtension
Some parameter documentations has been truncated, see Models::SavedExtensionCreateParams for more details.
-
#delete(id, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::SavedExtensionDeleteParams for more details.
-
#get(id, request_options: {}) ⇒ Imagekitio::Models::SavedExtension
Some parameter documentations has been truncated, see Models::SavedExtensionGetParams for more details.
-
#initialize(client:) ⇒ SavedExtensions
constructor
private
A new instance of SavedExtensions.
-
#list(request_options: {}) ⇒ Array<Imagekitio::Models::SavedExtension>
This API returns an array of all saved extensions for your account.
-
#update(id, config: nil, description: nil, name: nil, request_options: {}) ⇒ Imagekitio::Models::SavedExtension
Some parameter documentations has been truncated, see Models::SavedExtensionUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ SavedExtensions
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SavedExtensions.
141 142 143 |
# File 'lib/imagekitio/resources/saved_extensions.rb', line 141 def initialize(client:) @client = client end |
Instance Method Details
#create(config:, description:, name:, request_options: {}) ⇒ Imagekitio::Models::SavedExtension
Some parameter documentations has been truncated, see Models::SavedExtensionCreateParams for more details.
This API creates a new saved extension. Saved extensions allow you to save complex extension configurations (like AI tasks) and reuse them by referencing the ID in upload or update file APIs.
**Saved extension limit** \ You can create a maximum of 100 saved extensions per account.
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/imagekitio/resources/saved_extensions.rb', line 29 def create(params) parsed, = Imagekitio::SavedExtensionCreateParams.dump_request(params) @client.request( method: :post, path: "v1/saved-extensions", body: parsed, model: Imagekitio::SavedExtension, options: ) end |
#delete(id, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::SavedExtensionDeleteParams for more details.
This API deletes a saved extension permanently.
106 107 108 109 110 111 112 113 |
# File 'lib/imagekitio/resources/saved_extensions.rb', line 106 def delete(id, params = {}) @client.request( method: :delete, path: ["v1/saved-extensions/%1$s", id], model: NilClass, options: params[:request_options] ) end |
#get(id, request_options: {}) ⇒ Imagekitio::Models::SavedExtension
Some parameter documentations has been truncated, see Models::SavedExtensionGetParams for more details.
This API returns details of a specific saved extension by ID.
129 130 131 132 133 134 135 136 |
# File 'lib/imagekitio/resources/saved_extensions.rb', line 129 def get(id, params = {}) @client.request( method: :get, path: ["v1/saved-extensions/%1$s", id], model: Imagekitio::SavedExtension, options: params[:request_options] ) end |
#list(request_options: {}) ⇒ Array<Imagekitio::Models::SavedExtension>
This API returns an array of all saved extensions for your account. Saved extensions allow you to save complex extension configurations and reuse them by referencing them by ID in upload or update file APIs.
83 84 85 86 87 88 89 90 |
# File 'lib/imagekitio/resources/saved_extensions.rb', line 83 def list(params = {}) @client.request( method: :get, path: "v1/saved-extensions", model: Imagekitio::Internal::Type::ArrayOf[Imagekitio::SavedExtension], options: params[:request_options] ) end |
#update(id, config: nil, description: nil, name: nil, request_options: {}) ⇒ Imagekitio::Models::SavedExtension
Some parameter documentations has been truncated, see Models::SavedExtensionUpdateParams for more details.
This API updates an existing saved extension. You can update the name, description, or config.
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/imagekitio/resources/saved_extensions.rb', line 61 def update(id, params = {}) parsed, = Imagekitio::SavedExtensionUpdateParams.dump_request(params) @client.request( method: :patch, path: ["v1/saved-extensions/%1$s", id], body: parsed, model: Imagekitio::SavedExtension, options: ) end |