/* * 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 { IPGeodata } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { SecurityInsights } from "../securityInsights"; import { IPGeodataGetOptionalParams, IPGeodataGetResponse } from "../models"; /** Class containing IPGeodata operations. */ export class IPGeodataImpl implements IPGeodata { private readonly client: SecurityInsights; /** * Initialize a new instance of the class IPGeodata class. * @param client Reference to the service client */ constructor(client: SecurityInsights) { this.client = client; } /** * Get geodata for a single IP address * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ipAddress IP address (v4 or v6) to be enriched * @param options The options parameters. */ get( resourceGroupName: string, ipAddress: string, options?: IPGeodataGetOptionalParams ): Promise { return this.client.sendOperationRequest( { resourceGroupName, ipAddress, options }, getOperationSpec ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityInsights/enrichment/ip/geodata/", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.EnrichmentIpGeodata }, default: { bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion, Parameters.ipAddress], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer };