UNPKG

ibmcloud-security-advisor-findings

Version:

JavaScript client library for the IBM Cloud Security Advisor Findings API

101 lines (85 loc) 2.98 kB
/** * Findings API * The Findings API * * OpenAPI spec version: 1.0.0 * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * * Swagger Codegen version: 2.4.7 * * Do not edit the class manually. * */ var ApiClient = require('../ApiClient'); /** * FindingsGraph service. * @module api/FindingsGraphApi */ /** * Constructs a new FindingsGraphApi. * @alias module:api/FindingsGraphApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ module.exports = function(apiClient) { this.apiClient = apiClient || ApiClient.instance; /** * query findings * query findings * @param {String} accountId Account ID * @param {String} authorization The Identity & Access Management (IAM) Bearer token. * @param {String} body Body for query findings * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response */ this.postGraphWithHttpInfo = function(accountId, authorization, body) { var postBody = body; // verify the required parameter 'accountId' is set if (accountId === undefined || accountId === null) { throw new Error("Missing the required parameter 'accountId' when calling postGraph"); } // verify the required parameter 'authorization' is set if (authorization === undefined || authorization === null) { throw new Error("Missing the required parameter 'authorization' when calling postGraph"); } // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling postGraph"); } var pathParams = { 'account_id': accountId }; var queryParams = { }; var headerParams = { 'Authorization': authorization }; var formParams = { }; var authNames = ['UserMin']; var contentTypes = ['application/graphql', 'application/json']; var accepts = ['application/json']; var returnType = Object; return this.apiClient.callApi( '/v1/{account_id}/graph', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } /** * query findings * query findings * @param {String} accountId Account ID * @param {String} authorization The Identity & Access Management (IAM) Bearer token. * @param {String} body Body for query findings * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object} */ this.postGraph = function(accountId, authorization, body) { return this.postGraphWithHttpInfo(accountId, authorization, body) .then(function(response_and_data) { return response_and_data.data; }); } };