/**
 * Exchange Rates Historical REST API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: v1
 * Contact: support@apibricks.io
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 *
 */


import ApiClient from "../ApiClient";
import V1Asset from '../model/V1Asset';
import V1Icon from '../model/V1Icon';

/**
* Metadata service.
* @module api/MetadataApi
* @version v1
*/
export default class MetadataApi {

    /**
    * Constructs a new MetadataApi. 
    * @alias module:api/MetadataApi
    * @class
    * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
    * default to {@link module:ApiClient#instance} if unspecified.
    */
    constructor(apiClient) {
        this.apiClient = apiClient || ApiClient.instance;
    }


    /**
     * Callback function to receive the result of the v1AssetsAssetIdGet operation.
     * @callback module:api/MetadataApi~v1AssetsAssetIdGetCallback
     * @param {String} error Error message, if any.
     * @param {Array.<module:model/V1Asset>} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * List all assets by asset ID
     * @param {String} assetId The asset ID.
     * @param {module:api/MetadataApi~v1AssetsAssetIdGetCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link Array.<module:model/V1Asset>}
     */
    v1AssetsAssetIdGet(assetId, callback) {
      let postBody = null;
      // verify the required parameter 'assetId' is set
      if (assetId === undefined || assetId === null) {
        throw new Error("Missing the required parameter 'assetId' when calling v1AssetsAssetIdGet");
      }

      let pathParams = {
        'asset_id': assetId
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['APIKey'];
      let contentTypes = [];
      let accepts = ['text/plain', 'application/json', 'text/json'];
      let returnType = [V1Asset];
      return this.apiClient.callApi(
        '/v1/assets/{asset_id}', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the v1AssetsGet operation.
     * @callback module:api/MetadataApi~v1AssetsGetCallback
     * @param {String} error Error message, if any.
     * @param {Array.<module:model/V1Asset>} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * List all assets
     * Retrieves all assets.              :::info Our asset identifiers are aligned with the ISO 4217 currency codes standard only for fiat money (government or law regulated currency). :::              :::info Properties of the output are providing aggregated information from across all symbols related to the specific asset. If you need to calculate your aggregation (e.g., limiting only the particular type of symbols), you should use /v1/symbols endpoint as a data source. :::
     * @param {Object} opts Optional parameters
     * @param {String} [filterAssetId] Comma or semicolon delimited asset identifiers used to filter response. (optional, eg. `BTC;ETH`).
     * @param {module:api/MetadataApi~v1AssetsGetCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link Array.<module:model/V1Asset>}
     */
    v1AssetsGet(opts, callback) {
      opts = opts || {};
      let postBody = null;

      let pathParams = {
      };
      let queryParams = {
        'filter_asset_id': opts['filterAssetId']
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['APIKey'];
      let contentTypes = [];
      let accepts = ['text/plain', 'application/json', 'text/json'];
      let returnType = [V1Asset];
      return this.apiClient.callApi(
        '/v1/assets', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the v1AssetsIconsSizeGet operation.
     * @callback module:api/MetadataApi~v1AssetsIconsSizeGetCallback
     * @param {String} error Error message, if any.
     * @param {Array.<module:model/V1Icon>} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * List all asset icons
     * Gets the list of icons (of the given size) for all the assets.
     * @param {Number} size The size of the icons.
     * @param {module:api/MetadataApi~v1AssetsIconsSizeGetCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link Array.<module:model/V1Icon>}
     */
    v1AssetsIconsSizeGet(size, callback) {
      let postBody = null;
      // verify the required parameter 'size' is set
      if (size === undefined || size === null) {
        throw new Error("Missing the required parameter 'size' when calling v1AssetsIconsSizeGet");
      }

      let pathParams = {
        'size': size
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['APIKey'];
      let contentTypes = [];
      let accepts = ['text/plain', 'application/json', 'text/json'];
      let returnType = [V1Icon];
      return this.apiClient.callApi(
        '/v1/assets/icons/{size}', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }


}
