diff --git a/lib/services/securityManagement/LICENSE.txt b/lib/services/securityManagement/LICENSE.txt index 5431ba98b9..8f3d856145 100644 --- a/lib/services/securityManagement/LICENSE.txt +++ b/lib/services/securityManagement/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/lib/services/securityManagement/README.md b/lib/services/securityManagement/README.md index cd9d0f56ca..25e02710d1 100644 --- a/lib/services/securityManagement/README.md +++ b/lib/services/securityManagement/README.md @@ -3,41 +3,43 @@ uid: azure-arm-security summary: *content --- -# Microsoft Azure SDK for Node.js - SecurityCenter +**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://github.com/Azure/azure-sdk-for-js) which works on Node.js and browsers.** +## Microsoft Azure SDK for Node.js - SecurityCenter + This project provides a Node.js package for accessing Azure. Right now it supports: - **Node.js version 6.x.x or higher** -## Features +### Features -## How to Install +### How to Install ```bash npm install azure-arm-security ``` -## How to use +### How to use -### Authentication, client creation and list pricings as an example. +#### Authentication, client creation, and list regulatoryComplianceStandards as an example. ```javascript const msRestAzure = require("ms-rest-azure"); const SecurityCenter = require("azure-arm-security"); msRestAzure.interactiveLogin().then((creds) => { - const subscriptionId = ""; - const client = new SecurityCenter(creds, subscriptionId); - return client.pricings.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); + const subscriptionId = ""; + const client = new SecurityCenter(creds, subscriptionId); + const resourceGroupName = "testresourceGroupName"; + const filter = "testfilter"; + + return client.regulatoryComplianceStandards.list(resourceGroupName, filter).then((result) => { + console.log("The result is:"); + console.log(result); + }); }).catch((err) => { console.log('An error occurred:'); console.dir(err, {depth: null, colors: true}); }); - -## Related projects +``` +### Related projects - [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-node%2Flib%2Fservices%2FsecurityManagement%2FREADME.png) diff --git a/lib/services/securityManagement/lib/models/aadConnectivityState1.js b/lib/services/securityManagement/lib/models/aadConnectivityState1.js index 348aacf4ce..e6c12ea546 100644 --- a/lib/services/securityManagement/lib/models/aadConnectivityState1.js +++ b/lib/services/securityManagement/lib/models/aadConnectivityState1.js @@ -17,7 +17,7 @@ class AadConnectivityState1 { /** * Create a AadConnectivityState1. - * @member {string} [connectivityState] The connectivity state of the + * @property {string} [connectivityState] The connectivity state of the * external AAD solution . Possible values include: 'Discovered', * 'NotLicensed', 'Connected' */ diff --git a/lib/services/securityManagement/lib/models/aadExternalSecuritySolution.js b/lib/services/securityManagement/lib/models/aadExternalSecuritySolution.js index 59c451177c..5dfbcafc91 100644 --- a/lib/services/securityManagement/lib/models/aadExternalSecuritySolution.js +++ b/lib/services/securityManagement/lib/models/aadExternalSecuritySolution.js @@ -21,13 +21,13 @@ const models = require('./index'); class AadExternalSecuritySolution extends models['ExternalSecuritySolution'] { /** * Create a AadExternalSecuritySolution. - * @member {object} [properties] - * @member {string} [properties.deviceVendor] - * @member {string} [properties.deviceType] - * @member {object} [properties.workspace] - * @member {string} [properties.workspace.id] Azure resource ID of the + * @property {object} [properties] + * @property {string} [properties.deviceVendor] + * @property {string} [properties.deviceType] + * @property {object} [properties.workspace] + * @property {string} [properties.workspace.id] Azure resource ID of the * connected OMS workspace - * @member {string} [properties.connectivityState] Possible values include: + * @property {string} [properties.connectivityState] Possible values include: * 'Discovered', 'NotLicensed', 'Connected' */ constructor() { diff --git a/lib/services/securityManagement/lib/models/aadSolutionProperties.js b/lib/services/securityManagement/lib/models/aadSolutionProperties.js index ab4bf04131..23c704d711 100644 --- a/lib/services/securityManagement/lib/models/aadSolutionProperties.js +++ b/lib/services/securityManagement/lib/models/aadSolutionProperties.js @@ -17,12 +17,12 @@ class AadSolutionProperties { /** * Create a AadSolutionProperties. - * @member {string} [deviceVendor] - * @member {string} [deviceType] - * @member {object} [workspace] - * @member {string} [workspace.id] Azure resource ID of the connected OMS + * @property {string} [deviceVendor] + * @property {string} [deviceType] + * @property {object} [workspace] + * @property {string} [workspace.id] Azure resource ID of the connected OMS * workspace - * @member {string} [connectivityState] The connectivity state of the + * @property {string} [connectivityState] The connectivity state of the * external AAD solution . Possible values include: 'Discovered', * 'NotLicensed', 'Connected' */ diff --git a/lib/services/securityManagement/lib/models/adaptiveNetworkHardening.js b/lib/services/securityManagement/lib/models/adaptiveNetworkHardening.js new file mode 100644 index 0000000000..6d8c084d14 --- /dev/null +++ b/lib/services/securityManagement/lib/models/adaptiveNetworkHardening.js @@ -0,0 +1,116 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The resource whose properties describes the Adaptive Network Hardening + * settings for some Azure resource + * + * @extends models['Resource'] + */ +class AdaptiveNetworkHardening extends models['Resource'] { + /** + * Create a AdaptiveNetworkHardening. + * @property {array} [rules] The security rules which are recommended to be + * effective on the VM + * @property {date} [rulesCalculationTime] The UTC time on which the rules + * were calculated + * @property {array} [effectiveNetworkSecurityGroups] The Network Security + * Groups effective on the network interfaces of the protected resource + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AdaptiveNetworkHardening + * + * @returns {object} metadata of AdaptiveNetworkHardening + * + */ + mapper() { + return { + required: false, + serializedName: 'AdaptiveNetworkHardening', + type: { + name: 'Composite', + className: 'AdaptiveNetworkHardening', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + rules: { + required: false, + serializedName: 'properties.rules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RuleElementType', + type: { + name: 'Composite', + className: 'Rule' + } + } + } + }, + rulesCalculationTime: { + required: false, + serializedName: 'properties.rulesCalculationTime', + type: { + name: 'DateTime' + } + }, + effectiveNetworkSecurityGroups: { + required: false, + serializedName: 'properties.effectiveNetworkSecurityGroups', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'EffectiveNetworkSecurityGroupsElementType', + type: { + name: 'Composite', + className: 'EffectiveNetworkSecurityGroups' + } + } + } + } + } + } + }; + } +} + +module.exports = AdaptiveNetworkHardening; diff --git a/lib/services/securityManagement/lib/models/adaptiveNetworkHardeningEnforceRequest.js b/lib/services/securityManagement/lib/models/adaptiveNetworkHardeningEnforceRequest.js new file mode 100644 index 0000000000..2afacbbbf1 --- /dev/null +++ b/lib/services/securityManagement/lib/models/adaptiveNetworkHardeningEnforceRequest.js @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Class representing a AdaptiveNetworkHardeningEnforceRequest. + */ +class AdaptiveNetworkHardeningEnforceRequest { + /** + * Create a AdaptiveNetworkHardeningEnforceRequest. + * @property {array} rules The rules to enforce + * @property {array} networkSecurityGroups The Azure resource IDs of the + * effective network security groups that will be updated with the created + * security rules from the Adaptive Network Hardening rules + */ + constructor() { + } + + /** + * Defines the metadata of AdaptiveNetworkHardeningEnforceRequest + * + * @returns {object} metadata of AdaptiveNetworkHardeningEnforceRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'AdaptiveNetworkHardeningEnforceRequest', + type: { + name: 'Composite', + className: 'AdaptiveNetworkHardeningEnforceRequest', + modelProperties: { + rules: { + required: true, + serializedName: 'rules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RuleElementType', + type: { + name: 'Composite', + className: 'Rule' + } + } + } + }, + networkSecurityGroups: { + required: true, + serializedName: 'networkSecurityGroups', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = AdaptiveNetworkHardeningEnforceRequest; diff --git a/lib/services/securityManagement/lib/models/adaptiveNetworkHardeningsList.js b/lib/services/securityManagement/lib/models/adaptiveNetworkHardeningsList.js new file mode 100644 index 0000000000..9252952069 --- /dev/null +++ b/lib/services/securityManagement/lib/models/adaptiveNetworkHardeningsList.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response for ListAdaptiveNetworkHardenings API service call + */ +class AdaptiveNetworkHardeningsList extends Array { + /** + * Create a AdaptiveNetworkHardeningsList. + * @property {string} [nextLink] The URL to get the next set of results + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AdaptiveNetworkHardeningsList + * + * @returns {object} metadata of AdaptiveNetworkHardeningsList + * + */ + mapper() { + return { + required: false, + serializedName: 'AdaptiveNetworkHardeningsList', + type: { + name: 'Composite', + className: 'AdaptiveNetworkHardeningsList', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AdaptiveNetworkHardeningElementType', + type: { + name: 'Composite', + className: 'AdaptiveNetworkHardening' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AdaptiveNetworkHardeningsList; diff --git a/lib/services/securityManagement/lib/models/advancedThreatProtectionSetting.js b/lib/services/securityManagement/lib/models/advancedThreatProtectionSetting.js index 72087c6aba..516f188e1b 100644 --- a/lib/services/securityManagement/lib/models/advancedThreatProtectionSetting.js +++ b/lib/services/securityManagement/lib/models/advancedThreatProtectionSetting.js @@ -20,8 +20,8 @@ const models = require('./index'); class AdvancedThreatProtectionSetting extends models['Resource'] { /** * Create a AdvancedThreatProtectionSetting. - * @member {boolean} [isEnabled] Indicates whether Advanced Threat Protection - * is enabled. + * @property {boolean} [isEnabled] Indicates whether Advanced Threat + * Protection is enabled. */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/alert.js b/lib/services/securityManagement/lib/models/alert.js index 88749cc4c9..c395020037 100644 --- a/lib/services/securityManagement/lib/models/alert.js +++ b/lib/services/securityManagement/lib/models/alert.js @@ -20,42 +20,47 @@ const models = require('./index'); class Alert extends models['Resource'] { /** * Create a Alert. - * @member {string} [state] State of the alert (Active, Dismissed etc.) - * @member {date} [reportedTimeUtc] The time the incident was reported to + * @property {string} [state] State of the alert (Active, Dismissed etc.) + * @property {date} [reportedTimeUtc] The time the incident was reported to * Microsoft.Security in UTC - * @member {string} [vendorName] Name of the vendor that discovered the + * @property {string} [vendorName] Name of the vendor that discovered the * incident - * @member {string} [alertName] Name of the alert type - * @member {string} [alertDisplayName] Display name of the alert type - * @member {date} [detectedTimeUtc] The time the incident was detected by the - * vendor - * @member {string} [description] Description of the incident and what it + * @property {string} [alertName] Name of the alert type + * @property {string} [alertDisplayName] Display name of the alert type + * @property {date} [detectedTimeUtc] The time the incident was detected by + * the vendor + * @property {string} [description] Description of the incident and what it * means - * @member {string} [remediationSteps] Recommended steps to reradiate the + * @property {string} [remediationSteps] Recommended steps to reradiate the * incident - * @member {string} [actionTaken] The action that was taken as a response to - * the alert (Active, Blocked etc.) - * @member {string} [reportedSeverity] Estimated severity of this alert - * @member {string} [compromisedEntity] The entity that the incident happened - * on - * @member {string} [associatedResource] Azure resource ID of the associated - * resource - * @member {object} [extendedProperties] - * @member {string} [systemSource] The type of the alerted resource (Azure, + * @property {string} [actionTaken] The action that was taken as a response + * to the alert (Active, Blocked etc.) + * @property {string} [reportedSeverity] Estimated severity of this alert. + * Possible values include: 'Informational', 'Low', 'Medium', 'High' + * @property {string} [compromisedEntity] The entity that the incident + * happened on + * @property {string} [associatedResource] Azure resource ID of the + * associated resource + * @property {object} [extendedProperties] + * @property {string} [systemSource] The type of the alerted resource (Azure, * Non-Azure) - * @member {boolean} [canBeInvestigated] Whether this alert can be + * @property {boolean} [canBeInvestigated] Whether this alert can be * investigated with Azure Security Center - * @member {array} [entities] objects that are related to this alerts - * @member {number} [confidenceScore] level of confidence we have on the + * @property {boolean} [isIncident] Whether this alert is for incident type + * or not (otherwise - single alert) + * @property {array} [entities] objects that are related to this alerts + * @property {number} [confidenceScore] level of confidence we have on the * alert - * @member {array} [confidenceReasons] reasons the alert got the + * @property {array} [confidenceReasons] reasons the alert got the * confidenceScore value - * @member {string} [subscriptionId] Azure subscription ID of the resource + * @property {string} [subscriptionId] Azure subscription ID of the resource * that had the security alert or the subscription ID of the workspace that * this resource reports to - * @member {string} [instanceId] Instance ID of the alert. - * @member {string} [workspaceArmId] Azure resource ID of the workspace that - * the alert was reported to. + * @property {string} [instanceId] Instance ID of the alert. + * @property {string} [workspaceArmId] Azure resource ID of the workspace + * that the alert was reported to. + * @property {string} [correlationKey] Alerts with the same CorrelationKey + * will be grouped together in Ibiza. */ constructor() { super(); @@ -225,6 +230,14 @@ class Alert extends models['Resource'] { name: 'Boolean' } }, + isIncident: { + required: false, + readOnly: true, + serializedName: 'properties.isIncident', + type: { + name: 'Boolean' + } + }, entities: { required: false, serializedName: 'properties.entities', @@ -302,6 +315,14 @@ class Alert extends models['Resource'] { type: { name: 'String' } + }, + correlationKey: { + required: false, + readOnly: true, + serializedName: 'properties.correlationKey', + type: { + name: 'String' + } } } } diff --git a/lib/services/securityManagement/lib/models/alertConfidenceReason.js b/lib/services/securityManagement/lib/models/alertConfidenceReason.js index 05b837a842..e9b9286466 100644 --- a/lib/services/securityManagement/lib/models/alertConfidenceReason.js +++ b/lib/services/securityManagement/lib/models/alertConfidenceReason.js @@ -17,8 +17,8 @@ class AlertConfidenceReason { /** * Create a AlertConfidenceReason. - * @member {string} [type] Type of confidence factor - * @member {string} [reason] description of the confidence reason + * @property {string} [type] Type of confidence factor + * @property {string} [reason] description of the confidence reason */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/alertEntity.js b/lib/services/securityManagement/lib/models/alertEntity.js index c314366704..bc671fcc37 100644 --- a/lib/services/securityManagement/lib/models/alertEntity.js +++ b/lib/services/securityManagement/lib/models/alertEntity.js @@ -17,7 +17,7 @@ class AlertEntity { /** * Create a AlertEntity. - * @member {string} [type] Type of entity + * @property {string} [type] Type of entity */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/alertList.js b/lib/services/securityManagement/lib/models/alertList.js index d3dc06babd..5747823bbc 100644 --- a/lib/services/securityManagement/lib/models/alertList.js +++ b/lib/services/securityManagement/lib/models/alertList.js @@ -16,7 +16,7 @@ class AlertList extends Array { /** * Create a AlertList. - * @member {string} [nextLink] The URI to fetch the next page. + * @property {string} [nextLink] The URI to fetch the next page. */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/allowedConnectionsList.js b/lib/services/securityManagement/lib/models/allowedConnectionsList.js index 7c7cf3c642..3ffe045e48 100644 --- a/lib/services/securityManagement/lib/models/allowedConnectionsList.js +++ b/lib/services/securityManagement/lib/models/allowedConnectionsList.js @@ -16,7 +16,7 @@ class AllowedConnectionsList extends Array { /** * Create a AllowedConnectionsList. - * @member {string} [nextLink] The URI to fetch the next page. + * @property {string} [nextLink] The URI to fetch the next page. */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/allowedConnectionsResource.js b/lib/services/securityManagement/lib/models/allowedConnectionsResource.js index 5e2cf970bf..c77c0879fd 100644 --- a/lib/services/securityManagement/lib/models/allowedConnectionsResource.js +++ b/lib/services/securityManagement/lib/models/allowedConnectionsResource.js @@ -18,13 +18,13 @@ class AllowedConnectionsResource { /** * Create a AllowedConnectionsResource. - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type - * @member {string} [location] Location where the resource is stored - * @member {date} [calculatedDateTime] The UTC time on which the allowed + * @property {string} [id] Resource Id + * @property {string} [name] Resource name + * @property {string} [type] Resource type + * @property {string} [location] Location where the resource is stored + * @property {date} [calculatedDateTime] The UTC time on which the allowed * connections resource was calculated - * @member {array} [connectableResources] List of connectable resources + * @property {array} [connectableResources] List of connectable resources */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/allowlistCustomAlertRule.js b/lib/services/securityManagement/lib/models/allowlistCustomAlertRule.js new file mode 100644 index 0000000000..4451f181ce --- /dev/null +++ b/lib/services/securityManagement/lib/models/allowlistCustomAlertRule.js @@ -0,0 +1,103 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A custom alert rule that checks if a value (depends on the custom alert + * type) is allowed + * + * @extends models['ListCustomAlertRule'] + */ +class AllowlistCustomAlertRule extends models['ListCustomAlertRule'] { + /** + * Create a AllowlistCustomAlertRule. + * @property {array} allowlistValues The values to allow. The format of the + * values depends on the rule type. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AllowlistCustomAlertRule + * + * @returns {object} metadata of AllowlistCustomAlertRule + * + */ + mapper() { + return { + required: false, + serializedName: 'AllowlistCustomAlertRule', + type: { + name: 'Composite', + className: 'AllowlistCustomAlertRule', + modelProperties: { + displayName: { + required: false, + readOnly: true, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'description', + type: { + name: 'String' + } + }, + isEnabled: { + required: true, + serializedName: 'isEnabled', + type: { + name: 'Boolean' + } + }, + ruleType: { + required: true, + serializedName: 'ruleType', + type: { + name: 'String' + } + }, + valueType: { + required: false, + readOnly: true, + serializedName: 'valueType', + type: { + name: 'String' + } + }, + allowlistValues: { + required: true, + serializedName: 'allowlistValues', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = AllowlistCustomAlertRule; diff --git a/lib/services/securityManagement/lib/models/ascLocation.js b/lib/services/securityManagement/lib/models/ascLocation.js index 22219c21b7..debe28a3c6 100644 --- a/lib/services/securityManagement/lib/models/ascLocation.js +++ b/lib/services/securityManagement/lib/models/ascLocation.js @@ -20,7 +20,7 @@ const models = require('./index'); class AscLocation extends models['Resource'] { /** * Create a AscLocation. - * @member {object} [properties] + * @property {object} [properties] */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/ascLocationList.js b/lib/services/securityManagement/lib/models/ascLocationList.js index af27700684..938a0f6e7e 100644 --- a/lib/services/securityManagement/lib/models/ascLocationList.js +++ b/lib/services/securityManagement/lib/models/ascLocationList.js @@ -16,7 +16,7 @@ class AscLocationList extends Array { /** * Create a AscLocationList. - * @member {string} [nextLink] The URI to fetch the next page. + * @property {string} [nextLink] The URI to fetch the next page. */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/ataExternalSecuritySolution.js b/lib/services/securityManagement/lib/models/ataExternalSecuritySolution.js index 3af8920bf4..1795307b42 100644 --- a/lib/services/securityManagement/lib/models/ataExternalSecuritySolution.js +++ b/lib/services/securityManagement/lib/models/ataExternalSecuritySolution.js @@ -20,8 +20,8 @@ const models = require('./index'); class AtaExternalSecuritySolution extends models['ExternalSecuritySolution'] { /** * Create a AtaExternalSecuritySolution. - * @member {object} [properties] - * @member {string} [properties.lastEventReceived] + * @property {object} [properties] + * @property {string} [properties.lastEventReceived] */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/ataSolutionProperties.js b/lib/services/securityManagement/lib/models/ataSolutionProperties.js index 6257db3058..61e1c4284b 100644 --- a/lib/services/securityManagement/lib/models/ataSolutionProperties.js +++ b/lib/services/securityManagement/lib/models/ataSolutionProperties.js @@ -20,7 +20,7 @@ const models = require('./index'); class AtaSolutionProperties extends models['ExternalSecuritySolutionProperties'] { /** * Create a AtaSolutionProperties. - * @member {string} [lastEventReceived] + * @property {string} [lastEventReceived] */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/autoProvisioningSetting.js b/lib/services/securityManagement/lib/models/autoProvisioningSetting.js index 87afc3136a..8c6907cfba 100644 --- a/lib/services/securityManagement/lib/models/autoProvisioningSetting.js +++ b/lib/services/securityManagement/lib/models/autoProvisioningSetting.js @@ -20,7 +20,7 @@ const models = require('./index'); class AutoProvisioningSetting extends models['Resource'] { /** * Create a AutoProvisioningSetting. - * @member {string} autoProvision Describes what kind of security agent + * @property {string} autoProvision Describes what kind of security agent * provisioning action to take. Possible values include: 'On', 'Off' */ constructor() { diff --git a/lib/services/securityManagement/lib/models/autoProvisioningSettingList.js b/lib/services/securityManagement/lib/models/autoProvisioningSettingList.js index f7cfe0b985..38ae123485 100644 --- a/lib/services/securityManagement/lib/models/autoProvisioningSettingList.js +++ b/lib/services/securityManagement/lib/models/autoProvisioningSettingList.js @@ -16,7 +16,7 @@ class AutoProvisioningSettingList extends Array { /** * Create a AutoProvisioningSettingList. - * @member {string} [nextLink] The URI to fetch the next page. + * @property {string} [nextLink] The URI to fetch the next page. */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/cefExternalSecuritySolution.js b/lib/services/securityManagement/lib/models/cefExternalSecuritySolution.js index 948150931d..ae3f291585 100644 --- a/lib/services/securityManagement/lib/models/cefExternalSecuritySolution.js +++ b/lib/services/securityManagement/lib/models/cefExternalSecuritySolution.js @@ -20,10 +20,10 @@ const models = require('./index'); class CefExternalSecuritySolution extends models['ExternalSecuritySolution'] { /** * Create a CefExternalSecuritySolution. - * @member {object} [properties] - * @member {string} [properties.hostname] - * @member {string} [properties.agent] - * @member {string} [properties.lastEventReceived] + * @property {object} [properties] + * @property {string} [properties.hostname] + * @property {string} [properties.agent] + * @property {string} [properties.lastEventReceived] */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/cefSolutionProperties.js b/lib/services/securityManagement/lib/models/cefSolutionProperties.js index 2efdc15360..6e409e5bf7 100644 --- a/lib/services/securityManagement/lib/models/cefSolutionProperties.js +++ b/lib/services/securityManagement/lib/models/cefSolutionProperties.js @@ -20,9 +20,9 @@ const models = require('./index'); class CefSolutionProperties extends models['ExternalSecuritySolutionProperties'] { /** * Create a CefSolutionProperties. - * @member {string} [hostname] - * @member {string} [agent] - * @member {string} [lastEventReceived] + * @property {string} [hostname] + * @property {string} [agent] + * @property {string} [lastEventReceived] */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/compliance.js b/lib/services/securityManagement/lib/models/compliance.js index f0f1157fe2..3e2dfa9bfb 100644 --- a/lib/services/securityManagement/lib/models/compliance.js +++ b/lib/services/securityManagement/lib/models/compliance.js @@ -20,12 +20,12 @@ const models = require('./index'); class Compliance extends models['Resource'] { /** * Create a Compliance. - * @member {date} [assessmentTimestampUtcDate] The timestamp when the + * @property {date} [assessmentTimestampUtcDate] The timestamp when the * Compliance calculation was conducted. - * @member {number} [resourceCount] The resource count of the given + * @property {number} [resourceCount] The resource count of the given * subscription for which the Compliance calculation was conducted (needed * for Management Group Compliance calculation). - * @member {array} [assessmentResult] An array of segment, which is the + * @property {array} [assessmentResult] An array of segment, which is the * actually the compliance assessment. */ constructor() { diff --git a/lib/services/securityManagement/lib/models/complianceList.js b/lib/services/securityManagement/lib/models/complianceList.js index da7c9b3822..a014696259 100644 --- a/lib/services/securityManagement/lib/models/complianceList.js +++ b/lib/services/securityManagement/lib/models/complianceList.js @@ -16,7 +16,7 @@ class ComplianceList extends Array { /** * Create a ComplianceList. - * @member {string} [nextLink] The URI to fetch the next page. + * @property {string} [nextLink] The URI to fetch the next page. */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/complianceSegment.js b/lib/services/securityManagement/lib/models/complianceSegment.js index c33dd4a4e1..02bf54e17c 100644 --- a/lib/services/securityManagement/lib/models/complianceSegment.js +++ b/lib/services/securityManagement/lib/models/complianceSegment.js @@ -17,9 +17,9 @@ class ComplianceSegment { /** * Create a ComplianceSegment. - * @member {string} [segmentType] The segment type, e.g. compliant, + * @property {string} [segmentType] The segment type, e.g. compliant, * non-compliance, insufficient coverage, N/A, etc. - * @member {number} [percentage] The size (%) of the segment. + * @property {number} [percentage] The size (%) of the segment. */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/connectableResource.js b/lib/services/securityManagement/lib/models/connectableResource.js index 29f7c08bce..97c012eb2b 100644 --- a/lib/services/securityManagement/lib/models/connectableResource.js +++ b/lib/services/securityManagement/lib/models/connectableResource.js @@ -17,10 +17,10 @@ class ConnectableResource { /** * Create a ConnectableResource. - * @member {string} [id] The Azure resource id - * @member {array} [inboundConnectedResources] The list of Azure resources + * @property {string} [id] The Azure resource id + * @property {array} [inboundConnectedResources] The list of Azure resources * that the resource has inbound allowed connection from - * @member {array} [outboundConnectedResources] The list of Azure resources + * @property {array} [outboundConnectedResources] The list of Azure resources * that the resource has outbound allowed connection to */ constructor() { diff --git a/lib/services/securityManagement/lib/models/connectedResource.js b/lib/services/securityManagement/lib/models/connectedResource.js index 06a6399542..95fe90fcb9 100644 --- a/lib/services/securityManagement/lib/models/connectedResource.js +++ b/lib/services/securityManagement/lib/models/connectedResource.js @@ -17,10 +17,10 @@ class ConnectedResource { /** * Create a ConnectedResource. - * @member {string} [connectedResourceId] The Azure resource id of the + * @property {string} [connectedResourceId] The Azure resource id of the * connected resource - * @member {string} [tcpPorts] The allowed tcp ports - * @member {string} [udpPorts] The allowed udp ports + * @property {string} [tcpPorts] The allowed tcp ports + * @property {string} [udpPorts] The allowed udp ports */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/connectedWorkspace.js b/lib/services/securityManagement/lib/models/connectedWorkspace.js index d2c7e8276a..5738e817a6 100644 --- a/lib/services/securityManagement/lib/models/connectedWorkspace.js +++ b/lib/services/securityManagement/lib/models/connectedWorkspace.js @@ -17,7 +17,7 @@ class ConnectedWorkspace { /** * Create a ConnectedWorkspace. - * @member {string} [id] Azure resource ID of the connected OMS workspace + * @property {string} [id] Azure resource ID of the connected OMS workspace */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/customAlertRule.js b/lib/services/securityManagement/lib/models/customAlertRule.js new file mode 100644 index 0000000000..15cf1bb4a3 --- /dev/null +++ b/lib/services/securityManagement/lib/models/customAlertRule.js @@ -0,0 +1,78 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A custom alert rule + * + */ +class CustomAlertRule { + /** + * Create a CustomAlertRule. + * @property {string} [displayName] The display name of the custom alert. + * @property {string} [description] The description of the custom alert. + * @property {boolean} isEnabled Whether the custom alert is enabled. + * @property {string} ruleType The type of the custom alert rule. + */ + constructor() { + } + + /** + * Defines the metadata of CustomAlertRule + * + * @returns {object} metadata of CustomAlertRule + * + */ + mapper() { + return { + required: false, + serializedName: 'CustomAlertRule', + type: { + name: 'Composite', + className: 'CustomAlertRule', + modelProperties: { + displayName: { + required: false, + readOnly: true, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'description', + type: { + name: 'String' + } + }, + isEnabled: { + required: true, + serializedName: 'isEnabled', + type: { + name: 'Boolean' + } + }, + ruleType: { + required: true, + serializedName: 'ruleType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CustomAlertRule; diff --git a/lib/services/securityManagement/lib/models/dataExportSetting.js b/lib/services/securityManagement/lib/models/dataExportSetting.js index 3641d31a83..cd688e51fa 100644 --- a/lib/services/securityManagement/lib/models/dataExportSetting.js +++ b/lib/services/securityManagement/lib/models/dataExportSetting.js @@ -20,7 +20,7 @@ const models = require('./index'); class DataExportSetting extends models['Setting'] { /** * Create a DataExportSetting. - * @member {boolean} enabled Is the data export setting is enabled + * @property {boolean} enabled Is the data export setting is enabled */ constructor() { super(); @@ -38,11 +38,6 @@ class DataExportSetting extends models['Setting'] { serializedName: 'DataExportSetting', type: { name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'kind', - clientName: 'kind' - }, - uberParent: 'Setting', className: 'DataExportSetting', modelProperties: { id: { @@ -72,7 +67,6 @@ class DataExportSetting extends models['Setting'] { kind: { required: true, serializedName: 'kind', - isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/securityManagement/lib/models/denylistCustomAlertRule.js b/lib/services/securityManagement/lib/models/denylistCustomAlertRule.js new file mode 100644 index 0000000000..c6ed2a3a5d --- /dev/null +++ b/lib/services/securityManagement/lib/models/denylistCustomAlertRule.js @@ -0,0 +1,103 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A custom alert rule that checks if a value (depends on the custom alert + * type) is denied + * + * @extends models['ListCustomAlertRule'] + */ +class DenylistCustomAlertRule extends models['ListCustomAlertRule'] { + /** + * Create a DenylistCustomAlertRule. + * @property {array} denylistValues The values to deny. The format of the + * values depends on the rule type. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DenylistCustomAlertRule + * + * @returns {object} metadata of DenylistCustomAlertRule + * + */ + mapper() { + return { + required: false, + serializedName: 'DenylistCustomAlertRule', + type: { + name: 'Composite', + className: 'DenylistCustomAlertRule', + modelProperties: { + displayName: { + required: false, + readOnly: true, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'description', + type: { + name: 'String' + } + }, + isEnabled: { + required: true, + serializedName: 'isEnabled', + type: { + name: 'Boolean' + } + }, + ruleType: { + required: true, + serializedName: 'ruleType', + type: { + name: 'String' + } + }, + valueType: { + required: false, + readOnly: true, + serializedName: 'valueType', + type: { + name: 'String' + } + }, + denylistValues: { + required: true, + serializedName: 'denylistValues', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = DenylistCustomAlertRule; diff --git a/lib/services/securityManagement/lib/models/deviceSecurityGroup.js b/lib/services/securityManagement/lib/models/deviceSecurityGroup.js new file mode 100644 index 0000000000..a137b58229 --- /dev/null +++ b/lib/services/securityManagement/lib/models/deviceSecurityGroup.js @@ -0,0 +1,138 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The device security group resource + * + * @extends models['Resource'] + */ +class DeviceSecurityGroup extends models['Resource'] { + /** + * Create a DeviceSecurityGroup. + * @property {array} [thresholdRules] A list of threshold custom alert rules. + * @property {array} [timeWindowRules] A list of time window custom alert + * rules. + * @property {array} [allowlistRules] A list of allow-list custom alert + * rules. + * @property {array} [denylistRules] A list of deny-list custom alert rules. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeviceSecurityGroup + * + * @returns {object} metadata of DeviceSecurityGroup + * + */ + mapper() { + return { + required: false, + serializedName: 'DeviceSecurityGroup', + type: { + name: 'Composite', + className: 'DeviceSecurityGroup', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + thresholdRules: { + required: false, + serializedName: 'properties.thresholdRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ThresholdCustomAlertRuleElementType', + type: { + name: 'Composite', + className: 'ThresholdCustomAlertRule' + } + } + } + }, + timeWindowRules: { + required: false, + serializedName: 'properties.timeWindowRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TimeWindowCustomAlertRuleElementType', + type: { + name: 'Composite', + className: 'TimeWindowCustomAlertRule' + } + } + } + }, + allowlistRules: { + required: false, + serializedName: 'properties.allowlistRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AllowlistCustomAlertRuleElementType', + type: { + name: 'Composite', + className: 'AllowlistCustomAlertRule' + } + } + } + }, + denylistRules: { + required: false, + serializedName: 'properties.denylistRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DenylistCustomAlertRuleElementType', + type: { + name: 'Composite', + className: 'DenylistCustomAlertRule' + } + } + } + } + } + } + }; + } +} + +module.exports = DeviceSecurityGroup; diff --git a/lib/services/securityManagement/lib/models/deviceSecurityGroupList.js b/lib/services/securityManagement/lib/models/deviceSecurityGroupList.js new file mode 100644 index 0000000000..f804a7301b --- /dev/null +++ b/lib/services/securityManagement/lib/models/deviceSecurityGroupList.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * List of device security groups + */ +class DeviceSecurityGroupList extends Array { + /** + * Create a DeviceSecurityGroupList. + * @property {string} [nextLink] The URI to fetch the next page. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeviceSecurityGroupList + * + * @returns {object} metadata of DeviceSecurityGroupList + * + */ + mapper() { + return { + required: false, + serializedName: 'DeviceSecurityGroupList', + type: { + name: 'Composite', + className: 'DeviceSecurityGroupList', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DeviceSecurityGroupElementType', + type: { + name: 'Composite', + className: 'DeviceSecurityGroup' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DeviceSecurityGroupList; diff --git a/lib/services/securityManagement/lib/models/discoveredSecuritySolution.js b/lib/services/securityManagement/lib/models/discoveredSecuritySolution.js index 1a8681dab8..f3ea919215 100644 --- a/lib/services/securityManagement/lib/models/discoveredSecuritySolution.js +++ b/lib/services/securityManagement/lib/models/discoveredSecuritySolution.js @@ -16,15 +16,15 @@ class DiscoveredSecuritySolution { /** * Create a DiscoveredSecuritySolution. - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type - * @member {string} [location] Location where the resource is stored - * @member {string} securityFamily The security family of the discovered + * @property {string} [id] Resource Id + * @property {string} [name] Resource name + * @property {string} [type] Resource type + * @property {string} [location] Location where the resource is stored + * @property {string} securityFamily The security family of the discovered * solution. Possible values include: 'Waf', 'Ngfw', 'SaasWaf', 'Va' - * @member {string} offer The security solutions' image offer - * @member {string} publisher The security solutions' image publisher - * @member {string} sku The security solutions' image sku + * @property {string} offer The security solutions' image offer + * @property {string} publisher The security solutions' image publisher + * @property {string} sku The security solutions' image sku */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/discoveredSecuritySolutionList.js b/lib/services/securityManagement/lib/models/discoveredSecuritySolutionList.js index 4f792818a8..a74121a811 100644 --- a/lib/services/securityManagement/lib/models/discoveredSecuritySolutionList.js +++ b/lib/services/securityManagement/lib/models/discoveredSecuritySolutionList.js @@ -16,7 +16,7 @@ class DiscoveredSecuritySolutionList extends Array { /** * Create a DiscoveredSecuritySolutionList. - * @member {string} [nextLink] The URI to fetch the next page. + * @property {string} [nextLink] The URI to fetch the next page. */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/effectiveNetworkSecurityGroups.js b/lib/services/securityManagement/lib/models/effectiveNetworkSecurityGroups.js new file mode 100644 index 0000000000..d2d3f84b9c --- /dev/null +++ b/lib/services/securityManagement/lib/models/effectiveNetworkSecurityGroups.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes the Network Security Groups effective on a network interface + * + */ +class EffectiveNetworkSecurityGroups { + /** + * Create a EffectiveNetworkSecurityGroups. + * @property {string} [networkInterface] The Azure resource ID of the network + * interface + * @property {array} [networkSecurityGroups] The Network Security Groups + * effective on the network interface + */ + constructor() { + } + + /** + * Defines the metadata of EffectiveNetworkSecurityGroups + * + * @returns {object} metadata of EffectiveNetworkSecurityGroups + * + */ + mapper() { + return { + required: false, + serializedName: 'EffectiveNetworkSecurityGroups', + type: { + name: 'Composite', + className: 'EffectiveNetworkSecurityGroups', + modelProperties: { + networkInterface: { + required: false, + serializedName: 'networkInterface', + type: { + name: 'String' + } + }, + networkSecurityGroups: { + required: false, + serializedName: 'networkSecurityGroups', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = EffectiveNetworkSecurityGroups; diff --git a/lib/services/securityManagement/lib/models/externalSecuritySolution.js b/lib/services/securityManagement/lib/models/externalSecuritySolution.js index 622d25b092..2c0a779b01 100644 --- a/lib/services/securityManagement/lib/models/externalSecuritySolution.js +++ b/lib/services/securityManagement/lib/models/externalSecuritySolution.js @@ -12,18 +12,18 @@ /** * Represents a security solution external to Azure Security Center which sends - * information to an OMS workspace and whos data is displayed by Azure Security - * Center. + * information to an OMS workspace and whose data is displayed by Azure + * Security Center. * */ class ExternalSecuritySolution { /** * Create a ExternalSecuritySolution. - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type - * @member {string} [location] Location where the resource is stored - * @member {string} kind Polymorphic Discriminator + * @property {string} [id] Resource Id + * @property {string} [name] Resource name + * @property {string} [type] Resource type + * @property {string} [location] Location where the resource is stored + * @property {string} kind Polymorphic Discriminator */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/externalSecuritySolutionKind1.js b/lib/services/securityManagement/lib/models/externalSecuritySolutionKind1.js index 599960a5ed..d5d5a03e70 100644 --- a/lib/services/securityManagement/lib/models/externalSecuritySolutionKind1.js +++ b/lib/services/securityManagement/lib/models/externalSecuritySolutionKind1.js @@ -17,8 +17,8 @@ class ExternalSecuritySolutionKind1 { /** * Create a ExternalSecuritySolutionKind1. - * @member {string} [kind] The kind of the external solution. Possible values - * include: 'CEF', 'ATA', 'AAD' + * @property {string} [kind] The kind of the external solution. Possible + * values include: 'CEF', 'ATA', 'AAD' */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/externalSecuritySolutionList.js b/lib/services/securityManagement/lib/models/externalSecuritySolutionList.js index 8ebc08dc7b..5a34fa928c 100644 --- a/lib/services/securityManagement/lib/models/externalSecuritySolutionList.js +++ b/lib/services/securityManagement/lib/models/externalSecuritySolutionList.js @@ -16,7 +16,7 @@ class ExternalSecuritySolutionList extends Array { /** * Create a ExternalSecuritySolutionList. - * @member {string} [nextLink] The URI to fetch the next page. + * @property {string} [nextLink] The URI to fetch the next page. */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/externalSecuritySolutionProperties.js b/lib/services/securityManagement/lib/models/externalSecuritySolutionProperties.js index 429a32a6a8..1bf4a1748d 100644 --- a/lib/services/securityManagement/lib/models/externalSecuritySolutionProperties.js +++ b/lib/services/securityManagement/lib/models/externalSecuritySolutionProperties.js @@ -17,10 +17,10 @@ class ExternalSecuritySolutionProperties { /** * Create a ExternalSecuritySolutionProperties. - * @member {string} [deviceVendor] - * @member {string} [deviceType] - * @member {object} [workspace] - * @member {string} [workspace.id] Azure resource ID of the connected OMS + * @property {string} [deviceVendor] + * @property {string} [deviceType] + * @property {object} [workspace] + * @property {string} [workspace.id] Azure resource ID of the connected OMS * workspace */ constructor() { diff --git a/lib/services/securityManagement/lib/models/index.d.ts b/lib/services/securityManagement/lib/models/index.d.ts index d12fa7ba87..b68a4e4570 100644 --- a/lib/services/securityManagement/lib/models/index.d.ts +++ b/lib/services/securityManagement/lib/models/index.d.ts @@ -1,789 +1,946 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource } from 'ms-rest-azure'; -import { CloudError } from 'ms-rest-azure'; -import * as moment from 'moment'; +import { BaseResource, CloudError } from "ms-rest-azure"; +import * as moment from "moment"; -export { BaseResource } from 'ms-rest-azure'; -export { CloudError } from 'ms-rest-azure'; +export { + BaseResource, + CloudError +}; /** - * @class - * Initializes a new instance of the Resource class. - * @constructor * Describes an Azure resource. - * - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type */ export interface Resource extends BaseResource { + /** + * Resource Id + */ readonly id?: string; + /** + * Resource name + */ readonly name?: string; + /** + * Resource type + */ readonly type?: string; } /** - * @class - * Initializes a new instance of the Kind class. - * @constructor - * Describes an Azure resource with kind - * - * @member {string} [kind] Kind of the resource + * Regulatory compliance standard details and state */ -export interface Kind { - kind?: string; +export interface RegulatoryComplianceStandard extends Resource { + /** + * Aggregative state based on the standard's supported controls states. Possible values include: + * 'Passed', 'Failed', 'Skipped', 'Unsupported' + */ + state?: string; + /** + * The number of supported regulatory compliance controls of the given standard with a passed + * state + */ + readonly passedControls?: number; + /** + * The number of supported regulatory compliance controls of the given standard with a failed + * state + */ + readonly failedControls?: number; + /** + * The number of supported regulatory compliance controls of the given standard with a skipped + * state + */ + readonly skippedControls?: number; + /** + * The number of regulatory compliance controls of the given standard which are unsupported by + * automated assessments + */ + readonly unsupportedControls?: number; } /** - * @class - * Initializes a new instance of the SecurityContact class. - * @constructor - * Contact details for security issues - * - * @member {string} email The email of this security contact - * @member {string} [phone] The phone number of this security contact - * @member {string} alertNotifications Whether to send security alerts - * notifications to the security contact. Possible values include: 'On', 'Off' - * @member {string} alertsToAdmins Whether to send security alerts - * notifications to subscription admins. Possible values include: 'On', 'Off' + * Regulatory compliance control details and state */ -export interface SecurityContact extends Resource { - email: string; - phone?: string; - alertNotifications: string; - alertsToAdmins: string; +export interface RegulatoryComplianceControl extends Resource { + /** + * The description of the regulatory compliance control + */ + readonly description?: string; + /** + * Aggregative state based on the control's supported assessments states. Possible values + * include: 'Passed', 'Failed', 'Skipped', 'Unsupported' + */ + state?: string; + /** + * The number of supported regulatory compliance assessments of the given control with a passed + * state + */ + readonly passedAssessments?: number; + /** + * The number of supported regulatory compliance assessments of the given control with a failed + * state + */ + readonly failedAssessments?: number; + /** + * The number of supported regulatory compliance assessments of the given control with a skipped + * state + */ + readonly skippedAssessments?: number; } /** - * @class - * Initializes a new instance of the Pricing class. - * @constructor - * Pricing tier will be applied for the scope based on the resource ID - * - * @member {string} pricingTier Pricing tier type. Possible values include: - * 'Free', 'Standard' + * Regulatory compliance assessment details and state + */ +export interface RegulatoryComplianceAssessment extends Resource { + /** + * The description of the regulatory compliance assessment + */ + readonly description?: string; + /** + * The expected type of assessment contained in the AssessmentDetailsLink + */ + readonly assessmentType?: string; + /** + * Link to more detailed assessment results data. The response type will be according to the + * assessmentType field + */ + readonly assessmentDetailsLink?: string; + /** + * Aggregative state based on the assessment's scanned resources states. Possible values include: + * 'Passed', 'Failed', 'Skipped', 'Unsupported' + */ + state?: string; + /** + * The given assessment's related resources count with passed state. + */ + readonly passedResources?: number; + /** + * The given assessment's related resources count with failed state. + */ + readonly failedResources?: number; + /** + * The given assessment's related resources count with skipped state. + */ + readonly skippedResources?: number; + /** + * The given assessment's related resources count with unsupported state. + */ + readonly unsupportedResources?: number; +} + +/** + * The ASC location of the subscription is in the "name" field */ +export interface AscLocation extends Resource { + properties?: any; +} + +/** + * Pricing tier will be applied for the scope based on the resource ID +*/ export interface Pricing extends Resource { + /** + * The pricing tier value. Possible values include: 'Free', 'Standard' + */ pricingTier: string; + /** + * The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. + * P3Y6M4DT12H30M5S). + */ + readonly freeTrialRemainingTime?: moment.Duration; +} + +/** + * List of pricing configurations response +*/ +export interface PricingList { + /** + * List of pricing configurations + */ + value: Pricing[]; +} + +/** + * Contact details for security issues +*/ +export interface SecurityContact extends Resource { + /** + * The email of this security contact + */ + email: string; + /** + * The phone number of this security contact + */ + phone?: string; + /** + * Whether to send security alerts notifications to the security contact. Possible values + * include: 'On', 'Off' + */ + alertNotifications: string; + /** + * Whether to send security alerts notifications to subscription admins. Possible values include: + * 'On', 'Off' + */ + alertsToAdmins: string; } /** - * @class - * Initializes a new instance of the WorkspaceSetting class. - * @constructor * Configures where to store the OMS agent data for workspaces under a scope - * - * @member {string} workspaceId The full Azure ID of the workspace to save the - * data in - * @member {string} scope All the VMs in this scope will send their security - * data to the mentioned workspace unless overridden by a setting with more - * specific scope - */ +*/ export interface WorkspaceSetting extends Resource { + /** + * The full Azure ID of the workspace to save the data in + */ workspaceId: string; + /** + * All the VMs in this scope will send their security data to the mentioned workspace unless + * overridden by a setting with more specific scope + */ scope: string; } /** - * @class - * Initializes a new instance of the AutoProvisioningSetting class. - * @constructor * Auto provisioning setting - * - * @member {string} autoProvision Describes what kind of security agent - * provisioning action to take. Possible values include: 'On', 'Off' - */ +*/ export interface AutoProvisioningSetting extends Resource { + /** + * Describes what kind of security agent provisioning action to take. Possible values include: + * 'On', 'Off' + */ autoProvision: string; } /** - * @class - * Initializes a new instance of the ComplianceSegment class. - * @constructor * A segment of a compliance assessment. - * - * @member {string} [segmentType] The segment type, e.g. compliant, - * non-compliance, insufficient coverage, N/A, etc. - * @member {number} [percentage] The size (%) of the segment. - */ +*/ export interface ComplianceSegment { + /** + * The segment type, e.g. compliant, non-compliance, insufficient coverage, N/A, etc. + */ readonly segmentType?: string; + /** + * The size (%) of the segment. + */ readonly percentage?: number; } /** - * @class - * Initializes a new instance of the Compliance class. - * @constructor * Compliance of a scope - * - * @member {date} [assessmentTimestampUtcDate] The timestamp when the - * Compliance calculation was conducted. - * @member {number} [resourceCount] The resource count of the given - * subscription for which the Compliance calculation was conducted (needed for - * Management Group Compliance calculation). - * @member {array} [assessmentResult] An array of segment, which is the - * actually the compliance assessment. - */ +*/ export interface Compliance extends Resource { + /** + * The timestamp when the Compliance calculation was conducted. + */ readonly assessmentTimestampUtcDate?: Date; + /** + * The resource count of the given subscription for which the Compliance calculation was + * conducted (needed for Management Group Compliance calculation). + */ readonly resourceCount?: number; + /** + * An array of segment, which is the actually the compliance assessment. + */ readonly assessmentResult?: ComplianceSegment[]; } /** - * @class - * Initializes a new instance of the AdvancedThreatProtectionSetting class. - * @constructor * The Advanced Threat Protection resource. - * - * @member {boolean} [isEnabled] Indicates whether Advanced Threat Protection - * is enabled. - */ +*/ export interface AdvancedThreatProtectionSetting extends Resource { + /** + * Indicates whether Advanced Threat Protection is enabled. + */ isEnabled?: boolean; } /** - * @class - * Initializes a new instance of the Setting class. - * @constructor - * Represents a security setting in Azure Security Center. - * - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type - * @member {string} kind Polymorphic Discriminator - */ -export interface Setting { - readonly id?: string; - readonly name?: string; - readonly type?: string; - kind: string; + * A custom alert rule +*/ +export interface CustomAlertRule { + /** + * The display name of the custom alert. + */ + readonly displayName?: string; + /** + * The description of the custom alert. + */ + readonly description?: string; + /** + * Whether the custom alert is enabled. + */ + isEnabled: boolean; + /** + * The type of the custom alert rule. + */ + ruleType: string; } /** - * @class - * Initializes a new instance of the DataExportSetting class. - * @constructor - * Represents a data export setting - * - * @member {boolean} enabled Is the data export setting is enabled - */ -export interface DataExportSetting extends Setting { - enabled: boolean; + * A custom alert rule that checks if a value (depends on the custom alert type) is within the + * given range. +*/ +export interface ThresholdCustomAlertRule extends CustomAlertRule { + /** + * The minimum threshold. + */ + minThreshold: number; + /** + * The maximum threshold. + */ + maxThreshold: number; +} + +/** + * A custom alert rule that checks if the number of activities (depends on the custom alert type) + * in a time window is within the given range. +*/ +export interface TimeWindowCustomAlertRule { + /** + * The display name of the custom alert. + */ + readonly displayName?: string; + /** + * The description of the custom alert. + */ + readonly description?: string; + /** + * Whether the custom alert is enabled. + */ + isEnabled: boolean; + /** + * The type of the custom alert rule. + */ + ruleType: string; + /** + * The minimum threshold. + */ + minThreshold: number; + /** + * The maximum threshold. + */ + maxThreshold: number; + /** + * The time window size in iso8601 format. + */ + timeWindowSize: moment.Duration; +} + +/** + * A List custom alert rule +*/ +export interface ListCustomAlertRule extends CustomAlertRule { + /** + * The value type of the items in the list. Possible values include: 'IpCidr', 'String' + */ + readonly valueType?: string; +} + +/** + * A custom alert rule that checks if a value (depends on the custom alert type) is allowed +*/ +export interface AllowlistCustomAlertRule extends ListCustomAlertRule { + /** + * The values to allow. The format of the values depends on the rule type. + */ + allowlistValues: string[]; +} + +/** + * A custom alert rule that checks if a value (depends on the custom alert type) is denied +*/ +export interface DenylistCustomAlertRule extends ListCustomAlertRule { + /** + * The values to deny. The format of the values depends on the rule type. + */ + denylistValues: string[]; +} + +/** + * The device security group resource +*/ +export interface DeviceSecurityGroup extends Resource { + /** + * A list of threshold custom alert rules. + */ + thresholdRules?: ThresholdCustomAlertRule[]; + /** + * A list of time window custom alert rules. + */ + timeWindowRules?: TimeWindowCustomAlertRule[]; + /** + * A list of allow-list custom alert rules. + */ + allowlistRules?: AllowlistCustomAlertRule[]; + /** + * A list of deny-list custom alert rules. + */ + denylistRules?: DenylistCustomAlertRule[]; } /** - * @class - * Initializes a new instance of the SettingKind1 class. - * @constructor * The kind of the security setting - * - * @member {string} [kind] the kind of the settings string. Possible values - * include: 'DataExportSetting' - */ -export interface SettingKind1 { - kind?: string; +*/ +export interface SettingResource extends Resource { + /** + * the kind of the settings string (DataExportSetting). Possible values include: + * 'DataExportSetting', 'AlertSuppressionSetting' + */ + kind: string; +} + +/** + * Represents a security setting in Azure Security Center. +*/ +export interface Setting extends SettingResource { +} + +/** + * Represents a data export setting +*/ +export interface DataExportSetting extends Setting { + /** + * Is the data export setting is enabled + */ + enabled: boolean; } /** - * @class - * Initializes a new instance of the SensitivityLabel class. - * @constructor * The sensitivity label. - * - * @member {string} [displayName] The name of the sensitivity label. - * @member {number} [order] The order of the sensitivity label. - * @member {boolean} [enabled] Indicates whether the label is enabled or not. - */ +*/ export interface SensitivityLabel { + /** + * The name of the sensitivity label. + */ displayName?: string; + /** + * The order of the sensitivity label. + */ order?: number; + /** + * Indicates whether the label is enabled or not. + */ enabled?: boolean; } /** - * @class - * Initializes a new instance of the InformationProtectionKeyword class. - * @constructor * The information type keyword. - * - * @member {string} [pattern] The keyword pattern. - * @member {boolean} [custom] Indicates whether the keyword is custom or not. - * @member {boolean} [canBeNumeric] Indicates whether the keyword can be - * applied on numeric types or not. - * @member {boolean} [excluded] Indicates whether the keyword is excluded or - * not. - */ +*/ export interface InformationProtectionKeyword { + /** + * The keyword pattern. + */ pattern?: string; + /** + * Indicates whether the keyword is custom or not. + */ custom?: boolean; + /** + * Indicates whether the keyword can be applied on numeric types or not. + */ canBeNumeric?: boolean; + /** + * Indicates whether the keyword is excluded or not. + */ excluded?: boolean; } /** - * @class - * Initializes a new instance of the InformationType class. - * @constructor * The information type. - * - * @member {string} [displayName] The name of the information type. - * @member {number} [order] The order of the information type. - * @member {uuid} [recommendedLabelId] The recommended label id to be - * associated with this information type. - * @member {boolean} [enabled] Indicates whether the information type is - * enabled or not. - * @member {boolean} [custom] Indicates whether the information type is custom - * or not. - * @member {array} [keywords] The information type keywords. - */ +*/ export interface InformationType { + /** + * The name of the information type. + */ displayName?: string; + /** + * The order of the information type. + */ order?: number; + /** + * The recommended label id to be associated with this information type. + */ recommendedLabelId?: string; + /** + * Indicates whether the information type is enabled or not. + */ enabled?: boolean; + /** + * Indicates whether the information type is custom or not. + */ custom?: boolean; + /** + * The information type keywords. + */ keywords?: InformationProtectionKeyword[]; } /** - * @class - * Initializes a new instance of the InformationProtectionPolicy class. - * @constructor * Information protection policy. - * - * @member {date} [lastModifiedUtc] Describes the last UTC time the policy was - * modified. - * @member {object} [labels] Dictionary of sensitivity labels. - * @member {object} [informationTypes] The sensitivity information types. - */ +*/ export interface InformationProtectionPolicy extends Resource { + /** + * Describes the last UTC time the policy was modified. + */ readonly lastModifiedUtc?: Date; + /** + * Dictionary of sensitivity labels. + */ labels?: { [propertyName: string]: SensitivityLabel }; + /** + * The sensitivity information types. + */ informationTypes?: { [propertyName: string]: InformationType }; } /** - * @class - * Initializes a new instance of the Location class. - * @constructor - * Describes an Azure resource with location - * - * @member {string} [location] Location where the resource is stored - */ -export interface Location { - readonly location?: string; -} - -/** - * @class - * Initializes a new instance of the OperationDisplay class. - * @constructor * Security operation display - * - * @member {string} [provider] The resource provider for the operation. - * @member {string} [resource] The display name of the resource the operation - * applies to. - * @member {string} [operation] The display name of the security operation. - * @member {string} [description] The description of the operation. - */ +*/ export interface OperationDisplay { + /** + * The resource provider for the operation. + */ readonly provider?: string; + /** + * The display name of the resource the operation applies to. + */ readonly resource?: string; + /** + * The display name of the security operation. + */ readonly operation?: string; + /** + * The description of the operation. + */ readonly description?: string; } /** - * @class - * Initializes a new instance of the Operation class. - * @constructor * Possible operation in the REST API of Microsoft.Security - * - * @member {string} [name] Name of the operation - * @member {string} [origin] Where the operation is originated - * @member {object} [display] - * @member {string} [display.provider] The resource provider for the operation. - * @member {string} [display.resource] The display name of the resource the - * operation applies to. - * @member {string} [display.operation] The display name of the security - * operation. - * @member {string} [display.description] The description of the operation. - */ +*/ export interface Operation { + /** + * Name of the operation + */ readonly name?: string; + /** + * Where the operation is originated + */ readonly origin?: string; display?: OperationDisplay; } /** - * @class - * Initializes a new instance of the SecurityTaskParameters class. - * @constructor - * Changing set of properties, depending on the task type that is derived from - * the name field - * - * @member {string} [name] Name of the task type - */ + * Changing set of properties, depending on the task type that is derived from the name field +*/ export interface SecurityTaskParameters { + /** + * Name of the task type + */ readonly name?: string; /** - * @property Describes unknown properties. The value of an unknown property - * can be of "any" type. - */ - [property: string]: any; + * Describes unknown properties. The value of an unknown property can be of "any" type. + */ + [additionalPropertyName: string]: any; } /** - * @class - * Initializes a new instance of the SecurityTask class. - * @constructor * Security task that we recommend to do in order to strengthen security - * - * @member {string} [state] State of the task (Active, Resolved etc.) - * @member {date} [creationTimeUtc] The time this task was discovered in UTC - * @member {object} [securityTaskParameters] - * @member {string} [securityTaskParameters.name] Name of the task type - * @member {date} [lastStateChangeTimeUtc] The time this task's details were - * last changed in UTC - * @member {string} [subState] Additional data on the state of the task - */ +*/ export interface SecurityTask extends Resource { + /** + * State of the task (Active, Resolved etc.) + */ readonly state?: string; + /** + * The time this task was discovered in UTC + */ readonly creationTimeUtc?: Date; securityTaskParameters?: SecurityTaskParameters; + /** + * The time this task's details were last changed in UTC + */ readonly lastStateChangeTimeUtc?: Date; + /** + * Additional data on the state of the task + */ readonly subState?: string; } /** - * @class - * Initializes a new instance of the AscLocation class. - * @constructor - * The ASC location of the subscription is in the "name" field - * - * @member {object} [properties] - */ -export interface AscLocation extends Resource { - properties?: any; -} - -/** - * @class - * Initializes a new instance of the AlertEntity class. - * @constructor * Changing set of properties depending on the entity type. - * - * @member {string} [type] Type of entity - */ +*/ export interface AlertEntity { + /** + * Type of entity + */ readonly type?: string; /** - * @property Describes unknown properties. The value of an unknown property - * can be of "any" type. - */ - [property: string]: any; + * Describes unknown properties. The value of an unknown property can be of "any" type. + */ + [additionalPropertyName: string]: any; } /** - * @class - * Initializes a new instance of the AlertConfidenceReason class. - * @constructor * Factors that increase our confidence that the alert is a true positive - * - * @member {string} [type] Type of confidence factor - * @member {string} [reason] description of the confidence reason - */ +*/ export interface AlertConfidenceReason { + /** + * Type of confidence factor + */ readonly type?: string; + /** + * description of the confidence reason + */ readonly reason?: string; } /** - * @class - * Initializes a new instance of the Alert class. - * @constructor * Security alert - * - * @member {string} [state] State of the alert (Active, Dismissed etc.) - * @member {date} [reportedTimeUtc] The time the incident was reported to - * Microsoft.Security in UTC - * @member {string} [vendorName] Name of the vendor that discovered the - * incident - * @member {string} [alertName] Name of the alert type - * @member {string} [alertDisplayName] Display name of the alert type - * @member {date} [detectedTimeUtc] The time the incident was detected by the - * vendor - * @member {string} [description] Description of the incident and what it means - * @member {string} [remediationSteps] Recommended steps to reradiate the - * incident - * @member {string} [actionTaken] The action that was taken as a response to - * the alert (Active, Blocked etc.) - * @member {string} [reportedSeverity] Estimated severity of this alert - * @member {string} [compromisedEntity] The entity that the incident happened - * on - * @member {string} [associatedResource] Azure resource ID of the associated - * resource - * @member {object} [extendedProperties] - * @member {string} [systemSource] The type of the alerted resource (Azure, - * Non-Azure) - * @member {boolean} [canBeInvestigated] Whether this alert can be investigated - * with Azure Security Center - * @member {array} [entities] objects that are related to this alerts - * @member {number} [confidenceScore] level of confidence we have on the alert - * @member {array} [confidenceReasons] reasons the alert got the - * confidenceScore value - * @member {string} [subscriptionId] Azure subscription ID of the resource that - * had the security alert or the subscription ID of the workspace that this - * resource reports to - * @member {string} [instanceId] Instance ID of the alert. - * @member {string} [workspaceArmId] Azure resource ID of the workspace that - * the alert was reported to. - */ +*/ export interface Alert extends Resource { + /** + * State of the alert (Active, Dismissed etc.) + */ readonly state?: string; + /** + * The time the incident was reported to Microsoft.Security in UTC + */ readonly reportedTimeUtc?: Date; + /** + * Name of the vendor that discovered the incident + */ readonly vendorName?: string; + /** + * Name of the alert type + */ readonly alertName?: string; + /** + * Display name of the alert type + */ readonly alertDisplayName?: string; + /** + * The time the incident was detected by the vendor + */ readonly detectedTimeUtc?: Date; + /** + * Description of the incident and what it means + */ readonly description?: string; + /** + * Recommended steps to reradiate the incident + */ readonly remediationSteps?: string; + /** + * The action that was taken as a response to the alert (Active, Blocked etc.) + */ readonly actionTaken?: string; + /** + * Estimated severity of this alert. Possible values include: 'Informational', 'Low', 'Medium', + * 'High' + */ readonly reportedSeverity?: string; + /** + * The entity that the incident happened on + */ readonly compromisedEntity?: string; + /** + * Azure resource ID of the associated resource + */ readonly associatedResource?: string; extendedProperties?: { [propertyName: string]: any }; + /** + * The type of the alerted resource (Azure, Non-Azure) + */ readonly systemSource?: string; + /** + * Whether this alert can be investigated with Azure Security Center + */ readonly canBeInvestigated?: boolean; + /** + * Whether this alert is for incident type or not (otherwise - single alert) + */ + readonly isIncident?: boolean; + /** + * objects that are related to this alerts + */ entities?: AlertEntity[]; + /** + * level of confidence we have on the alert + */ readonly confidenceScore?: number; + /** + * reasons the alert got the confidenceScore value + */ confidenceReasons?: AlertConfidenceReason[]; + /** + * Azure subscription ID of the resource that had the security alert or the subscription ID of + * the workspace that this resource reports to + */ readonly subscriptionId?: string; + /** + * Instance ID of the alert. + */ readonly instanceId?: string; + /** + * Azure resource ID of the workspace that the alert was reported to. + */ readonly workspaceArmId?: string; + /** + * Alerts with the same CorrelationKey will be grouped together in Ibiza. + */ + readonly correlationKey?: string; } -/** - * @class - * Initializes a new instance of the DiscoveredSecuritySolution class. - * @constructor - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type - * @member {string} [location] Location where the resource is stored - * @member {string} securityFamily The security family of the discovered - * solution. Possible values include: 'Waf', 'Ngfw', 'SaasWaf', 'Va' - * @member {string} offer The security solutions' image offer - * @member {string} publisher The security solutions' image publisher - * @member {string} sku The security solutions' image sku - */ export interface DiscoveredSecuritySolution { + /** + * Resource Id + */ readonly id?: string; + /** + * Resource name + */ readonly name?: string; + /** + * Resource type + */ readonly type?: string; + /** + * Location where the resource is stored + */ readonly location?: string; - securityFamily: string; - offer: string; - publisher: string; - sku: string; -} - -/** - * @class - * Initializes a new instance of the TopologySingleResourceParent class. - * @constructor - * @member {string} [resourceId] Azure resource id which serves as parent - * resource in topology view - */ -export interface TopologySingleResourceParent { - readonly resourceId?: string; -} - -/** - * @class - * Initializes a new instance of the TopologySingleResourceChild class. - * @constructor - * @member {string} [resourceId] Azure resource id which serves as child - * resource in topology view - */ -export interface TopologySingleResourceChild { - readonly resourceId?: string; -} - -/** - * @class - * Initializes a new instance of the TopologySingleResource class. - * @constructor - * @member {string} [resourceId] Azure resource id - * @member {string} [severity] The security severity of the resource - * @member {boolean} [recommendationsExist] Indicates if the resource has - * security recommendations - * @member {string} [networkZones] Indicates the resource connectivity level to - * the Internet (InternetFacing, Internal ,etc.) - * @member {number} [topologyScore] Score of the resource based on its security - * severity - * @member {string} [location] The location of this resource - * @member {array} [parents] Azure resources connected to this resource which - * are in higher level in the topology view - * @member {array} [children] Azure resources connected to this resource which - * are in lower level in the topology view - */ -export interface TopologySingleResource { - readonly resourceId?: string; - readonly severity?: string; - readonly recommendationsExist?: boolean; - readonly networkZones?: string; - readonly topologyScore?: number; - readonly location?: string; - readonly parents?: TopologySingleResourceParent[]; - readonly children?: TopologySingleResourceChild[]; -} - -/** - * @class - * Initializes a new instance of the TopologyResource class. - * @constructor - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type - * @member {string} [location] Location where the resource is stored - * @member {date} [calculatedDateTime] The UTC time on which the topology was - * calculated - * @member {array} [topologyResources] Azure resources which are part of this - * topology resource - */ -export interface TopologyResource { - readonly id?: string; - readonly name?: string; - readonly type?: string; - readonly location?: string; - readonly calculatedDateTime?: Date; - readonly topologyResources?: TopologySingleResource[]; + /** + * The security family of the discovered solution. Possible values include: 'Waf', 'Ngfw', + * 'SaasWaf', 'Va' + */ + securityFamily: string; + /** + * The security solutions' image offer + */ + offer: string; + /** + * The security solutions' image publisher + */ + publisher: string; + /** + * The security solutions' image sku + */ + sku: string; } /** - * @class - * Initializes a new instance of the JitNetworkAccessPortRule class. - * @constructor - * @member {number} number - * @member {string} protocol Possible values include: 'TCP', 'UDP', 'All' - * @member {string} [allowedSourceAddressPrefix] Mutually exclusive with the - * "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, - * for example "192.168.0.3" or "192.168.0.0/16". - * @member {array} [allowedSourceAddressPrefixes] Mutually exclusive with the - * "allowedSourceAddressPrefix" parameter. - * @member {string} maxRequestAccessDuration Maximum duration requests can be - * made for. In ISO 8601 duration format. Minimum 5 minutes, maximum 1 day - */ + * Describes an Azure resource with location +*/ +export interface Location { + /** + * Location where the resource is stored + */ + readonly location?: string; +} + export interface JitNetworkAccessPortRule { number: number; + /** + * Possible values include: 'TCP', 'UDP', 'All' + */ protocol: string; + /** + * Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. Should be an IP address + * or CIDR, for example "192.168.0.3" or "192.168.0.0/16". + */ allowedSourceAddressPrefix?: string; + /** + * Mutually exclusive with the "allowedSourceAddressPrefix" parameter. + */ allowedSourceAddressPrefixes?: string[]; + /** + * Maximum duration requests can be made for. In ISO 8601 duration format. Minimum 5 minutes, + * maximum 1 day + */ maxRequestAccessDuration: string; } -/** - * @class - * Initializes a new instance of the JitNetworkAccessPolicyVirtualMachine class. - * @constructor - * @member {string} id Resource ID of the virtual machine that is linked to - * this policy - * @member {array} ports Port configurations for the virtual machine - */ export interface JitNetworkAccessPolicyVirtualMachine { + /** + * Resource ID of the virtual machine that is linked to this policy + */ id: string; + /** + * Port configurations for the virtual machine + */ ports: JitNetworkAccessPortRule[]; } -/** - * @class - * Initializes a new instance of the JitNetworkAccessRequestPort class. - * @constructor - * @member {number} number - * @member {string} [allowedSourceAddressPrefix] Mutually exclusive with the - * "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, - * for example "192.168.0.3" or "192.168.0.0/16". - * @member {array} [allowedSourceAddressPrefixes] Mutually exclusive with the - * "allowedSourceAddressPrefix" parameter. - * @member {date} endTimeUtc The date & time at which the request ends in UTC - * @member {string} status The status of the port. Possible values include: - * 'Revoked', 'Initiated' - * @member {string} statusReason A description of why the `status` has its - * value. Possible values include: 'Expired', 'UserRequested', - * 'NewerRequestInitiated' - */ export interface JitNetworkAccessRequestPort { number: number; + /** + * Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. Should be an IP address + * or CIDR, for example "192.168.0.3" or "192.168.0.0/16". + */ allowedSourceAddressPrefix?: string; + /** + * Mutually exclusive with the "allowedSourceAddressPrefix" parameter. + */ allowedSourceAddressPrefixes?: string[]; + /** + * The date & time at which the request ends in UTC + */ endTimeUtc: Date; + /** + * The status of the port. Possible values include: 'Revoked', 'Initiated' + */ status: string; + /** + * A description of why the `status` has its value. Possible values include: 'Expired', + * 'UserRequested', 'NewerRequestInitiated' + */ statusReason: string; } -/** - * @class - * Initializes a new instance of the JitNetworkAccessRequestVirtualMachine class. - * @constructor - * @member {string} id Resource ID of the virtual machine that is linked to - * this policy - * @member {array} ports The ports that were opened for the virtual machine - */ export interface JitNetworkAccessRequestVirtualMachine { + /** + * Resource ID of the virtual machine that is linked to this policy + */ id: string; + /** + * The ports that were opened for the virtual machine + */ ports: JitNetworkAccessRequestPort[]; } -/** - * @class - * Initializes a new instance of the JitNetworkAccessRequest class. - * @constructor - * @member {array} virtualMachines - * @member {date} startTimeUtc The start time of the request in UTC - * @member {string} requestor The identity of the person who made the request - */ export interface JitNetworkAccessRequest { virtualMachines: JitNetworkAccessRequestVirtualMachine[]; + /** + * The start time of the request in UTC + */ startTimeUtc: Date; + /** + * The identity of the person who made the request + */ requestor: string; } -/** - * @class - * Initializes a new instance of the JitNetworkAccessPolicy class. - * @constructor - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type - * @member {string} [kind] Kind of the resource - * @member {string} [location] Location where the resource is stored - * @member {array} virtualMachines Configurations for - * Microsoft.Compute/virtualMachines resource type. - * @member {array} [requests] - * @member {string} [provisioningState] Gets the provisioning state of the - * Just-in-Time policy. - */ export interface JitNetworkAccessPolicy { + /** + * Resource Id + */ readonly id?: string; + /** + * Resource name + */ readonly name?: string; + /** + * Resource type + */ readonly type?: string; + /** + * Kind of the resource + */ kind?: string; + /** + * Location where the resource is stored + */ readonly location?: string; + /** + * Configurations for Microsoft.Compute/virtualMachines resource type. + */ virtualMachines: JitNetworkAccessPolicyVirtualMachine[]; requests?: JitNetworkAccessRequest[]; + /** + * Gets the provisioning state of the Just-in-Time policy. + */ readonly provisioningState?: string; } -/** - * @class - * Initializes a new instance of the JitNetworkAccessPolicyInitiatePort class. - * @constructor - * @member {number} number - * @member {string} [allowedSourceAddressPrefix] Source of the allowed traffic. - * If omitted, the request will be for the source IP address of the initiate - * request. - * @member {date} endTimeUtc The time to close the request in UTC - */ export interface JitNetworkAccessPolicyInitiatePort { number: number; + /** + * Source of the allowed traffic. If omitted, the request will be for the source IP address of + * the initiate request. + */ allowedSourceAddressPrefix?: string; + /** + * The time to close the request in UTC + */ endTimeUtc: Date; } -/** - * @class - * Initializes a new instance of the JitNetworkAccessPolicyInitiateVirtualMachine class. - * @constructor - * @member {string} id Resource ID of the virtual machine that is linked to - * this policy - * @member {array} ports The ports to open for the resource with the `id` - */ export interface JitNetworkAccessPolicyInitiateVirtualMachine { + /** + * Resource ID of the virtual machine that is linked to this policy + */ id: string; + /** + * The ports to open for the resource with the `id` + */ ports: JitNetworkAccessPolicyInitiatePort[]; } -/** - * @class - * Initializes a new instance of the JitNetworkAccessPolicyInitiateRequest class. - * @constructor - * @member {array} virtualMachines A list of virtual machines & ports to open - * access for - */ export interface JitNetworkAccessPolicyInitiateRequest { + /** + * A list of virtual machines & ports to open access for + */ virtualMachines: JitNetworkAccessPolicyInitiateVirtualMachine[]; } /** - * @class - * Initializes a new instance of the ExternalSecuritySolution class. - * @constructor - * Represents a security solution external to Azure Security Center which sends - * information to an OMS workspace and whos data is displayed by Azure Security - * Center. - * - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type - * @member {string} [location] Location where the resource is stored - * @member {string} kind Polymorphic Discriminator - */ + * Describes an Azure resource with kind +*/ +export interface Kind { + /** + * Kind of the resource + */ + kind?: string; +} + +/** + * Represents a security solution external to Azure Security Center which sends information to an + * OMS workspace and whose data is displayed by Azure Security Center. +*/ export interface ExternalSecuritySolution { + /** + * Resource Id + */ readonly id?: string; + /** + * Resource name + */ readonly name?: string; + /** + * Resource type + */ readonly type?: string; + /** + * Location where the resource is stored + */ readonly location?: string; + /** + * Polymorphic Discriminator + */ kind: string; } /** - * @class - * Initializes a new instance of the ExternalSecuritySolutionProperties class. - * @constructor * The solution properties (correspond to the solution kind) - * - * @member {string} [deviceVendor] - * @member {string} [deviceType] - * @member {object} [workspace] - * @member {string} [workspace.id] Azure resource ID of the connected OMS - * workspace - */ +*/ export interface ExternalSecuritySolutionProperties { deviceVendor?: string; deviceType?: string; workspace?: ConnectedWorkspace; /** - * @property Describes unknown properties. The value of an unknown property - * can be of "any" type. - */ - [property: string]: any; + * Describes unknown properties. The value of an unknown property can be of "any" type. + */ + [additionalPropertyName: string]: any; } /** - * @class - * Initializes a new instance of the CefSolutionProperties class. - * @constructor * @summary The external security solution properties for CEF solutions - * - * @member {string} [hostname] - * @member {string} [agent] - * @member {string} [lastEventReceived] - */ +*/ export interface CefSolutionProperties extends ExternalSecuritySolutionProperties { hostname?: string; agent?: string; @@ -791,366 +948,477 @@ export interface CefSolutionProperties extends ExternalSecuritySolutionPropertie } /** - * @class - * Initializes a new instance of the CefExternalSecuritySolution class. - * @constructor * Represents a security solution which sends CEF logs to an OMS workspace - * - * @member {object} [properties] - * @member {string} [properties.hostname] - * @member {string} [properties.agent] - * @member {string} [properties.lastEventReceived] - */ +*/ export interface CefExternalSecuritySolution extends ExternalSecuritySolution { properties?: CefSolutionProperties; } /** - * @class - * Initializes a new instance of the AtaSolutionProperties class. - * @constructor * @summary The external security solution properties for ATA solutions - * - * @member {string} [lastEventReceived] - */ +*/ export interface AtaSolutionProperties extends ExternalSecuritySolutionProperties { lastEventReceived?: string; } /** - * @class - * Initializes a new instance of the AtaExternalSecuritySolution class. - * @constructor * Represents an ATA security solution which sends logs to an OMS workspace - * - * @member {object} [properties] - * @member {string} [properties.lastEventReceived] - */ +*/ export interface AtaExternalSecuritySolution extends ExternalSecuritySolution { properties?: AtaSolutionProperties; } /** - * @class - * Initializes a new instance of the ConnectedWorkspace class. - * @constructor * @summary Represents an OMS workspace to which the solution is connected - * - * @member {string} [id] Azure resource ID of the connected OMS workspace - */ +*/ export interface ConnectedWorkspace { + /** + * Azure resource ID of the connected OMS workspace + */ id?: string; } /** - * @class - * Initializes a new instance of the AadSolutionProperties class. - * @constructor * @summary The external security solution properties for AAD solutions - * - * @member {string} [deviceVendor] - * @member {string} [deviceType] - * @member {object} [workspace] - * @member {string} [workspace.id] Azure resource ID of the connected OMS - * workspace - * @member {string} [connectivityState] The connectivity state of the external - * AAD solution . Possible values include: 'Discovered', 'NotLicensed', - * 'Connected' - */ +*/ export interface AadSolutionProperties { deviceVendor?: string; deviceType?: string; workspace?: ConnectedWorkspace; + /** + * @summary The connectivity state of the external AAD solution + * @description Possible values include: 'Discovered', 'NotLicensed', 'Connected' + */ connectivityState?: string; } /** - * @class - * Initializes a new instance of the AadExternalSecuritySolution class. - * @constructor - * Represents an AAD identity protection solution which sends logs to an OMS - * workspace. - * - * @member {object} [properties] - * @member {string} [properties.deviceVendor] - * @member {string} [properties.deviceType] - * @member {object} [properties.workspace] - * @member {string} [properties.workspace.id] Azure resource ID of the - * connected OMS workspace - * @member {string} [properties.connectivityState] Possible values include: - * 'Discovered', 'NotLicensed', 'Connected' - */ + * Represents an AAD identity protection solution which sends logs to an OMS workspace. +*/ export interface AadExternalSecuritySolution extends ExternalSecuritySolution { properties?: AadSolutionProperties; } /** - * @class - * Initializes a new instance of the ExternalSecuritySolutionKind1 class. - * @constructor * Describes an Azure resource with kind - * - * @member {string} [kind] The kind of the external solution. Possible values - * include: 'CEF', 'ATA', 'AAD' - */ +*/ export interface ExternalSecuritySolutionKind1 { + /** + * The kind of the external solution. Possible values include: 'CEF', 'ATA', 'AAD' + */ kind?: string; } /** - * @class - * Initializes a new instance of the AadConnectivityState1 class. - * @constructor * Describes an Azure resource with kind - * - * @member {string} [connectivityState] The connectivity state of the external - * AAD solution . Possible values include: 'Discovered', 'NotLicensed', - * 'Connected' - */ +*/ export interface AadConnectivityState1 { + /** + * @summary The connectivity state of the external AAD solution + * @description Possible values include: 'Discovered', 'NotLicensed', 'Connected' + */ connectivityState?: string; } +export interface TopologySingleResourceParent { + /** + * Azure resource id which serves as parent resource in topology view + */ + readonly resourceId?: string; +} + +export interface TopologySingleResourceChild { + /** + * Azure resource id which serves as child resource in topology view + */ + readonly resourceId?: string; +} + +export interface TopologySingleResource { + /** + * Azure resource id + */ + readonly resourceId?: string; + /** + * The security severity of the resource + */ + readonly severity?: string; + /** + * Indicates if the resource has security recommendations + */ + readonly recommendationsExist?: boolean; + /** + * Indicates the resource connectivity level to the Internet (InternetFacing, Internal ,etc.) + */ + readonly networkZones?: string; + /** + * Score of the resource based on its security severity + */ + readonly topologyScore?: number; + /** + * The location of this resource + */ + readonly location?: string; + /** + * Azure resources connected to this resource which are in higher level in the topology view + */ + readonly parents?: TopologySingleResourceParent[]; + /** + * Azure resources connected to this resource which are in lower level in the topology view + */ + readonly children?: TopologySingleResourceChild[]; +} + +export interface TopologyResource { + /** + * Resource Id + */ + readonly id?: string; + /** + * Resource name + */ + readonly name?: string; + /** + * Resource type + */ + readonly type?: string; + /** + * Location where the resource is stored + */ + readonly location?: string; + /** + * The UTC time on which the topology was calculated + */ + readonly calculatedDateTime?: Date; + /** + * Azure resources which are part of this topology resource + */ + readonly topologyResources?: TopologySingleResource[]; +} + /** - * @class - * Initializes a new instance of the ConnectedResource class. - * @constructor * Describes properties of a connected resource - * - * @member {string} [connectedResourceId] The Azure resource id of the - * connected resource - * @member {string} [tcpPorts] The allowed tcp ports - * @member {string} [udpPorts] The allowed udp ports - */ +*/ export interface ConnectedResource { + /** + * The Azure resource id of the connected resource + */ readonly connectedResourceId?: string; + /** + * The allowed tcp ports + */ readonly tcpPorts?: string; + /** + * The allowed udp ports + */ readonly udpPorts?: string; } /** - * @class - * Initializes a new instance of the ConnectableResource class. - * @constructor * Describes the allowed inbound and outbound traffic of an Azure resource - * - * @member {string} [id] The Azure resource id - * @member {array} [inboundConnectedResources] The list of Azure resources that - * the resource has inbound allowed connection from - * @member {array} [outboundConnectedResources] The list of Azure resources - * that the resource has outbound allowed connection to - */ +*/ export interface ConnectableResource { + /** + * The Azure resource id + */ readonly id?: string; + /** + * The list of Azure resources that the resource has inbound allowed connection from + */ readonly inboundConnectedResources?: ConnectedResource[]; + /** + * The list of Azure resources that the resource has outbound allowed connection to + */ readonly outboundConnectedResources?: ConnectedResource[]; } /** - * @class - * Initializes a new instance of the AllowedConnectionsResource class. - * @constructor - * The resource whose properties describes the allowed traffic between Azure - * resources - * - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type - * @member {string} [location] Location where the resource is stored - * @member {date} [calculatedDateTime] The UTC time on which the allowed - * connections resource was calculated - * @member {array} [connectableResources] List of connectable resources - */ + * The resource whose properties describes the allowed traffic between Azure resources +*/ export interface AllowedConnectionsResource { + /** + * Resource Id + */ readonly id?: string; + /** + * Resource name + */ readonly name?: string; + /** + * Resource type + */ readonly type?: string; + /** + * Location where the resource is stored + */ readonly location?: string; + /** + * The UTC time on which the allowed connections resource was calculated + */ readonly calculatedDateTime?: Date; + /** + * List of connectable resources + */ readonly connectableResources?: ConnectableResource[]; } +/** + * Describes remote addresses that is recommended to communicate with the Azure resource on some + * (Protocol, Port, Direction). All other remote addresses are recommended to be blocked +*/ +export interface Rule { + /** + * The name of the rule + */ + name?: string; + /** + * The rule's direction. Possible values include: 'Inbound', 'Outbound' + */ + direction?: string; + /** + * The rule's destination port + */ + destinationPort?: number; + /** + * The rule's transport protocols + */ + protocols?: string[]; + /** + * The remote IP addresses that should be able to communicate with the Azure resource on the + * rule's destination port and protocol + */ + ipAddresses?: string[]; +} /** - * @class - * Initializes a new instance of the PricingList class. - * @constructor - * List of pricing configurations response - * - * @member {string} [nextLink] The URI to fetch the next page. - */ -export interface PricingList extends Array { + * Describes the Network Security Groups effective on a network interface +*/ +export interface EffectiveNetworkSecurityGroups { + /** + * The Azure resource ID of the network interface + */ + networkInterface?: string; + /** + * The Network Security Groups effective on the network interface + */ + networkSecurityGroups?: string[]; +} + +/** + * The resource whose properties describes the Adaptive Network Hardening settings for some Azure + * resource +*/ +export interface AdaptiveNetworkHardening extends Resource { + /** + * The security rules which are recommended to be effective on the VM + */ + rules?: Rule[]; + /** + * The UTC time on which the rules were calculated + */ + rulesCalculationTime?: Date; + /** + * The Network Security Groups effective on the network interfaces of the protected resource + */ + effectiveNetworkSecurityGroups?: EffectiveNetworkSecurityGroups[]; +} + +export interface AdaptiveNetworkHardeningEnforceRequest { + /** + * The rules to enforce + */ + rules: Rule[]; + /** + * The Azure resource IDs of the effective network security groups that will be updated with the + * created security rules from the Adaptive Network Hardening rules + */ + networkSecurityGroups: string[]; +} + +/** + * List of regulatory compliance standards response +*/ +export interface RegulatoryComplianceStandardList extends Array { + /** + * The URI to fetch the next page. + */ + readonly nextLink?: string; +} + +/** + * List of regulatory compliance controls response +*/ +export interface RegulatoryComplianceControlList extends Array { + /** + * The URI to fetch the next page. + */ + readonly nextLink?: string; +} + +/** + * List of regulatory compliance assessment response +*/ +export interface RegulatoryComplianceAssessmentList extends Array { + /** + * The URI to fetch the next page. + */ readonly nextLink?: string; } /** - * @class - * Initializes a new instance of the SecurityContactList class. - * @constructor * List of security contacts response - * - * @member {string} [nextLink] The URI to fetch the next page. - */ +*/ export interface SecurityContactList extends Array { + /** + * The URI to fetch the next page. + */ readonly nextLink?: string; } /** - * @class - * Initializes a new instance of the WorkspaceSettingList class. - * @constructor * List of workspace settings response - * - * @member {string} [nextLink] The URI to fetch the next page. - */ +*/ export interface WorkspaceSettingList extends Array { + /** + * The URI to fetch the next page. + */ readonly nextLink?: string; } /** - * @class - * Initializes a new instance of the AutoProvisioningSettingList class. - * @constructor * List of all the auto provisioning settings response - * - * @member {string} [nextLink] The URI to fetch the next page. - */ +*/ export interface AutoProvisioningSettingList extends Array { + /** + * The URI to fetch the next page. + */ readonly nextLink?: string; } /** - * @class - * Initializes a new instance of the ComplianceList class. - * @constructor * List of Compliance objects response - * - * @member {string} [nextLink] The URI to fetch the next page. - */ +*/ export interface ComplianceList extends Array { + /** + * The URI to fetch the next page. + */ + readonly nextLink?: string; +} + +/** + * List of device security groups +*/ +export interface DeviceSecurityGroupList extends Array { + /** + * The URI to fetch the next page. + */ readonly nextLink?: string; } /** - * @class - * Initializes a new instance of the SettingsList class. - * @constructor * Subscription settings list. - * - * @member {string} [nextLink] The URI to fetch the next page. - */ +*/ export interface SettingsList extends Array { + /** + * The URI to fetch the next page. + */ readonly nextLink?: string; } /** - * @class - * Initializes a new instance of the InformationProtectionPolicyList class. - * @constructor * Information protection policies response. - * - * @member {string} [nextLink] The URI to fetch the next page. - */ +*/ export interface InformationProtectionPolicyList extends Array { + /** + * The URI to fetch the next page. + */ readonly nextLink?: string; } /** - * @class - * Initializes a new instance of the OperationList class. - * @constructor * List of possible operations for Microsoft.Security resource provider - * - * @member {string} [nextLink] The URI to fetch the next page. - */ +*/ export interface OperationList extends Array { + /** + * The URI to fetch the next page. + */ readonly nextLink?: string; } /** - * @class - * Initializes a new instance of the AscLocationList class. - * @constructor * List of locations where ASC saves your data - * - * @member {string} [nextLink] The URI to fetch the next page. - */ +*/ export interface AscLocationList extends Array { + /** + * The URI to fetch the next page. + */ readonly nextLink?: string; } /** - * @class - * Initializes a new instance of the SecurityTaskList class. - * @constructor * List of security task recommendations - * - * @member {string} [nextLink] The URI to fetch the next page. - */ +*/ export interface SecurityTaskList extends Array { + /** + * The URI to fetch the next page. + */ readonly nextLink?: string; } /** - * @class - * Initializes a new instance of the AlertList class. - * @constructor * List of security alerts - * - * @member {string} [nextLink] The URI to fetch the next page. - */ +*/ export interface AlertList extends Array { + /** + * The URI to fetch the next page. + */ readonly nextLink?: string; } -/** - * @class - * Initializes a new instance of the DiscoveredSecuritySolutionList class. - * @constructor - * @member {string} [nextLink] The URI to fetch the next page. - */ export interface DiscoveredSecuritySolutionList extends Array { + /** + * The URI to fetch the next page. + */ readonly nextLink?: string; } -/** - * @class - * Initializes a new instance of the JitNetworkAccessPoliciesList class. - * @constructor - * @member {string} [nextLink] The URI to fetch the next page. - */ export interface JitNetworkAccessPoliciesList extends Array { + /** + * The URI to fetch the next page. + */ readonly nextLink?: string; } -/** - * @class - * Initializes a new instance of the ExternalSecuritySolutionList class. - * @constructor - * @member {string} [nextLink] The URI to fetch the next page. - */ export interface ExternalSecuritySolutionList extends Array { + /** + * The URI to fetch the next page. + */ readonly nextLink?: string; } -/** - * @class - * Initializes a new instance of the TopologyList class. - * @constructor - * @member {string} [nextLink] The URI to fetch the next page. - */ export interface TopologyList extends Array { + /** + * The URI to fetch the next page. + */ readonly nextLink?: string; } /** - * @class - * Initializes a new instance of the AllowedConnectionsList class. - * @constructor * List of all possible traffic between Azure resources - * - * @member {string} [nextLink] The URI to fetch the next page. - */ +*/ export interface AllowedConnectionsList extends Array { + /** + * The URI to fetch the next page. + */ readonly nextLink?: string; } + +/** + * Response for ListAdaptiveNetworkHardenings API service call +*/ +export interface AdaptiveNetworkHardeningsList extends Array { + /** + * The URL to get the next set of results + */ + nextLink?: string; +} diff --git a/lib/services/securityManagement/lib/models/index.js b/lib/services/securityManagement/lib/models/index.js index 750d5ba0d8..99f68d36b0 100644 --- a/lib/services/securityManagement/lib/models/index.js +++ b/lib/services/securityManagement/lib/models/index.js @@ -19,35 +19,41 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; exports.Resource = require('./resource'); -exports.Kind = require('./kind'); -exports.SecurityContact = require('./securityContact'); +exports.RegulatoryComplianceStandard = require('./regulatoryComplianceStandard'); +exports.RegulatoryComplianceControl = require('./regulatoryComplianceControl'); +exports.RegulatoryComplianceAssessment = require('./regulatoryComplianceAssessment'); +exports.AscLocation = require('./ascLocation'); exports.Pricing = require('./pricing'); +exports.PricingList = require('./pricingList'); +exports.SecurityContact = require('./securityContact'); exports.WorkspaceSetting = require('./workspaceSetting'); exports.AutoProvisioningSetting = require('./autoProvisioningSetting'); exports.ComplianceSegment = require('./complianceSegment'); exports.Compliance = require('./compliance'); exports.AdvancedThreatProtectionSetting = require('./advancedThreatProtectionSetting'); +exports.CustomAlertRule = require('./customAlertRule'); +exports.ThresholdCustomAlertRule = require('./thresholdCustomAlertRule'); +exports.TimeWindowCustomAlertRule = require('./timeWindowCustomAlertRule'); +exports.ListCustomAlertRule = require('./listCustomAlertRule'); +exports.AllowlistCustomAlertRule = require('./allowlistCustomAlertRule'); +exports.DenylistCustomAlertRule = require('./denylistCustomAlertRule'); +exports.DeviceSecurityGroup = require('./deviceSecurityGroup'); +exports.SettingResource = require('./settingResource'); exports.Setting = require('./setting'); exports.DataExportSetting = require('./dataExportSetting'); -exports.SettingKind1 = require('./settingKind1'); exports.SensitivityLabel = require('./sensitivityLabel'); exports.InformationProtectionKeyword = require('./informationProtectionKeyword'); exports.InformationType = require('./informationType'); exports.InformationProtectionPolicy = require('./informationProtectionPolicy'); -exports.Location = require('./location'); exports.OperationDisplay = require('./operationDisplay'); exports.Operation = require('./operation'); exports.SecurityTaskParameters = require('./securityTaskParameters'); exports.SecurityTask = require('./securityTask'); -exports.AscLocation = require('./ascLocation'); exports.AlertEntity = require('./alertEntity'); exports.AlertConfidenceReason = require('./alertConfidenceReason'); exports.Alert = require('./alert'); exports.DiscoveredSecuritySolution = require('./discoveredSecuritySolution'); -exports.TopologySingleResourceParent = require('./topologySingleResourceParent'); -exports.TopologySingleResourceChild = require('./topologySingleResourceChild'); -exports.TopologySingleResource = require('./topologySingleResource'); -exports.TopologyResource = require('./topologyResource'); +exports.Location = require('./location'); exports.JitNetworkAccessPortRule = require('./jitNetworkAccessPortRule'); exports.JitNetworkAccessPolicyVirtualMachine = require('./jitNetworkAccessPolicyVirtualMachine'); exports.JitNetworkAccessRequestPort = require('./jitNetworkAccessRequestPort'); @@ -57,6 +63,7 @@ exports.JitNetworkAccessPolicy = require('./jitNetworkAccessPolicy'); exports.JitNetworkAccessPolicyInitiatePort = require('./jitNetworkAccessPolicyInitiatePort'); exports.JitNetworkAccessPolicyInitiateVirtualMachine = require('./jitNetworkAccessPolicyInitiateVirtualMachine'); exports.JitNetworkAccessPolicyInitiateRequest = require('./jitNetworkAccessPolicyInitiateRequest'); +exports.Kind = require('./kind'); exports.ExternalSecuritySolution = require('./externalSecuritySolution'); exports.ExternalSecuritySolutionProperties = require('./externalSecuritySolutionProperties'); exports.CefSolutionProperties = require('./cefSolutionProperties'); @@ -68,14 +75,25 @@ exports.AadSolutionProperties = require('./aadSolutionProperties'); exports.AadExternalSecuritySolution = require('./aadExternalSecuritySolution'); exports.ExternalSecuritySolutionKind1 = require('./externalSecuritySolutionKind1'); exports.AadConnectivityState1 = require('./aadConnectivityState1'); +exports.TopologySingleResourceParent = require('./topologySingleResourceParent'); +exports.TopologySingleResourceChild = require('./topologySingleResourceChild'); +exports.TopologySingleResource = require('./topologySingleResource'); +exports.TopologyResource = require('./topologyResource'); exports.ConnectedResource = require('./connectedResource'); exports.ConnectableResource = require('./connectableResource'); exports.AllowedConnectionsResource = require('./allowedConnectionsResource'); -exports.PricingList = require('./pricingList'); +exports.Rule = require('./rule'); +exports.EffectiveNetworkSecurityGroups = require('./effectiveNetworkSecurityGroups'); +exports.AdaptiveNetworkHardening = require('./adaptiveNetworkHardening'); +exports.AdaptiveNetworkHardeningEnforceRequest = require('./adaptiveNetworkHardeningEnforceRequest'); +exports.RegulatoryComplianceStandardList = require('./regulatoryComplianceStandardList'); +exports.RegulatoryComplianceControlList = require('./regulatoryComplianceControlList'); +exports.RegulatoryComplianceAssessmentList = require('./regulatoryComplianceAssessmentList'); exports.SecurityContactList = require('./securityContactList'); exports.WorkspaceSettingList = require('./workspaceSettingList'); exports.AutoProvisioningSettingList = require('./autoProvisioningSettingList'); exports.ComplianceList = require('./complianceList'); +exports.DeviceSecurityGroupList = require('./deviceSecurityGroupList'); exports.SettingsList = require('./settingsList'); exports.InformationProtectionPolicyList = require('./informationProtectionPolicyList'); exports.OperationList = require('./operationList'); @@ -87,9 +105,8 @@ exports.JitNetworkAccessPoliciesList = require('./jitNetworkAccessPoliciesList') exports.ExternalSecuritySolutionList = require('./externalSecuritySolutionList'); exports.TopologyList = require('./topologyList'); exports.AllowedConnectionsList = require('./allowedConnectionsList'); +exports.AdaptiveNetworkHardeningsList = require('./adaptiveNetworkHardeningsList'); exports.discriminators = { - 'Setting' : exports.Setting, - 'Setting.DataExportSetting' : exports.DataExportSetting, 'ExternalSecuritySolution' : exports.ExternalSecuritySolution, 'ExternalSecuritySolution.CEF' : exports.CefExternalSecuritySolution, 'ExternalSecuritySolution.ATA' : exports.AtaExternalSecuritySolution, diff --git a/lib/services/securityManagement/lib/models/informationProtectionKeyword.js b/lib/services/securityManagement/lib/models/informationProtectionKeyword.js index 47c99e1014..2de4851152 100644 --- a/lib/services/securityManagement/lib/models/informationProtectionKeyword.js +++ b/lib/services/securityManagement/lib/models/informationProtectionKeyword.js @@ -17,12 +17,13 @@ class InformationProtectionKeyword { /** * Create a InformationProtectionKeyword. - * @member {string} [pattern] The keyword pattern. - * @member {boolean} [custom] Indicates whether the keyword is custom or not. - * @member {boolean} [canBeNumeric] Indicates whether the keyword can be - * applied on numeric types or not. - * @member {boolean} [excluded] Indicates whether the keyword is excluded or + * @property {string} [pattern] The keyword pattern. + * @property {boolean} [custom] Indicates whether the keyword is custom or * not. + * @property {boolean} [canBeNumeric] Indicates whether the keyword can be + * applied on numeric types or not. + * @property {boolean} [excluded] Indicates whether the keyword is excluded + * or not. */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/informationProtectionPolicy.js b/lib/services/securityManagement/lib/models/informationProtectionPolicy.js index 031ef06a3a..159285b13d 100644 --- a/lib/services/securityManagement/lib/models/informationProtectionPolicy.js +++ b/lib/services/securityManagement/lib/models/informationProtectionPolicy.js @@ -20,10 +20,10 @@ const models = require('./index'); class InformationProtectionPolicy extends models['Resource'] { /** * Create a InformationProtectionPolicy. - * @member {date} [lastModifiedUtc] Describes the last UTC time the policy + * @property {date} [lastModifiedUtc] Describes the last UTC time the policy * was modified. - * @member {object} [labels] Dictionary of sensitivity labels. - * @member {object} [informationTypes] The sensitivity information types. + * @property {object} [labels] Dictionary of sensitivity labels. + * @property {object} [informationTypes] The sensitivity information types. */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/informationProtectionPolicyList.js b/lib/services/securityManagement/lib/models/informationProtectionPolicyList.js index e841f1588e..c626fb9b6c 100644 --- a/lib/services/securityManagement/lib/models/informationProtectionPolicyList.js +++ b/lib/services/securityManagement/lib/models/informationProtectionPolicyList.js @@ -16,7 +16,7 @@ class InformationProtectionPolicyList extends Array { /** * Create a InformationProtectionPolicyList. - * @member {string} [nextLink] The URI to fetch the next page. + * @property {string} [nextLink] The URI to fetch the next page. */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/informationType.js b/lib/services/securityManagement/lib/models/informationType.js index 34b061f93b..fc0993c9b8 100644 --- a/lib/services/securityManagement/lib/models/informationType.js +++ b/lib/services/securityManagement/lib/models/informationType.js @@ -17,15 +17,15 @@ class InformationType { /** * Create a InformationType. - * @member {string} [displayName] The name of the information type. - * @member {number} [order] The order of the information type. - * @member {uuid} [recommendedLabelId] The recommended label id to be + * @property {string} [displayName] The name of the information type. + * @property {number} [order] The order of the information type. + * @property {uuid} [recommendedLabelId] The recommended label id to be * associated with this information type. - * @member {boolean} [enabled] Indicates whether the information type is + * @property {boolean} [enabled] Indicates whether the information type is * enabled or not. - * @member {boolean} [custom] Indicates whether the information type is + * @property {boolean} [custom] Indicates whether the information type is * custom or not. - * @member {array} [keywords] The information type keywords. + * @property {array} [keywords] The information type keywords. */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/jitNetworkAccessPoliciesList.js b/lib/services/securityManagement/lib/models/jitNetworkAccessPoliciesList.js index 1d80436399..638a3dd489 100644 --- a/lib/services/securityManagement/lib/models/jitNetworkAccessPoliciesList.js +++ b/lib/services/securityManagement/lib/models/jitNetworkAccessPoliciesList.js @@ -16,7 +16,7 @@ class JitNetworkAccessPoliciesList extends Array { /** * Create a JitNetworkAccessPoliciesList. - * @member {string} [nextLink] The URI to fetch the next page. + * @property {string} [nextLink] The URI to fetch the next page. */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/jitNetworkAccessPolicy.js b/lib/services/securityManagement/lib/models/jitNetworkAccessPolicy.js index 9293f27bce..f93f6430b0 100644 --- a/lib/services/securityManagement/lib/models/jitNetworkAccessPolicy.js +++ b/lib/services/securityManagement/lib/models/jitNetworkAccessPolicy.js @@ -16,15 +16,15 @@ class JitNetworkAccessPolicy { /** * Create a JitNetworkAccessPolicy. - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type - * @member {string} [kind] Kind of the resource - * @member {string} [location] Location where the resource is stored - * @member {array} virtualMachines Configurations for + * @property {string} [id] Resource Id + * @property {string} [name] Resource name + * @property {string} [type] Resource type + * @property {string} [kind] Kind of the resource + * @property {string} [location] Location where the resource is stored + * @property {array} virtualMachines Configurations for * Microsoft.Compute/virtualMachines resource type. - * @member {array} [requests] - * @member {string} [provisioningState] Gets the provisioning state of the + * @property {array} [requests] + * @property {string} [provisioningState] Gets the provisioning state of the * Just-in-Time policy. */ constructor() { diff --git a/lib/services/securityManagement/lib/models/jitNetworkAccessPolicyInitiatePort.js b/lib/services/securityManagement/lib/models/jitNetworkAccessPolicyInitiatePort.js index 8595a0ad79..66389172e5 100644 --- a/lib/services/securityManagement/lib/models/jitNetworkAccessPolicyInitiatePort.js +++ b/lib/services/securityManagement/lib/models/jitNetworkAccessPolicyInitiatePort.js @@ -16,11 +16,11 @@ class JitNetworkAccessPolicyInitiatePort { /** * Create a JitNetworkAccessPolicyInitiatePort. - * @member {number} number - * @member {string} [allowedSourceAddressPrefix] Source of the allowed + * @property {number} number + * @property {string} [allowedSourceAddressPrefix] Source of the allowed * traffic. If omitted, the request will be for the source IP address of the * initiate request. - * @member {date} endTimeUtc The time to close the request in UTC + * @property {date} endTimeUtc The time to close the request in UTC */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/jitNetworkAccessPolicyInitiateRequest.js b/lib/services/securityManagement/lib/models/jitNetworkAccessPolicyInitiateRequest.js index 70bfd90afc..849183e2fd 100644 --- a/lib/services/securityManagement/lib/models/jitNetworkAccessPolicyInitiateRequest.js +++ b/lib/services/securityManagement/lib/models/jitNetworkAccessPolicyInitiateRequest.js @@ -16,8 +16,8 @@ class JitNetworkAccessPolicyInitiateRequest { /** * Create a JitNetworkAccessPolicyInitiateRequest. - * @member {array} virtualMachines A list of virtual machines & ports to open - * access for + * @property {array} virtualMachines A list of virtual machines & ports to + * open access for */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/jitNetworkAccessPolicyInitiateVirtualMachine.js b/lib/services/securityManagement/lib/models/jitNetworkAccessPolicyInitiateVirtualMachine.js index aa3799d5b3..4e2ee1978a 100644 --- a/lib/services/securityManagement/lib/models/jitNetworkAccessPolicyInitiateVirtualMachine.js +++ b/lib/services/securityManagement/lib/models/jitNetworkAccessPolicyInitiateVirtualMachine.js @@ -16,9 +16,9 @@ class JitNetworkAccessPolicyInitiateVirtualMachine { /** * Create a JitNetworkAccessPolicyInitiateVirtualMachine. - * @member {string} id Resource ID of the virtual machine that is linked to + * @property {string} id Resource ID of the virtual machine that is linked to * this policy - * @member {array} ports The ports to open for the resource with the `id` + * @property {array} ports The ports to open for the resource with the `id` */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/jitNetworkAccessPolicyVirtualMachine.js b/lib/services/securityManagement/lib/models/jitNetworkAccessPolicyVirtualMachine.js index d040e9aef2..c4f3f0af6e 100644 --- a/lib/services/securityManagement/lib/models/jitNetworkAccessPolicyVirtualMachine.js +++ b/lib/services/securityManagement/lib/models/jitNetworkAccessPolicyVirtualMachine.js @@ -16,9 +16,9 @@ class JitNetworkAccessPolicyVirtualMachine { /** * Create a JitNetworkAccessPolicyVirtualMachine. - * @member {string} id Resource ID of the virtual machine that is linked to + * @property {string} id Resource ID of the virtual machine that is linked to * this policy - * @member {array} ports Port configurations for the virtual machine + * @property {array} ports Port configurations for the virtual machine */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/jitNetworkAccessPortRule.js b/lib/services/securityManagement/lib/models/jitNetworkAccessPortRule.js index 42e4270bf3..a08b268963 100644 --- a/lib/services/securityManagement/lib/models/jitNetworkAccessPortRule.js +++ b/lib/services/securityManagement/lib/models/jitNetworkAccessPortRule.js @@ -16,15 +16,15 @@ class JitNetworkAccessPortRule { /** * Create a JitNetworkAccessPortRule. - * @member {number} number - * @member {string} protocol Possible values include: 'TCP', 'UDP', 'All' - * @member {string} [allowedSourceAddressPrefix] Mutually exclusive with the - * "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, - * for example "192.168.0.3" or "192.168.0.0/16". - * @member {array} [allowedSourceAddressPrefixes] Mutually exclusive with the - * "allowedSourceAddressPrefix" parameter. - * @member {string} maxRequestAccessDuration Maximum duration requests can be - * made for. In ISO 8601 duration format. Minimum 5 minutes, maximum 1 day + * @property {number} number + * @property {string} protocol Possible values include: 'TCP', 'UDP', 'All' + * @property {string} [allowedSourceAddressPrefix] Mutually exclusive with + * the "allowedSourceAddressPrefixes" parameter. Should be an IP address or + * CIDR, for example "192.168.0.3" or "192.168.0.0/16". + * @property {array} [allowedSourceAddressPrefixes] Mutually exclusive with + * the "allowedSourceAddressPrefix" parameter. + * @property {string} maxRequestAccessDuration Maximum duration requests can + * be made for. In ISO 8601 duration format. Minimum 5 minutes, maximum 1 day */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/jitNetworkAccessRequest.js b/lib/services/securityManagement/lib/models/jitNetworkAccessRequest.js index db90de669d..a1a456a74f 100644 --- a/lib/services/securityManagement/lib/models/jitNetworkAccessRequest.js +++ b/lib/services/securityManagement/lib/models/jitNetworkAccessRequest.js @@ -16,9 +16,10 @@ class JitNetworkAccessRequest { /** * Create a JitNetworkAccessRequest. - * @member {array} virtualMachines - * @member {date} startTimeUtc The start time of the request in UTC - * @member {string} requestor The identity of the person who made the request + * @property {array} virtualMachines + * @property {date} startTimeUtc The start time of the request in UTC + * @property {string} requestor The identity of the person who made the + * request */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/jitNetworkAccessRequestPort.js b/lib/services/securityManagement/lib/models/jitNetworkAccessRequestPort.js index 1bcdb77351..31612ac09d 100644 --- a/lib/services/securityManagement/lib/models/jitNetworkAccessRequestPort.js +++ b/lib/services/securityManagement/lib/models/jitNetworkAccessRequestPort.js @@ -16,16 +16,17 @@ class JitNetworkAccessRequestPort { /** * Create a JitNetworkAccessRequestPort. - * @member {number} number - * @member {string} [allowedSourceAddressPrefix] Mutually exclusive with the - * "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, - * for example "192.168.0.3" or "192.168.0.0/16". - * @member {array} [allowedSourceAddressPrefixes] Mutually exclusive with the - * "allowedSourceAddressPrefix" parameter. - * @member {date} endTimeUtc The date & time at which the request ends in UTC - * @member {string} status The status of the port. Possible values include: + * @property {number} number + * @property {string} [allowedSourceAddressPrefix] Mutually exclusive with + * the "allowedSourceAddressPrefixes" parameter. Should be an IP address or + * CIDR, for example "192.168.0.3" or "192.168.0.0/16". + * @property {array} [allowedSourceAddressPrefixes] Mutually exclusive with + * the "allowedSourceAddressPrefix" parameter. + * @property {date} endTimeUtc The date & time at which the request ends in + * UTC + * @property {string} status The status of the port. Possible values include: * 'Revoked', 'Initiated' - * @member {string} statusReason A description of why the `status` has its + * @property {string} statusReason A description of why the `status` has its * value. Possible values include: 'Expired', 'UserRequested', * 'NewerRequestInitiated' */ diff --git a/lib/services/securityManagement/lib/models/jitNetworkAccessRequestVirtualMachine.js b/lib/services/securityManagement/lib/models/jitNetworkAccessRequestVirtualMachine.js index 4e7524d26d..4acefe8e14 100644 --- a/lib/services/securityManagement/lib/models/jitNetworkAccessRequestVirtualMachine.js +++ b/lib/services/securityManagement/lib/models/jitNetworkAccessRequestVirtualMachine.js @@ -16,9 +16,9 @@ class JitNetworkAccessRequestVirtualMachine { /** * Create a JitNetworkAccessRequestVirtualMachine. - * @member {string} id Resource ID of the virtual machine that is linked to + * @property {string} id Resource ID of the virtual machine that is linked to * this policy - * @member {array} ports The ports that were opened for the virtual machine + * @property {array} ports The ports that were opened for the virtual machine */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/kind.js b/lib/services/securityManagement/lib/models/kind.js index fec70c6c67..f81bce4066 100644 --- a/lib/services/securityManagement/lib/models/kind.js +++ b/lib/services/securityManagement/lib/models/kind.js @@ -17,7 +17,7 @@ class Kind { /** * Create a Kind. - * @member {string} [kind] Kind of the resource + * @property {string} [kind] Kind of the resource */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/listCustomAlertRule.js b/lib/services/securityManagement/lib/models/listCustomAlertRule.js new file mode 100644 index 0000000000..2961a1959f --- /dev/null +++ b/lib/services/securityManagement/lib/models/listCustomAlertRule.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A List custom alert rule + * + * @extends models['CustomAlertRule'] + */ +class ListCustomAlertRule extends models['CustomAlertRule'] { + /** + * Create a ListCustomAlertRule. + * @property {string} [valueType] The value type of the items in the list. + * Possible values include: 'IpCidr', 'String' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ListCustomAlertRule + * + * @returns {object} metadata of ListCustomAlertRule + * + */ + mapper() { + return { + required: false, + serializedName: 'ListCustomAlertRule', + type: { + name: 'Composite', + className: 'ListCustomAlertRule', + modelProperties: { + displayName: { + required: false, + readOnly: true, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'description', + type: { + name: 'String' + } + }, + isEnabled: { + required: true, + serializedName: 'isEnabled', + type: { + name: 'Boolean' + } + }, + ruleType: { + required: true, + serializedName: 'ruleType', + type: { + name: 'String' + } + }, + valueType: { + required: false, + readOnly: true, + serializedName: 'valueType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ListCustomAlertRule; diff --git a/lib/services/securityManagement/lib/models/location.js b/lib/services/securityManagement/lib/models/location.js index 366adf3b59..6b67d645ff 100644 --- a/lib/services/securityManagement/lib/models/location.js +++ b/lib/services/securityManagement/lib/models/location.js @@ -17,7 +17,7 @@ class Location { /** * Create a Location. - * @member {string} [location] Location where the resource is stored + * @property {string} [location] Location where the resource is stored */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/operation.js b/lib/services/securityManagement/lib/models/operation.js index 52be69f344..af31009905 100644 --- a/lib/services/securityManagement/lib/models/operation.js +++ b/lib/services/securityManagement/lib/models/operation.js @@ -17,16 +17,16 @@ class Operation { /** * Create a Operation. - * @member {string} [name] Name of the operation - * @member {string} [origin] Where the operation is originated - * @member {object} [display] - * @member {string} [display.provider] The resource provider for the + * @property {string} [name] Name of the operation + * @property {string} [origin] Where the operation is originated + * @property {object} [display] + * @property {string} [display.provider] The resource provider for the * operation. - * @member {string} [display.resource] The display name of the resource the + * @property {string} [display.resource] The display name of the resource the * operation applies to. - * @member {string} [display.operation] The display name of the security + * @property {string} [display.operation] The display name of the security * operation. - * @member {string} [display.description] The description of the operation. + * @property {string} [display.description] The description of the operation. */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/operationDisplay.js b/lib/services/securityManagement/lib/models/operationDisplay.js index 514abfaba2..04b94b6cc7 100644 --- a/lib/services/securityManagement/lib/models/operationDisplay.js +++ b/lib/services/securityManagement/lib/models/operationDisplay.js @@ -17,11 +17,11 @@ class OperationDisplay { /** * Create a OperationDisplay. - * @member {string} [provider] The resource provider for the operation. - * @member {string} [resource] The display name of the resource the operation - * applies to. - * @member {string} [operation] The display name of the security operation. - * @member {string} [description] The description of the operation. + * @property {string} [provider] The resource provider for the operation. + * @property {string} [resource] The display name of the resource the + * operation applies to. + * @property {string} [operation] The display name of the security operation. + * @property {string} [description] The description of the operation. */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/operationList.js b/lib/services/securityManagement/lib/models/operationList.js index b50fa44b8f..b78411c586 100644 --- a/lib/services/securityManagement/lib/models/operationList.js +++ b/lib/services/securityManagement/lib/models/operationList.js @@ -16,7 +16,7 @@ class OperationList extends Array { /** * Create a OperationList. - * @member {string} [nextLink] The URI to fetch the next page. + * @property {string} [nextLink] The URI to fetch the next page. */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/pricing.js b/lib/services/securityManagement/lib/models/pricing.js index 3474916a05..ea97589a21 100644 --- a/lib/services/securityManagement/lib/models/pricing.js +++ b/lib/services/securityManagement/lib/models/pricing.js @@ -20,8 +20,11 @@ const models = require('./index'); class Pricing extends models['Resource'] { /** * Create a Pricing. - * @member {string} pricingTier Pricing tier type. Possible values include: - * 'Free', 'Standard' + * @property {string} pricingTier The pricing tier value. Possible values + * include: 'Free', 'Standard' + * @property {moment.duration} [freeTrialRemainingTime] The duration left for + * the subscriptions free trial period - in ISO 8601 format (e.g. + * P3Y6M4DT12H30M5S). */ constructor() { super(); @@ -71,6 +74,14 @@ class Pricing extends models['Resource'] { type: { name: 'String' } + }, + freeTrialRemainingTime: { + required: false, + readOnly: true, + serializedName: 'properties.freeTrialRemainingTime', + type: { + name: 'TimeSpan' + } } } } diff --git a/lib/services/securityManagement/lib/models/pricingList.js b/lib/services/securityManagement/lib/models/pricingList.js index f75672f10b..e2f8ca08b3 100644 --- a/lib/services/securityManagement/lib/models/pricingList.js +++ b/lib/services/securityManagement/lib/models/pricingList.js @@ -12,14 +12,14 @@ /** * List of pricing configurations response + * */ -class PricingList extends Array { +class PricingList { /** * Create a PricingList. - * @member {string} [nextLink] The URI to fetch the next page. + * @property {array} value List of pricing configurations */ constructor() { - super(); } /** @@ -38,7 +38,7 @@ class PricingList extends Array { modelProperties: { value: { required: true, - serializedName: '', + serializedName: 'value', type: { name: 'Sequence', element: { @@ -50,14 +50,6 @@ class PricingList extends Array { } } } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } } } } diff --git a/lib/services/securityManagement/lib/models/regulatoryComplianceAssessment.js b/lib/services/securityManagement/lib/models/regulatoryComplianceAssessment.js new file mode 100644 index 0000000000..1061139212 --- /dev/null +++ b/lib/services/securityManagement/lib/models/regulatoryComplianceAssessment.js @@ -0,0 +1,153 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Regulatory compliance assessment details and state + * + * @extends models['Resource'] + */ +class RegulatoryComplianceAssessment extends models['Resource'] { + /** + * Create a RegulatoryComplianceAssessment. + * @property {string} [description] The description of the regulatory + * compliance assessment + * @property {string} [assessmentType] The expected type of assessment + * contained in the AssessmentDetailsLink + * @property {string} [assessmentDetailsLink] Link to more detailed + * assessment results data. The response type will be according to the + * assessmentType field + * @property {string} [state] Aggregative state based on the assessment's + * scanned resources states. Possible values include: 'Passed', 'Failed', + * 'Skipped', 'Unsupported' + * @property {number} [passedResources] The given assessment's related + * resources count with passed state. + * @property {number} [failedResources] The given assessment's related + * resources count with failed state. + * @property {number} [skippedResources] The given assessment's related + * resources count with skipped state. + * @property {number} [unsupportedResources] The given assessment's related + * resources count with unsupported state. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RegulatoryComplianceAssessment + * + * @returns {object} metadata of RegulatoryComplianceAssessment + * + */ + mapper() { + return { + required: false, + serializedName: 'RegulatoryComplianceAssessment', + type: { + name: 'Composite', + className: 'RegulatoryComplianceAssessment', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + assessmentType: { + required: false, + readOnly: true, + serializedName: 'properties.assessmentType', + type: { + name: 'String' + } + }, + assessmentDetailsLink: { + required: false, + readOnly: true, + serializedName: 'properties.assessmentDetailsLink', + type: { + name: 'String' + } + }, + state: { + required: false, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + passedResources: { + required: false, + readOnly: true, + serializedName: 'properties.passedResources', + type: { + name: 'Number' + } + }, + failedResources: { + required: false, + readOnly: true, + serializedName: 'properties.failedResources', + type: { + name: 'Number' + } + }, + skippedResources: { + required: false, + readOnly: true, + serializedName: 'properties.skippedResources', + type: { + name: 'Number' + } + }, + unsupportedResources: { + required: false, + readOnly: true, + serializedName: 'properties.unsupportedResources', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = RegulatoryComplianceAssessment; diff --git a/lib/services/securityManagement/lib/models/regulatoryComplianceAssessmentList.js b/lib/services/securityManagement/lib/models/regulatoryComplianceAssessmentList.js new file mode 100644 index 0000000000..0d6a1cb699 --- /dev/null +++ b/lib/services/securityManagement/lib/models/regulatoryComplianceAssessmentList.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * List of regulatory compliance assessment response + */ +class RegulatoryComplianceAssessmentList extends Array { + /** + * Create a RegulatoryComplianceAssessmentList. + * @property {string} [nextLink] The URI to fetch the next page. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RegulatoryComplianceAssessmentList + * + * @returns {object} metadata of RegulatoryComplianceAssessmentList + * + */ + mapper() { + return { + required: false, + serializedName: 'RegulatoryComplianceAssessmentList', + type: { + name: 'Composite', + className: 'RegulatoryComplianceAssessmentList', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RegulatoryComplianceAssessmentElementType', + type: { + name: 'Composite', + className: 'RegulatoryComplianceAssessment' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RegulatoryComplianceAssessmentList; diff --git a/lib/services/securityManagement/lib/models/regulatoryComplianceControl.js b/lib/services/securityManagement/lib/models/regulatoryComplianceControl.js new file mode 100644 index 0000000000..bffec8b1a6 --- /dev/null +++ b/lib/services/securityManagement/lib/models/regulatoryComplianceControl.js @@ -0,0 +1,122 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Regulatory compliance control details and state + * + * @extends models['Resource'] + */ +class RegulatoryComplianceControl extends models['Resource'] { + /** + * Create a RegulatoryComplianceControl. + * @property {string} [description] The description of the regulatory + * compliance control + * @property {string} [state] Aggregative state based on the control's + * supported assessments states. Possible values include: 'Passed', 'Failed', + * 'Skipped', 'Unsupported' + * @property {number} [passedAssessments] The number of supported regulatory + * compliance assessments of the given control with a passed state + * @property {number} [failedAssessments] The number of supported regulatory + * compliance assessments of the given control with a failed state + * @property {number} [skippedAssessments] The number of supported regulatory + * compliance assessments of the given control with a skipped state + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RegulatoryComplianceControl + * + * @returns {object} metadata of RegulatoryComplianceControl + * + */ + mapper() { + return { + required: false, + serializedName: 'RegulatoryComplianceControl', + type: { + name: 'Composite', + className: 'RegulatoryComplianceControl', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + state: { + required: false, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + passedAssessments: { + required: false, + readOnly: true, + serializedName: 'properties.passedAssessments', + type: { + name: 'Number' + } + }, + failedAssessments: { + required: false, + readOnly: true, + serializedName: 'properties.failedAssessments', + type: { + name: 'Number' + } + }, + skippedAssessments: { + required: false, + readOnly: true, + serializedName: 'properties.skippedAssessments', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = RegulatoryComplianceControl; diff --git a/lib/services/securityManagement/lib/models/regulatoryComplianceControlList.js b/lib/services/securityManagement/lib/models/regulatoryComplianceControlList.js new file mode 100644 index 0000000000..71feb5a173 --- /dev/null +++ b/lib/services/securityManagement/lib/models/regulatoryComplianceControlList.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * List of regulatory compliance controls response + */ +class RegulatoryComplianceControlList extends Array { + /** + * Create a RegulatoryComplianceControlList. + * @property {string} [nextLink] The URI to fetch the next page. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RegulatoryComplianceControlList + * + * @returns {object} metadata of RegulatoryComplianceControlList + * + */ + mapper() { + return { + required: false, + serializedName: 'RegulatoryComplianceControlList', + type: { + name: 'Composite', + className: 'RegulatoryComplianceControlList', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RegulatoryComplianceControlElementType', + type: { + name: 'Composite', + className: 'RegulatoryComplianceControl' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RegulatoryComplianceControlList; diff --git a/lib/services/securityManagement/lib/models/regulatoryComplianceStandard.js b/lib/services/securityManagement/lib/models/regulatoryComplianceStandard.js new file mode 100644 index 0000000000..5d4bad6461 --- /dev/null +++ b/lib/services/securityManagement/lib/models/regulatoryComplianceStandard.js @@ -0,0 +1,123 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Regulatory compliance standard details and state + * + * @extends models['Resource'] + */ +class RegulatoryComplianceStandard extends models['Resource'] { + /** + * Create a RegulatoryComplianceStandard. + * @property {string} [state] Aggregative state based on the standard's + * supported controls states. Possible values include: 'Passed', 'Failed', + * 'Skipped', 'Unsupported' + * @property {number} [passedControls] The number of supported regulatory + * compliance controls of the given standard with a passed state + * @property {number} [failedControls] The number of supported regulatory + * compliance controls of the given standard with a failed state + * @property {number} [skippedControls] The number of supported regulatory + * compliance controls of the given standard with a skipped state + * @property {number} [unsupportedControls] The number of regulatory + * compliance controls of the given standard which are unsupported by + * automated assessments + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RegulatoryComplianceStandard + * + * @returns {object} metadata of RegulatoryComplianceStandard + * + */ + mapper() { + return { + required: false, + serializedName: 'RegulatoryComplianceStandard', + type: { + name: 'Composite', + className: 'RegulatoryComplianceStandard', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + state: { + required: false, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + passedControls: { + required: false, + readOnly: true, + serializedName: 'properties.passedControls', + type: { + name: 'Number' + } + }, + failedControls: { + required: false, + readOnly: true, + serializedName: 'properties.failedControls', + type: { + name: 'Number' + } + }, + skippedControls: { + required: false, + readOnly: true, + serializedName: 'properties.skippedControls', + type: { + name: 'Number' + } + }, + unsupportedControls: { + required: false, + readOnly: true, + serializedName: 'properties.unsupportedControls', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = RegulatoryComplianceStandard; diff --git a/lib/services/securityManagement/lib/models/regulatoryComplianceStandardList.js b/lib/services/securityManagement/lib/models/regulatoryComplianceStandardList.js new file mode 100644 index 0000000000..507f00499e --- /dev/null +++ b/lib/services/securityManagement/lib/models/regulatoryComplianceStandardList.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * List of regulatory compliance standards response + */ +class RegulatoryComplianceStandardList extends Array { + /** + * Create a RegulatoryComplianceStandardList. + * @property {string} [nextLink] The URI to fetch the next page. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RegulatoryComplianceStandardList + * + * @returns {object} metadata of RegulatoryComplianceStandardList + * + */ + mapper() { + return { + required: false, + serializedName: 'RegulatoryComplianceStandardList', + type: { + name: 'Composite', + className: 'RegulatoryComplianceStandardList', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RegulatoryComplianceStandardElementType', + type: { + name: 'Composite', + className: 'RegulatoryComplianceStandard' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RegulatoryComplianceStandardList; diff --git a/lib/services/securityManagement/lib/models/resource.js b/lib/services/securityManagement/lib/models/resource.js index d32ef328f6..fe96e636d9 100644 --- a/lib/services/securityManagement/lib/models/resource.js +++ b/lib/services/securityManagement/lib/models/resource.js @@ -20,9 +20,9 @@ const models = require('./index'); class Resource extends models['BaseResource'] { /** * Create a Resource. - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type + * @property {string} [id] Resource Id + * @property {string} [name] Resource name + * @property {string} [type] Resource type */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/rule.js b/lib/services/securityManagement/lib/models/rule.js new file mode 100644 index 0000000000..05257f01da --- /dev/null +++ b/lib/services/securityManagement/lib/models/rule.js @@ -0,0 +1,103 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes remote addresses that is recommended to communicate with the Azure + * resource on some (Protocol, Port, Direction). All other remote addresses are + * recommended to be blocked + * + */ +class Rule { + /** + * Create a Rule. + * @property {string} [name] The name of the rule + * @property {string} [direction] The rule's direction. Possible values + * include: 'Inbound', 'Outbound' + * @property {number} [destinationPort] The rule's destination port + * @property {array} [protocols] The rule's transport protocols + * @property {array} [ipAddresses] The remote IP addresses that should be + * able to communicate with the Azure resource on the rule's destination port + * and protocol + */ + constructor() { + } + + /** + * Defines the metadata of Rule + * + * @returns {object} metadata of Rule + * + */ + mapper() { + return { + required: false, + serializedName: 'Rule', + type: { + name: 'Composite', + className: 'Rule', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + direction: { + required: false, + serializedName: 'direction', + type: { + name: 'String' + } + }, + destinationPort: { + required: false, + serializedName: 'destinationPort', + type: { + name: 'Number' + } + }, + protocols: { + required: false, + serializedName: 'protocols', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TransportProtocolElementType', + type: { + name: 'String' + } + } + } + }, + ipAddresses: { + required: false, + serializedName: 'ipAddresses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = Rule; diff --git a/lib/services/securityManagement/lib/models/securityContact.js b/lib/services/securityManagement/lib/models/securityContact.js index ce7257074e..839e3bc05c 100644 --- a/lib/services/securityManagement/lib/models/securityContact.js +++ b/lib/services/securityManagement/lib/models/securityContact.js @@ -20,12 +20,12 @@ const models = require('./index'); class SecurityContact extends models['Resource'] { /** * Create a SecurityContact. - * @member {string} email The email of this security contact - * @member {string} [phone] The phone number of this security contact - * @member {string} alertNotifications Whether to send security alerts + * @property {string} email The email of this security contact + * @property {string} [phone] The phone number of this security contact + * @property {string} alertNotifications Whether to send security alerts * notifications to the security contact. Possible values include: 'On', * 'Off' - * @member {string} alertsToAdmins Whether to send security alerts + * @property {string} alertsToAdmins Whether to send security alerts * notifications to subscription admins. Possible values include: 'On', 'Off' */ constructor() { diff --git a/lib/services/securityManagement/lib/models/securityContactList.js b/lib/services/securityManagement/lib/models/securityContactList.js index 6647309edb..535f5761e4 100644 --- a/lib/services/securityManagement/lib/models/securityContactList.js +++ b/lib/services/securityManagement/lib/models/securityContactList.js @@ -16,7 +16,7 @@ class SecurityContactList extends Array { /** * Create a SecurityContactList. - * @member {string} [nextLink] The URI to fetch the next page. + * @property {string} [nextLink] The URI to fetch the next page. */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/securityTask.js b/lib/services/securityManagement/lib/models/securityTask.js index 3b6b13557d..67bc6b31a0 100644 --- a/lib/services/securityManagement/lib/models/securityTask.js +++ b/lib/services/securityManagement/lib/models/securityTask.js @@ -20,13 +20,14 @@ const models = require('./index'); class SecurityTask extends models['Resource'] { /** * Create a SecurityTask. - * @member {string} [state] State of the task (Active, Resolved etc.) - * @member {date} [creationTimeUtc] The time this task was discovered in UTC - * @member {object} [securityTaskParameters] - * @member {string} [securityTaskParameters.name] Name of the task type - * @member {date} [lastStateChangeTimeUtc] The time this task's details were - * last changed in UTC - * @member {string} [subState] Additional data on the state of the task + * @property {string} [state] State of the task (Active, Resolved etc.) + * @property {date} [creationTimeUtc] The time this task was discovered in + * UTC + * @property {object} [securityTaskParameters] + * @property {string} [securityTaskParameters.name] Name of the task type + * @property {date} [lastStateChangeTimeUtc] The time this task's details + * were last changed in UTC + * @property {string} [subState] Additional data on the state of the task */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/securityTaskList.js b/lib/services/securityManagement/lib/models/securityTaskList.js index bc0e3f0214..83e3bf625b 100644 --- a/lib/services/securityManagement/lib/models/securityTaskList.js +++ b/lib/services/securityManagement/lib/models/securityTaskList.js @@ -16,7 +16,7 @@ class SecurityTaskList extends Array { /** * Create a SecurityTaskList. - * @member {string} [nextLink] The URI to fetch the next page. + * @property {string} [nextLink] The URI to fetch the next page. */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/securityTaskParameters.js b/lib/services/securityManagement/lib/models/securityTaskParameters.js index e657353d23..e3c7a43cee 100644 --- a/lib/services/securityManagement/lib/models/securityTaskParameters.js +++ b/lib/services/securityManagement/lib/models/securityTaskParameters.js @@ -18,7 +18,7 @@ class SecurityTaskParameters { /** * Create a SecurityTaskParameters. - * @member {string} [name] Name of the task type + * @property {string} [name] Name of the task type */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/sensitivityLabel.js b/lib/services/securityManagement/lib/models/sensitivityLabel.js index 637c8725e6..d6201f7a41 100644 --- a/lib/services/securityManagement/lib/models/sensitivityLabel.js +++ b/lib/services/securityManagement/lib/models/sensitivityLabel.js @@ -17,9 +17,10 @@ class SensitivityLabel { /** * Create a SensitivityLabel. - * @member {string} [displayName] The name of the sensitivity label. - * @member {number} [order] The order of the sensitivity label. - * @member {boolean} [enabled] Indicates whether the label is enabled or not. + * @property {string} [displayName] The name of the sensitivity label. + * @property {number} [order] The order of the sensitivity label. + * @property {boolean} [enabled] Indicates whether the label is enabled or + * not. */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/setting.js b/lib/services/securityManagement/lib/models/setting.js index b07ec9ccce..6e7b01c8cc 100644 --- a/lib/services/securityManagement/lib/models/setting.js +++ b/lib/services/securityManagement/lib/models/setting.js @@ -10,19 +10,19 @@ 'use strict'; +const models = require('./index'); + /** * Represents a security setting in Azure Security Center. * + * @extends models['SettingResource'] */ -class Setting { +class Setting extends models['SettingResource'] { /** * Create a Setting. - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type - * @member {string} kind Polymorphic Discriminator */ constructor() { + super(); } /** @@ -37,11 +37,6 @@ class Setting { serializedName: 'Setting', type: { name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'kind', - clientName: 'kind' - }, - uberParent: 'Setting', className: 'Setting', modelProperties: { id: { @@ -71,7 +66,6 @@ class Setting { kind: { required: true, serializedName: 'kind', - isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/securityManagement/lib/models/settingResource.js b/lib/services/securityManagement/lib/models/settingResource.js new file mode 100644 index 0000000000..16e9f1f7e9 --- /dev/null +++ b/lib/services/securityManagement/lib/models/settingResource.js @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The kind of the security setting + * + * @extends models['Resource'] + */ +class SettingResource extends models['Resource'] { + /** + * Create a SettingResource. + * @property {string} kind the kind of the settings string + * (DataExportSetting). Possible values include: 'DataExportSetting', + * 'AlertSuppressionSetting' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SettingResource + * + * @returns {object} metadata of SettingResource + * + */ + mapper() { + return { + required: false, + serializedName: 'SettingResource', + type: { + name: 'Composite', + className: 'SettingResource', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + kind: { + required: true, + serializedName: 'kind', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SettingResource; diff --git a/lib/services/securityManagement/lib/models/settingsList.js b/lib/services/securityManagement/lib/models/settingsList.js index f0fd4ba0cb..608398f0e7 100644 --- a/lib/services/securityManagement/lib/models/settingsList.js +++ b/lib/services/securityManagement/lib/models/settingsList.js @@ -16,7 +16,7 @@ class SettingsList extends Array { /** * Create a SettingsList. - * @member {string} [nextLink] The URI to fetch the next page. + * @property {string} [nextLink] The URI to fetch the next page. */ constructor() { super(); @@ -46,11 +46,6 @@ class SettingsList extends Array { serializedName: 'SettingElementType', type: { name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'kind', - clientName: 'kind' - }, - uberParent: 'Setting', className: 'Setting' } } diff --git a/lib/services/securityManagement/lib/models/thresholdCustomAlertRule.js b/lib/services/securityManagement/lib/models/thresholdCustomAlertRule.js new file mode 100644 index 0000000000..8a71aa1542 --- /dev/null +++ b/lib/services/securityManagement/lib/models/thresholdCustomAlertRule.js @@ -0,0 +1,95 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A custom alert rule that checks if a value (depends on the custom alert + * type) is within the given range. + * + * @extends models['CustomAlertRule'] + */ +class ThresholdCustomAlertRule extends models['CustomAlertRule'] { + /** + * Create a ThresholdCustomAlertRule. + * @property {number} minThreshold The minimum threshold. + * @property {number} maxThreshold The maximum threshold. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ThresholdCustomAlertRule + * + * @returns {object} metadata of ThresholdCustomAlertRule + * + */ + mapper() { + return { + required: false, + serializedName: 'ThresholdCustomAlertRule', + type: { + name: 'Composite', + className: 'ThresholdCustomAlertRule', + modelProperties: { + displayName: { + required: false, + readOnly: true, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'description', + type: { + name: 'String' + } + }, + isEnabled: { + required: true, + serializedName: 'isEnabled', + type: { + name: 'Boolean' + } + }, + ruleType: { + required: true, + serializedName: 'ruleType', + type: { + name: 'String' + } + }, + minThreshold: { + required: true, + serializedName: 'minThreshold', + type: { + name: 'Number' + } + }, + maxThreshold: { + required: true, + serializedName: 'maxThreshold', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ThresholdCustomAlertRule; diff --git a/lib/services/securityManagement/lib/models/timeWindowCustomAlertRule.js b/lib/services/securityManagement/lib/models/timeWindowCustomAlertRule.js new file mode 100644 index 0000000000..47e232f144 --- /dev/null +++ b/lib/services/securityManagement/lib/models/timeWindowCustomAlertRule.js @@ -0,0 +1,104 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A custom alert rule that checks if the number of activities (depends on the + * custom alert type) in a time window is within the given range. + * + */ +class TimeWindowCustomAlertRule { + /** + * Create a TimeWindowCustomAlertRule. + * @property {string} [displayName] The display name of the custom alert. + * @property {string} [description] The description of the custom alert. + * @property {boolean} isEnabled Whether the custom alert is enabled. + * @property {string} ruleType The type of the custom alert rule. + * @property {number} minThreshold The minimum threshold. + * @property {number} maxThreshold The maximum threshold. + * @property {moment.duration} timeWindowSize The time window size in iso8601 + * format. + */ + constructor() { + } + + /** + * Defines the metadata of TimeWindowCustomAlertRule + * + * @returns {object} metadata of TimeWindowCustomAlertRule + * + */ + mapper() { + return { + required: false, + serializedName: 'TimeWindowCustomAlertRule', + type: { + name: 'Composite', + className: 'TimeWindowCustomAlertRule', + modelProperties: { + displayName: { + required: false, + readOnly: true, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'description', + type: { + name: 'String' + } + }, + isEnabled: { + required: true, + serializedName: 'isEnabled', + type: { + name: 'Boolean' + } + }, + ruleType: { + required: true, + serializedName: 'ruleType', + type: { + name: 'String' + } + }, + minThreshold: { + required: true, + serializedName: 'minThreshold', + type: { + name: 'Number' + } + }, + maxThreshold: { + required: true, + serializedName: 'maxThreshold', + type: { + name: 'Number' + } + }, + timeWindowSize: { + required: true, + serializedName: 'timeWindowSize', + type: { + name: 'TimeSpan' + } + } + } + } + }; + } +} + +module.exports = TimeWindowCustomAlertRule; diff --git a/lib/services/securityManagement/lib/models/topologyList.js b/lib/services/securityManagement/lib/models/topologyList.js index 81b73a238d..dee4418fa2 100644 --- a/lib/services/securityManagement/lib/models/topologyList.js +++ b/lib/services/securityManagement/lib/models/topologyList.js @@ -16,7 +16,7 @@ class TopologyList extends Array { /** * Create a TopologyList. - * @member {string} [nextLink] The URI to fetch the next page. + * @property {string} [nextLink] The URI to fetch the next page. */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/topologyResource.js b/lib/services/securityManagement/lib/models/topologyResource.js index 7d33b6cd43..39b946375f 100644 --- a/lib/services/securityManagement/lib/models/topologyResource.js +++ b/lib/services/securityManagement/lib/models/topologyResource.js @@ -16,14 +16,14 @@ class TopologyResource { /** * Create a TopologyResource. - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type - * @member {string} [location] Location where the resource is stored - * @member {date} [calculatedDateTime] The UTC time on which the topology was - * calculated - * @member {array} [topologyResources] Azure resources which are part of this - * topology resource + * @property {string} [id] Resource Id + * @property {string} [name] Resource name + * @property {string} [type] Resource type + * @property {string} [location] Location where the resource is stored + * @property {date} [calculatedDateTime] The UTC time on which the topology + * was calculated + * @property {array} [topologyResources] Azure resources which are part of + * this topology resource */ constructor() { } diff --git a/lib/services/securityManagement/lib/models/topologySingleResource.js b/lib/services/securityManagement/lib/models/topologySingleResource.js index 85a139e42a..bdd3a962db 100644 --- a/lib/services/securityManagement/lib/models/topologySingleResource.js +++ b/lib/services/securityManagement/lib/models/topologySingleResource.js @@ -16,18 +16,18 @@ class TopologySingleResource { /** * Create a TopologySingleResource. - * @member {string} [resourceId] Azure resource id - * @member {string} [severity] The security severity of the resource - * @member {boolean} [recommendationsExist] Indicates if the resource has + * @property {string} [resourceId] Azure resource id + * @property {string} [severity] The security severity of the resource + * @property {boolean} [recommendationsExist] Indicates if the resource has * security recommendations - * @member {string} [networkZones] Indicates the resource connectivity level - * to the Internet (InternetFacing, Internal ,etc.) - * @member {number} [topologyScore] Score of the resource based on its + * @property {string} [networkZones] Indicates the resource connectivity + * level to the Internet (InternetFacing, Internal ,etc.) + * @property {number} [topologyScore] Score of the resource based on its * security severity - * @member {string} [location] The location of this resource - * @member {array} [parents] Azure resources connected to this resource which - * are in higher level in the topology view - * @member {array} [children] Azure resources connected to this resource + * @property {string} [location] The location of this resource + * @property {array} [parents] Azure resources connected to this resource + * which are in higher level in the topology view + * @property {array} [children] Azure resources connected to this resource * which are in lower level in the topology view */ constructor() { diff --git a/lib/services/securityManagement/lib/models/topologySingleResourceChild.js b/lib/services/securityManagement/lib/models/topologySingleResourceChild.js index bbb26e7052..37f1efa777 100644 --- a/lib/services/securityManagement/lib/models/topologySingleResourceChild.js +++ b/lib/services/securityManagement/lib/models/topologySingleResourceChild.js @@ -16,7 +16,7 @@ class TopologySingleResourceChild { /** * Create a TopologySingleResourceChild. - * @member {string} [resourceId] Azure resource id which serves as child + * @property {string} [resourceId] Azure resource id which serves as child * resource in topology view */ constructor() { diff --git a/lib/services/securityManagement/lib/models/topologySingleResourceParent.js b/lib/services/securityManagement/lib/models/topologySingleResourceParent.js index c08dff05d2..ab3af80bae 100644 --- a/lib/services/securityManagement/lib/models/topologySingleResourceParent.js +++ b/lib/services/securityManagement/lib/models/topologySingleResourceParent.js @@ -16,7 +16,7 @@ class TopologySingleResourceParent { /** * Create a TopologySingleResourceParent. - * @member {string} [resourceId] Azure resource id which serves as parent + * @property {string} [resourceId] Azure resource id which serves as parent * resource in topology view */ constructor() { diff --git a/lib/services/securityManagement/lib/models/workspaceSetting.js b/lib/services/securityManagement/lib/models/workspaceSetting.js index 08e515f9ed..1e038aeb87 100644 --- a/lib/services/securityManagement/lib/models/workspaceSetting.js +++ b/lib/services/securityManagement/lib/models/workspaceSetting.js @@ -20,11 +20,11 @@ const models = require('./index'); class WorkspaceSetting extends models['Resource'] { /** * Create a WorkspaceSetting. - * @member {string} workspaceId The full Azure ID of the workspace to save + * @property {string} workspaceId The full Azure ID of the workspace to save * the data in - * @member {string} scope All the VMs in this scope will send their security - * data to the mentioned workspace unless overridden by a setting with more - * specific scope + * @property {string} scope All the VMs in this scope will send their + * security data to the mentioned workspace unless overridden by a setting + * with more specific scope */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/models/workspaceSettingList.js b/lib/services/securityManagement/lib/models/workspaceSettingList.js index 3db19fc072..1aac2b2c6a 100644 --- a/lib/services/securityManagement/lib/models/workspaceSettingList.js +++ b/lib/services/securityManagement/lib/models/workspaceSettingList.js @@ -16,7 +16,7 @@ class WorkspaceSettingList extends Array { /** * Create a WorkspaceSettingList. - * @member {string} [nextLink] The URI to fetch the next page. + * @property {string} [nextLink] The URI to fetch the next page. */ constructor() { super(); diff --git a/lib/services/securityManagement/lib/operations/adaptiveNetworkHardenings.js b/lib/services/securityManagement/lib/operations/adaptiveNetworkHardenings.js new file mode 100644 index 0000000000..8e8857d3fc --- /dev/null +++ b/lib/services/securityManagement/lib/operations/adaptiveNetworkHardenings.js @@ -0,0 +1,1319 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets a list of Adaptive Network Hardenings resources in scope of an extended + * resource. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AdaptiveNetworkHardeningsList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2015-06-01-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { + if (this.client.subscriptionId.match(/^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/) === null) + { + throw new Error('"this.client.subscriptionId" should satisfy the constraint - "Pattern": /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/'); + } + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (resourceNamespace === null || resourceNamespace === undefined || typeof resourceNamespace.valueOf() !== 'string') { + throw new Error('resourceNamespace cannot be null or undefined and it must be of type string.'); + } + if (resourceType === null || resourceType === undefined || typeof resourceType.valueOf() !== 'string') { + throw new Error('resourceType cannot be null or undefined and it must be of type string.'); + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceNamespace}', encodeURIComponent(resourceNamespace)); + requestUrl = requestUrl.replace('{resourceType}', encodeURIComponent(resourceType)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AdaptiveNetworkHardeningsList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a single Adaptive Network Hardening resource + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {string} adaptiveNetworkHardeningResourceName The name of the + * Adaptive Network Hardening resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AdaptiveNetworkHardening} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2015-06-01-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { + if (this.client.subscriptionId.match(/^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/) === null) + { + throw new Error('"this.client.subscriptionId" should satisfy the constraint - "Pattern": /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/'); + } + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (resourceNamespace === null || resourceNamespace === undefined || typeof resourceNamespace.valueOf() !== 'string') { + throw new Error('resourceNamespace cannot be null or undefined and it must be of type string.'); + } + if (resourceType === null || resourceType === undefined || typeof resourceType.valueOf() !== 'string') { + throw new Error('resourceType cannot be null or undefined and it must be of type string.'); + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (adaptiveNetworkHardeningResourceName === null || adaptiveNetworkHardeningResourceName === undefined || typeof adaptiveNetworkHardeningResourceName.valueOf() !== 'string') { + throw new Error('adaptiveNetworkHardeningResourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceNamespace}', encodeURIComponent(resourceNamespace)); + requestUrl = requestUrl.replace('{resourceType}', encodeURIComponent(resourceType)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + requestUrl = requestUrl.replace('{adaptiveNetworkHardeningResourceName}', encodeURIComponent(adaptiveNetworkHardeningResourceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AdaptiveNetworkHardening']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Enforces the given rules on the NSG(s) listed in the request + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {string} adaptiveNetworkHardeningResourceName The name of the + * Adaptive Network Hardening resource. + * + * @param {object} body + * + * @param {array} body.rules The rules to enforce + * + * @param {array} body.networkSecurityGroups The Azure resource IDs of the + * effective network security groups that will be updated with the created + * security rules from the Adaptive Network Hardening rules + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _enforce(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginEnforce(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Enforces the given rules on the NSG(s) listed in the request + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {string} adaptiveNetworkHardeningResourceName The name of the + * Adaptive Network Hardening resource. + * + * @param {object} body + * + * @param {array} body.rules The rules to enforce + * + * @param {array} body.networkSecurityGroups The Azure resource IDs of the + * effective network security groups that will be updated with the created + * security rules from the Adaptive Network Hardening rules + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginEnforce(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let adaptiveNetworkHardeningEnforceAction = 'enforce'; + let apiVersion = '2015-06-01-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { + if (this.client.subscriptionId.match(/^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/) === null) + { + throw new Error('"this.client.subscriptionId" should satisfy the constraint - "Pattern": /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/'); + } + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (resourceNamespace === null || resourceNamespace === undefined || typeof resourceNamespace.valueOf() !== 'string') { + throw new Error('resourceNamespace cannot be null or undefined and it must be of type string.'); + } + if (resourceType === null || resourceType === undefined || typeof resourceType.valueOf() !== 'string') { + throw new Error('resourceType cannot be null or undefined and it must be of type string.'); + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (adaptiveNetworkHardeningResourceName === null || adaptiveNetworkHardeningResourceName === undefined || typeof adaptiveNetworkHardeningResourceName.valueOf() !== 'string') { + throw new Error('adaptiveNetworkHardeningResourceName cannot be null or undefined and it must be of type string.'); + } + if (body === null || body === undefined) { + throw new Error('body cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceNamespace}', encodeURIComponent(resourceNamespace)); + requestUrl = requestUrl.replace('{resourceType}', encodeURIComponent(resourceType)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + requestUrl = requestUrl.replace('{adaptiveNetworkHardeningResourceName}', encodeURIComponent(adaptiveNetworkHardeningResourceName)); + requestUrl = requestUrl.replace('{adaptiveNetworkHardeningEnforceAction}', encodeURIComponent(adaptiveNetworkHardeningEnforceAction)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (body !== null && body !== undefined) { + let requestModelMapper = new client.models['AdaptiveNetworkHardeningEnforceRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, body, 'body'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(body, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a list of Adaptive Network Hardenings resources in scope of an extended + * resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AdaptiveNetworkHardeningsList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByExtendedResourceNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AdaptiveNetworkHardeningsList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a AdaptiveNetworkHardenings. */ +class AdaptiveNetworkHardenings { + /** + * Create a AdaptiveNetworkHardenings. + * @param {SecurityCenter} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByExtendedResource = _listByExtendedResource; + this._get = _get; + this._enforce = _enforce; + this._beginEnforce = _beginEnforce; + this._listByExtendedResourceNext = _listByExtendedResourceNext; + } + + /** + * Gets a list of Adaptive Network Hardenings resources in scope of an extended + * resource. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByExtendedResourceWithHttpOperationResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of Adaptive Network Hardenings resources in scope of an extended + * resource. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {AdaptiveNetworkHardeningsList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AdaptiveNetworkHardeningsList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName, options, optionalCallback); + } + } + + /** + * Gets a single Adaptive Network Hardening resource + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {string} adaptiveNetworkHardeningResourceName The name of the + * Adaptive Network Hardening resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a single Adaptive Network Hardening resource + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {string} adaptiveNetworkHardeningResourceName The name of the + * Adaptive Network Hardening resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {AdaptiveNetworkHardening} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AdaptiveNetworkHardening} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, options, optionalCallback); + } + } + + /** + * Enforces the given rules on the NSG(s) listed in the request + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {string} adaptiveNetworkHardeningResourceName The name of the + * Adaptive Network Hardening resource. + * + * @param {object} body + * + * @param {array} body.rules The rules to enforce + * + * @param {array} body.networkSecurityGroups The Azure resource IDs of the + * effective network security groups that will be updated with the created + * security rules from the Adaptive Network Hardening rules + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + enforceWithHttpOperationResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._enforce(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Enforces the given rules on the NSG(s) listed in the request + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {string} adaptiveNetworkHardeningResourceName The name of the + * Adaptive Network Hardening resource. + * + * @param {object} body + * + * @param {array} body.rules The rules to enforce + * + * @param {array} body.networkSecurityGroups The Azure resource IDs of the + * effective network security groups that will be updated with the created + * security rules from the Adaptive Network Hardening rules + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + enforce(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._enforce(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._enforce(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options, optionalCallback); + } + } + + /** + * Enforces the given rules on the NSG(s) listed in the request + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {string} adaptiveNetworkHardeningResourceName The name of the + * Adaptive Network Hardening resource. + * + * @param {object} body + * + * @param {array} body.rules The rules to enforce + * + * @param {array} body.networkSecurityGroups The Azure resource IDs of the + * effective network security groups that will be updated with the created + * security rules from the Adaptive Network Hardening rules + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginEnforceWithHttpOperationResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginEnforce(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Enforces the given rules on the NSG(s) listed in the request + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {string} adaptiveNetworkHardeningResourceName The name of the + * Adaptive Network Hardening resource. + * + * @param {object} body + * + * @param {array} body.rules The rules to enforce + * + * @param {array} body.networkSecurityGroups The Azure resource IDs of the + * effective network security groups that will be updated with the created + * security rules from the Adaptive Network Hardening rules + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginEnforce(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginEnforce(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginEnforce(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options, optionalCallback); + } + } + + /** + * Gets a list of Adaptive Network Hardenings resources in scope of an extended + * resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByExtendedResourceNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByExtendedResourceNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of Adaptive Network Hardenings resources in scope of an extended + * resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {AdaptiveNetworkHardeningsList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AdaptiveNetworkHardeningsList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByExtendedResourceNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByExtendedResourceNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByExtendedResourceNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = AdaptiveNetworkHardenings; diff --git a/lib/services/securityManagement/lib/operations/alerts.js b/lib/services/securityManagement/lib/operations/alerts.js index 05a7bf7b5f..76661d812a 100644 --- a/lib/services/securityManagement/lib/operations/alerts.js +++ b/lib/services/securityManagement/lib/operations/alerts.js @@ -54,7 +54,7 @@ function _list(options, callback) { let filter = (options && options.filter !== undefined) ? options.filter : undefined; let select = (options && options.select !== undefined) ? options.select : undefined; let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2015-06-01-preview'; + let apiVersion = '2019-01-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -179,7 +179,7 @@ function _list(options, callback) { } /** - * List all the alerts alerts that are associated with the resource group + * List all the alerts that are associated with the resource group * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. @@ -221,7 +221,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { let filter = (options && options.filter !== undefined) ? options.filter : undefined; let select = (options && options.select !== undefined) ? options.select : undefined; let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2015-06-01-preview'; + let apiVersion = '2019-01-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -404,7 +404,7 @@ function _listSubscriptionLevelAlertsByRegion(options, callback) { let filter = (options && options.filter !== undefined) ? options.filter : undefined; let select = (options && options.select !== undefined) ? options.select : undefined; let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2015-06-01-preview'; + let apiVersion = '2019-01-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -576,7 +576,7 @@ function _listResourceGroupLevelAlertsByRegion(resourceGroupName, options, callb let filter = (options && options.filter !== undefined) ? options.filter : undefined; let select = (options && options.select !== undefined) ? options.select : undefined; let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2015-06-01-preview'; + let apiVersion = '2019-01-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -755,7 +755,7 @@ function _getSubscriptionLevelAlert(alertName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-06-01-preview'; + let apiVersion = '2019-01-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -906,7 +906,7 @@ function _getResourceGroupLevelAlerts(alertName, resourceGroupName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-06-01-preview'; + let apiVersion = '2019-01-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1073,7 +1073,7 @@ function _updateSubscriptionLevelAlertState(alertName, alertUpdateActionType, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-06-01-preview'; + let apiVersion = '2019-01-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1212,7 +1212,7 @@ function _updateResourceGroupLevelAlertState(alertName, alertUpdateActionType, r if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-06-01-preview'; + let apiVersion = '2019-01-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1459,7 +1459,7 @@ function _listNext(nextPageLink, options, callback) { } /** - * List all the alerts alerts that are associated with the resource group + * List all the alerts that are associated with the resource group * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1954,7 +1954,7 @@ class Alerts { } /** - * List all the alerts alerts that are associated with the resource group + * List all the alerts that are associated with the resource group * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. @@ -1991,7 +1991,7 @@ class Alerts { } /** - * List all the alerts alerts that are associated with the resource group + * List all the alerts that are associated with the resource group * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. @@ -2676,7 +2676,7 @@ class Alerts { } /** - * List all the alerts alerts that are associated with the resource group + * List all the alerts that are associated with the resource group * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2707,7 +2707,7 @@ class Alerts { } /** - * List all the alerts alerts that are associated with the resource group + * List all the alerts that are associated with the resource group * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. diff --git a/lib/services/securityManagement/lib/operations/deviceSecurityGroups.js b/lib/services/securityManagement/lib/operations/deviceSecurityGroups.js new file mode 100644 index 0000000000..b810db1797 --- /dev/null +++ b/lib/services/securityManagement/lib/operations/deviceSecurityGroups.js @@ -0,0 +1,1208 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets the list of device security groups for the specified IoT hub resource. + * + * @param {string} resourceId The identifier of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeviceSecurityGroupList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-08-01-preview'; + // Validate + try { + if (resourceId === null || resourceId === undefined || typeof resourceId.valueOf() !== 'string') { + throw new Error('resourceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{resourceId}/providers/Microsoft.Security/deviceSecurityGroups'; + requestUrl = requestUrl.replace('{resourceId}', encodeURIComponent(resourceId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeviceSecurityGroupList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets the device security group for the specified IoT hub resource. + * + * @param {string} resourceId The identifier of the resource. + * + * @param {string} deviceSecurityGroupName The name of the security group. + * Please notice that the name is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeviceSecurityGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceId, deviceSecurityGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-08-01-preview'; + // Validate + try { + if (resourceId === null || resourceId === undefined || typeof resourceId.valueOf() !== 'string') { + throw new Error('resourceId cannot be null or undefined and it must be of type string.'); + } + if (deviceSecurityGroupName === null || deviceSecurityGroupName === undefined || typeof deviceSecurityGroupName.valueOf() !== 'string') { + throw new Error('deviceSecurityGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'; + requestUrl = requestUrl.replace('{resourceId}', encodeURIComponent(resourceId)); + requestUrl = requestUrl.replace('{deviceSecurityGroupName}', encodeURIComponent(deviceSecurityGroupName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeviceSecurityGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates or updates the device security group on a specified IoT hub + * resource. + * + * @param {string} resourceId The identifier of the resource. + * + * @param {string} deviceSecurityGroupName The name of the security group. + * Please notice that the name is case insensitive. + * + * @param {object} deviceSecurityGroup Security group object. + * + * @param {array} [deviceSecurityGroup.thresholdRules] A list of threshold + * custom alert rules. + * + * @param {array} [deviceSecurityGroup.timeWindowRules] A list of time window + * custom alert rules. + * + * @param {array} [deviceSecurityGroup.allowlistRules] A list of allow-list + * custom alert rules. + * + * @param {array} [deviceSecurityGroup.denylistRules] A list of deny-list + * custom alert rules. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeviceSecurityGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceId, deviceSecurityGroupName, deviceSecurityGroup, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-08-01-preview'; + // Validate + try { + if (resourceId === null || resourceId === undefined || typeof resourceId.valueOf() !== 'string') { + throw new Error('resourceId cannot be null or undefined and it must be of type string.'); + } + if (deviceSecurityGroupName === null || deviceSecurityGroupName === undefined || typeof deviceSecurityGroupName.valueOf() !== 'string') { + throw new Error('deviceSecurityGroupName cannot be null or undefined and it must be of type string.'); + } + if (deviceSecurityGroup === null || deviceSecurityGroup === undefined) { + throw new Error('deviceSecurityGroup cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'; + requestUrl = requestUrl.replace('{resourceId}', encodeURIComponent(resourceId)); + requestUrl = requestUrl.replace('{deviceSecurityGroupName}', encodeURIComponent(deviceSecurityGroupName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (deviceSecurityGroup !== null && deviceSecurityGroup !== undefined) { + let requestModelMapper = new client.models['DeviceSecurityGroup']().mapper(); + requestModel = client.serialize(requestModelMapper, deviceSecurityGroup, 'deviceSecurityGroup'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(deviceSecurityGroup, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeviceSecurityGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeviceSecurityGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the security group + * + * @param {string} resourceId The identifier of the resource. + * + * @param {string} deviceSecurityGroupName The name of the security group. + * Please notice that the name is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceId, deviceSecurityGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-08-01-preview'; + // Validate + try { + if (resourceId === null || resourceId === undefined || typeof resourceId.valueOf() !== 'string') { + throw new Error('resourceId cannot be null or undefined and it must be of type string.'); + } + if (deviceSecurityGroupName === null || deviceSecurityGroupName === undefined || typeof deviceSecurityGroupName.valueOf() !== 'string') { + throw new Error('deviceSecurityGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + '{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'; + requestUrl = requestUrl.replace('{resourceId}', encodeURIComponent(resourceId)); + requestUrl = requestUrl.replace('{deviceSecurityGroupName}', encodeURIComponent(deviceSecurityGroupName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets the list of device security groups for the specified IoT hub resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeviceSecurityGroupList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeviceSecurityGroupList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a DeviceSecurityGroups. */ +class DeviceSecurityGroups { + /** + * Create a DeviceSecurityGroups. + * @param {SecurityCenter} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._listNext = _listNext; + } + + /** + * Gets the list of device security groups for the specified IoT hub resource. + * + * @param {string} resourceId The identifier of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the list of device security groups for the specified IoT hub resource. + * + * @param {string} resourceId The identifier of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeviceSecurityGroupList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeviceSecurityGroupList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(resourceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceId, options, optionalCallback); + } + } + + /** + * Gets the device security group for the specified IoT hub resource. + * + * @param {string} resourceId The identifier of the resource. + * + * @param {string} deviceSecurityGroupName The name of the security group. + * Please notice that the name is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceId, deviceSecurityGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceId, deviceSecurityGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the device security group for the specified IoT hub resource. + * + * @param {string} resourceId The identifier of the resource. + * + * @param {string} deviceSecurityGroupName The name of the security group. + * Please notice that the name is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeviceSecurityGroup} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeviceSecurityGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceId, deviceSecurityGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceId, deviceSecurityGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceId, deviceSecurityGroupName, options, optionalCallback); + } + } + + /** + * Creates or updates the device security group on a specified IoT hub + * resource. + * + * @param {string} resourceId The identifier of the resource. + * + * @param {string} deviceSecurityGroupName The name of the security group. + * Please notice that the name is case insensitive. + * + * @param {object} deviceSecurityGroup Security group object. + * + * @param {array} [deviceSecurityGroup.thresholdRules] A list of threshold + * custom alert rules. + * + * @param {array} [deviceSecurityGroup.timeWindowRules] A list of time window + * custom alert rules. + * + * @param {array} [deviceSecurityGroup.allowlistRules] A list of allow-list + * custom alert rules. + * + * @param {array} [deviceSecurityGroup.denylistRules] A list of deny-list + * custom alert rules. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceId, deviceSecurityGroupName, deviceSecurityGroup, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceId, deviceSecurityGroupName, deviceSecurityGroup, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates the device security group on a specified IoT hub + * resource. + * + * @param {string} resourceId The identifier of the resource. + * + * @param {string} deviceSecurityGroupName The name of the security group. + * Please notice that the name is case insensitive. + * + * @param {object} deviceSecurityGroup Security group object. + * + * @param {array} [deviceSecurityGroup.thresholdRules] A list of threshold + * custom alert rules. + * + * @param {array} [deviceSecurityGroup.timeWindowRules] A list of time window + * custom alert rules. + * + * @param {array} [deviceSecurityGroup.allowlistRules] A list of allow-list + * custom alert rules. + * + * @param {array} [deviceSecurityGroup.denylistRules] A list of deny-list + * custom alert rules. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeviceSecurityGroup} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeviceSecurityGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceId, deviceSecurityGroupName, deviceSecurityGroup, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceId, deviceSecurityGroupName, deviceSecurityGroup, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceId, deviceSecurityGroupName, deviceSecurityGroup, options, optionalCallback); + } + } + + /** + * Deletes the security group + * + * @param {string} resourceId The identifier of the resource. + * + * @param {string} deviceSecurityGroupName The name of the security group. + * Please notice that the name is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceId, deviceSecurityGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceId, deviceSecurityGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the security group + * + * @param {string} resourceId The identifier of the resource. + * + * @param {string} deviceSecurityGroupName The name of the security group. + * Please notice that the name is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceId, deviceSecurityGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceId, deviceSecurityGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceId, deviceSecurityGroupName, options, optionalCallback); + } + } + + /** + * Gets the list of device security groups for the specified IoT hub resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the list of device security groups for the specified IoT hub resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeviceSecurityGroupList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeviceSecurityGroupList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = DeviceSecurityGroups; diff --git a/lib/services/securityManagement/lib/operations/index.d.ts b/lib/services/securityManagement/lib/operations/index.d.ts index 0adb512f20..e5f4aa8864 100644 --- a/lib/services/securityManagement/lib/operations/index.d.ts +++ b/lib/services/securityManagement/lib/operations/index.d.ts @@ -9,39 +9,50 @@ */ import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest'; +import * as moment from 'moment'; import * as models from '../models'; /** * @class - * Pricings + * RegulatoryComplianceStandards * __NOTE__: An instance of this class is automatically created for an * instance of the SecurityCenter. */ -export interface Pricings { +export interface RegulatoryComplianceStandards { /** - * Security pricing configurations in the subscription + * Supported regulatory compliance standards details and state + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] OData filter. Optional. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Security pricing configurations in the subscription + * Supported regulatory compliance standards details and state + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] OData filter. Optional. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -52,7 +63,7 @@ export interface Pricings { * * {Promise} A promise is returned. * - * @resolve {PricingList} - The deserialized result object. + * @resolve {RegulatoryComplianceStandardList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -60,24 +71,28 @@ export interface Pricings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PricingList} [result] - The deserialized result object if an error did not occur. - * See {@link PricingList} for more information. + * {RegulatoryComplianceStandardList} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceStandardList} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Security pricing configurations in the resource group + * Supported regulatory compliance details state for selected standard * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -85,18 +100,21 @@ export interface Pricings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, regulatoryComplianceStandardName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Security pricing configurations in the resource group + * Supported regulatory compliance details state for selected standard * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -109,7 +127,7 @@ export interface Pricings { * * {Promise} A promise is returned. * - * @resolve {PricingList} - The deserialized result object. + * @resolve {RegulatoryComplianceStandard} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -117,23 +135,24 @@ export interface Pricings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PricingList} [result] - The deserialized result object if an error did not occur. - * See {@link PricingList} for more information. + * {RegulatoryComplianceStandard} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceStandard} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, regulatoryComplianceStandardName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, regulatoryComplianceStandardName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, regulatoryComplianceStandardName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Security pricing configuration in the subscriptionSecurity pricing - * configuration in the subscription + * Supported regulatory compliance standards details and state * - * @param {string} pricingName name of the pricing configuration + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -142,17 +161,17 @@ export interface Pricings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getSubscriptionPricingWithHttpOperationResponse(pricingName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Security pricing configuration in the subscriptionSecurity pricing - * configuration in the subscription + * Supported regulatory compliance standards details and state * - * @param {string} pricingName name of the pricing configuration + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -166,7 +185,7 @@ export interface Pricings { * * {Promise} A promise is returned. * - * @resolve {Pricing} - The deserialized result object. + * @resolve {RegulatoryComplianceStandardList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -174,53 +193,67 @@ export interface Pricings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Pricing} [result] - The deserialized result object if an error did not occur. - * See {@link Pricing} for more information. + * {RegulatoryComplianceStandardList} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceStandardList} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getSubscriptionPricing(pricingName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getSubscriptionPricing(pricingName: string, callback: ServiceCallback): void; - getSubscriptionPricing(pricingName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * RegulatoryComplianceControls + * __NOTE__: An instance of this class is automatically created for an + * instance of the SecurityCenter. + */ +export interface RegulatoryComplianceControls { /** - * Security pricing configuration in the subscription - * - * @param {string} pricingName name of the pricing configuration + * All supported regulatory compliance controls details and state for selected + * standard * - * @param {object} pricing Pricing object + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. * - * @param {string} pricing.pricingTier Pricing tier type. Possible values - * include: 'Free', 'Standard' + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] OData filter. Optional. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateSubscriptionPricingWithHttpOperationResponse(pricingName: string, pricing: models.Pricing, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, regulatoryComplianceStandardName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Security pricing configuration in the subscription - * - * @param {string} pricingName name of the pricing configuration + * All supported regulatory compliance controls details and state for selected + * standard * - * @param {object} pricing Pricing object + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. * - * @param {string} pricing.pricingTier Pricing tier type. Possible values - * include: 'Free', 'Standard' + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] OData filter. Optional. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -231,7 +264,7 @@ export interface Pricings { * * {Promise} A promise is returned. * - * @resolve {Pricing} - The deserialized result object. + * @resolve {RegulatoryComplianceControlList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -239,25 +272,30 @@ export interface Pricings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Pricing} [result] - The deserialized result object if an error did not occur. - * See {@link Pricing} for more information. + * {RegulatoryComplianceControlList} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceControlList} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - updateSubscriptionPricing(pricingName: string, pricing: models.Pricing, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateSubscriptionPricing(pricingName: string, pricing: models.Pricing, callback: ServiceCallback): void; - updateSubscriptionPricing(pricingName: string, pricing: models.Pricing, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, regulatoryComplianceStandardName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, regulatoryComplianceStandardName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, regulatoryComplianceStandardName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Security pricing configuration in the resource group + * Selected regulatory compliance control details and state * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. * - * @param {string} pricingName name of the pricing configuration + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {string} regulatoryComplianceControlName Name of the regulatory + * compliance control object * * @param {object} [options] Optional Parameters. * @@ -266,19 +304,23 @@ export interface Pricings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getResourceGroupPricingWithHttpOperationResponse(resourceGroupName: string, pricingName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, regulatoryComplianceStandardName: string, regulatoryComplianceControlName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Security pricing configuration in the resource group + * Selected regulatory compliance control details and state * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. * - * @param {string} pricingName name of the pricing configuration + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {string} regulatoryComplianceControlName Name of the regulatory + * compliance control object * * @param {object} [options] Optional Parameters. * @@ -292,7 +334,7 @@ export interface Pricings { * * {Promise} A promise is returned. * - * @resolve {Pricing} - The deserialized result object. + * @resolve {RegulatoryComplianceControl} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -300,59 +342,133 @@ export interface Pricings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Pricing} [result] - The deserialized result object if an error did not occur. - * See {@link Pricing} for more information. + * {RegulatoryComplianceControl} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceControl} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, regulatoryComplianceStandardName: string, regulatoryComplianceControlName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, regulatoryComplianceStandardName: string, regulatoryComplianceControlName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, regulatoryComplianceStandardName: string, regulatoryComplianceControlName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * All supported regulatory compliance controls details and state for selected + * standard + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * All supported regulatory compliance controls details and state for selected + * standard + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RegulatoryComplianceControlList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RegulatoryComplianceControlList} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceControlList} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getResourceGroupPricing(resourceGroupName: string, pricingName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getResourceGroupPricing(resourceGroupName: string, pricingName: string, callback: ServiceCallback): void; - getResourceGroupPricing(resourceGroupName: string, pricingName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * RegulatoryComplianceAssessments + * __NOTE__: An instance of this class is automatically created for an + * instance of the SecurityCenter. + */ +export interface RegulatoryComplianceAssessments { /** - * Security pricing configuration in the resource group + * Details and state of assessments mapped to selected regulatory compliance + * control * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. * - * @param {string} pricingName name of the pricing configuration - * - * @param {object} pricing Pricing object + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object * - * @param {string} pricing.pricingTier Pricing tier type. Possible values - * include: 'Free', 'Standard' + * @param {string} regulatoryComplianceControlName Name of the regulatory + * compliance control object * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] OData filter. Optional. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateResourceGroupPricingWithHttpOperationResponse(resourceGroupName: string, pricingName: string, pricing: models.Pricing, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, regulatoryComplianceStandardName: string, regulatoryComplianceControlName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Security pricing configuration in the resource group + * Details and state of assessments mapped to selected regulatory compliance + * control * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. * - * @param {string} pricingName name of the pricing configuration - * - * @param {object} pricing Pricing object + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object * - * @param {string} pricing.pricingTier Pricing tier type. Possible values - * include: 'Free', 'Standard' + * @param {string} regulatoryComplianceControlName Name of the regulatory + * compliance control object * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] OData filter. Optional. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -363,7 +479,7 @@ export interface Pricings { * * {Promise} A promise is returned. * - * @resolve {Pricing} - The deserialized result object. + * @resolve {RegulatoryComplianceAssessmentList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -371,23 +487,33 @@ export interface Pricings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Pricing} [result] - The deserialized result object if an error did not occur. - * See {@link Pricing} for more information. + * {RegulatoryComplianceAssessmentList} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceAssessmentList} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdateResourceGroupPricing(resourceGroupName: string, pricingName: string, pricing: models.Pricing, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateResourceGroupPricing(resourceGroupName: string, pricingName: string, pricing: models.Pricing, callback: ServiceCallback): void; - createOrUpdateResourceGroupPricing(resourceGroupName: string, pricingName: string, pricing: models.Pricing, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, regulatoryComplianceStandardName: string, regulatoryComplianceControlName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, regulatoryComplianceStandardName: string, regulatoryComplianceControlName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, regulatoryComplianceStandardName: string, regulatoryComplianceControlName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Security pricing configurations in the subscription + * Supported regulatory compliance details and state for selected assessment * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {string} regulatoryComplianceControlName Name of the regulatory + * compliance control object + * + * @param {string} regulatoryComplianceAssessmentName Name of the regulatory + * compliance assessment object * * @param {object} [options] Optional Parameters. * @@ -396,17 +522,26 @@ export interface Pricings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, regulatoryComplianceStandardName: string, regulatoryComplianceControlName: string, regulatoryComplianceAssessmentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Security pricing configurations in the subscription + * Supported regulatory compliance details and state for selected assessment * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {string} regulatoryComplianceControlName Name of the regulatory + * compliance control object + * + * @param {string} regulatoryComplianceAssessmentName Name of the regulatory + * compliance assessment object * * @param {object} [options] Optional Parameters. * @@ -420,7 +555,7 @@ export interface Pricings { * * {Promise} A promise is returned. * - * @resolve {PricingList} - The deserialized result object. + * @resolve {RegulatoryComplianceAssessment} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -428,20 +563,22 @@ export interface Pricings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PricingList} [result] - The deserialized result object if an error did not occur. - * See {@link PricingList} for more information. + * {RegulatoryComplianceAssessment} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceAssessment} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, regulatoryComplianceStandardName: string, regulatoryComplianceControlName: string, regulatoryComplianceAssessmentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, regulatoryComplianceStandardName: string, regulatoryComplianceControlName: string, regulatoryComplianceAssessmentName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, regulatoryComplianceStandardName: string, regulatoryComplianceControlName: string, regulatoryComplianceAssessmentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Security pricing configurations in the resource group + * Details and state of assessments mapped to selected regulatory compliance + * control * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -453,14 +590,15 @@ export interface Pricings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Security pricing configurations in the resource group + * Details and state of assessments mapped to selected regulatory compliance + * control * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -477,7 +615,7 @@ export interface Pricings { * * {Promise} A promise is returned. * - * @resolve {PricingList} - The deserialized result object. + * @resolve {RegulatoryComplianceAssessmentList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -485,29 +623,30 @@ export interface Pricings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PricingList} [result] - The deserialized result object if an error did not occur. - * See {@link PricingList} for more information. + * {RegulatoryComplianceAssessmentList} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceAssessmentList} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * SecurityContacts + * Pricings * __NOTE__: An instance of this class is automatically created for an * instance of the SecurityCenter. */ -export interface SecurityContacts { +export interface Pricings { /** - * Security contact configurations for the subscription + * Security pricing configurations in the subscription * * @param {object} [options] Optional Parameters. * @@ -516,14 +655,14 @@ export interface SecurityContacts { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Security contact configurations for the subscription + * Security pricing configurations in the subscription * * @param {object} [options] Optional Parameters. * @@ -537,7 +676,7 @@ export interface SecurityContacts { * * {Promise} A promise is returned. * - * @resolve {SecurityContactList} - The deserialized result object. + * @resolve {PricingList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -545,22 +684,22 @@ export interface SecurityContacts { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SecurityContactList} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityContactList} for more information. + * {PricingList} [result] - The deserialized result object if an error did not occur. + * See {@link PricingList} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Security contact configurations for the subscription + * Security pricing configuration in the subscription * - * @param {string} securityContactName Name of the security contact object + * @param {string} pricingName name of the pricing configuration * * @param {object} [options] Optional Parameters. * @@ -569,16 +708,16 @@ export interface SecurityContacts { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(securityContactName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(pricingName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Security contact configurations for the subscription + * Security pricing configuration in the subscription * - * @param {string} securityContactName Name of the security contact object + * @param {string} pricingName name of the pricing configuration * * @param {object} [options] Optional Parameters. * @@ -592,7 +731,7 @@ export interface SecurityContacts { * * {Promise} A promise is returned. * - * @resolve {SecurityContact} - The deserialized result object. + * @resolve {Pricing} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -600,37 +739,27 @@ export interface SecurityContacts { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SecurityContact} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityContact} for more information. + * {Pricing} [result] - The deserialized result object if an error did not occur. + * See {@link Pricing} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(securityContactName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(securityContactName: string, callback: ServiceCallback): void; - get(securityContactName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(pricingName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(pricingName: string, callback: ServiceCallback): void; + get(pricingName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Security contact configurations for the subscription - * - * @param {string} securityContactName Name of the security contact object - * - * @param {object} securityContact Security contact object - * - * @param {string} securityContact.email The email of this security contact + * Security pricing configuration in the subscription * - * @param {string} [securityContact.phone] The phone number of this security - * contact + * @param {string} pricingName name of the pricing configuration * - * @param {string} securityContact.alertNotifications Whether to send security - * alerts notifications to the security contact. Possible values include: 'On', - * 'Off' + * @param {object} pricing Pricing object * - * @param {string} securityContact.alertsToAdmins Whether to send security - * alerts notifications to subscription admins. Possible values include: 'On', - * 'Off' + * @param {string} pricing.pricingTier The pricing tier value. Possible values + * include: 'Free', 'Standard' * * @param {object} [options] Optional Parameters. * @@ -639,25 +768,215 @@ export interface SecurityContacts { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createWithHttpOperationResponse(securityContactName: string, securityContact: models.SecurityContact, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(pricingName: string, pricing: models.Pricing, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Security contact configurations for the subscription + * Security pricing configuration in the subscription * - * @param {string} securityContactName Name of the security contact object + * @param {string} pricingName name of the pricing configuration * - * @param {object} securityContact Security contact object + * @param {object} pricing Pricing object * - * @param {string} securityContact.email The email of this security contact + * @param {string} pricing.pricingTier The pricing tier value. Possible values + * include: 'Free', 'Standard' * - * @param {string} [securityContact.phone] The phone number of this security - * contact + * @param {object} [options] Optional Parameters. * - * @param {string} securityContact.alertNotifications Whether to send security + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Pricing} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Pricing} [result] - The deserialized result object if an error did not occur. + * See {@link Pricing} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(pricingName: string, pricing: models.Pricing, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(pricingName: string, pricing: models.Pricing, callback: ServiceCallback): void; + update(pricingName: string, pricing: models.Pricing, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * SecurityContacts + * __NOTE__: An instance of this class is automatically created for an + * instance of the SecurityCenter. + */ +export interface SecurityContacts { + + + /** + * Security contact configurations for the subscription + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Security contact configurations for the subscription + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SecurityContactList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SecurityContactList} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityContactList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Security contact configurations for the subscription + * + * @param {string} securityContactName Name of the security contact object + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(securityContactName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Security contact configurations for the subscription + * + * @param {string} securityContactName Name of the security contact object + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SecurityContact} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SecurityContact} [result] - The deserialized result object if an error did not occur. + * See {@link SecurityContact} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(securityContactName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(securityContactName: string, callback: ServiceCallback): void; + get(securityContactName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Security contact configurations for the subscription + * + * @param {string} securityContactName Name of the security contact object + * + * @param {object} securityContact Security contact object + * + * @param {string} securityContact.email The email of this security contact + * + * @param {string} [securityContact.phone] The phone number of this security + * contact + * + * @param {string} securityContact.alertNotifications Whether to send security + * alerts notifications to the security contact. Possible values include: 'On', + * 'Off' + * + * @param {string} securityContact.alertsToAdmins Whether to send security + * alerts notifications to subscription admins. Possible values include: 'On', + * 'Off' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createWithHttpOperationResponse(securityContactName: string, securityContact: models.SecurityContact, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Security contact configurations for the subscription + * + * @param {string} securityContactName Name of the security contact object + * + * @param {object} securityContact Security contact object + * + * @param {string} securityContact.email The email of this security contact + * + * @param {string} [securityContact.phone] The phone number of this security + * contact + * + * @param {string} securityContact.alertNotifications Whether to send security * alerts notifications to the security contact. Possible values include: 'On', * 'Off' * @@ -903,7 +1222,8 @@ export interface WorkspaceSettings { /** - * Settings about where we should store your security data and logs + * Settings about where we should store your security data and logs. If the + * result is empty, it means that no custom-workspace configuration was set * * @param {object} [options] Optional Parameters. * @@ -919,7 +1239,8 @@ export interface WorkspaceSettings { listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Settings about where we should store your security data and logs + * Settings about where we should store your security data and logs. If the + * result is empty, it means that no custom-workspace configuration was set * * @param {object} [options] Optional Parameters. * @@ -954,7 +1275,8 @@ export interface WorkspaceSettings { /** - * Settings about where we should store your security data and logs + * Settings about where we should store your security data and logs. If the + * result is empty, it means that no custom-workspace configuration was set * * @param {string} workspaceSettingName Name of the security setting * @@ -972,7 +1294,8 @@ export interface WorkspaceSettings { getWithHttpOperationResponse(workspaceSettingName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Settings about where we should store your security data and logs + * Settings about where we should store your security data and logs. If the + * result is empty, it means that no custom-workspace configuration was set * * @param {string} workspaceSettingName Name of the security setting * @@ -1211,7 +1534,8 @@ export interface WorkspaceSettings { /** - * Settings about where we should store your security data and logs + * Settings about where we should store your security data and logs. If the + * result is empty, it means that no custom-workspace configuration was set * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1230,7 +1554,8 @@ export interface WorkspaceSettings { listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Settings about where we should store your security data and logs + * Settings about where we should store your security data and logs. If the + * result is empty, it means that no custom-workspace configuration was set * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1833,15 +2158,17 @@ export interface AdvancedThreatProtection { /** * @class - * Settings + * DeviceSecurityGroups * __NOTE__: An instance of this class is automatically created for an * instance of the SecurityCenter. */ -export interface Settings { +export interface DeviceSecurityGroups { /** - * Settings about different configurations in security center + * Gets the list of device security groups for the specified IoT hub resource. + * + * @param {string} resourceId The identifier of the resource. * * @param {object} [options] Optional Parameters. * @@ -1850,14 +2177,16 @@ export interface Settings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Settings about different configurations in security center + * Gets the list of device security groups for the specified IoT hub resource. + * + * @param {string} resourceId The identifier of the resource. * * @param {object} [options] Optional Parameters. * @@ -1871,7 +2200,7 @@ export interface Settings { * * {Promise} A promise is returned. * - * @resolve {SettingsList} - The deserialized result object. + * @resolve {DeviceSecurityGroupList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1879,23 +2208,26 @@ export interface Settings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SettingsList} [result] - The deserialized result object if an error did not occur. - * See {@link SettingsList} for more information. + * {DeviceSecurityGroupList} [result] - The deserialized result object if an error did not occur. + * See {@link DeviceSecurityGroupList} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceId: string, callback: ServiceCallback): void; + list(resourceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Settings of different configurations in security center + * Gets the device security group for the specified IoT hub resource. * - * @param {string} settingName Name of setting. Possible values include: - * 'MCAS', 'WDATP' + * @param {string} resourceId The identifier of the resource. + * + * @param {string} deviceSecurityGroupName The name of the security group. + * Please notice that the name is case insensitive. * * @param {object} [options] Optional Parameters. * @@ -1904,17 +2236,19 @@ export interface Settings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(settingName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceId: string, deviceSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Settings of different configurations in security center + * Gets the device security group for the specified IoT hub resource. + * + * @param {string} resourceId The identifier of the resource. * - * @param {string} settingName Name of setting. Possible values include: - * 'MCAS', 'WDATP' + * @param {string} deviceSecurityGroupName The name of the security group. + * Please notice that the name is case insensitive. * * @param {object} [options] Optional Parameters. * @@ -1928,7 +2262,7 @@ export interface Settings { * * {Promise} A promise is returned. * - * @resolve {Setting} - The deserialized result object. + * @resolve {DeviceSecurityGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1936,27 +2270,40 @@ export interface Settings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Setting} [result] - The deserialized result object if an error did not occur. - * See {@link Setting} for more information. + * {DeviceSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link DeviceSecurityGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(settingName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(settingName: string, callback: ServiceCallback): void; - get(settingName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceId: string, deviceSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceId: string, deviceSecurityGroupName: string, callback: ServiceCallback): void; + get(resourceId: string, deviceSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * updating settings about different configurations in security center + * Creates or updates the device security group on a specified IoT hub + * resource. + * + * @param {string} resourceId The identifier of the resource. * - * @param {string} settingName Name of setting. Possible values include: - * 'MCAS', 'WDATP' + * @param {string} deviceSecurityGroupName The name of the security group. + * Please notice that the name is case insensitive. * - * @param {object} setting Setting object + * @param {object} deviceSecurityGroup Security group object. + * + * @param {array} [deviceSecurityGroup.thresholdRules] A list of threshold + * custom alert rules. + * + * @param {array} [deviceSecurityGroup.timeWindowRules] A list of time window + * custom alert rules. * - * @param {string} setting.kind Polymorphic Discriminator + * @param {array} [deviceSecurityGroup.allowlistRules] A list of allow-list + * custom alert rules. + * + * @param {array} [deviceSecurityGroup.denylistRules] A list of deny-list + * custom alert rules. * * @param {object} [options] Optional Parameters. * @@ -1965,21 +2312,34 @@ export interface Settings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(settingName: string, setting: models.Setting, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceId: string, deviceSecurityGroupName: string, deviceSecurityGroup: models.DeviceSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * updating settings about different configurations in security center + * Creates or updates the device security group on a specified IoT hub + * resource. + * + * @param {string} resourceId The identifier of the resource. * - * @param {string} settingName Name of setting. Possible values include: - * 'MCAS', 'WDATP' + * @param {string} deviceSecurityGroupName The name of the security group. + * Please notice that the name is case insensitive. * - * @param {object} setting Setting object + * @param {object} deviceSecurityGroup Security group object. * - * @param {string} setting.kind Polymorphic Discriminator + * @param {array} [deviceSecurityGroup.thresholdRules] A list of threshold + * custom alert rules. + * + * @param {array} [deviceSecurityGroup.timeWindowRules] A list of time window + * custom alert rules. + * + * @param {array} [deviceSecurityGroup.allowlistRules] A list of allow-list + * custom alert rules. + * + * @param {array} [deviceSecurityGroup.denylistRules] A list of deny-list + * custom alert rules. * * @param {object} [options] Optional Parameters. * @@ -1993,7 +2353,7 @@ export interface Settings { * * {Promise} A promise is returned. * - * @resolve {Setting} - The deserialized result object. + * @resolve {DeviceSecurityGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2001,23 +2361,25 @@ export interface Settings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Setting} [result] - The deserialized result object if an error did not occur. - * See {@link Setting} for more information. + * {DeviceSecurityGroup} [result] - The deserialized result object if an error did not occur. + * See {@link DeviceSecurityGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(settingName: string, setting: models.Setting, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(settingName: string, setting: models.Setting, callback: ServiceCallback): void; - update(settingName: string, setting: models.Setting, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceId: string, deviceSecurityGroupName: string, deviceSecurityGroup: models.DeviceSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceId: string, deviceSecurityGroupName: string, deviceSecurityGroup: models.DeviceSecurityGroup, callback: ServiceCallback): void; + createOrUpdate(resourceId: string, deviceSecurityGroupName: string, deviceSecurityGroup: models.DeviceSecurityGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Settings about different configurations in security center + * Deletes the security group * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceId The identifier of the resource. + * + * @param {string} deviceSecurityGroupName The name of the security group. + * Please notice that the name is case insensitive. * * @param {object} [options] Optional Parameters. * @@ -2026,14 +2388,72 @@ export interface Settings { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceId: string, deviceSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Settings about different configurations in security center + * Deletes the security group + * + * @param {string} resourceId The identifier of the resource. + * + * @param {string} deviceSecurityGroupName The name of the security group. + * Please notice that the name is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceId: string, deviceSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceId: string, deviceSecurityGroupName: string, callback: ServiceCallback): void; + deleteMethod(resourceId: string, deviceSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the list of device security groups for the specified IoT hub resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the list of device security groups for the specified IoT hub resource. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2050,7 +2470,7 @@ export interface Settings { * * {Promise} A promise is returned. * - * @resolve {SettingsList} - The deserialized result object. + * @resolve {DeviceSecurityGroupList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2058,36 +2478,30 @@ export interface Settings { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SettingsList} [result] - The deserialized result object if an error did not occur. - * See {@link SettingsList} for more information. + * {DeviceSecurityGroupList} [result] - The deserialized result object if an error did not occur. + * See {@link DeviceSecurityGroupList} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * InformationProtectionPolicies + * Settings * __NOTE__: An instance of this class is automatically created for an * instance of the SecurityCenter. */ -export interface InformationProtectionPolicies { +export interface Settings { /** - * Details of the information protection policy. - * - * @param {string} scope Scope of the query, can be subscription - * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group - * (/providers/Microsoft.Management/managementGroups/mgName). - * - * @param {string} informationProtectionPolicyName Name of the information - * protection policy. Possible values include: 'effective', 'custom' + * Settings about different configurations in security center * * @param {object} [options] Optional Parameters. * @@ -2096,21 +2510,14 @@ export interface InformationProtectionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(scope: string, informationProtectionPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Details of the information protection policy. - * - * @param {string} scope Scope of the query, can be subscription - * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group - * (/providers/Microsoft.Management/managementGroups/mgName). - * - * @param {string} informationProtectionPolicyName Name of the information - * protection policy. Possible values include: 'effective', 'custom' + * Settings about different configurations in security center * * @param {object} [options] Optional Parameters. * @@ -2124,7 +2531,7 @@ export interface InformationProtectionPolicies { * * {Promise} A promise is returned. * - * @resolve {InformationProtectionPolicy} - The deserialized result object. + * @resolve {SettingsList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2132,28 +2539,23 @@ export interface InformationProtectionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {InformationProtectionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link InformationProtectionPolicy} for more - * information. + * {SettingsList} [result] - The deserialized result object if an error did not occur. + * See {@link SettingsList} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(scope: string, informationProtectionPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(scope: string, informationProtectionPolicyName: string, callback: ServiceCallback): void; - get(scope: string, informationProtectionPolicyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Details of the information protection policy. - * - * @param {string} scope Scope of the query, can be subscription - * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group - * (/providers/Microsoft.Management/managementGroups/mgName). + * Settings of different configurations in security center * - * @param {string} informationProtectionPolicyName Name of the information - * protection policy. Possible values include: 'effective', 'custom' + * @param {string} settingName Name of setting: (MCAS/WDATP). Possible values + * include: 'MCAS', 'WDATP' * * @param {object} [options] Optional Parameters. * @@ -2162,21 +2564,17 @@ export interface InformationProtectionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(scope: string, informationProtectionPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(settingName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Details of the information protection policy. - * - * @param {string} scope Scope of the query, can be subscription - * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group - * (/providers/Microsoft.Management/managementGroups/mgName). + * Settings of different configurations in security center * - * @param {string} informationProtectionPolicyName Name of the information - * protection policy. Possible values include: 'effective', 'custom' + * @param {string} settingName Name of setting: (MCAS/WDATP). Possible values + * include: 'MCAS', 'WDATP' * * @param {object} [options] Optional Parameters. * @@ -2190,7 +2588,7 @@ export interface InformationProtectionPolicies { * * {Promise} A promise is returned. * - * @resolve {InformationProtectionPolicy} - The deserialized result object. + * @resolve {Setting} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2198,25 +2596,29 @@ export interface InformationProtectionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {InformationProtectionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link InformationProtectionPolicy} for more - * information. + * {Setting} [result] - The deserialized result object if an error did not occur. + * See {@link Setting} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(scope: string, informationProtectionPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(scope: string, informationProtectionPolicyName: string, callback: ServiceCallback): void; - createOrUpdate(scope: string, informationProtectionPolicyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(settingName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(settingName: string, callback: ServiceCallback): void; + get(settingName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Information protection policies of a specific management group. + * updating settings about different configurations in security center * - * @param {string} scope Scope of the query, can be subscription - * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group - * (/providers/Microsoft.Management/managementGroups/mgName). + * @param {string} settingName Name of setting: (MCAS/WDATP). Possible values + * include: 'MCAS', 'WDATP' + * + * @param {object} setting Setting object + * + * @param {string} setting.kind the kind of the settings string + * (DataExportSetting). Possible values include: 'DataExportSetting', + * 'AlertSuppressionSetting' * * @param {object} [options] Optional Parameters. * @@ -2225,18 +2627,23 @@ export interface InformationProtectionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(scope: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(settingName: string, setting: models.Setting, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Information protection policies of a specific management group. + * updating settings about different configurations in security center * - * @param {string} scope Scope of the query, can be subscription - * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group - * (/providers/Microsoft.Management/managementGroups/mgName). + * @param {string} settingName Name of setting: (MCAS/WDATP). Possible values + * include: 'MCAS', 'WDATP' + * + * @param {object} setting Setting object + * + * @param {string} setting.kind the kind of the settings string + * (DataExportSetting). Possible values include: 'DataExportSetting', + * 'AlertSuppressionSetting' * * @param {object} [options] Optional Parameters. * @@ -2250,7 +2657,7 @@ export interface InformationProtectionPolicies { * * {Promise} A promise is returned. * - * @resolve {InformationProtectionPolicyList} - The deserialized result object. + * @resolve {Setting} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2258,21 +2665,20 @@ export interface InformationProtectionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {InformationProtectionPolicyList} [result] - The deserialized result object if an error did not occur. - * See {@link InformationProtectionPolicyList} for more - * information. + * {Setting} [result] - The deserialized result object if an error did not occur. + * See {@link Setting} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(scope: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(scope: string, callback: ServiceCallback): void; - list(scope: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(settingName: string, setting: models.Setting, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(settingName: string, setting: models.Setting, callback: ServiceCallback): void; + update(settingName: string, setting: models.Setting, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Information protection policies of a specific management group. + * Settings about different configurations in security center * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2284,14 +2690,14 @@ export interface InformationProtectionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Information protection policies of a specific management group. + * Settings about different configurations in security center * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2308,7 +2714,7 @@ export interface InformationProtectionPolicies { * * {Promise} A promise is returned. * - * @resolve {InformationProtectionPolicyList} - The deserialized result object. + * @resolve {SettingsList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2316,30 +2722,36 @@ export interface InformationProtectionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {InformationProtectionPolicyList} [result] - The deserialized result object if an error did not occur. - * See {@link InformationProtectionPolicyList} for more - * information. + * {SettingsList} [result] - The deserialized result object if an error did not occur. + * See {@link SettingsList} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * Operations + * InformationProtectionPolicies * __NOTE__: An instance of this class is automatically created for an * instance of the SecurityCenter. */ -export interface Operations { +export interface InformationProtectionPolicies { /** - * Exposes all available operations for discovery purposes. + * Details of the information protection policy. + * + * @param {string} scope Scope of the query, can be subscription + * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group + * (/providers/Microsoft.Management/managementGroups/mgName). + * + * @param {string} informationProtectionPolicyName Name of the information + * protection policy. Possible values include: 'effective', 'custom' * * @param {object} [options] Optional Parameters. * @@ -2348,14 +2760,21 @@ export interface Operations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(scope: string, informationProtectionPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Exposes all available operations for discovery purposes. + * Details of the information protection policy. + * + * @param {string} scope Scope of the query, can be subscription + * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group + * (/providers/Microsoft.Management/managementGroups/mgName). + * + * @param {string} informationProtectionPolicyName Name of the information + * protection policy. Possible values include: 'effective', 'custom' * * @param {object} [options] Optional Parameters. * @@ -2369,7 +2788,7 @@ export interface Operations { * * {Promise} A promise is returned. * - * @resolve {OperationList} - The deserialized result object. + * @resolve {InformationProtectionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2377,23 +2796,28 @@ export interface Operations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationList} [result] - The deserialized result object if an error did not occur. - * See {@link OperationList} for more information. + * {InformationProtectionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link InformationProtectionPolicy} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(scope: string, informationProtectionPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(scope: string, informationProtectionPolicyName: string, callback: ServiceCallback): void; + get(scope: string, informationProtectionPolicyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Exposes all available operations for discovery purposes. + * Details of the information protection policy. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} scope Scope of the query, can be subscription + * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group + * (/providers/Microsoft.Management/managementGroups/mgName). + * + * @param {string} informationProtectionPolicyName Name of the information + * protection policy. Possible values include: 'effective', 'custom' * * @param {object} [options] Optional Parameters. * @@ -2402,17 +2826,21 @@ export interface Operations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(scope: string, informationProtectionPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Exposes all available operations for discovery purposes. + * Details of the information protection policy. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} scope Scope of the query, can be subscription + * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group + * (/providers/Microsoft.Management/managementGroups/mgName). + * + * @param {string} informationProtectionPolicyName Name of the information + * protection policy. Possible values include: 'effective', 'custom' * * @param {object} [options] Optional Parameters. * @@ -2426,7 +2854,7 @@ export interface Operations { * * {Promise} A promise is returned. * - * @resolve {OperationList} - The deserialized result object. + * @resolve {InformationProtectionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2434,15 +2862,251 @@ export interface Operations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationList} [result] - The deserialized result object if an error did not occur. - * See {@link OperationList} for more information. + * {InformationProtectionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link InformationProtectionPolicy} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; + createOrUpdate(scope: string, informationProtectionPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(scope: string, informationProtectionPolicyName: string, callback: ServiceCallback): void; + createOrUpdate(scope: string, informationProtectionPolicyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Information protection policies of a specific management group. + * + * @param {string} scope Scope of the query, can be subscription + * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group + * (/providers/Microsoft.Management/managementGroups/mgName). + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(scope: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Information protection policies of a specific management group. + * + * @param {string} scope Scope of the query, can be subscription + * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group + * (/providers/Microsoft.Management/managementGroups/mgName). + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {InformationProtectionPolicyList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {InformationProtectionPolicyList} [result] - The deserialized result object if an error did not occur. + * See {@link InformationProtectionPolicyList} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(scope: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(scope: string, callback: ServiceCallback): void; + list(scope: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Information protection policies of a specific management group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Information protection policies of a specific management group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {InformationProtectionPolicyList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {InformationProtectionPolicyList} [result] - The deserialized result object if an error did not occur. + * See {@link InformationProtectionPolicyList} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SecurityCenter. + */ +export interface Operations { + + + /** + * Exposes all available operations for discovery purposes. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Exposes all available operations for discovery purposes. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OperationList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationList} [result] - The deserialized result object if an error did not occur. + * See {@link OperationList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Exposes all available operations for discovery purposes. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Exposes all available operations for discovery purposes. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OperationList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationList} [result] - The deserialized result object if an error did not occur. + * See {@link OperationList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } @@ -3312,7 +3976,7 @@ export interface Alerts { /** - * List all the alerts alerts that are associated with the resource group + * List all the alerts that are associated with the resource group * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. @@ -3337,7 +4001,7 @@ export interface Alerts { listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { filter? : string, select? : string, expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * List all the alerts alerts that are associated with the resource group + * List all the alerts that are associated with the resource group * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. @@ -3818,7 +4482,7 @@ export interface Alerts { /** - * List all the alerts alerts that are associated with the resource group + * List all the alerts that are associated with the resource group * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -3837,7 +4501,7 @@ export interface Alerts { listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * List all the alerts alerts that are associated with the resource group + * List all the alerts that are associated with the resource group * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -4772,8 +5436,307 @@ export interface JitNetworkAccessPolicies { * * @param {object} body * - * @param {array} body.virtualMachines A list of virtual machines & ports to - * open access for + * @param {array} body.virtualMachines A list of virtual machines & ports to + * open access for + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {JitNetworkAccessRequest} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {JitNetworkAccessRequest} [result] - The deserialized result object if an error did not occur. + * See {@link JitNetworkAccessRequest} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + initiate(resourceGroupName: string, jitNetworkAccessPolicyName: string, body: models.JitNetworkAccessPolicyInitiateRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + initiate(resourceGroupName: string, jitNetworkAccessPolicyName: string, body: models.JitNetworkAccessPolicyInitiateRequest, callback: ServiceCallback): void; + initiate(resourceGroupName: string, jitNetworkAccessPolicyName: string, body: models.JitNetworkAccessPolicyInitiateRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Policies for protecting resources using Just-in-Time access control. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Policies for protecting resources using Just-in-Time access control. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {JitNetworkAccessPoliciesList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {JitNetworkAccessPoliciesList} [result] - The deserialized result object if an error did not occur. + * See {@link JitNetworkAccessPoliciesList} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Policies for protecting resources using Just-in-Time access control for the + * subscription, location + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByRegionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Policies for protecting resources using Just-in-Time access control for the + * subscription, location + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {JitNetworkAccessPoliciesList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {JitNetworkAccessPoliciesList} [result] - The deserialized result object if an error did not occur. + * See {@link JitNetworkAccessPoliciesList} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByRegionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByRegionNext(nextPageLink: string, callback: ServiceCallback): void; + listByRegionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Policies for protecting resources using Just-in-Time access control for the + * subscription, location + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Policies for protecting resources using Just-in-Time access control for the + * subscription, location + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {JitNetworkAccessPoliciesList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {JitNetworkAccessPoliciesList} [result] - The deserialized result object if an error did not occur. + * See {@link JitNetworkAccessPoliciesList} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Policies for protecting resources using Just-in-Time access control for the + * subscription, location + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupAndRegionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Policies for protecting resources using Just-in-Time access control for the + * subscription, location + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {JitNetworkAccessPoliciesList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {JitNetworkAccessPoliciesList} [result] - The deserialized result object if an error did not occur. + * See {@link JitNetworkAccessPoliciesList} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupAndRegionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupAndRegionNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupAndRegionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ExternalSecuritySolutions + * __NOTE__: An instance of this class is automatically created for an + * instance of the SecurityCenter. + */ +export interface ExternalSecuritySolutions { + + + /** + * Gets a list of external security solutions for the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of external security solutions for the subscription. * * @param {object} [options] Optional Parameters. * @@ -4787,7 +5750,7 @@ export interface JitNetworkAccessPolicies { * * {Promise} A promise is returned. * - * @resolve {JitNetworkAccessRequest} - The deserialized result object. + * @resolve {ExternalSecuritySolutionList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4795,24 +5758,22 @@ export interface JitNetworkAccessPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JitNetworkAccessRequest} [result] - The deserialized result object if an error did not occur. - * See {@link JitNetworkAccessRequest} for more + * {ExternalSecuritySolutionList} [result] - The deserialized result object if an error did not occur. + * See {@link ExternalSecuritySolutionList} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - initiate(resourceGroupName: string, jitNetworkAccessPolicyName: string, body: models.JitNetworkAccessPolicyInitiateRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - initiate(resourceGroupName: string, jitNetworkAccessPolicyName: string, body: models.JitNetworkAccessPolicyInitiateRequest, callback: ServiceCallback): void; - initiate(resourceGroupName: string, jitNetworkAccessPolicyName: string, body: models.JitNetworkAccessPolicyInitiateRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Policies for protecting resources using Just-in-Time access control. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Gets a list of external Security Solutions for the subscription and + * location. * * @param {object} [options] Optional Parameters. * @@ -4821,17 +5782,15 @@ export interface JitNetworkAccessPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByHomeRegionWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Policies for protecting resources using Just-in-Time access control. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Gets a list of external Security Solutions for the subscription and + * location. * * @param {object} [options] Optional Parameters. * @@ -4845,7 +5804,7 @@ export interface JitNetworkAccessPolicies { * * {Promise} A promise is returned. * - * @resolve {JitNetworkAccessPoliciesList} - The deserialized result object. + * @resolve {ExternalSecuritySolutionList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4853,25 +5812,27 @@ export interface JitNetworkAccessPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JitNetworkAccessPoliciesList} [result] - The deserialized result object if an error did not occur. - * See {@link JitNetworkAccessPoliciesList} for more + * {ExternalSecuritySolutionList} [result] - The deserialized result object if an error did not occur. + * See {@link ExternalSecuritySolutionList} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByHomeRegion(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByHomeRegion(callback: ServiceCallback): void; + listByHomeRegion(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Policies for protecting resources using Just-in-Time access control for the - * subscription, location + * Gets a specific external Security Solution. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} externalSecuritySolutionsName Name of an external security + * solution. * * @param {object} [options] Optional Parameters. * @@ -4880,18 +5841,20 @@ export interface JitNetworkAccessPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByRegionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, externalSecuritySolutionsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Policies for protecting resources using Just-in-Time access control for the - * subscription, location + * Gets a specific external Security Solution. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} externalSecuritySolutionsName Name of an external security + * solution. * * @param {object} [options] Optional Parameters. * @@ -4905,7 +5868,7 @@ export interface JitNetworkAccessPolicies { * * {Promise} A promise is returned. * - * @resolve {JitNetworkAccessPoliciesList} - The deserialized result object. + * @resolve {ExternalSecuritySolution} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4913,22 +5876,21 @@ export interface JitNetworkAccessPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JitNetworkAccessPoliciesList} [result] - The deserialized result object if an error did not occur. - * See {@link JitNetworkAccessPoliciesList} for more + * {ExternalSecuritySolution} [result] - The deserialized result object if an error did not occur. + * See {@link ExternalSecuritySolution} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByRegionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByRegionNext(nextPageLink: string, callback: ServiceCallback): void; - listByRegionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, externalSecuritySolutionsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, externalSecuritySolutionsName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, externalSecuritySolutionsName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Policies for protecting resources using Just-in-Time access control for the - * subscription, location + * Gets a list of external security solutions for the subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -4940,15 +5902,14 @@ export interface JitNetworkAccessPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Policies for protecting resources using Just-in-Time access control for the - * subscription, location + * Gets a list of external security solutions for the subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -4965,7 +5926,7 @@ export interface JitNetworkAccessPolicies { * * {Promise} A promise is returned. * - * @resolve {JitNetworkAccessPoliciesList} - The deserialized result object. + * @resolve {ExternalSecuritySolutionList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4973,22 +5934,22 @@ export interface JitNetworkAccessPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JitNetworkAccessPoliciesList} [result] - The deserialized result object if an error did not occur. - * See {@link JitNetworkAccessPoliciesList} for more + * {ExternalSecuritySolutionList} [result] - The deserialized result object if an error did not occur. + * See {@link ExternalSecuritySolutionList} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Policies for protecting resources using Just-in-Time access control for the - * subscription, location + * Gets a list of external Security Solutions for the subscription and + * location. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5000,15 +5961,15 @@ export interface JitNetworkAccessPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupAndRegionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByHomeRegionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Policies for protecting resources using Just-in-Time access control for the - * subscription, location + * Gets a list of external Security Solutions for the subscription and + * location. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5025,7 +5986,7 @@ export interface JitNetworkAccessPolicies { * * {Promise} A promise is returned. * - * @resolve {JitNetworkAccessPoliciesList} - The deserialized result object. + * @resolve {ExternalSecuritySolutionList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5033,30 +5994,30 @@ export interface JitNetworkAccessPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JitNetworkAccessPoliciesList} [result] - The deserialized result object if an error did not occur. - * See {@link JitNetworkAccessPoliciesList} for more + * {ExternalSecuritySolutionList} [result] - The deserialized result object if an error did not occur. + * See {@link ExternalSecuritySolutionList} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByResourceGroupAndRegionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupAndRegionNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupAndRegionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByHomeRegionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByHomeRegionNext(nextPageLink: string, callback: ServiceCallback): void; + listByHomeRegionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * ExternalSecuritySolutions + * Topology * __NOTE__: An instance of this class is automatically created for an * instance of the SecurityCenter. */ -export interface ExternalSecuritySolutions { +export interface Topology { /** - * Gets a list of external security solutions for the subscription. + * Gets a list that allows to build a topology view of a subscription. * * @param {object} [options] Optional Parameters. * @@ -5065,14 +6026,14 @@ export interface ExternalSecuritySolutions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of external security solutions for the subscription. + * Gets a list that allows to build a topology view of a subscription. * * @param {object} [options] Optional Parameters. * @@ -5086,7 +6047,7 @@ export interface ExternalSecuritySolutions { * * {Promise} A promise is returned. * - * @resolve {ExternalSecuritySolutionList} - The deserialized result object. + * @resolve {TopologyList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5094,21 +6055,20 @@ export interface ExternalSecuritySolutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExternalSecuritySolutionList} [result] - The deserialized result object if an error did not occur. - * See {@link ExternalSecuritySolutionList} for more - * information. + * {TopologyList} [result] - The deserialized result object if an error did not occur. + * See {@link TopologyList} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of external Security Solutions for the subscription and + * Gets a list that allows to build a topology view of a subscription and * location. * * @param {object} [options] Optional Parameters. @@ -5118,14 +6078,14 @@ export interface ExternalSecuritySolutions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByHomeRegionWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByHomeRegionWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of external Security Solutions for the subscription and + * Gets a list that allows to build a topology view of a subscription and * location. * * @param {object} [options] Optional Parameters. @@ -5140,7 +6100,7 @@ export interface ExternalSecuritySolutions { * * {Promise} A promise is returned. * - * @resolve {ExternalSecuritySolutionList} - The deserialized result object. + * @resolve {TopologyList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5148,27 +6108,26 @@ export interface ExternalSecuritySolutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExternalSecuritySolutionList} [result] - The deserialized result object if an error did not occur. - * See {@link ExternalSecuritySolutionList} for more - * information. + * {TopologyList} [result] - The deserialized result object if an error did not occur. + * See {@link TopologyList} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByHomeRegion(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByHomeRegion(callback: ServiceCallback): void; - listByHomeRegion(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByHomeRegion(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByHomeRegion(callback: ServiceCallback): void; + listByHomeRegion(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a specific external Security Solution. + * Gets a specific topology component. * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. * - * @param {string} externalSecuritySolutionsName Name of an external security - * solution. + * @param {string} topologyResourceName Name of a topology resources + * collection. * * @param {object} [options] Optional Parameters. * @@ -5177,20 +6136,20 @@ export interface ExternalSecuritySolutions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, externalSecuritySolutionsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, topologyResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a specific external Security Solution. + * Gets a specific topology component. * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. * - * @param {string} externalSecuritySolutionsName Name of an external security - * solution. + * @param {string} topologyResourceName Name of a topology resources + * collection. * * @param {object} [options] Optional Parameters. * @@ -5204,7 +6163,7 @@ export interface ExternalSecuritySolutions { * * {Promise} A promise is returned. * - * @resolve {ExternalSecuritySolution} - The deserialized result object. + * @resolve {TopologyResource} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5212,21 +6171,20 @@ export interface ExternalSecuritySolutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExternalSecuritySolution} [result] - The deserialized result object if an error did not occur. - * See {@link ExternalSecuritySolution} for more - * information. + * {TopologyResource} [result] - The deserialized result object if an error did not occur. + * See {@link TopologyResource} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, externalSecuritySolutionsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, externalSecuritySolutionsName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, externalSecuritySolutionsName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, topologyResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, topologyResourceName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, topologyResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of external security solutions for the subscription. + * Gets a list that allows to build a topology view of a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5238,14 +6196,14 @@ export interface ExternalSecuritySolutions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of external security solutions for the subscription. + * Gets a list that allows to build a topology view of a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5262,7 +6220,7 @@ export interface ExternalSecuritySolutions { * * {Promise} A promise is returned. * - * @resolve {ExternalSecuritySolutionList} - The deserialized result object. + * @resolve {TopologyList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5270,21 +6228,20 @@ export interface ExternalSecuritySolutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExternalSecuritySolutionList} [result] - The deserialized result object if an error did not occur. - * See {@link ExternalSecuritySolutionList} for more - * information. + * {TopologyList} [result] - The deserialized result object if an error did not occur. + * See {@link TopologyList} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of external Security Solutions for the subscription and + * Gets a list that allows to build a topology view of a subscription and * location. * * @param {string} nextPageLink The NextLink from the previous successful call @@ -5297,14 +6254,14 @@ export interface ExternalSecuritySolutions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByHomeRegionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByHomeRegionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of external Security Solutions for the subscription and + * Gets a list that allows to build a topology view of a subscription and * location. * * @param {string} nextPageLink The NextLink from the previous successful call @@ -5322,7 +6279,7 @@ export interface ExternalSecuritySolutions { * * {Promise} A promise is returned. * - * @resolve {ExternalSecuritySolutionList} - The deserialized result object. + * @resolve {TopologyList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5330,30 +6287,29 @@ export interface ExternalSecuritySolutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExternalSecuritySolutionList} [result] - The deserialized result object if an error did not occur. - * See {@link ExternalSecuritySolutionList} for more - * information. + * {TopologyList} [result] - The deserialized result object if an error did not occur. + * See {@link TopologyList} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByHomeRegionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByHomeRegionNext(nextPageLink: string, callback: ServiceCallback): void; - listByHomeRegionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByHomeRegionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByHomeRegionNext(nextPageLink: string, callback: ServiceCallback): void; + listByHomeRegionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * Topology + * AllowedConnections * __NOTE__: An instance of this class is automatically created for an * instance of the SecurityCenter. */ -export interface Topology { +export interface AllowedConnections { /** - * Gets a list that allows to build a topology view of a subscription. + * Gets the list of all possible traffic between resources for the subscription * * @param {object} [options] Optional Parameters. * @@ -5362,14 +6318,14 @@ export interface Topology { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list that allows to build a topology view of a subscription. + * Gets the list of all possible traffic between resources for the subscription * * @param {object} [options] Optional Parameters. * @@ -5383,7 +6339,7 @@ export interface Topology { * * {Promise} A promise is returned. * - * @resolve {TopologyList} - The deserialized result object. + * @resolve {AllowedConnectionsList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5391,21 +6347,22 @@ export interface Topology { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TopologyList} [result] - The deserialized result object if an error did not occur. - * See {@link TopologyList} for more information. + * {AllowedConnectionsList} [result] - The deserialized result object if an error did not occur. + * See {@link AllowedConnectionsList} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list that allows to build a topology view of a subscription and - * location. + * Gets the list of all possible traffic between resources for the subscription + * and location. * * @param {object} [options] Optional Parameters. * @@ -5414,15 +6371,15 @@ export interface Topology { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByHomeRegionWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByHomeRegionWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list that allows to build a topology view of a subscription and - * location. + * Gets the list of all possible traffic between resources for the subscription + * and location. * * @param {object} [options] Optional Parameters. * @@ -5436,7 +6393,7 @@ export interface Topology { * * {Promise} A promise is returned. * - * @resolve {TopologyList} - The deserialized result object. + * @resolve {AllowedConnectionsList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5444,26 +6401,28 @@ export interface Topology { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TopologyList} [result] - The deserialized result object if an error did not occur. - * See {@link TopologyList} for more information. + * {AllowedConnectionsList} [result] - The deserialized result object if an error did not occur. + * See {@link AllowedConnectionsList} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByHomeRegion(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByHomeRegion(callback: ServiceCallback): void; - listByHomeRegion(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByHomeRegion(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByHomeRegion(callback: ServiceCallback): void; + listByHomeRegion(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a specific topology component. + * Gets the list of all possible traffic between resources for the subscription + * and location, based on connection type. * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. * - * @param {string} topologyResourceName Name of a topology resources - * collection. + * @param {string} connectionType The type of allowed connections (Internal, + * External). Possible values include: 'Internal', 'External' * * @param {object} [options] Optional Parameters. * @@ -5472,20 +6431,21 @@ export interface Topology { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, topologyResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, connectionType: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a specific topology component. + * Gets the list of all possible traffic between resources for the subscription + * and location, based on connection type. * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. * - * @param {string} topologyResourceName Name of a topology resources - * collection. + * @param {string} connectionType The type of allowed connections (Internal, + * External). Possible values include: 'Internal', 'External' * * @param {object} [options] Optional Parameters. * @@ -5499,7 +6459,7 @@ export interface Topology { * * {Promise} A promise is returned. * - * @resolve {TopologyResource} - The deserialized result object. + * @resolve {AllowedConnectionsResource} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5507,20 +6467,21 @@ export interface Topology { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TopologyResource} [result] - The deserialized result object if an error did not occur. - * See {@link TopologyResource} for more information. + * {AllowedConnectionsResource} [result] - The deserialized result object if an error did not occur. + * See {@link AllowedConnectionsResource} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, topologyResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, topologyResourceName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, topologyResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, connectionType: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, connectionType: string, callback: ServiceCallback): void; + get(resourceGroupName: string, connectionType: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list that allows to build a topology view of a subscription. + * Gets the list of all possible traffic between resources for the subscription * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5532,14 +6493,14 @@ export interface Topology { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list that allows to build a topology view of a subscription. + * Gets the list of all possible traffic between resources for the subscription * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5556,7 +6517,7 @@ export interface Topology { * * {Promise} A promise is returned. * - * @resolve {TopologyList} - The deserialized result object. + * @resolve {AllowedConnectionsList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5564,21 +6525,22 @@ export interface Topology { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TopologyList} [result] - The deserialized result object if an error did not occur. - * See {@link TopologyList} for more information. + * {AllowedConnectionsList} [result] - The deserialized result object if an error did not occur. + * See {@link AllowedConnectionsList} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list that allows to build a topology view of a subscription and - * location. + * Gets the list of all possible traffic between resources for the subscription + * and location. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5590,15 +6552,15 @@ export interface Topology { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByHomeRegionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByHomeRegionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list that allows to build a topology view of a subscription and - * location. + * Gets the list of all possible traffic between resources for the subscription + * and location. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5615,7 +6577,7 @@ export interface Topology { * * {Promise} A promise is returned. * - * @resolve {TopologyList} - The deserialized result object. + * @resolve {AllowedConnectionsList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5623,29 +6585,40 @@ export interface Topology { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TopologyList} [result] - The deserialized result object if an error did not occur. - * See {@link TopologyList} for more information. + * {AllowedConnectionsList} [result] - The deserialized result object if an error did not occur. + * See {@link AllowedConnectionsList} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByHomeRegionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByHomeRegionNext(nextPageLink: string, callback: ServiceCallback): void; - listByHomeRegionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByHomeRegionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByHomeRegionNext(nextPageLink: string, callback: ServiceCallback): void; + listByHomeRegionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * AllowedConnections + * AdaptiveNetworkHardenings * __NOTE__: An instance of this class is automatically created for an * instance of the SecurityCenter. */ -export interface AllowedConnections { +export interface AdaptiveNetworkHardenings { /** - * Gets the list of all possible traffic between resources for the subscription + * Gets a list of Adaptive Network Hardenings resources in scope of an extended + * resource. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. * * @param {object} [options] Optional Parameters. * @@ -5654,14 +6627,24 @@ export interface AllowedConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByExtendedResourceWithHttpOperationResponse(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the list of all possible traffic between resources for the subscription + * Gets a list of Adaptive Network Hardenings resources in scope of an extended + * resource. + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. * * @param {object} [options] Optional Parameters. * @@ -5675,7 +6658,7 @@ export interface AllowedConnections { * * {Promise} A promise is returned. * - * @resolve {AllowedConnectionsList} - The deserialized result object. + * @resolve {AdaptiveNetworkHardeningsList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5683,22 +6666,33 @@ export interface AllowedConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AllowedConnectionsList} [result] - The deserialized result object if an error did not occur. - * See {@link AllowedConnectionsList} for more + * {AdaptiveNetworkHardeningsList} [result] - The deserialized result object if an error did not occur. + * See {@link AdaptiveNetworkHardeningsList} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByExtendedResource(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByExtendedResource(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, callback: ServiceCallback): void; + listByExtendedResource(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the list of all possible traffic between resources for the subscription - * and location. + * Gets a single Adaptive Network Hardening resource + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {string} adaptiveNetworkHardeningResourceName The name of the + * Adaptive Network Hardening resource. * * @param {object} [options] Optional Parameters. * @@ -5707,15 +6701,26 @@ export interface AllowedConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByHomeRegionWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the list of all possible traffic between resources for the subscription - * and location. + * Gets a single Adaptive Network Hardening resource + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {string} adaptiveNetworkHardeningResourceName The name of the + * Adaptive Network Hardening resource. * * @param {object} [options] Optional Parameters. * @@ -5729,7 +6734,7 @@ export interface AllowedConnections { * * {Promise} A promise is returned. * - * @resolve {AllowedConnectionsList} - The deserialized result object. + * @resolve {AdaptiveNetworkHardening} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5737,28 +6742,41 @@ export interface AllowedConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AllowedConnectionsList} [result] - The deserialized result object if an error did not occur. - * See {@link AllowedConnectionsList} for more + * {AdaptiveNetworkHardening} [result] - The deserialized result object if an error did not occur. + * See {@link AdaptiveNetworkHardening} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByHomeRegion(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByHomeRegion(callback: ServiceCallback): void; - listByHomeRegion(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the list of all possible traffic between resources for the subscription - * and location, based on connection type. + * Enforces the given rules on the NSG(s) listed in the request * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. * - * @param {string} connectionType The type of allowed connections (Internal, - * External). Possible values include: 'Internal', 'External' + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {string} adaptiveNetworkHardeningResourceName The name of the + * Adaptive Network Hardening resource. + * + * @param {object} body + * + * @param {array} body.rules The rules to enforce + * + * @param {array} body.networkSecurityGroups The Azure resource IDs of the + * effective network security groups that will be updated with the created + * security rules from the Adaptive Network Hardening rules * * @param {object} [options] Optional Parameters. * @@ -5767,21 +6785,34 @@ export interface AllowedConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, connectionType: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + enforceWithHttpOperationResponse(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, body: models.AdaptiveNetworkHardeningEnforceRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the list of all possible traffic between resources for the subscription - * and location, based on connection type. + * Enforces the given rules on the NSG(s) listed in the request * * @param {string} resourceGroupName The name of the resource group within the * user's subscription. The name is case insensitive. * - * @param {string} connectionType The type of allowed connections (Internal, - * External). Possible values include: 'Internal', 'External' + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {string} adaptiveNetworkHardeningResourceName The name of the + * Adaptive Network Hardening resource. + * + * @param {object} body + * + * @param {array} body.rules The rules to enforce + * + * @param {array} body.networkSecurityGroups The Azure resource IDs of the + * effective network security groups that will be updated with the created + * security rules from the Adaptive Network Hardening rules * * @param {object} [options] Optional Parameters. * @@ -5795,7 +6826,7 @@ export interface AllowedConnections { * * {Promise} A promise is returned. * - * @resolve {AllowedConnectionsResource} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5803,24 +6834,39 @@ export interface AllowedConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AllowedConnectionsResource} [result] - The deserialized result object if an error did not occur. - * See {@link AllowedConnectionsResource} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, connectionType: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, connectionType: string, callback: ServiceCallback): void; - get(resourceGroupName: string, connectionType: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + enforce(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, body: models.AdaptiveNetworkHardeningEnforceRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + enforce(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, body: models.AdaptiveNetworkHardeningEnforceRequest, callback: ServiceCallback): void; + enforce(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, body: models.AdaptiveNetworkHardeningEnforceRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the list of all possible traffic between resources for the subscription + * Enforces the given rules on the NSG(s) listed in the request * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {string} adaptiveNetworkHardeningResourceName The name of the + * Adaptive Network Hardening resource. + * + * @param {object} body + * + * @param {array} body.rules The rules to enforce + * + * @param {array} body.networkSecurityGroups The Azure resource IDs of the + * effective network security groups that will be updated with the created + * security rules from the Adaptive Network Hardening rules * * @param {object} [options] Optional Parameters. * @@ -5829,17 +6875,34 @@ export interface AllowedConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginEnforceWithHttpOperationResponse(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, body: models.AdaptiveNetworkHardeningEnforceRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the list of all possible traffic between resources for the subscription + * Enforces the given rules on the NSG(s) listed in the request * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} resourceNamespace The Namespace of the resource. + * + * @param {string} resourceType The type of the resource. + * + * @param {string} resourceName Name of the resource. + * + * @param {string} adaptiveNetworkHardeningResourceName The name of the + * Adaptive Network Hardening resource. + * + * @param {object} body + * + * @param {array} body.rules The rules to enforce + * + * @param {array} body.networkSecurityGroups The Azure resource IDs of the + * effective network security groups that will be updated with the created + * security rules from the Adaptive Network Hardening rules * * @param {object} [options] Optional Parameters. * @@ -5853,7 +6916,7 @@ export interface AllowedConnections { * * {Promise} A promise is returned. * - * @resolve {AllowedConnectionsList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5861,22 +6924,20 @@ export interface AllowedConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AllowedConnectionsList} [result] - The deserialized result object if an error did not occur. - * See {@link AllowedConnectionsList} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginEnforce(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, body: models.AdaptiveNetworkHardeningEnforceRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginEnforce(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, body: models.AdaptiveNetworkHardeningEnforceRequest, callback: ServiceCallback): void; + beginEnforce(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, body: models.AdaptiveNetworkHardeningEnforceRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the list of all possible traffic between resources for the subscription - * and location. + * Gets a list of Adaptive Network Hardenings resources in scope of an extended + * resource. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5888,15 +6949,15 @@ export interface AllowedConnections { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByHomeRegionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByExtendedResourceNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the list of all possible traffic between resources for the subscription - * and location. + * Gets a list of Adaptive Network Hardenings resources in scope of an extended + * resource. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5913,7 +6974,7 @@ export interface AllowedConnections { * * {Promise} A promise is returned. * - * @resolve {AllowedConnectionsList} - The deserialized result object. + * @resolve {AdaptiveNetworkHardeningsList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5921,15 +6982,15 @@ export interface AllowedConnections { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {AllowedConnectionsList} [result] - The deserialized result object if an error did not occur. - * See {@link AllowedConnectionsList} for more + * {AdaptiveNetworkHardeningsList} [result] - The deserialized result object if an error did not occur. + * See {@link AdaptiveNetworkHardeningsList} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByHomeRegionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByHomeRegionNext(nextPageLink: string, callback: ServiceCallback): void; - listByHomeRegionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByExtendedResourceNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByExtendedResourceNext(nextPageLink: string, callback: ServiceCallback): void; + listByExtendedResourceNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } diff --git a/lib/services/securityManagement/lib/operations/index.js b/lib/services/securityManagement/lib/operations/index.js index d14a107507..0dd226c183 100644 --- a/lib/services/securityManagement/lib/operations/index.js +++ b/lib/services/securityManagement/lib/operations/index.js @@ -14,12 +14,16 @@ 'use strict'; +exports.RegulatoryComplianceStandards = require('./regulatoryComplianceStandards'); +exports.RegulatoryComplianceControls = require('./regulatoryComplianceControls'); +exports.RegulatoryComplianceAssessments = require('./regulatoryComplianceAssessments'); exports.Pricings = require('./pricings'); exports.SecurityContacts = require('./securityContacts'); exports.WorkspaceSettings = require('./workspaceSettings'); exports.AutoProvisioningSettings = require('./autoProvisioningSettings'); exports.Compliances = require('./compliances'); exports.AdvancedThreatProtection = require('./advancedThreatProtection'); +exports.DeviceSecurityGroups = require('./deviceSecurityGroups'); exports.Settings = require('./settings'); exports.InformationProtectionPolicies = require('./informationProtectionPolicies'); exports.Operations = require('./operations'); @@ -31,3 +35,4 @@ exports.JitNetworkAccessPolicies = require('./jitNetworkAccessPolicies'); exports.ExternalSecuritySolutions = require('./externalSecuritySolutions'); exports.Topology = require('./topology'); exports.AllowedConnections = require('./allowedConnections'); +exports.AdaptiveNetworkHardenings = require('./adaptiveNetworkHardenings'); diff --git a/lib/services/securityManagement/lib/operations/pricings.js b/lib/services/securityManagement/lib/operations/pricings.js index 4fa731d873..4aa1d9e953 100644 --- a/lib/services/securityManagement/lib/operations/pricings.js +++ b/lib/services/securityManagement/lib/operations/pricings.js @@ -13,6 +13,7 @@ const msRest = require('ms-rest'); const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; +const moment = require('moment'); /** * Security pricing configurations in the subscription @@ -45,7 +46,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-08-01-preview'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -152,166 +153,7 @@ function _list(options, callback) { } /** - * Security pricing configurations in the resource group - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PricingList} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _listByResourceGroup(resourceGroupName, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let apiVersion = '2017-08-01-preview'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { - if (this.client.subscriptionId.match(/^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/) === null) - { - throw new Error('"this.client.subscriptionId" should satisfy the constraint - "Pattern": /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/'); - } - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); - } - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PricingList']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Security pricing configuration in the subscriptionSecurity pricing - * configuration in the subscription + * Security pricing configuration in the subscription * * @param {string} pricingName name of the pricing configuration * @@ -333,7 +175,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getSubscriptionPricing(pricingName, options, callback) { +function _get(pricingName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -343,7 +185,7 @@ function _getSubscriptionPricing(pricingName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-08-01-preview'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -460,7 +302,7 @@ function _getSubscriptionPricing(pricingName, options, callback) { * * @param {object} pricing Pricing object * - * @param {string} pricing.pricingTier Pricing tier type. Possible values + * @param {string} pricing.pricingTier The pricing tier value. Possible values * include: 'Free', 'Standard' * * @param {object} [options] Optional Parameters. @@ -481,7 +323,7 @@ function _getSubscriptionPricing(pricingName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _updateSubscriptionPricing(pricingName, pricing, options, callback) { +function _update(pricingName, pricing, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -491,7 +333,7 @@ function _updateSubscriptionPricing(pricingName, pricing, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-08-01-preview'; + let apiVersion = '2018-06-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -618,826 +460,49 @@ function _updateSubscriptionPricing(pricingName, pricing, options, callback) { }); } -/** - * Security pricing configuration in the resource group - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} pricingName name of the pricing configuration - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Pricing} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _getResourceGroupPricing(resourceGroupName, pricingName, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let apiVersion = '2017-08-01-preview'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { - if (this.client.subscriptionId.match(/^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/) === null) - { - throw new Error('"this.client.subscriptionId" should satisfy the constraint - "Pattern": /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/'); - } - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); - } - } - if (pricingName === null || pricingName === undefined || typeof pricingName.valueOf() !== 'string') { - throw new Error('pricingName cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); +/** Class representing a Pricings. */ +class Pricings { + /** + * Create a Pricings. + * @param {SecurityCenter} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._update = _update; } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings/{pricingName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{pricingName}', encodeURIComponent(pricingName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Pricing']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Security pricing configuration in the resource group - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} pricingName name of the pricing configuration - * - * @param {object} pricing Pricing object - * - * @param {string} pricing.pricingTier Pricing tier type. Possible values - * include: 'Free', 'Standard' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Pricing} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _createOrUpdateResourceGroupPricing(resourceGroupName, pricingName, pricing, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let apiVersion = '2017-08-01-preview'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { - if (this.client.subscriptionId.match(/^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/) === null) - { - throw new Error('"this.client.subscriptionId" should satisfy the constraint - "Pattern": /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/'); - } - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); - } - } - if (pricingName === null || pricingName === undefined || typeof pricingName.valueOf() !== 'string') { - throw new Error('pricingName cannot be null or undefined and it must be of type string.'); - } - if (pricing === null || pricing === undefined) { - throw new Error('pricing cannot be null or undefined.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings/{pricingName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{pricingName}', encodeURIComponent(pricingName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (pricing !== null && pricing !== undefined) { - let requestModelMapper = new client.models['Pricing']().mapper(); - requestModel = client.serialize(requestModelMapper, pricing, 'pricing'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(pricing, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Pricing']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Security pricing configurations in the subscription - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PricingList} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _listNext(nextPageLink, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PricingList']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Security pricing configurations in the resource group - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PricingList} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _listByResourceGroupNext(nextPageLink, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PricingList']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** Class representing a Pricings. */ -class Pricings { - /** - * Create a Pricings. - * @param {SecurityCenter} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._listByResourceGroup = _listByResourceGroup; - this._getSubscriptionPricing = _getSubscriptionPricing; - this._updateSubscriptionPricing = _updateSubscriptionPricing; - this._getResourceGroupPricing = _getResourceGroupPricing; - this._createOrUpdateResourceGroupPricing = _createOrUpdateResourceGroupPricing; - this._listNext = _listNext; - this._listByResourceGroupNext = _listByResourceGroupNext; - } - - /** - * Security pricing configurations in the subscription - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Security pricing configurations in the subscription - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {PricingList} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PricingList} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - list(options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * Security pricing configurations in the resource group - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Security pricing configurations in the resource group - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {PricingList} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PricingList} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listByResourceGroup(resourceGroupName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); - } - } - - /** - * Security pricing configuration in the subscriptionSecurity pricing - * configuration in the subscription - * - * @param {string} pricingName name of the pricing configuration - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getSubscriptionPricingWithHttpOperationResponse(pricingName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getSubscriptionPricing(pricingName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); + /** + * Security pricing configurations in the subscription + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); } /** - * Security pricing configuration in the subscriptionSecurity pricing - * configuration in the subscription - * - * @param {string} pricingName name of the pricing configuration + * Security pricing configurations in the subscription * * @param {object} [options] Optional Parameters. * @@ -1451,7 +516,7 @@ class Pricings { * * {Promise} A promise is returned * - * @resolve {Pricing} - The deserialized result object. + * @resolve {PricingList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1460,13 +525,13 @@ class Pricings { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Pricing} for more information. + * See {@link PricingList} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getSubscriptionPricing(pricingName, options, optionalCallback) { + list(options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1475,14 +540,14 @@ class Pricings { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getSubscriptionPricing(pricingName, options, (err, result, request, response) => { + self._list(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getSubscriptionPricing(pricingName, options, optionalCallback); + return self._list(options, optionalCallback); } } @@ -1491,11 +556,6 @@ class Pricings { * * @param {string} pricingName name of the pricing configuration * - * @param {object} pricing Pricing object - * - * @param {string} pricing.pricingTier Pricing tier type. Possible values - * include: 'Free', 'Standard' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1507,11 +567,11 @@ class Pricings { * * @reject {Error} - The error object. */ - updateSubscriptionPricingWithHttpOperationResponse(pricingName, pricing, options) { + getWithHttpOperationResponse(pricingName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._updateSubscriptionPricing(pricingName, pricing, options, (err, result, request, response) => { + self._get(pricingName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1526,99 +586,6 @@ class Pricings { * * @param {string} pricingName name of the pricing configuration * - * @param {object} pricing Pricing object - * - * @param {string} pricing.pricingTier Pricing tier type. Possible values - * include: 'Free', 'Standard' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {Pricing} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Pricing} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - updateSubscriptionPricing(pricingName, pricing, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._updateSubscriptionPricing(pricingName, pricing, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateSubscriptionPricing(pricingName, pricing, options, optionalCallback); - } - } - - /** - * Security pricing configuration in the resource group - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} pricingName name of the pricing configuration - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getResourceGroupPricingWithHttpOperationResponse(resourceGroupName, pricingName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getResourceGroupPricing(resourceGroupName, pricingName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Security pricing configuration in the resource group - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. - * - * @param {string} pricingName name of the pricing configuration - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1646,7 +613,7 @@ class Pricings { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getResourceGroupPricing(resourceGroupName, pricingName, options, optionalCallback) { + get(pricingName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1655,28 +622,25 @@ class Pricings { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getResourceGroupPricing(resourceGroupName, pricingName, options, (err, result, request, response) => { + self._get(pricingName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getResourceGroupPricing(resourceGroupName, pricingName, options, optionalCallback); + return self._get(pricingName, options, optionalCallback); } } /** - * Security pricing configuration in the resource group - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. + * Security pricing configuration in the subscription * * @param {string} pricingName name of the pricing configuration * * @param {object} pricing Pricing object * - * @param {string} pricing.pricingTier Pricing tier type. Possible values + * @param {string} pricing.pricingTier The pricing tier value. Possible values * include: 'Free', 'Standard' * * @param {object} [options] Optional Parameters. @@ -1690,11 +654,11 @@ class Pricings { * * @reject {Error} - The error object. */ - createOrUpdateResourceGroupPricingWithHttpOperationResponse(resourceGroupName, pricingName, pricing, options) { + updateWithHttpOperationResponse(pricingName, pricing, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdateResourceGroupPricing(resourceGroupName, pricingName, pricing, options, (err, result, request, response) => { + self._update(pricingName, pricing, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1705,16 +669,13 @@ class Pricings { } /** - * Security pricing configuration in the resource group - * - * @param {string} resourceGroupName The name of the resource group within the - * user's subscription. The name is case insensitive. + * Security pricing configuration in the subscription * * @param {string} pricingName name of the pricing configuration * * @param {object} pricing Pricing object * - * @param {string} pricing.pricingTier Pricing tier type. Possible values + * @param {string} pricing.pricingTier The pricing tier value. Possible values * include: 'Free', 'Standard' * * @param {object} [options] Optional Parameters. @@ -1744,175 +705,7 @@ class Pricings { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdateResourceGroupPricing(resourceGroupName, pricingName, pricing, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._createOrUpdateResourceGroupPricing(resourceGroupName, pricingName, pricing, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdateResourceGroupPricing(resourceGroupName, pricingName, pricing, options, optionalCallback); - } - } - - /** - * Security pricing configurations in the subscription - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Security pricing configurations in the subscription - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {PricingList} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PricingList} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Security pricing configurations in the resource group - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Security pricing configurations in the resource group - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {PricingList} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PricingList} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listByResourceGroupNext(nextPageLink, options, optionalCallback) { + update(pricingName, pricing, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1921,14 +714,14 @@ class Pricings { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + self._update(pricingName, pricing, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + return self._update(pricingName, pricing, options, optionalCallback); } } diff --git a/lib/services/securityManagement/lib/operations/regulatoryComplianceAssessments.js b/lib/services/securityManagement/lib/operations/regulatoryComplianceAssessments.js new file mode 100644 index 0000000000..4521d52053 --- /dev/null +++ b/lib/services/securityManagement/lib/operations/regulatoryComplianceAssessments.js @@ -0,0 +1,817 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Details and state of assessments mapped to selected regulatory compliance + * control + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {string} regulatoryComplianceControlName Name of the regulatory + * compliance control object + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceAssessmentList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2019-01-01-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { + if (this.client.subscriptionId.match(/^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/) === null) + { + throw new Error('"this.client.subscriptionId" should satisfy the constraint - "Pattern": /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/'); + } + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (regulatoryComplianceStandardName === null || regulatoryComplianceStandardName === undefined || typeof regulatoryComplianceStandardName.valueOf() !== 'string') { + throw new Error('regulatoryComplianceStandardName cannot be null or undefined and it must be of type string.'); + } + if (regulatoryComplianceControlName === null || regulatoryComplianceControlName === undefined || typeof regulatoryComplianceControlName.valueOf() !== 'string') { + throw new Error('regulatoryComplianceControlName cannot be null or undefined and it must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{regulatoryComplianceStandardName}', encodeURIComponent(regulatoryComplianceStandardName)); + requestUrl = requestUrl.replace('{regulatoryComplianceControlName}', encodeURIComponent(regulatoryComplianceControlName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RegulatoryComplianceAssessmentList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Supported regulatory compliance details and state for selected assessment + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {string} regulatoryComplianceControlName Name of the regulatory + * compliance control object + * + * @param {string} regulatoryComplianceAssessmentName Name of the regulatory + * compliance assessment object + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceAssessment} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, regulatoryComplianceAssessmentName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2019-01-01-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { + if (this.client.subscriptionId.match(/^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/) === null) + { + throw new Error('"this.client.subscriptionId" should satisfy the constraint - "Pattern": /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/'); + } + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (regulatoryComplianceStandardName === null || regulatoryComplianceStandardName === undefined || typeof regulatoryComplianceStandardName.valueOf() !== 'string') { + throw new Error('regulatoryComplianceStandardName cannot be null or undefined and it must be of type string.'); + } + if (regulatoryComplianceControlName === null || regulatoryComplianceControlName === undefined || typeof regulatoryComplianceControlName.valueOf() !== 'string') { + throw new Error('regulatoryComplianceControlName cannot be null or undefined and it must be of type string.'); + } + if (regulatoryComplianceAssessmentName === null || regulatoryComplianceAssessmentName === undefined || typeof regulatoryComplianceAssessmentName.valueOf() !== 'string') { + throw new Error('regulatoryComplianceAssessmentName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{regulatoryComplianceStandardName}', encodeURIComponent(regulatoryComplianceStandardName)); + requestUrl = requestUrl.replace('{regulatoryComplianceControlName}', encodeURIComponent(regulatoryComplianceControlName)); + requestUrl = requestUrl.replace('{regulatoryComplianceAssessmentName}', encodeURIComponent(regulatoryComplianceAssessmentName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RegulatoryComplianceAssessment']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Details and state of assessments mapped to selected regulatory compliance + * control + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceAssessmentList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RegulatoryComplianceAssessmentList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a RegulatoryComplianceAssessments. */ +class RegulatoryComplianceAssessments { + /** + * Create a RegulatoryComplianceAssessments. + * @param {SecurityCenter} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._listNext = _listNext; + } + + /** + * Details and state of assessments mapped to selected regulatory compliance + * control + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {string} regulatoryComplianceControlName Name of the regulatory + * compliance control object + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Details and state of assessments mapped to selected regulatory compliance + * control + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {string} regulatoryComplianceControlName Name of the regulatory + * compliance control object + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RegulatoryComplianceAssessmentList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceAssessmentList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, options, optionalCallback); + } + } + + /** + * Supported regulatory compliance details and state for selected assessment + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {string} regulatoryComplianceControlName Name of the regulatory + * compliance control object + * + * @param {string} regulatoryComplianceAssessmentName Name of the regulatory + * compliance assessment object + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, regulatoryComplianceAssessmentName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, regulatoryComplianceAssessmentName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Supported regulatory compliance details and state for selected assessment + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {string} regulatoryComplianceControlName Name of the regulatory + * compliance control object + * + * @param {string} regulatoryComplianceAssessmentName Name of the regulatory + * compliance assessment object + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RegulatoryComplianceAssessment} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceAssessment} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, regulatoryComplianceAssessmentName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, regulatoryComplianceAssessmentName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, regulatoryComplianceAssessmentName, options, optionalCallback); + } + } + + /** + * Details and state of assessments mapped to selected regulatory compliance + * control + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Details and state of assessments mapped to selected regulatory compliance + * control + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RegulatoryComplianceAssessmentList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceAssessmentList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = RegulatoryComplianceAssessments; diff --git a/lib/services/securityManagement/lib/operations/regulatoryComplianceControls.js b/lib/services/securityManagement/lib/operations/regulatoryComplianceControls.js new file mode 100644 index 0000000000..1bd0ecd113 --- /dev/null +++ b/lib/services/securityManagement/lib/operations/regulatoryComplianceControls.js @@ -0,0 +1,791 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * All supported regulatory compliance controls details and state for selected + * standard + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceControlList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, regulatoryComplianceStandardName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2019-01-01-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { + if (this.client.subscriptionId.match(/^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/) === null) + { + throw new Error('"this.client.subscriptionId" should satisfy the constraint - "Pattern": /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/'); + } + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (regulatoryComplianceStandardName === null || regulatoryComplianceStandardName === undefined || typeof regulatoryComplianceStandardName.valueOf() !== 'string') { + throw new Error('regulatoryComplianceStandardName cannot be null or undefined and it must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{regulatoryComplianceStandardName}', encodeURIComponent(regulatoryComplianceStandardName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RegulatoryComplianceControlList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Selected regulatory compliance control details and state + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {string} regulatoryComplianceControlName Name of the regulatory + * compliance control object + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceControl} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2019-01-01-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { + if (this.client.subscriptionId.match(/^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/) === null) + { + throw new Error('"this.client.subscriptionId" should satisfy the constraint - "Pattern": /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/'); + } + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (regulatoryComplianceStandardName === null || regulatoryComplianceStandardName === undefined || typeof regulatoryComplianceStandardName.valueOf() !== 'string') { + throw new Error('regulatoryComplianceStandardName cannot be null or undefined and it must be of type string.'); + } + if (regulatoryComplianceControlName === null || regulatoryComplianceControlName === undefined || typeof regulatoryComplianceControlName.valueOf() !== 'string') { + throw new Error('regulatoryComplianceControlName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{regulatoryComplianceStandardName}', encodeURIComponent(regulatoryComplianceStandardName)); + requestUrl = requestUrl.replace('{regulatoryComplianceControlName}', encodeURIComponent(regulatoryComplianceControlName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RegulatoryComplianceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * All supported regulatory compliance controls details and state for selected + * standard + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceControlList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RegulatoryComplianceControlList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a RegulatoryComplianceControls. */ +class RegulatoryComplianceControls { + /** + * Create a RegulatoryComplianceControls. + * @param {SecurityCenter} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._listNext = _listNext; + } + + /** + * All supported regulatory compliance controls details and state for selected + * standard + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, regulatoryComplianceStandardName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, regulatoryComplianceStandardName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * All supported regulatory compliance controls details and state for selected + * standard + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RegulatoryComplianceControlList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceControlList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName, regulatoryComplianceStandardName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(resourceGroupName, regulatoryComplianceStandardName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, regulatoryComplianceStandardName, options, optionalCallback); + } + } + + /** + * Selected regulatory compliance control details and state + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {string} regulatoryComplianceControlName Name of the regulatory + * compliance control object + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Selected regulatory compliance control details and state + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {string} regulatoryComplianceControlName Name of the regulatory + * compliance control object + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RegulatoryComplianceControl} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceControl} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, regulatoryComplianceStandardName, regulatoryComplianceControlName, options, optionalCallback); + } + } + + /** + * All supported regulatory compliance controls details and state for selected + * standard + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * All supported regulatory compliance controls details and state for selected + * standard + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RegulatoryComplianceControlList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceControlList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = RegulatoryComplianceControls; diff --git a/lib/services/securityManagement/lib/operations/regulatoryComplianceStandards.js b/lib/services/securityManagement/lib/operations/regulatoryComplianceStandards.js new file mode 100644 index 0000000000..46920c0500 --- /dev/null +++ b/lib/services/securityManagement/lib/operations/regulatoryComplianceStandards.js @@ -0,0 +1,759 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Supported regulatory compliance standards details and state + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceStandardList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2019-01-01-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { + if (this.client.subscriptionId.match(/^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/) === null) + { + throw new Error('"this.client.subscriptionId" should satisfy the constraint - "Pattern": /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/'); + } + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/regulatoryComplianceStandards'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RegulatoryComplianceStandardList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Supported regulatory compliance details state for selected standard + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceStandard} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, regulatoryComplianceStandardName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2019-01-01-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) { + if (this.client.subscriptionId.match(/^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/) === null) + { + throw new Error('"this.client.subscriptionId" should satisfy the constraint - "Pattern": /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/'); + } + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (regulatoryComplianceStandardName === null || regulatoryComplianceStandardName === undefined || typeof regulatoryComplianceStandardName.valueOf() !== 'string') { + throw new Error('regulatoryComplianceStandardName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{regulatoryComplianceStandardName}', encodeURIComponent(regulatoryComplianceStandardName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RegulatoryComplianceStandard']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Supported regulatory compliance standards details and state + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceStandardList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RegulatoryComplianceStandardList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a RegulatoryComplianceStandards. */ +class RegulatoryComplianceStandards { + /** + * Create a RegulatoryComplianceStandards. + * @param {SecurityCenter} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._listNext = _listNext; + } + + /** + * Supported regulatory compliance standards details and state + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Supported regulatory compliance standards details and state + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RegulatoryComplianceStandardList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceStandardList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Supported regulatory compliance details state for selected standard + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, regulatoryComplianceStandardName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, regulatoryComplianceStandardName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Supported regulatory compliance details state for selected standard + * + * @param {string} resourceGroupName The name of the resource group within the + * user's subscription. The name is case insensitive. + * + * @param {string} regulatoryComplianceStandardName Name of the regulatory + * compliance standard object + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RegulatoryComplianceStandard} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceStandard} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, regulatoryComplianceStandardName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, regulatoryComplianceStandardName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, regulatoryComplianceStandardName, options, optionalCallback); + } + } + + /** + * Supported regulatory compliance standards details and state + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Supported regulatory compliance standards details and state + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RegulatoryComplianceStandardList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RegulatoryComplianceStandardList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = RegulatoryComplianceStandards; diff --git a/lib/services/securityManagement/lib/operations/settings.js b/lib/services/securityManagement/lib/operations/settings.js index 270ce5d708..c2d6aa6bc2 100644 --- a/lib/services/securityManagement/lib/operations/settings.js +++ b/lib/services/securityManagement/lib/operations/settings.js @@ -154,8 +154,8 @@ function _list(options, callback) { /** * Settings of different configurations in security center * - * @param {string} settingName Name of setting. Possible values include: - * 'MCAS', 'WDATP' + * @param {string} settingName Name of setting: (MCAS/WDATP). Possible values + * include: 'MCAS', 'WDATP' * * @param {object} [options] Optional Parameters. * @@ -298,12 +298,14 @@ function _get(settingName, options, callback) { /** * updating settings about different configurations in security center * - * @param {string} settingName Name of setting. Possible values include: - * 'MCAS', 'WDATP' + * @param {string} settingName Name of setting: (MCAS/WDATP). Possible values + * include: 'MCAS', 'WDATP' * * @param {object} setting Setting object * - * @param {string} setting.kind Polymorphic Discriminator + * @param {string} setting.kind the kind of the settings string + * (DataExportSetting). Possible values include: 'DataExportSetting', + * 'AlertSuppressionSetting' * * @param {object} [options] Optional Parameters. * @@ -348,9 +350,6 @@ function _update(settingName, setting, options, callback) { if (settingName === null || settingName === undefined || typeof settingName.valueOf() !== 'string') { throw new Error('settingName cannot be null or undefined and it must be of type string.'); } - if (setting === null || setting === undefined) { - throw new Error('setting cannot be null or undefined.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -682,8 +681,8 @@ class Settings { /** * Settings of different configurations in security center * - * @param {string} settingName Name of setting. Possible values include: - * 'MCAS', 'WDATP' + * @param {string} settingName Name of setting: (MCAS/WDATP). Possible values + * include: 'MCAS', 'WDATP' * * @param {object} [options] Optional Parameters. * @@ -713,8 +712,8 @@ class Settings { /** * Settings of different configurations in security center * - * @param {string} settingName Name of setting. Possible values include: - * 'MCAS', 'WDATP' + * @param {string} settingName Name of setting: (MCAS/WDATP). Possible values + * include: 'MCAS', 'WDATP' * * @param {object} [options] Optional Parameters. * @@ -766,12 +765,14 @@ class Settings { /** * updating settings about different configurations in security center * - * @param {string} settingName Name of setting. Possible values include: - * 'MCAS', 'WDATP' + * @param {string} settingName Name of setting: (MCAS/WDATP). Possible values + * include: 'MCAS', 'WDATP' * * @param {object} setting Setting object * - * @param {string} setting.kind Polymorphic Discriminator + * @param {string} setting.kind the kind of the settings string + * (DataExportSetting). Possible values include: 'DataExportSetting', + * 'AlertSuppressionSetting' * * @param {object} [options] Optional Parameters. * @@ -801,12 +802,14 @@ class Settings { /** * updating settings about different configurations in security center * - * @param {string} settingName Name of setting. Possible values include: - * 'MCAS', 'WDATP' + * @param {string} settingName Name of setting: (MCAS/WDATP). Possible values + * include: 'MCAS', 'WDATP' * * @param {object} setting Setting object * - * @param {string} setting.kind Polymorphic Discriminator + * @param {string} setting.kind the kind of the settings string + * (DataExportSetting). Possible values include: 'DataExportSetting', + * 'AlertSuppressionSetting' * * @param {object} [options] Optional Parameters. * diff --git a/lib/services/securityManagement/lib/operations/workspaceSettings.js b/lib/services/securityManagement/lib/operations/workspaceSettings.js index d7a066a4de..e6b7a9f455 100644 --- a/lib/services/securityManagement/lib/operations/workspaceSettings.js +++ b/lib/services/securityManagement/lib/operations/workspaceSettings.js @@ -15,7 +15,8 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * Settings about where we should store your security data and logs + * Settings about where we should store your security data and logs. If the + * result is empty, it means that no custom-workspace configuration was set * * @param {object} [options] Optional Parameters. * @@ -152,7 +153,8 @@ function _list(options, callback) { } /** - * Settings about where we should store your security data and logs + * Settings about where we should store your security data and logs. If the + * result is empty, it means that no custom-workspace configuration was set * * @param {string} workspaceSettingName Name of the security setting * @@ -759,7 +761,8 @@ function _deleteMethod(workspaceSettingName, options, callback) { } /** - * Settings about where we should store your security data and logs + * Settings about where we should store your security data and logs. If the + * result is empty, it means that no custom-workspace configuration was set * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -902,7 +905,8 @@ class WorkspaceSettings { } /** - * Settings about where we should store your security data and logs + * Settings about where we should store your security data and logs. If the + * result is empty, it means that no custom-workspace configuration was set * * @param {object} [options] Optional Parameters. * @@ -930,7 +934,8 @@ class WorkspaceSettings { } /** - * Settings about where we should store your security data and logs + * Settings about where we should store your security data and logs. If the + * result is empty, it means that no custom-workspace configuration was set * * @param {object} [options] Optional Parameters. * @@ -980,7 +985,8 @@ class WorkspaceSettings { } /** - * Settings about where we should store your security data and logs + * Settings about where we should store your security data and logs. If the + * result is empty, it means that no custom-workspace configuration was set * * @param {string} workspaceSettingName Name of the security setting * @@ -1010,7 +1016,8 @@ class WorkspaceSettings { } /** - * Settings about where we should store your security data and logs + * Settings about where we should store your security data and logs. If the + * result is empty, it means that no custom-workspace configuration was set * * @param {string} workspaceSettingName Name of the security setting * @@ -1345,7 +1352,8 @@ class WorkspaceSettings { } /** - * Settings about where we should store your security data and logs + * Settings about where we should store your security data and logs. If the + * result is empty, it means that no custom-workspace configuration was set * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1376,7 +1384,8 @@ class WorkspaceSettings { } /** - * Settings about where we should store your security data and logs + * Settings about where we should store your security data and logs. If the + * result is empty, it means that no custom-workspace configuration was set * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. diff --git a/lib/services/securityManagement/lib/securityCenter.d.ts b/lib/services/securityManagement/lib/securityCenter.d.ts index d229d77689..c66eaccc52 100644 --- a/lib/services/securityManagement/lib/securityCenter.d.ts +++ b/lib/services/securityManagement/lib/securityCenter.d.ts @@ -58,12 +58,16 @@ export default class SecurityCenter extends AzureServiceClient { generateClientRequestId: boolean; // Operation groups + regulatoryComplianceStandards: operations.RegulatoryComplianceStandards; + regulatoryComplianceControls: operations.RegulatoryComplianceControls; + regulatoryComplianceAssessments: operations.RegulatoryComplianceAssessments; pricings: operations.Pricings; securityContacts: operations.SecurityContacts; workspaceSettings: operations.WorkspaceSettings; autoProvisioningSettings: operations.AutoProvisioningSettings; compliances: operations.Compliances; advancedThreatProtection: operations.AdvancedThreatProtection; + deviceSecurityGroups: operations.DeviceSecurityGroups; settings: operations.Settings; informationProtectionPolicies: operations.InformationProtectionPolicies; operations: operations.Operations; @@ -75,6 +79,7 @@ export default class SecurityCenter extends AzureServiceClient { externalSecuritySolutions: operations.ExternalSecuritySolutions; topology: operations.Topology; allowedConnections: operations.AllowedConnections; + adaptiveNetworkHardenings: operations.AdaptiveNetworkHardenings; } export { SecurityCenter, models as SecurityCenterModels }; diff --git a/lib/services/securityManagement/lib/securityCenter.js b/lib/services/securityManagement/lib/securityCenter.js index f5fb9130ac..f6009062ca 100644 --- a/lib/services/securityManagement/lib/securityCenter.js +++ b/lib/services/securityManagement/lib/securityCenter.js @@ -76,12 +76,16 @@ class SecurityCenter extends ServiceClient { if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } + this.regulatoryComplianceStandards = new operations.RegulatoryComplianceStandards(this); + this.regulatoryComplianceControls = new operations.RegulatoryComplianceControls(this); + this.regulatoryComplianceAssessments = new operations.RegulatoryComplianceAssessments(this); this.pricings = new operations.Pricings(this); this.securityContacts = new operations.SecurityContacts(this); this.workspaceSettings = new operations.WorkspaceSettings(this); this.autoProvisioningSettings = new operations.AutoProvisioningSettings(this); this.compliances = new operations.Compliances(this); this.advancedThreatProtection = new operations.AdvancedThreatProtection(this); + this.deviceSecurityGroups = new operations.DeviceSecurityGroups(this); this.settings = new operations.Settings(this); this.informationProtectionPolicies = new operations.InformationProtectionPolicies(this); this.operations = new operations.Operations(this); @@ -93,6 +97,7 @@ class SecurityCenter extends ServiceClient { this.externalSecuritySolutions = new operations.ExternalSecuritySolutions(this); this.topology = new operations.Topology(this); this.allowedConnections = new operations.AllowedConnections(this); + this.adaptiveNetworkHardenings = new operations.AdaptiveNetworkHardenings(this); this.models = models; msRest.addSerializationMixin(this); }