Class: Imagekitio::Resources::Files::Bulk

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Bulk

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 Bulk.

Parameters:



125
126
127
# File 'lib/imagekitio/resources/files/bulk.rb', line 125

def initialize(client:)
  @client = client
end

Instance Method Details

#add_tags(file_ids: , tags: , request_options: {}) ⇒ Imagekitio::Models::Files::BulkAddTagsResponse

Some parameter documentations has been truncated, see Models::Files::BulkAddTagsParams for more details.

This API adds tags to multiple files in bulk. A maximum of 50 files can be specified at a time.

Parameters:

  • file_ids (Array<String>)

    An array of fileIds to which you want to add tags.

  • tags (Array<String>)

    An array of tags that you want to add to the files.

  • request_options (Imagekitio::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



55
56
57
58
59
60
61
62
63
64
# File 'lib/imagekitio/resources/files/bulk.rb', line 55

def add_tags(params)
  parsed, options = Imagekitio::Files::BulkAddTagsParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/files/addTags",
    body: parsed,
    model: Imagekitio::Models::Files::BulkAddTagsResponse,
    options: options
  )
end

#delete(file_ids: , request_options: {}) ⇒ Imagekitio::Models::Files::BulkDeleteResponse

Some parameter documentations has been truncated, see Models::Files::BulkDeleteParams for more details.

This API deletes multiple files and all their file versions permanently.

Note: If a file or specific transformation has been requested in the past, then the response is cached. Deleting a file does not purge the cache. You can purge the cache using purge cache API.

A maximum of 100 files can be deleted at a time.

Parameters:

  • file_ids (Array<String>)

    An array of fileIds which you want to delete.

  • request_options (Imagekitio::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



27
28
29
30
31
32
33
34
35
36
# File 'lib/imagekitio/resources/files/bulk.rb', line 27

def delete(params)
  parsed, options = Imagekitio::Files::BulkDeleteParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/files/batch/deleteByFileIds",
    body: parsed,
    model: Imagekitio::Models::Files::BulkDeleteResponse,
    options: options
  )
end

#remove_ai_tags(ai_tags: , file_ids: , request_options: {}) ⇒ Imagekitio::Models::Files::BulkRemoveAITagsResponse

Some parameter documentations has been truncated, see Models::Files::BulkRemoveAITagsParams for more details.

This API removes AITags from multiple files in bulk. A maximum of 50 files can be specified at a time.

Parameters:

  • ai_tags (Array<String>)

    An array of AITags that you want to remove from the files.

  • file_ids (Array<String>)

    An array of fileIds from which you want to remove AITags.

  • request_options (Imagekitio::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



83
84
85
86
87
88
89
90
91
92
# File 'lib/imagekitio/resources/files/bulk.rb', line 83

def remove_ai_tags(params)
  parsed, options = Imagekitio::Files::BulkRemoveAITagsParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/files/removeAITags",
    body: parsed,
    model: Imagekitio::Models::Files::BulkRemoveAITagsResponse,
    options: options
  )
end

#remove_tags(file_ids: , tags: , request_options: {}) ⇒ Imagekitio::Models::Files::BulkRemoveTagsResponse

Some parameter documentations has been truncated, see Models::Files::BulkRemoveTagsParams for more details.

This API removes tags from multiple files in bulk. A maximum of 50 files can be specified at a time.

Parameters:

  • file_ids (Array<String>)

    An array of fileIds from which you want to remove tags.

  • tags (Array<String>)

    An array of tags that you want to remove from the files.

  • request_options (Imagekitio::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



111
112
113
114
115
116
117
118
119
120
# File 'lib/imagekitio/resources/files/bulk.rb', line 111

def remove_tags(params)
  parsed, options = Imagekitio::Files::BulkRemoveTagsParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/files/removeTags",
    body: parsed,
    model: Imagekitio::Models::Files::BulkRemoveTagsResponse,
    options: options
  )
end