/
domainWhois.ts
71 lines (66 loc) · 2.08 KB
/
domainWhois.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* 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 { DomainWhois } 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 {
DomainWhoisGetOptionalParams,
DomainWhoisGetResponse
} from "../models";
/** Class containing DomainWhois operations. */
export class DomainWhoisImpl implements DomainWhois {
private readonly client: SecurityInsights;
/**
* Initialize a new instance of the class DomainWhois class.
* @param client Reference to the service client
*/
constructor(client: SecurityInsights) {
this.client = client;
}
/**
* Get whois information for a single domain name
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param domain Domain name to be enriched
* @param options The options parameters.
*/
get(
resourceGroupName: string,
domain: string,
options?: DomainWhoisGetOptionalParams
): Promise<DomainWhoisGetResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, domain, options },
getOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityInsights/enrichment/domain/whois/",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.EnrichmentDomainWhois
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion, Parameters.domain],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName
],
headerParameters: [Parameters.accept],
serializer
};