Class: Imagekitio::Resources::CustomMetadataFields
- Inherits:
-
Object
- Object
- Imagekitio::Resources::CustomMetadataFields
- Defined in:
- lib/imagekitio/resources/custom_metadata_fields.rb
Instance Method Summary collapse
-
#create(label: , name: , schema: , request_options: {}) ⇒ Imagekitio::Models::CustomMetadataField
Some parameter documentations has been truncated, see Models::CustomMetadataFieldCreateParams for more details.
-
#delete(id, request_options: {}) ⇒ Imagekitio::Models::CustomMetadataFieldDeleteResponse
Some parameter documentations has been truncated, see Models::CustomMetadataFieldDeleteParams for more details.
-
#initialize(client:) ⇒ CustomMetadataFields
constructor
private
A new instance of CustomMetadataFields.
-
#list(folder_path: nil, include_deleted: nil, request_options: {}) ⇒ Array<Imagekitio::Models::CustomMetadataField>
Some parameter documentations has been truncated, see Models::CustomMetadataFieldListParams for more details.
-
#update(id, label: nil, schema: nil, request_options: {}) ⇒ Imagekitio::Models::CustomMetadataField
Some parameter documentations has been truncated, see Models::CustomMetadataFieldUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ CustomMetadataFields
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 CustomMetadataFields.
128 129 130 |
# File 'lib/imagekitio/resources/custom_metadata_fields.rb', line 128 def initialize(client:) @client = client end |
Instance Method Details
#create(label: , name: , schema: , request_options: {}) ⇒ Imagekitio::Models::CustomMetadataField
Some parameter documentations has been truncated, see Models::CustomMetadataFieldCreateParams for more details.
This API creates a new custom metadata field. Once a custom metadata field is created either through this API or using the dashboard UI, its value can be set on the assets. The value of a field for an asset can be set using the media library UI or programmatically through upload or update assets API.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/imagekitio/resources/custom_metadata_fields.rb', line 27 def create(params) parsed, = Imagekitio::CustomMetadataFieldCreateParams.dump_request(params) @client.request( method: :post, path: "v1/customMetadataFields", body: parsed, model: Imagekitio::CustomMetadataField, options: ) end |
#delete(id, request_options: {}) ⇒ Imagekitio::Models::CustomMetadataFieldDeleteResponse
Some parameter documentations has been truncated, see Models::CustomMetadataFieldDeleteParams for more details.
This API deletes a custom metadata field. Even after deleting a custom metadata field, you cannot create any new custom metadata field with the same name.
116 117 118 119 120 121 122 123 |
# File 'lib/imagekitio/resources/custom_metadata_fields.rb', line 116 def delete(id, params = {}) @client.request( method: :delete, path: ["v1/customMetadataFields/%1$s", id], model: Imagekitio::Models::CustomMetadataFieldDeleteResponse, options: params[:request_options] ) end |
#list(folder_path: nil, include_deleted: nil, request_options: {}) ⇒ Array<Imagekitio::Models::CustomMetadataField>
Some parameter documentations has been truncated, see Models::CustomMetadataFieldListParams for more details.
This API returns the array of created custom metadata field objects. By default the API returns only non deleted field objects, but you can include deleted fields in the API response.
You can also filter results by a specific folder path to retrieve custom metadata fields applicable at that location. This path-specific filtering is useful when using the **Path policy** feature to determine which custom metadata fields are selected for a given path.
90 91 92 93 94 95 96 97 98 99 |
# File 'lib/imagekitio/resources/custom_metadata_fields.rb', line 90 def list(params = {}) parsed, = Imagekitio::CustomMetadataFieldListParams.dump_request(params) @client.request( method: :get, path: "v1/customMetadataFields", query: parsed.transform_keys(folder_path: "folderPath", include_deleted: "includeDeleted"), model: Imagekitio::Internal::Type::ArrayOf[Imagekitio::CustomMetadataField], options: ) end |
#update(id, label: nil, schema: nil, request_options: {}) ⇒ Imagekitio::Models::CustomMetadataField
Some parameter documentations has been truncated, see Models::CustomMetadataFieldUpdateParams for more details.
This API updates the label or schema of an existing custom metadata field.
56 57 58 59 60 61 62 63 64 65 |
# File 'lib/imagekitio/resources/custom_metadata_fields.rb', line 56 def update(id, params = {}) parsed, = Imagekitio::CustomMetadataFieldUpdateParams.dump_request(params) @client.request( method: :patch, path: ["v1/customMetadataFields/%1$s", id], body: parsed, model: Imagekitio::CustomMetadataField, options: ) end |