@azure/arm-security
Version:
A generated SDK for SecurityCenter.
82 lines • 2.91 kB
JavaScript
/*
* 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 * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
/** Class containing AdvancedThreatProtection operations. */
export class AdvancedThreatProtectionImpl {
/**
* Initialize a new instance of the class AdvancedThreatProtection class.
* @param client Reference to the service client
*/
constructor(client) {
this.client = client;
}
/**
* Gets the Advanced Threat Protection settings for the specified resource.
* @param resourceId The identifier of the resource.
* @param options The options parameters.
*/
get(resourceId, options) {
return this.client.sendOperationRequest({ resourceId, options }, getOperationSpec);
}
/**
* Creates or updates the Advanced Threat Protection settings on a specified resource.
* @param resourceId The identifier of the resource.
* @param advancedThreatProtectionSetting Advanced Threat Protection Settings
* @param options The options parameters.
*/
create(resourceId, advancedThreatProtectionSetting, options) {
return this.client.sendOperationRequest({ resourceId, advancedThreatProtectionSetting, options }, createOperationSpec);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const getOperationSpec = {
path: "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.AdvancedThreatProtectionSetting
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion4],
urlParameters: [
Parameters.$host,
Parameters.resourceId,
Parameters.settingName
],
headerParameters: [Parameters.accept],
serializer
};
const createOperationSpec = {
path: "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.AdvancedThreatProtectionSetting
},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.advancedThreatProtectionSetting,
queryParameters: [Parameters.apiVersion4],
urlParameters: [
Parameters.$host,
Parameters.resourceId,
Parameters.settingName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
//# sourceMappingURL=advancedThreatProtection.js.map