class BlueprintClient::AssetsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/blueprint_ruby_client/api/assets_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

add_asset_to_node(namespace, type, id, asset_type, asset_id, opts = {}) click to toggle source

Add an asset to the node. Body must be empty. Will upsert the asset if it doesn't exist @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param type subtype of Node, e.g. 'modules', 'departments', etc. @param id id identifying a domain model @param asset_type subtype of Asset, e.g. 'textbooks', 'digitisations', etc. @param asset_id id of an asset @param [Hash] opts the optional parameters @return [AssetBody]

# File lib/blueprint_ruby_client/api/assets_api.rb, line 32
def add_asset_to_node(namespace, type, id, asset_type, asset_id, opts = {})
  data, _status_code, _headers = add_asset_to_node_with_http_info(namespace, type, id, asset_type, asset_id, opts)
  return data
end
add_asset_to_node_with_http_info(namespace, type, id, asset_type, asset_id, opts = {}) click to toggle source

Add an asset to the node. Body must be empty. Will upsert the asset if it doesn&#39;t exist @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param type subtype of Node, e.g. &#39;modules&#39;, &#39;departments&#39;, etc. @param id id identifying a domain model @param asset_type subtype of Asset, e.g. &#39;textbooks&#39;, &#39;digitisations&#39;, etc. @param asset_id id of an asset @param [Hash] opts the optional parameters @return [Array<(AssetBody, Fixnum, Hash)>] AssetBody data, response status code and response headers

# File lib/blueprint_ruby_client/api/assets_api.rb, line 46
def add_asset_to_node_with_http_info(namespace, type, id, asset_type, asset_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AssetsApi.add_asset_to_node ..."
  end
  
  
  # verify the required parameter 'namespace' is set
  fail ArgumentError, "Missing the required parameter 'namespace' when calling AssetsApi.add_asset_to_node" if namespace.nil?
  
  
  
  
  
  
  # verify the required parameter 'type' is set
  fail ArgumentError, "Missing the required parameter 'type' when calling AssetsApi.add_asset_to_node" if type.nil?
  
  
  
  
  
  
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling AssetsApi.add_asset_to_node" if id.nil?
  
  
  
  
  
  
  # verify the required parameter 'asset_type' is set
  fail ArgumentError, "Missing the required parameter 'asset_type' when calling AssetsApi.add_asset_to_node" if asset_type.nil?
  
  
  
  
  
  
  # verify the required parameter 'asset_id' is set
  fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.add_asset_to_node" if asset_id.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/{namespace}/nodes/{type}/{id}/assets/{assetType}/{assetId}".sub('{format}','json').sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'type' + '}', type.to_s).sub('{' + 'id' + '}', id.to_s).sub('{' + 'assetType' + '}', asset_type.to_s).sub('{' + 'assetId' + '}', asset_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AssetBody')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#add_asset_to_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_asset(namespace, asset_id, asset_type, opts = {}) click to toggle source

Delete an Asset @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param asset_id id of an asset @param asset_type subtype of Asset, e.g. &#39;textbooks&#39;, &#39;digitisations&#39;, etc. @param [Hash] opts the optional parameters @return [nil]

# File lib/blueprint_ruby_client/api/assets_api.rb, line 135
def delete_asset(namespace, asset_id, asset_type, opts = {})
  delete_asset_with_http_info(namespace, asset_id, asset_type, opts)
  return nil
end
delete_asset_with_http_info(namespace, asset_id, asset_type, opts = {}) click to toggle source

Delete an Asset @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param asset_id id of an asset @param asset_type subtype of Asset, e.g. &#39;textbooks&#39;, &#39;digitisations&#39;, etc. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/blueprint_ruby_client/api/assets_api.rb, line 147
def delete_asset_with_http_info(namespace, asset_id, asset_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AssetsApi.delete_asset ..."
  end
  
  
  # verify the required parameter 'namespace' is set
  fail ArgumentError, "Missing the required parameter 'namespace' when calling AssetsApi.delete_asset" if namespace.nil?
  
  
  
  
  
  
  # verify the required parameter 'asset_id' is set
  fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.delete_asset" if asset_id.nil?
  
  
  
  
  
  
  # verify the required parameter 'asset_type' is set
  fail ArgumentError, "Missing the required parameter 'asset_type' when calling AssetsApi.delete_asset" if asset_type.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/{namespace}/assets/{assetType}/{assetId}".sub('{format}','json').sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'assetId' + '}', asset_id.to_s).sub('{' + 'assetType' + '}', asset_type.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#delete_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_assets(namespace, opts = {}) click to toggle source

Delete assets Delete all assets belonging to the given namespace. @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param [Hash] opts the optional parameters @return [nil]

# File lib/blueprint_ruby_client/api/assets_api.rb, line 217
def delete_assets(namespace, opts = {})
  delete_assets_with_http_info(namespace, opts)
  return nil
end
delete_assets_with_http_info(namespace, opts = {}) click to toggle source

Delete assets Delete all assets belonging to the given namespace. @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/blueprint_ruby_client/api/assets_api.rb, line 227
def delete_assets_with_http_info(namespace, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AssetsApi.delete_assets ..."
  end
  
  
  # verify the required parameter 'namespace' is set
  fail ArgumentError, "Missing the required parameter 'namespace' when calling AssetsApi.delete_assets" if namespace.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/{namespace}/assets".sub('{format}','json').sub('{' + 'namespace' + '}', namespace.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#delete_assets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_asset(namespace, asset_type, asset_id, opts = {}) click to toggle source

Get details of a given asset @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param asset_type subtype of Asset, e.g. &#39;textbooks&#39;, &#39;digitisations&#39;, etc. @param asset_id id of an asset @param [Hash] opts the optional parameters @return [AssetBody]

# File lib/blueprint_ruby_client/api/assets_api.rb, line 283
def get_asset(namespace, asset_type, asset_id, opts = {})
  data, _status_code, _headers = get_asset_with_http_info(namespace, asset_type, asset_id, opts)
  return data
end
get_asset_with_http_info(namespace, asset_type, asset_id, opts = {}) click to toggle source

Get details of a given asset @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param asset_type subtype of Asset, e.g. &#39;textbooks&#39;, &#39;digitisations&#39;, etc. @param asset_id id of an asset @param [Hash] opts the optional parameters @return [Array<(AssetBody, Fixnum, Hash)>] AssetBody data, response status code and response headers

# File lib/blueprint_ruby_client/api/assets_api.rb, line 295
def get_asset_with_http_info(namespace, asset_type, asset_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AssetsApi.get_asset ..."
  end
  
  
  # verify the required parameter 'namespace' is set
  fail ArgumentError, "Missing the required parameter 'namespace' when calling AssetsApi.get_asset" if namespace.nil?
  
  
  
  
  
  
  # verify the required parameter 'asset_type' is set
  fail ArgumentError, "Missing the required parameter 'asset_type' when calling AssetsApi.get_asset" if asset_type.nil?
  
  
  
  
  
  
  # verify the required parameter 'asset_id' is set
  fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.get_asset" if asset_id.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/{namespace}/assets/{assetType}/{assetId}".sub('{format}','json').sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'assetType' + '}', asset_type.to_s).sub('{' + 'assetId' + '}', asset_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AssetBody')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#get_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_assets_in_node(namespace, type, id, opts = {}) click to toggle source

Get for assets in the relevant node @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param type subtype of Node, e.g. &#39;modules&#39;, &#39;departments&#39;, etc. @param id id identifying a domain model @param [Hash] opts the optional parameters @option opts [Array<String>] :filter_asset_type type of asset to return. This filters the results by asset type, but returns all the assets associated with the result. @option opts [Float] :offset index to start result set from @option opts [Float] :limit number of records to return @return [AssetResultSet]

# File lib/blueprint_ruby_client/api/assets_api.rb, line 371
def get_assets_in_node(namespace, type, id, opts = {})
  data, _status_code, _headers = get_assets_in_node_with_http_info(namespace, type, id, opts)
  return data
end
get_assets_in_node_with_http_info(namespace, type, id, opts = {}) click to toggle source

Get for assets in the relevant node @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param type subtype of Node, e.g. &#39;modules&#39;, &#39;departments&#39;, etc. @param id id identifying a domain model @param [Hash] opts the optional parameters @option opts [Array<String>] :filter_asset_type type of asset to return. This filters the results by asset type, but returns all the assets associated with the result. @option opts [Float] :offset index to start result set from @option opts [Float] :limit number of records to return @return [Array<(AssetResultSet, Fixnum, Hash)>] AssetResultSet data, response status code and response headers

# File lib/blueprint_ruby_client/api/assets_api.rb, line 386
def get_assets_in_node_with_http_info(namespace, type, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AssetsApi.get_assets_in_node ..."
  end
  
  
  # verify the required parameter 'namespace' is set
  fail ArgumentError, "Missing the required parameter 'namespace' when calling AssetsApi.get_assets_in_node" if namespace.nil?
  
  
  
  
  
  
  # verify the required parameter 'type' is set
  fail ArgumentError, "Missing the required parameter 'type' when calling AssetsApi.get_assets_in_node" if type.nil?
  
  
  
  
  
  
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling AssetsApi.get_assets_in_node" if id.nil?
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  # resource path
  local_var_path = "/{namespace}/nodes/{type}/{id}/assets".sub('{format}','json').sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'type' + '}', type.to_s).sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'filter[assetType]'] = @api_client.build_collection_param(opts[:'filter_asset_type'], :csv) if opts[:'filter_asset_type']
  query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AssetResultSet')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#get_assets_in_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
remove_asset_from_node(namespace, type, id, asset_type, asset_id, opts = {}) click to toggle source

Remove an asset from the relevant node @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param type subtype of Node, e.g. &#39;modules&#39;, &#39;departments&#39;, etc. @param id id identifying a domain model @param asset_type subtype of Asset, e.g. &#39;textbooks&#39;, &#39;digitisations&#39;, etc. @param asset_id id of an asset @param [Hash] opts the optional parameters @return [nil]

# File lib/blueprint_ruby_client/api/assets_api.rb, line 482
def remove_asset_from_node(namespace, type, id, asset_type, asset_id, opts = {})
  remove_asset_from_node_with_http_info(namespace, type, id, asset_type, asset_id, opts)
  return nil
end
remove_asset_from_node_with_http_info(namespace, type, id, asset_type, asset_id, opts = {}) click to toggle source

Remove an asset from the relevant node @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param type subtype of Node, e.g. &#39;modules&#39;, &#39;departments&#39;, etc. @param id id identifying a domain model @param asset_type subtype of Asset, e.g. &#39;textbooks&#39;, &#39;digitisations&#39;, etc. @param asset_id id of an asset @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/blueprint_ruby_client/api/assets_api.rb, line 496
def remove_asset_from_node_with_http_info(namespace, type, id, asset_type, asset_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AssetsApi.remove_asset_from_node ..."
  end
  
  
  # verify the required parameter 'namespace' is set
  fail ArgumentError, "Missing the required parameter 'namespace' when calling AssetsApi.remove_asset_from_node" if namespace.nil?
  
  
  
  
  
  
  # verify the required parameter 'type' is set
  fail ArgumentError, "Missing the required parameter 'type' when calling AssetsApi.remove_asset_from_node" if type.nil?
  
  
  
  
  
  
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling AssetsApi.remove_asset_from_node" if id.nil?
  
  
  
  
  
  
  # verify the required parameter 'asset_type' is set
  fail ArgumentError, "Missing the required parameter 'asset_type' when calling AssetsApi.remove_asset_from_node" if asset_type.nil?
  
  
  
  
  
  
  # verify the required parameter 'asset_id' is set
  fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.remove_asset_from_node" if asset_id.nil?
  
  
  
  
  
  # resource path
  local_var_path = "/{namespace}/nodes/{type}/{id}/assets/{assetType}/{assetId}".sub('{format}','json').sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'type' + '}', type.to_s).sub('{' + 'id' + '}', id.to_s).sub('{' + 'assetType' + '}', asset_type.to_s).sub('{' + 'assetId' + '}', asset_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#remove_asset_from_node\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
replace_asset(namespace, asset_id, asset_type, opts = {}) click to toggle source

Replaces the Asset with the data sent in the body Wholesale replacement of Asset data: if you were to PUT to:n /1/{namespace}/assets/sometype/someidnnwith a body of:n { type: "someothertype", id: "someotherid" }nnIt would change the Asset's path to:n /1/{namespace}/assets/someothertype/someotheridnnandn /1/{namespace}/assets/sometype/someidnwould return a 404.nIt would also update the assets associated with any node.n @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param asset_id id of an asset @param asset_type subtype of Asset, e.g. &#39;textbooks&#39;, &#39;digitisations&#39;, etc. @param [Hash] opts the optional parameters @option opts [AssetBody] :body asset @return [AssetBody]

# File lib/blueprint_ruby_client/api/assets_api.rb, line 585
def replace_asset(namespace, asset_id, asset_type, opts = {})
  data, _status_code, _headers = replace_asset_with_http_info(namespace, asset_id, asset_type, opts)
  return data
end
replace_asset_with_http_info(namespace, asset_id, asset_type, opts = {}) click to toggle source

Replaces the Asset with the data sent in the body Wholesale replacement of Asset data: if you were to PUT to:n /1/{namespace}/assets/sometype/someidnnwith a body of:n { type: "someothertype&quot;, id: "someotherid&quot; }nnIt would change the Asset&#39;s path to:n /1/{namespace}/assets/someothertype/someotheridnnandn /1/{namespace}/assets/sometype/someidnwould return a 404.nIt would also update the assets associated with any node.n @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param asset_id id of an asset @param asset_type subtype of Asset, e.g. &#39;textbooks&#39;, &#39;digitisations&#39;, etc. @param [Hash] opts the optional parameters @option opts [AssetBody] :body asset @return [Array<(AssetBody, Fixnum, Hash)>] AssetBody data, response status code and response headers

# File lib/blueprint_ruby_client/api/assets_api.rb, line 598
def replace_asset_with_http_info(namespace, asset_id, asset_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AssetsApi.replace_asset ..."
  end
  
  
  # verify the required parameter 'namespace' is set
  fail ArgumentError, "Missing the required parameter 'namespace' when calling AssetsApi.replace_asset" if namespace.nil?
  
  
  
  
  
  
  # verify the required parameter 'asset_id' is set
  fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.replace_asset" if asset_id.nil?
  
  
  
  
  
  
  # verify the required parameter 'asset_type' is set
  fail ArgumentError, "Missing the required parameter 'asset_type' when calling AssetsApi.replace_asset" if asset_type.nil?
  
  
  
  
  
  
  
  
  
  
  
  # resource path
  local_var_path = "/{namespace}/assets/{assetType}/{assetId}".sub('{format}','json').sub('{' + 'namespace' + '}', namespace.to_s).sub('{' + 'assetId' + '}', asset_id.to_s).sub('{' + 'assetType' + '}', asset_type.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AssetBody')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#replace_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
search_assets(namespace, opts = {}) click to toggle source

Search assets This endpoint provides a way to get assets as a pageable result set, based (optionally) on filters.nThe include parameter can only be set to `nodes`nn###### Find all assets in namespace abcn`/1/abc/assets`nn###### Find all lists for abc:n`/1/abc/assets?filter=lists`nn###### Find all assets that are related to a given node of DEP101:n`/1/abc/assets?filter=departments%2Fdep101`nn###### Find all assets that are related to both node DEP101 and DEP102:n`/1/abc/assets?filter=departments%2Fdep101&filter=departments%2Fdep102`nn###### Find all assets that are related to either node DEP101 and DEP102:n`/1/abc/assets?filter=departments%2Fdep101,departments%2Fdep102`n @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param [Hash] opts the optional parameters @option opts [Float] :offset index to start result set from @option opts [Float] :limit number of records to return @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets @option opts [Array<String>] :filter_node limit to assets that are related to a node matching type/code @option opts [Array<String>] :filter_asset_type type of asset to return. This filters the results by asset type, but returns all the assets associated with the result. @return [AssetResultSet]

# File lib/blueprint_ruby_client/api/assets_api.rb, line 680
def search_assets(namespace, opts = {})
  data, _status_code, _headers = search_assets_with_http_info(namespace, opts)
  return data
end
search_assets_with_http_info(namespace, opts = {}) click to toggle source

Search assets This endpoint provides a way to get assets as a pageable result set, based (optionally) on filters.nThe include parameter can only be set to `nodes`nn###### Find all assets in namespace abcn`/1/abc/assets`nn###### Find all lists for abc:n`/1/abc/assets?filter=lists`nn###### Find all assets that are related to a given node of DEP101:n`/1/abc/assets?filter=departments%2Fdep101`nn###### Find all assets that are related to both node DEP101 and DEP102:n`/1/abc/assets?filter=departments%2Fdep101&filter=departments%2Fdep102`nn###### Find all assets that are related to either node DEP101 and DEP102:n`/1/abc/assets?filter=departments%2Fdep101,departments%2Fdep102`n @param namespace identifier namespacing the blueprint. It must start with a letter or underscore and can only be followed by letters, numbers and underscores. @param [Hash] opts the optional parameters @option opts [Float] :offset index to start result set from @option opts [Float] :limit number of records to return @option opts [Array<String>] :include comma separated list of elements to hydrate. Can include children, parents, nodes, and/or assets @option opts [Array<String>] :filter_node limit to assets that are related to a node matching type/code @option opts [Array<String>] :filter_asset_type type of asset to return. This filters the results by asset type, but returns all the assets associated with the result. @return [Array<(AssetResultSet, Fixnum, Hash)>] AssetResultSet data, response status code and response headers

# File lib/blueprint_ruby_client/api/assets_api.rb, line 695
def search_assets_with_http_info(namespace, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AssetsApi.search_assets ..."
  end
  
  
  # verify the required parameter 'namespace' is set
  fail ArgumentError, "Missing the required parameter 'namespace' when calling AssetsApi.search_assets" if namespace.nil?
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  # resource path
  local_var_path = "/{namespace}/assets".sub('{format}','json').sub('{' + 'namespace' + '}', namespace.to_s)

  # query parameters
  query_params = {}
  query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if opts[:'include']
  query_params[:'filter[node]'] = @api_client.build_collection_param(opts[:'filter_node'], :csv) if opts[:'filter_node']
  query_params[:'filter[assetType]'] = @api_client.build_collection_param(opts[:'filter_asset_type'], :csv) if opts[:'filter_asset_type']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/vnd.api+json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AssetResultSet')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AssetsApi#search_assets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end