lib/victorops_api_client.js
/**
   * Performs a VictorOps API request.
   *
   * @param {Object} options Request options.
   * @returns {Promise<Object|Array>} The response from the API request.
   * @memberof VictorOpsApiClient
   */
Performs a VictorOps API request.
@param {Object} options Request options.
@returns {Promise} The response from the API request.
Performs a VictorOps API request . @param { Object } options Request options . @returns { Promise } The response from the API request .
async _performRequest(options) {
    if (!options || !isPlainObject(options) || isEmpty(options)) {
      throw new Error('A request options object must be provided');
    }
    const response = await this._axiosInstance.request(options);
    if (this.fullResponse) {
      const statusMessage = response.statusText || status[response.status];
      return {
        statusCode: response.status,
        statusMessage,
        headers: response.headers,
        data: response.data,
      };
    }
    return response.data;
  }
async _performRequest ( options ) { if ( ! options || ! isPlainObject ( options ) || isEmpty ( options ) ) { throw new Error ( 'A request options object must be provided' ) ; } const response = await this . _axiosInstance . request ( options ) ; if ( this . fullResponse ) { const statusMessage = response . statusText || status [ response . status ] ; return { statusCode : response . status , statusMessage , headers : response . headers , data : response . data , } ; } return response . data ; }
Performs a VictorOps API request.
Performs a VictorOps API request .
// Check the options. // Get the response. // Should the full response be returned. // Get the status message.