UNPKG

@azure/arm-security

Version:
116 lines (109 loc) 3.84 kB
/* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import { SqlVulnerabilityAssessmentScanResults } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { SecurityCenter } from "../securityCenter"; import { SqlVulnerabilityAssessmentScanResultsGetOptionalParams, SqlVulnerabilityAssessmentScanResultsGetResponse, SqlVulnerabilityAssessmentScanResultsListOptionalParams, SqlVulnerabilityAssessmentScanResultsListResponse } from "../models"; /** Class containing SqlVulnerabilityAssessmentScanResults operations. */ export class SqlVulnerabilityAssessmentScanResultsImpl implements SqlVulnerabilityAssessmentScanResults { private readonly client: SecurityCenter; /** * Initialize a new instance of the class SqlVulnerabilityAssessmentScanResults class. * @param client Reference to the service client */ constructor(client: SecurityCenter) { this.client = client; } /** * Gets the scan results of a single rule in a scan record. * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. * @param scanResultId The rule Id of the results. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @param options The options parameters. */ get( scanId: string, scanResultId: string, workspaceId: string, resourceId: string, options?: SqlVulnerabilityAssessmentScanResultsGetOptionalParams ): Promise<SqlVulnerabilityAssessmentScanResultsGetResponse> { return this.client.sendOperationRequest( { scanId, scanResultId, workspaceId, resourceId, options }, getOperationSpec ); } /** * Gets a list of scan results for a single scan record. * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @param options The options parameters. */ list( scanId: string, workspaceId: string, resourceId: string, options?: SqlVulnerabilityAssessmentScanResultsListOptionalParams ): Promise<SqlVulnerabilityAssessmentScanResultsListResponse> { return this.client.sendOperationRequest( { scanId, workspaceId, resourceId, options }, listOperationSpec ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getOperationSpec: coreClient.OperationSpec = { path: "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults/{scanResultId}", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ScanResult }, default: { bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.workspaceId, Parameters.apiVersion12], urlParameters: [ Parameters.$host, Parameters.resourceId, Parameters.scanId, Parameters.scanResultId ], headerParameters: [Parameters.accept], serializer }; const listOperationSpec: coreClient.OperationSpec = { path: "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ScanResults }, default: { bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.workspaceId, Parameters.apiVersion12], urlParameters: [Parameters.$host, Parameters.resourceId, Parameters.scanId], headerParameters: [Parameters.accept], serializer };