Class: Uiza::Category

Inherits:
Object
  • Object
show all
Extended by:
APIOperation::Create, APIOperation::Delete, APIOperation::List, APIOperation::Retrieve, APIOperation::Update
Defined in:
lib/uiza/category.rb

Constant Summary collapse

OBJECT_API_PATH =
"media/metadata".freeze
{
  create: "https://docs.uiza.io/#create-category",
  retrieve: "https://docs.uiza.io/#retrieve-category",
  list: "https://docs.uiza.io/#retrieve-category-list",
  update: "https://docs.uiza.io/#update-category",
  delete: "https://docs.uiza.io/#delete-category",
  create_relation: "https://docs.uiza.io/#create-category-relation",
  delete_relation: "https://docs.uiza.io/#delete-category-relation"
}.freeze

Class Method Summary collapse

Methods included from APIOperation::Create

create

Methods included from APIOperation::Retrieve

retrieve

Methods included from APIOperation::Update

update

Methods included from APIOperation::Delete

delete

Methods included from APIOperation::List

list

Class Method Details

.create_relation(params) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/uiza/category.rb', line 21

def create_relation params
  url = "https://#{Uiza.workspace_api_domain}/api/public/v3/media/entity/related/metadata"
  method = :post
  headers = {"Authorization" => Uiza.authorization}
  description_link = OBJECT_API_DESCRIPTION_LINK[:create_relation]

  uiza_client = UizaClient.new url, method, headers, params, description_link
  uiza_client.execute_request
end

.delete_relation(params) ⇒ Object



31
32
33
34
35
36
37
38
39
# File 'lib/uiza/category.rb', line 31

def delete_relation params
  url = "https://#{Uiza.workspace_api_domain}/api/public/v3/media/entity/related/metadata"
  method = :post
  headers = {"Authorization" => Uiza.authorization}
  description_link = OBJECT_API_DESCRIPTION_LINK[:delete_relation]

  uiza_client = UizaClient.new url, method, headers, params, description_link
  uiza_client.execute_request
end