class GdsApi::AssetManager
def asset(id)
-
(HTTPErrorResponse)- if the request returns an error
Returns:
-
(Response, nil)- A response object containing the parsed JSON response. If
Parameters:
-
id(String) -- The asset identifier
def asset(id) get_json("#{base_url}/assets/#{id}") end
def base_url
def base_url endpoint end
def create_asset(asset)
-
(HTTPErrorResponse)- if the request returns an error
Returns:
-
(Net::HTTPResponse)- The raw http response from the api.
Parameters:
-
asset(Hash) -- The attributes for the asset to send to the api.
def create_asset(asset) post_multipart("#{base_url}/assets", { :asset => asset }) end
def update_asset(id, asset)
-
(HTTPErrorResponse)- if the request returns an error
Returns:
-
(Net::HTTPResponse)- The raw http response from the api.
Parameters:
-
asset(Hash) -- The attributes for the asset to send to the api. -
id(String) -- The asset identifier
def update_asset(id, asset) put_multipart("#{base_url}/assets/#{id}", { :asset => asset }) end