Class: Imagekitio::Resources::Cache::Invalidation
- Inherits:
-
Object
- Object
- Imagekitio::Resources::Cache::Invalidation
- Defined in:
- lib/imagekitio/resources/cache/invalidation.rb
Instance Method Summary collapse
-
#create(url: , request_options: {}) ⇒ Imagekitio::Models::Cache::InvalidationCreateResponse
Some parameter documentations has been truncated, see Models::Cache::InvalidationCreateParams for more details.
-
#get(request_id, request_options: {}) ⇒ Imagekitio::Models::Cache::InvalidationGetResponse
Some parameter documentations has been truncated, see Models::Cache::InvalidationGetParams for more details.
-
#initialize(client:) ⇒ Invalidation
constructor
private
A new instance of Invalidation.
Constructor Details
#initialize(client:) ⇒ Invalidation
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 Invalidation.
60 61 62 |
# File 'lib/imagekitio/resources/cache/invalidation.rb', line 60 def initialize(client:) @client = client end |
Instance Method Details
#create(url: , request_options: {}) ⇒ Imagekitio::Models::Cache::InvalidationCreateResponse
Some parameter documentations has been truncated, see Models::Cache::InvalidationCreateParams for more details.
This API will purge CDN cache and ImageKit.io’s internal cache for a file. Note: Purge cache is an asynchronous process and it may take some time to reflect the changes.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/imagekitio/resources/cache/invalidation.rb', line 23 def create(params) parsed, = Imagekitio::Cache::InvalidationCreateParams.dump_request(params) @client.request( method: :post, path: "v1/files/purge", body: parsed, model: Imagekitio::Models::Cache::InvalidationCreateResponse, options: ) end |
#get(request_id, request_options: {}) ⇒ Imagekitio::Models::Cache::InvalidationGetResponse
Some parameter documentations has been truncated, see Models::Cache::InvalidationGetParams for more details.
This API returns the status of a purge cache request.
48 49 50 51 52 53 54 55 |
# File 'lib/imagekitio/resources/cache/invalidation.rb', line 48 def get(request_id, params = {}) @client.request( method: :get, path: ["v1/files/purge/%1$s", request_id], model: Imagekitio::Models::Cache::InvalidationGetResponse, options: params[:request_options] ) end |