{"version":3,"sources":["../../builds/node.ts","../../src/usageClient.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type { ClientOptions } from '@algolia/client-common';\nimport {\n  createMemoryCache,\n  createNullCache,\n  DEFAULT_CONNECT_TIMEOUT_NODE,\n  DEFAULT_READ_TIMEOUT_NODE,\n  DEFAULT_WRITE_TIMEOUT_NODE,\n} from '@algolia/client-common';\nimport { createHttpRequester } from '@algolia/requester-node-http';\n\nimport { createUsageClient } from '../src/usageClient';\n\nexport type UsageClient = ReturnType<typeof createUsageClient>;\n\nexport { apiClientVersion } from '../src/usageClient';\nexport * from '../model';\n\nexport function usageClient(appId: string, apiKey: string, options?: ClientOptions): UsageClient {\n  if (!appId || typeof appId !== 'string') {\n    throw new Error('`appId` is missing.');\n  }\n\n  if (!apiKey || typeof apiKey !== 'string') {\n    throw new Error('`apiKey` is missing.');\n  }\n\n  return {\n    ...createUsageClient({\n      appId,\n      apiKey,\n      timeouts: {\n        connect: DEFAULT_CONNECT_TIMEOUT_NODE,\n        read: DEFAULT_READ_TIMEOUT_NODE,\n        write: DEFAULT_WRITE_TIMEOUT_NODE,\n      },\n      requester: createHttpRequester(),\n      algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],\n      responsesCache: createNullCache(),\n      requestsCache: createNullCache(),\n      hostsCache: createMemoryCache(),\n      ...options,\n    }),\n  };\n}\n","// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\nimport type {\n  CreateClientOptions,\n  Headers,\n  Host,\n  QueryParameters,\n  Request,\n  RequestOptions,\n} from '@algolia/client-common';\n\nimport type {\n  CustomDeleteProps,\n  CustomGetProps,\n  CustomPostProps,\n  CustomPutProps,\n  GetIndexUsageProps,\n  GetUsageProps,\n} from '../model/clientMethodProps';\nimport type { IndexUsage } from '../model/indexUsage';\n\nexport const apiClientVersion = '1.4.0';\n\nfunction getDefaultHosts(): Host[] {\n  return [{ url: 'usage.algolia.com', accept: 'readWrite', protocol: 'https' }];\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function createUsageClient({\n  appId: appIdOption,\n  apiKey: apiKeyOption,\n  authMode,\n  algoliaAgents,\n  ...options\n}: CreateClientOptions) {\n  const auth = createAuth(appIdOption, apiKeyOption, authMode);\n  const transporter = createTransporter({\n    hosts: getDefaultHosts(),\n    ...options,\n    algoliaAgent: getAlgoliaAgent({\n      algoliaAgents,\n      client: 'Usage',\n      version: apiClientVersion,\n    }),\n    baseHeaders: {\n      'content-type': 'text/plain',\n      ...auth.headers(),\n      ...options.baseHeaders,\n    },\n    baseQueryParameters: {\n      ...auth.queryParameters(),\n      ...options.baseQueryParameters,\n    },\n  });\n\n  return {\n    transporter,\n\n    /**\n     * The `appId` currently in use.\n     */\n    appId: appIdOption,\n\n    /**\n     * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n     */\n    clearCache(): Promise<void> {\n      return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n    },\n\n    /**\n     * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n     */\n    get _ua(): string {\n      return transporter.algoliaAgent.value;\n    },\n\n    /**\n     * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n     *\n     * @param segment - The algolia agent (user-agent) segment to add.\n     * @param version - The version of the agent.\n     */\n    addAlgoliaAgent(segment: string, version?: string): void {\n      transporter.algoliaAgent.add({ segment, version });\n    },\n\n    /**\n     * Helper method to switch the API key used to authenticate the requests.\n     *\n     * @param params - Method params.\n     * @param params.apiKey - The new API Key to use.\n     */\n    setClientApiKey({ apiKey }: { apiKey: string }): void {\n      if (!authMode || authMode === 'WithinHeaders') {\n        transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n      } else {\n        transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n      }\n    },\n\n    /**\n     * This method allow you to send requests to the Algolia REST API.\n     *\n     * @param customDelete - The customDelete object.\n     * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n     * @param customDelete.parameters - Query parameters to apply to the current query.\n     * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n     */\n    customDelete(\n      { path, parameters }: CustomDeleteProps,\n      requestOptions?: RequestOptions,\n    ): Promise<Record<string, unknown>> {\n      if (!path) {\n        throw new Error('Parameter `path` is required when calling `customDelete`.');\n      }\n\n      const requestPath = '/{path}'.replace('{path}', path);\n      const headers: Headers = {};\n      const queryParameters: QueryParameters = parameters ? parameters : {};\n\n      const request: Request = {\n        method: 'DELETE',\n        path: requestPath,\n        queryParameters,\n        headers,\n      };\n\n      return transporter.request(request, requestOptions);\n    },\n\n    /**\n     * This method allow you to send requests to the Algolia REST API.\n     *\n     * @param customGet - The customGet object.\n     * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n     * @param customGet.parameters - Query parameters to apply to the current query.\n     * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n     */\n    customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n      if (!path) {\n        throw new Error('Parameter `path` is required when calling `customGet`.');\n      }\n\n      const requestPath = '/{path}'.replace('{path}', path);\n      const headers: Headers = {};\n      const queryParameters: QueryParameters = parameters ? parameters : {};\n\n      const request: Request = {\n        method: 'GET',\n        path: requestPath,\n        queryParameters,\n        headers,\n      };\n\n      return transporter.request(request, requestOptions);\n    },\n\n    /**\n     * This method allow you to send requests to the Algolia REST API.\n     *\n     * @param customPost - The customPost object.\n     * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n     * @param customPost.parameters - Query parameters to apply to the current query.\n     * @param customPost.body - Parameters to send with the custom request.\n     * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n     */\n    customPost(\n      { path, parameters, body }: CustomPostProps,\n      requestOptions?: RequestOptions,\n    ): Promise<Record<string, unknown>> {\n      if (!path) {\n        throw new Error('Parameter `path` is required when calling `customPost`.');\n      }\n\n      const requestPath = '/{path}'.replace('{path}', path);\n      const headers: Headers = {};\n      const queryParameters: QueryParameters = parameters ? parameters : {};\n\n      const request: Request = {\n        method: 'POST',\n        path: requestPath,\n        queryParameters,\n        headers,\n        data: body ? body : {},\n      };\n\n      return transporter.request(request, requestOptions);\n    },\n\n    /**\n     * This method allow you to send requests to the Algolia REST API.\n     *\n     * @param customPut - The customPut object.\n     * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n     * @param customPut.parameters - Query parameters to apply to the current query.\n     * @param customPut.body - Parameters to send with the custom request.\n     * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n     */\n    customPut(\n      { path, parameters, body }: CustomPutProps,\n      requestOptions?: RequestOptions,\n    ): Promise<Record<string, unknown>> {\n      if (!path) {\n        throw new Error('Parameter `path` is required when calling `customPut`.');\n      }\n\n      const requestPath = '/{path}'.replace('{path}', path);\n      const headers: Headers = {};\n      const queryParameters: QueryParameters = parameters ? parameters : {};\n\n      const request: Request = {\n        method: 'PUT',\n        path: requestPath,\n        queryParameters,\n        headers,\n        data: body ? body : {},\n      };\n\n      return transporter.request(request, requestOptions);\n    },\n\n    /**\n     * Retrieves the selected usage statistics for one index.\n     *\n     * @param getIndexUsage - The getIndexUsage object.\n     * @param getIndexUsage.statistic - Usage statistics to retrieve.  Use `*` to retrieve all usage metrics, otherwise add one or more of the following metrics, separated by a comma.  **Search operations**  - `search_operations`. All search operations. - `total_search_operations`: Sum of all search operations. - `total_search_requests`: Sum of all [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-).    The number of billed search requests is equal to this value minus `querysuggestions_total_search_requests`. - `queries_operations`. Number of [single index search](/specs/search#tag/Search/operation/searchSingleIndex) operations. - `multi_queries_operations`. Number of [multi-index search](/specs/search#tag/Search/operation/search) operations.  **ACL operations**  - `acl_operations`. All ACL operations. - `total_acl_operations`. Sum of all ACL operations. - `get_api_keys_operations`. Number of [list API keys](/specs/search#tag/Api-Keys/operation/listApiKeys) operations. - `get_api_key_operations`. Number of [get API key permission](/specs/search#tag/Api-Keys/operation/getApiKey) operations. - `add_api_key_operations`. Number of [create API key](/specs/search#tag/Api-Keys/operation/addApiKey) operations. - `update_api_key_operations`. Number of [update API key](/specs/search#tag/Api-Keys/operation/updateApiKey) operations. - `delete_api_key_operations`. Number of [delete API key](/specs/search#tag/Api-Keys/operation/deleteApiKey) operations. - `list_api_key_operations`. Number of list index API keys operations.  **Indexing operations**  - `indexing_operations`. All indexing operations. - `total_indexing_operations`. Sum of all indexing operations. - `browse_operations`. Number of [browse index](/specs/search#tag/Search/operation/browse) operations. - `clear_index_operations`. Number of [clear records](/specs/search#tag/Records/operation/clearObjects) operations. - `copy_move_operations`. Number of [copy or move index](/specs/search#tag/Indices/operation/operationIndex) operations. - `delete_index_operations`. Number of [delete index](/specs/search#tag/Indices/operation/deleteIndex) operations. - `get_log_operations`. Number of [get logs](/specs/search#tag/Advanced/operation/getLogs) operations. - `get_settings_operations`. Number of [get settings](/specs/search#operation/getIndexUsage) operations. - `set_settings_operations`. Number of [set settings](/specs/search#tag/Indices/operation/setSettings) operations. - `list_indices_operations`. Number of [list indices](/specs/search#tag/Indices/operation/listIndices) operations. - `wait_task_operations`. Number of [wait](/specs/search#tag/Indices/operation/getTask) operations.  **Record operations**  - `record_operations`. All record operations. - `total_records_operations`. Sum of all record operations. - `add_record_operations`. Number of [add or replace record](/specs/search#tag/Records/operation/saveObject) operations. - `batch_operations`. Number of [batch indexing](/specs/search#tag/Records/operation/multipleBatch) operations. - `delete_by_query_operations`. Number of [delete by query](/specs/search#tag/Records/operation/deleteBy) operations. - `delete_record_operations`. Number of [delete record](/specs/search#tag/Records/operation/deleteObject) operations. - `get_record_operations`. Number of [get record](/specs/search#tag/Records/operation/getObject) operations. - `partial_update_record_operations`. Number of [partially update records](/specs/search#tag/Records/operation/partialUpdateObject) operations. - `update_record_operations`. Number of [add or replace record by objectID](/specs/search#tag/Records/operation/addOrUpdateObject) operations.  **Synonym operations**  - `synonym_operations`. All synonym operations. - `total_synonym_operations`. Sum of all synonym operations. - `batch_synonym_operations`. Number of [save all synonyms](/specs/search#tag/Synonyms/operation/saveSynonyms) operations. - `clear_synonym_operations`. Number of [clear synonyms](/specs/search#tag/Synonyms/operation/clearSynonyms) operations. - `delete_synonym_operations`. Number of [delete synonym](/specs/search#tag/Synonyms/operation/deleteSynonym) operations. - `get_synonym_operations`. Number of [get synonym](/specs/search#tag/Synonyms/operation/getSynonym) operations. - `query_synonym_operations`. Number of [search synonyms](/specs/search#tag/Synonyms/operation/searchSynonyms) operations. - `update_synonym_operations`. Number of [save a synonym](/specs/search#tag/Synonyms/operation/saveSynonym) operations.  **Rule operations**  - `rule_operations`. All rule operations. - `total_rules_operations`. Sum of all rule operations. - `batch_rules_operations`. Number of [batch rules](/specs/search#tag/Rules/operation/saveRules) operations. - `clear_rules_operations`. Number of [delete rule](/specs/search#tag/Rules/operation/deleteRule) operations. - `delete_rules_operations`. Number of [clear rules](/specs/search#tag/Rules/operation/clearRules) operations. - `get_rules_operations`. Number of [get rule](/specs/search#tag/Rules/operation/getRule) operations. - `save_rules_operations`. Number of [save rule](/specs/search#operation/getIndexUsage) operations. - `search_rules_operations`. Number of [search rules](/specs/search#tag/Rules/operation/searchRules) operations.  **Total operations**  - `total_recommend_requests`. Number of [Recommend requests](https://www.algolia.com/doc/guides/algolia-ai/recommend/) - `total_write_operations`. Number of Write operations - `total_read_operations`. Number of read operations - `total_operations`. Sum of all operations  **Total Query Suggestions operations**  Query Suggestions operations are a subset of `total_search_operations`.  - `querysuggestions_total_search_operations`. Number of Query Suggestions search operations. - `querysuggestions_total_search_requests`. Number of Query Suggestions [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). - `querysuggestions_total_acl_operations`. Sum of all Query Suggestions [ACL operations](#acl-operations). - `querysuggestions_total_indexing_operations`. Number of Query Suggestions [indexing operations](#indexing-operations). - `querysuggestions_total_records_operations`. Number of Query Suggestions [record operations](#record-operations). - `querysuggestions_total_synonym_operations`. Number of Query Suggestions [synonym operations](#synonym-operations). - `querysuggestions_total_rules_operations`. Number of Query Suggestions [Rule operations](#rule-operations). - `querysuggestions_total_write_operations`. Number of Query Suggestions Write operations. - `querysuggestions_total_read_operations`. Number of Query Suggestions Read operations. - `querysuggestions_total_operations`. Sum of all Query Suggestions operations.  **Processing time**  - `avg_processing_time`. Average processing time (in milliseconds). - `90p_processing_time`. 90th percentile of processing time (in milliseconds). - `99p_processing_time`. 99th percentile of processing time (in milliseconds). - `queries_above_last_ms_processing_time`. Number of queries that take one or more seconds to process.  **Indices**  - `records`. Number of records. - `data_size`. The size of the records (in bytes). - `file_size`. The size of the records _and_ index metadata (in bytes).  **Maximum queries per second**  - `max_qps`. [Maximum queries per second](https://support.algolia.com/hc/en-us/articles/4406975224721) per server. - `region_max_qps`. Maximum queries per second per region. - `total_max_qps`. Maximum queries per second across all servers.  **Used search capacity**  The following capacities are reported in percent:  - `used_search_capacity`. Maximum search capacity used per server. - `avg_used_search_capacity`. Average search capacity used per server. - `region_used_search_capacity`. Maximum search capacity used per region. - `region_avg_used_search_capacity`. Average search capacity used per region. - `total_used_search_capacity`. Maximum search capacity used for all servers. - `total_avg_used_search_capacity`. Average used search capacity for all servers.  **Degraded queries**  Check the impact of [degraded queries](https://support.algolia.com/hc/en-us/articles/4406981934481).  - `degraded_queries_ssd_used_queries_impacted`. Percentage of degraded queries due to the Algolia search engine having to read from the server\\'s SSD. - `degraded_queries_ssd_used_seconds_impacted`. Percentage of seconds affected by `ssd_used` degraded queries. - `degraded_queries_max_capacity_queries_impacted`. Percentage of degraded queries due to all search threads being used. - `degraded_queries_max_capacity_seconds_impacted`. Percentage of seconds affected by `max_capacity` degraded queries.\n     * @param getIndexUsage.indexName - Name of the index on which to perform the operation.\n     * @param getIndexUsage.startDate - Start date of the period to analyze, in RFC 3339 format.\n     * @param getIndexUsage.endDate - End date of the period to analyze, in RFC 3339 format.\n     * @param getIndexUsage.granularity - Granularity of the aggregated metrics.  - `hourly`: the maximum time range for hourly metrics is 7 days. - `daily`: the maximum time range for daily metrics is 365 days.\n     * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n     */\n    getIndexUsage(\n      { statistic, indexName, startDate, endDate, granularity }: GetIndexUsageProps,\n      requestOptions?: RequestOptions,\n    ): Promise<IndexUsage> {\n      if (!statistic) {\n        throw new Error('Parameter `statistic` is required when calling `getIndexUsage`.');\n      }\n\n      if (!indexName) {\n        throw new Error('Parameter `indexName` is required when calling `getIndexUsage`.');\n      }\n\n      if (!startDate) {\n        throw new Error('Parameter `startDate` is required when calling `getIndexUsage`.');\n      }\n\n      if (!endDate) {\n        throw new Error('Parameter `endDate` is required when calling `getIndexUsage`.');\n      }\n\n      const requestPath = '/1/usage/{statistic}/{indexName}'\n        .replace('{statistic}', encodeURIComponent(statistic))\n        .replace('{indexName}', encodeURIComponent(indexName));\n      const headers: Headers = {};\n      const queryParameters: QueryParameters = {};\n      if (startDate !== undefined) {\n        queryParameters.startDate = startDate.toString();\n      }\n      if (endDate !== undefined) {\n        queryParameters.endDate = endDate.toString();\n      }\n      if (granularity !== undefined) {\n        queryParameters.granularity = granularity.toString();\n      }\n\n      const request: Request = {\n        method: 'GET',\n        path: requestPath,\n        queryParameters,\n        headers,\n      };\n\n      return transporter.request(request, requestOptions);\n    },\n\n    /**\n     * Retrieves usage statistics evaluated over a specified period.\n     *\n     * @param getUsage - The getUsage object.\n     * @param getUsage.statistic - Usage statistics to retrieve.  Use `*` to retrieve all usage metrics, otherwise add one or more of the following metrics, separated by a comma.  **Search operations**  - `search_operations`. All search operations. - `total_search_operations`: Sum of all search operations. - `total_search_requests`: Sum of all [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-).    The number of billed search requests is equal to this value minus `querysuggestions_total_search_requests`. - `queries_operations`. Number of [single index search](/specs/search#tag/Search/operation/searchSingleIndex) operations. - `multi_queries_operations`. Number of [multi-index search](/specs/search#tag/Search/operation/search) operations.  **ACL operations**  - `acl_operations`. All ACL operations. - `total_acl_operations`. Sum of all ACL operations. - `get_api_keys_operations`. Number of [list API keys](/specs/search#tag/Api-Keys/operation/listApiKeys) operations. - `get_api_key_operations`. Number of [get API key permission](/specs/search#tag/Api-Keys/operation/getApiKey) operations. - `add_api_key_operations`. Number of [create API key](/specs/search#tag/Api-Keys/operation/addApiKey) operations. - `update_api_key_operations`. Number of [update API key](/specs/search#tag/Api-Keys/operation/updateApiKey) operations. - `delete_api_key_operations`. Number of [delete API key](/specs/search#tag/Api-Keys/operation/deleteApiKey) operations. - `list_api_key_operations`. Number of list index API keys operations.  **Indexing operations**  - `indexing_operations`. All indexing operations. - `total_indexing_operations`. Sum of all indexing operations. - `browse_operations`. Number of [browse index](/specs/search#tag/Search/operation/browse) operations. - `clear_index_operations`. Number of [clear records](/specs/search#tag/Records/operation/clearObjects) operations. - `copy_move_operations`. Number of [copy or move index](/specs/search#tag/Indices/operation/operationIndex) operations. - `delete_index_operations`. Number of [delete index](/specs/search#tag/Indices/operation/deleteIndex) operations. - `get_log_operations`. Number of [get logs](/specs/search#tag/Advanced/operation/getLogs) operations. - `get_settings_operations`. Number of [get settings](/specs/search#operation/getIndexUsage) operations. - `set_settings_operations`. Number of [set settings](/specs/search#tag/Indices/operation/setSettings) operations. - `list_indices_operations`. Number of [list indices](/specs/search#tag/Indices/operation/listIndices) operations. - `wait_task_operations`. Number of [wait](/specs/search#tag/Indices/operation/getTask) operations.  **Record operations**  - `record_operations`. All record operations. - `total_records_operations`. Sum of all record operations. - `add_record_operations`. Number of [add or replace record](/specs/search#tag/Records/operation/saveObject) operations. - `batch_operations`. Number of [batch indexing](/specs/search#tag/Records/operation/multipleBatch) operations. - `delete_by_query_operations`. Number of [delete by query](/specs/search#tag/Records/operation/deleteBy) operations. - `delete_record_operations`. Number of [delete record](/specs/search#tag/Records/operation/deleteObject) operations. - `get_record_operations`. Number of [get record](/specs/search#tag/Records/operation/getObject) operations. - `partial_update_record_operations`. Number of [partially update records](/specs/search#tag/Records/operation/partialUpdateObject) operations. - `update_record_operations`. Number of [add or replace record by objectID](/specs/search#tag/Records/operation/addOrUpdateObject) operations.  **Synonym operations**  - `synonym_operations`. All synonym operations. - `total_synonym_operations`. Sum of all synonym operations. - `batch_synonym_operations`. Number of [save all synonyms](/specs/search#tag/Synonyms/operation/saveSynonyms) operations. - `clear_synonym_operations`. Number of [clear synonyms](/specs/search#tag/Synonyms/operation/clearSynonyms) operations. - `delete_synonym_operations`. Number of [delete synonym](/specs/search#tag/Synonyms/operation/deleteSynonym) operations. - `get_synonym_operations`. Number of [get synonym](/specs/search#tag/Synonyms/operation/getSynonym) operations. - `query_synonym_operations`. Number of [search synonyms](/specs/search#tag/Synonyms/operation/searchSynonyms) operations. - `update_synonym_operations`. Number of [save a synonym](/specs/search#tag/Synonyms/operation/saveSynonym) operations.  **Rule operations**  - `rule_operations`. All rule operations. - `total_rules_operations`. Sum of all rule operations. - `batch_rules_operations`. Number of [batch rules](/specs/search#tag/Rules/operation/saveRules) operations. - `clear_rules_operations`. Number of [delete rule](/specs/search#tag/Rules/operation/deleteRule) operations. - `delete_rules_operations`. Number of [clear rules](/specs/search#tag/Rules/operation/clearRules) operations. - `get_rules_operations`. Number of [get rule](/specs/search#tag/Rules/operation/getRule) operations. - `save_rules_operations`. Number of [save rule](/specs/search#operation/getIndexUsage) operations. - `search_rules_operations`. Number of [search rules](/specs/search#tag/Rules/operation/searchRules) operations.  **Total operations**  - `total_recommend_requests`. Number of [Recommend requests](https://www.algolia.com/doc/guides/algolia-ai/recommend/) - `total_write_operations`. Number of Write operations - `total_read_operations`. Number of read operations - `total_operations`. Sum of all operations  **Total Query Suggestions operations**  Query Suggestions operations are a subset of `total_search_operations`.  - `querysuggestions_total_search_operations`. Number of Query Suggestions search operations. - `querysuggestions_total_search_requests`. Number of Query Suggestions [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). - `querysuggestions_total_acl_operations`. Sum of all Query Suggestions [ACL operations](#acl-operations). - `querysuggestions_total_indexing_operations`. Number of Query Suggestions [indexing operations](#indexing-operations). - `querysuggestions_total_records_operations`. Number of Query Suggestions [record operations](#record-operations). - `querysuggestions_total_synonym_operations`. Number of Query Suggestions [synonym operations](#synonym-operations). - `querysuggestions_total_rules_operations`. Number of Query Suggestions [Rule operations](#rule-operations). - `querysuggestions_total_write_operations`. Number of Query Suggestions Write operations. - `querysuggestions_total_read_operations`. Number of Query Suggestions Read operations. - `querysuggestions_total_operations`. Sum of all Query Suggestions operations.  **Processing time**  - `avg_processing_time`. Average processing time (in milliseconds). - `90p_processing_time`. 90th percentile of processing time (in milliseconds). - `99p_processing_time`. 99th percentile of processing time (in milliseconds). - `queries_above_last_ms_processing_time`. Number of queries that take one or more seconds to process.  **Indices**  - `records`. Number of records. - `data_size`. The size of the records (in bytes). - `file_size`. The size of the records _and_ index metadata (in bytes).  **Maximum queries per second**  - `max_qps`. [Maximum queries per second](https://support.algolia.com/hc/en-us/articles/4406975224721) per server. - `region_max_qps`. Maximum queries per second per region. - `total_max_qps`. Maximum queries per second across all servers.  **Used search capacity**  The following capacities are reported in percent:  - `used_search_capacity`. Maximum search capacity used per server. - `avg_used_search_capacity`. Average search capacity used per server. - `region_used_search_capacity`. Maximum search capacity used per region. - `region_avg_used_search_capacity`. Average search capacity used per region. - `total_used_search_capacity`. Maximum search capacity used for all servers. - `total_avg_used_search_capacity`. Average used search capacity for all servers.  **Degraded queries**  Check the impact of [degraded queries](https://support.algolia.com/hc/en-us/articles/4406981934481).  - `degraded_queries_ssd_used_queries_impacted`. Percentage of degraded queries due to the Algolia search engine having to read from the server\\'s SSD. - `degraded_queries_ssd_used_seconds_impacted`. Percentage of seconds affected by `ssd_used` degraded queries. - `degraded_queries_max_capacity_queries_impacted`. Percentage of degraded queries due to all search threads being used. - `degraded_queries_max_capacity_seconds_impacted`. Percentage of seconds affected by `max_capacity` degraded queries.\n     * @param getUsage.startDate - Start date of the period to analyze, in RFC 3339 format.\n     * @param getUsage.endDate - End date of the period to analyze, in RFC 3339 format.\n     * @param getUsage.granularity - Granularity of the aggregated metrics.  - `hourly`: the maximum time range for hourly metrics is 7 days. - `daily`: the maximum time range for daily metrics is 365 days.\n     * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n     */\n    getUsage(\n      { statistic, startDate, endDate, granularity }: GetUsageProps,\n      requestOptions?: RequestOptions,\n    ): Promise<IndexUsage> {\n      if (!statistic) {\n        throw new Error('Parameter `statistic` is required when calling `getUsage`.');\n      }\n\n      if (!startDate) {\n        throw new Error('Parameter `startDate` is required when calling `getUsage`.');\n      }\n\n      if (!endDate) {\n        throw new Error('Parameter `endDate` is required when calling `getUsage`.');\n      }\n\n      const requestPath = '/1/usage/{statistic}'.replace('{statistic}', encodeURIComponent(statistic));\n      const headers: Headers = {};\n      const queryParameters: QueryParameters = {};\n\n      if (startDate !== undefined) {\n        queryParameters.startDate = startDate.toString();\n      }\n      if (endDate !== undefined) {\n        queryParameters.endDate = endDate.toString();\n      }\n      if (granularity !== undefined) {\n        queryParameters.granularity = granularity.toString();\n      }\n\n      const request: Request = {\n        method: 'GET',\n        path: requestPath,\n        queryParameters,\n        headers,\n      };\n\n      return transporter.request(request, requestOptions);\n    },\n  };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,IAAAA,wBAMO;AACP,iCAAoC;;;ACRpC,2BAA+D;AAoBxD,IAAM,mBAAmB;AAEhC,SAAS,kBAA0B;AACjC,SAAO,CAAC,EAAE,KAAK,qBAAqB,QAAQ,aAAa,UAAU,QAAQ,CAAC;AAC9E;AAGO,SAAS,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