Class: Imagekitio::Resources::SavedExtensions

Inherits:
Object
  • Object
show all
Defined in:
lib/imagekitio/resources/saved_extensions.rb

Instance Method Summary collapse

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.

Parameters:



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.

Parameters:

Returns:

See Also:



29
30
31
32
33
34
35
36
37
38
# File 'lib/imagekitio/resources/saved_extensions.rb', line 29

def create(params)
  parsed, options = Imagekitio::SavedExtensionCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/saved-extensions",
    body: parsed,
    model: Imagekitio::SavedExtension,
    options: 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.

Parameters:

Returns:

  • (nil)

See Also:



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.

Parameters:

Returns:

See Also:



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.

Parameters:

Returns:

See Also:



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.

Parameters:

Returns:

See Also:



61
62
63
64
65
66
67
68
69
70
# File 'lib/imagekitio/resources/saved_extensions.rb', line 61

def update(id, params = {})
  parsed, options = Imagekitio::SavedExtensionUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["v1/saved-extensions/%1$s", id],
    body: parsed,
    model: Imagekitio::SavedExtension,
    options: options
  )
end