Module: Mrkt::CrudAssetStaticLists

Included in:
Client
Defined in:
lib/mrkt/concerns/crud_asset_static_lists.rb

Instance Method Summary collapse

Instance Method Details

#create_static_list(name, folder, description: nil) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/mrkt/concerns/crud_asset_static_lists.rb', line 3

def create_static_list(name, folder, description: nil)
  post('/rest/asset/v1/staticLists.json') do |req|
    params = {
      name: name,
      folder: JSON.generate(folder)
    }

    optional = {
      description: description
    }

    req.body = merge_params(params, optional)
  end
end

#delete_static_list(id) ⇒ Object



26
27
28
# File 'lib/mrkt/concerns/crud_asset_static_lists.rb', line 26

def delete_static_list(id)
  post("/rest/asset/v1/staticList/#{id}/delete.json")
end

#get_static_list_by_id(id) ⇒ Object



18
19
20
# File 'lib/mrkt/concerns/crud_asset_static_lists.rb', line 18

def get_static_list_by_id(id)
  get("/rest/asset/v1/staticList/#{id}.json")
end

#get_static_list_by_name(name) ⇒ Object



22
23
24
# File 'lib/mrkt/concerns/crud_asset_static_lists.rb', line 22

def get_static_list_by_name(name)
  get('/rest/asset/v1/staticList/byName.json', name: name)
end