From 8004ea7c22f5ae54b6f54949a739903d46950075 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 1 Apr 2019 12:59:02 +0000 Subject: [PATCH] Generated from f20f1d94a584bf55c225139c0991138b1c90420f Add cases aggregation endpoint to SecurityInsights RP swagger spec --- .../@azure/arm-securityinsight/LICENSE.txt | 21 + packages/@azure/arm-securityinsight/README.md | 96 + .../lib/models/actionsMappers.ts | 23 + .../lib/models/alertRulesMappers.ts | 25 + .../lib/models/bookmarksMappers.ts | 23 + .../lib/models/casesAggregationsMappers.ts | 16 + .../lib/models/casesMappers.ts | 23 + .../lib/models/dataConnectorsMappers.ts | 30 + .../lib/models/entitiesMappers.ts | 20 + .../arm-securityinsight/lib/models/index.ts | 2103 +++++++++++++++++ .../arm-securityinsight/lib/models/mappers.ts | 1535 ++++++++++++ .../lib/models/officeConsentsMappers.ts | 23 + .../lib/models/operationsMappers.ts | 18 + .../lib/models/parameters.ts | 187 ++ .../lib/models/productSettingsMappers.ts | 18 + .../lib/operations/actions.ts | 152 ++ .../lib/operations/alertRules.ts | 626 +++++ .../lib/operations/bookmarks.ts | 379 +++ .../lib/operations/cases.ts | 379 +++ .../lib/operations/casesAggregations.ts | 103 + .../lib/operations/dataConnectors.ts | 379 +++ .../lib/operations/entities.ts | 220 ++ .../lib/operations/index.ts | 20 + .../lib/operations/officeConsents.ts | 292 +++ .../lib/operations/operations.ts | 123 + .../lib/operations/productSettings.ts | 187 ++ .../lib/securityInsights.ts | 60 + .../lib/securityInsightsContext.ts | 62 + .../@azure/arm-securityinsight/package.json | 56 + .../arm-securityinsight/rollup.config.js | 37 + .../@azure/arm-securityinsight/tsconfig.json | 19 + 31 files changed, 7255 insertions(+) create mode 100644 packages/@azure/arm-securityinsight/LICENSE.txt create mode 100644 packages/@azure/arm-securityinsight/README.md create mode 100644 packages/@azure/arm-securityinsight/lib/models/actionsMappers.ts create mode 100644 packages/@azure/arm-securityinsight/lib/models/alertRulesMappers.ts create mode 100644 packages/@azure/arm-securityinsight/lib/models/bookmarksMappers.ts create mode 100644 packages/@azure/arm-securityinsight/lib/models/casesAggregationsMappers.ts create mode 100644 packages/@azure/arm-securityinsight/lib/models/casesMappers.ts create mode 100644 packages/@azure/arm-securityinsight/lib/models/dataConnectorsMappers.ts create mode 100644 packages/@azure/arm-securityinsight/lib/models/entitiesMappers.ts create mode 100644 packages/@azure/arm-securityinsight/lib/models/index.ts create mode 100644 packages/@azure/arm-securityinsight/lib/models/mappers.ts create mode 100644 packages/@azure/arm-securityinsight/lib/models/officeConsentsMappers.ts create mode 100644 packages/@azure/arm-securityinsight/lib/models/operationsMappers.ts create mode 100644 packages/@azure/arm-securityinsight/lib/models/parameters.ts create mode 100644 packages/@azure/arm-securityinsight/lib/models/productSettingsMappers.ts create mode 100644 packages/@azure/arm-securityinsight/lib/operations/actions.ts create mode 100644 packages/@azure/arm-securityinsight/lib/operations/alertRules.ts create mode 100644 packages/@azure/arm-securityinsight/lib/operations/bookmarks.ts create mode 100644 packages/@azure/arm-securityinsight/lib/operations/cases.ts create mode 100644 packages/@azure/arm-securityinsight/lib/operations/casesAggregations.ts create mode 100644 packages/@azure/arm-securityinsight/lib/operations/dataConnectors.ts create mode 100644 packages/@azure/arm-securityinsight/lib/operations/entities.ts create mode 100644 packages/@azure/arm-securityinsight/lib/operations/index.ts create mode 100644 packages/@azure/arm-securityinsight/lib/operations/officeConsents.ts create mode 100644 packages/@azure/arm-securityinsight/lib/operations/operations.ts create mode 100644 packages/@azure/arm-securityinsight/lib/operations/productSettings.ts create mode 100644 packages/@azure/arm-securityinsight/lib/securityInsights.ts create mode 100644 packages/@azure/arm-securityinsight/lib/securityInsightsContext.ts create mode 100644 packages/@azure/arm-securityinsight/package.json create mode 100644 packages/@azure/arm-securityinsight/rollup.config.js create mode 100644 packages/@azure/arm-securityinsight/tsconfig.json diff --git a/packages/@azure/arm-securityinsight/LICENSE.txt b/packages/@azure/arm-securityinsight/LICENSE.txt new file mode 100644 index 000000000000..8f3d856145c5 --- /dev/null +++ b/packages/@azure/arm-securityinsight/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/@azure/arm-securityinsight/README.md b/packages/@azure/arm-securityinsight/README.md new file mode 100644 index 000000000000..0fdd3c21655a --- /dev/null +++ b/packages/@azure/arm-securityinsight/README.md @@ -0,0 +1,96 @@ +## Azure SecurityInsights SDK for JavaScript + +This package contains an isomorphic SDK for SecurityInsights. + +### Currently supported environments + +- Node.js version 6.x.x or higher +- Browser JavaScript + +### How to Install + +```bash +npm install @azure/arm-securityinsight +``` + +### How to use + +#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. + +##### Install @azure/ms-rest-nodeauth + +```bash +npm install @azure/ms-rest-nodeauth +``` + +##### Sample code + +```typescript +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; +import { SecurityInsights, SecurityInsightsModels, SecurityInsightsMappers } from "@azure/arm-securityinsight"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new SecurityInsights(creds, subscriptionId); + client.operations.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +#### browser - Authentication, client creation and list operations as an example written in JavaScript. + +##### Install @azure/ms-rest-browserauth + +```bash +npm install @azure/ms-rest-browserauth +``` + +##### Sample code + +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/arm-securityinsight sample + + + + + + + + +``` + +## Related projects + +- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) diff --git a/packages/@azure/arm-securityinsight/lib/models/actionsMappers.ts b/packages/@azure/arm-securityinsight/lib/models/actionsMappers.ts new file mode 100644 index 000000000000..fed5fd617fbb --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/models/actionsMappers.ts @@ -0,0 +1,23 @@ +/* + * 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. + */ + +export { + discriminators, + ActionsList, + Action, + Resource, + BaseResource, + CloudError, + CaseModel, + UserInfo, + Bookmark, + OfficeConsent +} from "../models/mappers"; + diff --git a/packages/@azure/arm-securityinsight/lib/models/alertRulesMappers.ts b/packages/@azure/arm-securityinsight/lib/models/alertRulesMappers.ts new file mode 100644 index 000000000000..d882138ce961 --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/models/alertRulesMappers.ts @@ -0,0 +1,25 @@ +/* + * 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. + */ + +export { + discriminators, + AlertRulesList, + AlertRule, + CloudError, + Action, + Resource, + BaseResource, + ScheduledAlertRule, + CaseModel, + UserInfo, + Bookmark, + OfficeConsent +} from "../models/mappers"; + diff --git a/packages/@azure/arm-securityinsight/lib/models/bookmarksMappers.ts b/packages/@azure/arm-securityinsight/lib/models/bookmarksMappers.ts new file mode 100644 index 000000000000..c9c5812df22b --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/models/bookmarksMappers.ts @@ -0,0 +1,23 @@ +/* + * 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. + */ + +export { + discriminators, + BookmarkList, + Bookmark, + Resource, + BaseResource, + UserInfo, + CloudError, + Action, + CaseModel, + OfficeConsent +} from "../models/mappers"; + diff --git a/packages/@azure/arm-securityinsight/lib/models/casesAggregationsMappers.ts b/packages/@azure/arm-securityinsight/lib/models/casesAggregationsMappers.ts new file mode 100644 index 000000000000..4782b5c6c76a --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/models/casesAggregationsMappers.ts @@ -0,0 +1,16 @@ +/* + * 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. + */ + +export { + discriminators, + Aggregations, + CloudError +} from "../models/mappers"; + diff --git a/packages/@azure/arm-securityinsight/lib/models/casesMappers.ts b/packages/@azure/arm-securityinsight/lib/models/casesMappers.ts new file mode 100644 index 000000000000..d31a852028af --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/models/casesMappers.ts @@ -0,0 +1,23 @@ +/* + * 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. + */ + +export { + discriminators, + CaseList, + CaseModel, + Resource, + BaseResource, + UserInfo, + CloudError, + Action, + Bookmark, + OfficeConsent +} from "../models/mappers"; + diff --git a/packages/@azure/arm-securityinsight/lib/models/dataConnectorsMappers.ts b/packages/@azure/arm-securityinsight/lib/models/dataConnectorsMappers.ts new file mode 100644 index 000000000000..d69078382b55 --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/models/dataConnectorsMappers.ts @@ -0,0 +1,30 @@ +/* + * 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. + */ + +export { + discriminators, + DataConnectorList, + DataConnector, + CloudError, + OfficeDataConnector, + OfficeDataConnectorDataTypes, + OfficeDataConnectorDataTypesSharePoint, + DataConnectorDataTypeCommon, + OfficeDataConnectorDataTypesExchange, + TIDataConnectorDataTypesIndicators, + TIDataConnector, + TIDataConnectorDataTypes, + AlertsDataTypeOfDataConnectorAlerts, + AADDataConnector, + AlertsDataTypeOfDataConnector, + ASCDataConnector, + MCASDataConnector +} from "../models/mappers"; + diff --git a/packages/@azure/arm-securityinsight/lib/models/entitiesMappers.ts b/packages/@azure/arm-securityinsight/lib/models/entitiesMappers.ts new file mode 100644 index 000000000000..9dc1d1980607 --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/models/entitiesMappers.ts @@ -0,0 +1,20 @@ +/* + * 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. + */ + +export { + discriminators, + EntityList, + Entity, + CloudError, + AccountEntity, + HostEntity, + FileEntity +} from "../models/mappers"; + diff --git a/packages/@azure/arm-securityinsight/lib/models/index.ts b/packages/@azure/arm-securityinsight/lib/models/index.ts new file mode 100644 index 000000000000..430a2cd26867 --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/models/index.ts @@ -0,0 +1,2103 @@ +/* + * 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. + */ + +import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + + +/** + * @interface + * An interface representing OperationDisplay. + * Properties of the operation + * + */ +export interface OperationDisplay { + /** + * @member {string} [provider] Provider name + */ + provider?: string; + /** + * @member {string} [resource] Resource name + */ + resource?: string; + /** + * @member {string} [operation] Operation name + */ + operation?: string; + /** + * @member {string} [description] Description of the operation + */ + description?: string; +} + +/** + * @interface + * An interface representing Operation. + * Operation provided by provider + * + */ +export interface Operation { + /** + * @member {string} [name] Name of the operation + */ + name?: string; + /** + * @member {OperationDisplay} [display] Properties of the operation + */ + display?: OperationDisplay; +} + +/** + * Contains the possible cases for AlertRule. + */ +export type AlertRuleUnion = AlertRule | ScheduledAlertRule; + +/** + * @interface + * An interface representing AlertRule. + * Alert rule. + * + */ +export interface AlertRule { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "AlertRule"; + /** + * @member {string} [id] Azure resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] Azure resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] Azure resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [etag] Etag of the alert rule. + */ + etag?: string; +} + +/** + * @interface + * An interface representing AlertRuleKind1. + * Describes an Azure resource with kind. + * + */ +export interface AlertRuleKind1 { + /** + * @member {AlertRuleKind} [kind] The kind of the alert rule. Possible values + * include: 'Scheduled' + */ + kind?: AlertRuleKind; +} + +/** + * @interface + * An interface representing ScheduledAlertRule. + * Represents scheduled alert rule. + * + */ +export interface ScheduledAlertRule { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "Scheduled"; + /** + * @member {string} [id] Azure resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] Azure resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] Azure resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [etag] Etag of the alert rule. + */ + etag?: string; + /** + * @member {string} displayName The display name for alerts created by this + * alert rule. + */ + displayName: string; + /** + * @member {string} description The description of the alert rule. + */ + description: string; + /** + * @member {AlertSeverity} severity The severity for alerts created by this + * alert rule. Possible values include: 'High', 'Medium', 'Low', + * 'Informational' + */ + severity: AlertSeverity; + /** + * @member {boolean} enabled Determines whether this alert rule is enabled or + * disabled. + */ + enabled: boolean; + /** + * @member {string} query The query that creates alerts for this rule. + */ + query: string; + /** + * @member {string} queryFrequency The frequency (in ISO 8601 duration + * format) for this alert rule to run. + */ + queryFrequency: string; + /** + * @member {string} queryPeriod The period (in ISO 8601 duration format) that + * this alert rule looks at. + */ + queryPeriod: string; + /** + * @member {TriggerOperator} triggerOperator The operation against the + * threshold that triggers alert rule. Possible values include: + * 'GreaterThan', 'LessThan', 'Equal', 'NotEqual' + */ + triggerOperator: TriggerOperator; + /** + * @member {number} triggerThreshold The threshold triggers this alert rule. + */ + triggerThreshold: number; + /** + * @member {boolean} suppressionEnabled Determines whether the suppression + * for this alert rule is enabled or disabled. + */ + suppressionEnabled: boolean; + /** + * @member {string} suppressionDuration The suppression (in ISO 8601 duration + * format) to wait since last time this alert rule been triggered. + */ + suppressionDuration: string; + /** + * @member {string} [lastModifiedUtc] The last time that this alert has been + * modified. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly lastModifiedUtc?: string; +} + +/** + * @interface + * An interface representing Resource. + * An azure resource object + * + * @extends BaseResource + */ +export interface Resource extends BaseResource { + /** + * @member {string} [id] Azure resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] Azure resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] Azure resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; +} + +/** + * @interface + * An interface representing Action. + * Action for alert rule. + * + * @extends Resource + */ +export interface Action extends Resource { + /** + * @member {string} [etag] Etag of the action. + */ + etag?: string; + /** + * @member {string} [triggerUri] The uri for the action to trigger. + */ + triggerUri?: string; +} + +/** + * @interface + * An interface representing UserInfo. + * User information that made some action + * + */ +export interface UserInfo { + /** + * @member {string} [objectId] The object id of the user. + */ + objectId?: string; + /** + * @member {string} [email] The email of the user. + */ + email?: string; + /** + * @member {string} [name] The name of the user. + */ + name?: string; +} + +/** + * @interface + * An interface representing CaseModel. + * Represents a case in Azure Security Insights. + * + * @extends Resource + */ +export interface CaseModel extends Resource { + /** + * @member {string} [etag] Etag of the alert rule. + */ + etag?: string; + /** + * @member {Date} [lastUpdatedTimeUtc] The last time the case was updated + */ + lastUpdatedTimeUtc?: Date; + /** + * @member {Date} [createdTimeUtc] The time the case was created + */ + createdTimeUtc?: Date; + /** + * @member {Date} [endTimeUtc] The end time of the case + */ + endTimeUtc?: Date; + /** + * @member {Date} [startTimeUtc] The start time of the case + */ + startTimeUtc?: Date; + /** + * @member {string[]} [labels] List of labels relevant to this case + */ + labels?: string[]; + /** + * @member {string} [description] The description of the case + */ + description?: string; + /** + * @member {string} title The title of the case + */ + title: string; + /** + * @member {UserInfo} [assignedTo] Describes a user that the case is assigned + * to + */ + assignedTo?: UserInfo; + /** + * @member {CaseSeverity} severity The severity of the case. Possible values + * include: 'Critical', 'High', 'Medium', 'Low', 'Informational' + */ + severity: CaseSeverity; + /** + * @member {CaseStatus} status The status of the case. Possible values + * include: 'Draft', 'Open', 'InProgress', 'Closed' + */ + status: CaseStatus; + /** + * @member {CloseReason} [closeReason] The reason the case was closed. + * Possible values include: 'Resolved', 'Dismissed', 'Other' + */ + closeReason?: CloseReason; +} + +/** + * @interface + * An interface representing Bookmark. + * Represents a bookmark in Azure Security Insights. + * + * @extends Resource + */ +export interface Bookmark extends Resource { + /** + * @member {string} [etag] Etag of the bookmark. + */ + etag?: string; + /** + * @member {string} displayName The display name of the bookmark + */ + displayName: string; + /** + * @member {Date} [lastUpdatedTimeUtc] The last time the bookmark was updated + */ + lastUpdatedTimeUtc?: Date; + /** + * @member {Date} [createdTimeUtc] The time the bookmark was created + */ + createdTimeUtc?: Date; + /** + * @member {UserInfo} [createdBy] Describes a user that created the bookmark + */ + createdBy?: UserInfo; + /** + * @member {UserInfo} [updatedBy] Describes a user that updated the bookmark + */ + updatedBy?: UserInfo; + /** + * @member {string} [notes] The notes of the bookmark + */ + notes?: string; + /** + * @member {string[]} [labels] List of labels relevant to this bookmark + */ + labels?: string[]; + /** + * @member {string} query The query of the bookmark. + */ + query: string; +} + +/** + * Contains the possible cases for DataConnector. + */ +export type DataConnectorUnion = DataConnector | OfficeDataConnector | TIDataConnector | AADDataConnector | ASCDataConnector | MCASDataConnector; + +/** + * @interface + * An interface representing DataConnector. + * Data connector. + * + */ +export interface DataConnector { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "DataConnector"; + /** + * @member {string} [id] Azure resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] Azure resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] Azure resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [etag] Etag of the data connector. + */ + etag?: string; +} + +/** + * @interface + * An interface representing DataConnectorKind1. + * Describes an Azure resource with kind. + * + */ +export interface DataConnectorKind1 { + /** + * @member {DataConnectorKind} [kind] The kind of the data connector. + * Possible values include: 'AzureActiveDirectory', 'AzureSecurityCenter', + * 'MicrosoftCloudAppSecurity', 'ThreatIntelligence', 'Office365' + */ + kind?: DataConnectorKind; +} + +/** + * @interface + * An interface representing DataConnectorTenantId. + * Properties data connector on tenant level. + * + */ +export interface DataConnectorTenantId { + /** + * @member {string} [tenantId] The tenant id to connect to, and get the data + * from. + */ + tenantId?: string; +} + +/** + * @interface + * An interface representing DataConnectorDataTypeCommon. + * Common field for data type in data connectors. + * + */ +export interface DataConnectorDataTypeCommon { + /** + * @member {DataTypeState} [state] Describe whether this data type connection + * is enabled or not. Possible values include: 'Enabled', 'Disabled' + */ + state?: DataTypeState; +} + +/** + * @interface + * An interface representing OfficeDataConnectorDataTypesSharePoint. + * SharePoint data type connection. + * + * @extends DataConnectorDataTypeCommon + */ +export interface OfficeDataConnectorDataTypesSharePoint extends DataConnectorDataTypeCommon { +} + +/** + * @interface + * An interface representing OfficeDataConnectorDataTypesExchange. + * Exchange data type connection. + * + * @extends DataConnectorDataTypeCommon + */ +export interface OfficeDataConnectorDataTypesExchange extends DataConnectorDataTypeCommon { +} + +/** + * @interface + * An interface representing OfficeDataConnectorDataTypes. + * The available data types for office data connector. + * + */ +export interface OfficeDataConnectorDataTypes { + /** + * @member {OfficeDataConnectorDataTypesSharePoint} [sharePoint] SharePoint + * data type connection. + */ + sharePoint?: OfficeDataConnectorDataTypesSharePoint; + /** + * @member {OfficeDataConnectorDataTypesExchange} [exchange] Exchange data + * type connection. + */ + exchange?: OfficeDataConnectorDataTypesExchange; +} + +/** + * @interface + * An interface representing OfficeDataConnector. + * Represents office data connector. + * + */ +export interface OfficeDataConnector { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "Office365"; + /** + * @member {string} [id] Azure resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] Azure resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] Azure resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [etag] Etag of the data connector. + */ + etag?: string; + /** + * @member {string} [tenantId] The tenant id to connect to, and get the data + * from. + */ + tenantId?: string; + /** + * @member {OfficeDataConnectorDataTypes} [dataTypes] The available data + * types for the connector. + */ + dataTypes?: OfficeDataConnectorDataTypes; +} + +/** + * @interface + * An interface representing TIDataConnectorDataTypesIndicators. + * Data type for indicators connection. + * + * @extends DataConnectorDataTypeCommon + */ +export interface TIDataConnectorDataTypesIndicators extends DataConnectorDataTypeCommon { +} + +/** + * @interface + * An interface representing TIDataConnectorDataTypes. + * The available data types for TI (Threat Intelligence) data connector. + * + */ +export interface TIDataConnectorDataTypes { + /** + * @member {TIDataConnectorDataTypesIndicators} [indicators] Data type for + * indicators connection. + */ + indicators?: TIDataConnectorDataTypesIndicators; +} + +/** + * @interface + * An interface representing TIDataConnector. + * Represents threat intelligence data connector. + * + */ +export interface TIDataConnector { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "ThreatIntelligence"; + /** + * @member {string} [id] Azure resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] Azure resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] Azure resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [etag] Etag of the data connector. + */ + etag?: string; + /** + * @member {string} [tenantId] The tenant id to connect to, and get the data + * from. + */ + tenantId?: string; + /** + * @member {TIDataConnectorDataTypes} [dataTypes] The available data types + * for the connector. + */ + dataTypes?: TIDataConnectorDataTypes; +} + +/** + * @interface + * An interface representing AlertsDataTypeOfDataConnectorAlerts. + * Alerts data type connection. + * + * @extends DataConnectorDataTypeCommon + */ +export interface AlertsDataTypeOfDataConnectorAlerts extends DataConnectorDataTypeCommon { +} + +/** + * @interface + * An interface representing AlertsDataTypeOfDataConnector. + * Alerts data type for data connectors. + * + */ +export interface AlertsDataTypeOfDataConnector { + /** + * @member {AlertsDataTypeOfDataConnectorAlerts} [alerts] Alerts data type + * connection. + */ + alerts?: AlertsDataTypeOfDataConnectorAlerts; +} + +/** + * @interface + * An interface representing AADDataConnector. + * Represents AAD (Azure Active Directory) data connector. + * + */ +export interface AADDataConnector { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "AzureActiveDirectory"; + /** + * @member {string} [id] Azure resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] Azure resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] Azure resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [etag] Etag of the data connector. + */ + etag?: string; + /** + * @member {string} [tenantId] The tenant id to connect to, and get the data + * from. + */ + tenantId?: string; + /** + * @member {AlertsDataTypeOfDataConnector} [dataTypes] The available data + * types for the connector. + */ + dataTypes?: AlertsDataTypeOfDataConnector; +} + +/** + * @interface + * An interface representing ASCDataConnector. + * Represents ASC (Azure Security Center) data connector. + * + */ +export interface ASCDataConnector { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "AzureSecurityCenter"; + /** + * @member {string} [id] Azure resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] Azure resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] Azure resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [etag] Etag of the data connector. + */ + etag?: string; + /** + * @member {AlertsDataTypeOfDataConnector} [dataTypes] The available data + * types for the connector. + */ + dataTypes?: AlertsDataTypeOfDataConnector; + /** + * @member {string} [subscriptionId] The subscription id to connect to, and + * get the data from. + */ + subscriptionId?: string; +} + +/** + * @interface + * An interface representing MCASDataConnector. + * Represents MCAS (Microsoft Cloud App Security) data connector. + * + */ +export interface MCASDataConnector { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "MicrosoftCloudAppSecurity"; + /** + * @member {string} [id] Azure resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] Azure resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] Azure resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [etag] Etag of the data connector. + */ + etag?: string; + /** + * @member {string} [tenantId] The tenant id to connect to, and get the data + * from. + */ + tenantId?: string; + /** + * @member {AlertsDataTypeOfDataConnector} [dataTypes] The available data + * types for the connector. + */ + dataTypes?: AlertsDataTypeOfDataConnector; +} + +/** + * @interface + * An interface representing DataConnectorWithAlertsProperties. + * Data connector properties. + * + */ +export interface DataConnectorWithAlertsProperties { + /** + * @member {AlertsDataTypeOfDataConnector} [dataTypes] The available data + * types for the connector. + */ + dataTypes?: AlertsDataTypeOfDataConnector; +} + +/** + * Contains the possible cases for Entity. + */ +export type EntityUnion = Entity | AccountEntity | HostEntity | FileEntity; + +/** + * @interface + * An interface representing Entity. + * Specific entity. + * + */ +export interface Entity { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "Entity"; + /** + * @member {string} [id] Azure resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] Azure resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] Azure resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; +} + +/** + * @interface + * An interface representing EntityKind1. + * Describes an Azure resource with kind. + * + */ +export interface EntityKind1 { + /** + * @member {EntityKind} [kind] The kind of the entity. Possible values + * include: 'Account', 'Host', 'File' + */ + kind?: EntityKind; +} + +/** + * @interface + * An interface representing AccountEntity. + * Represents an account entity. + * + */ +export interface AccountEntity { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "Account"; + /** + * @member {string} [id] Azure resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] Azure resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] Azure resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [accountName] The name of the account. This field should + * hold only the name without any domain added to it, i.e. administrator. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly accountName?: string; + /** + * @member {string} [ntDomain] The NetBIOS domain name as it appears in the + * alert format – domain\username. Examples: NT AUTHORITY. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly ntDomain?: string; + /** + * @member {string} [upnSuffix] The user principal name suffix for the + * account, in some cases it is also the domain name. Examples: contoso.com. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly upnSuffix?: string; + /** + * @member {string} [sid] The account security identifier, e.g. S-1-5-18. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly sid?: string; + /** + * @member {string} [aadTenantId] The Azure Active Directory tenant id. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly aadTenantId?: string; + /** + * @member {string} [aadUserId] The Azure Active Directory user id. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly aadUserId?: string; + /** + * @member {string} [puid] The Azure Active Directory Passport User ID. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly puid?: string; + /** + * @member {boolean} [isDomainJoined] Determines whether this is a domain + * account. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly isDomainJoined?: boolean; + /** + * @member {string} [objectGuid] The objectGUID attribute is a single-value + * attribute that is the unique identifier for the object, assigned by active + * directory. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly objectGuid?: string; +} + +/** + * @interface + * An interface representing HostEntity. + * Represents a host entity. + * + */ +export interface HostEntity { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "Host"; + /** + * @member {string} [id] Azure resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] Azure resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] Azure resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [dnsDomain] The DNS domain that this host belongs to. + * Should contain the compete DNS suffix for the domain + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly dnsDomain?: string; + /** + * @member {string} [ntDomain] The NT domain that this host belongs to. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly ntDomain?: string; + /** + * @member {string} [hostName] The hostname without the domain suffix. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly hostName?: string; + /** + * @member {string} [netBiosName] The host name (pre-windows2000). + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly netBiosName?: string; + /** + * @member {string} [azureID] The azure resource id of the VM. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly azureID?: string; + /** + * @member {string} [omsAgentID] The OMS agent id, if the host has OMS agent + * installed. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly omsAgentID?: string; + /** + * @member {OSFamily} [osFamily] The operating system type. Possible values + * include: 'Linux', 'Windows', 'Android', 'IOS' + */ + osFamily?: OSFamily; + /** + * @member {string} [osVersion] A free text representation of the operating + * system. This field is meant to hold specific versions the are more fine + * grained than OSFamily or future values not supported by OSFamily + * enumeration + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly osVersion?: string; + /** + * @member {boolean} [isDomainJoined] Determines whether this host belongs to + * a domain. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly isDomainJoined?: boolean; +} + +/** + * @interface + * An interface representing FileEntity. + * Represents a file entity. + * + */ +export interface FileEntity { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "File"; + /** + * @member {string} [id] Azure resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] Azure resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] Azure resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [directory] The full path to the file. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly directory?: string; + /** + * @member {string} [fileName] The file name without path (some alerts might + * not include path). + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly fileName?: string; +} + +/** + * @interface + * An interface representing OfficeConsent. + * Consent for Office365 tenant that already made. + * + * @extends Resource + */ +export interface OfficeConsent extends Resource { + /** + * @member {string} [tenantId] The tenantId of the Office365 with the + * consent. + */ + tenantId?: string; + /** + * @member {string} [tenantName] The tenant name of the Office365 with the + * consent. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly tenantName?: string; +} + +/** + * Contains the possible cases for Settings. + */ +export type SettingsUnion = Settings | UebaSettings | ToggleSettings; + +/** + * @interface + * An interface representing Settings. + * The Setting. + * + */ +export interface Settings { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "Settings"; + /** + * @member {string} [id] Azure resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] Azure resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] Azure resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; +} + +/** + * @interface + * An interface representing SettingsKind. + * Describes an Azure resource with kind. + * + */ +export interface SettingsKind { + /** + * @member {SettingKind} [kind] The kind of the setting. Possible values + * include: 'UebaSettings', 'ToggleSettings' + */ + kind?: SettingKind; +} + +/** + * @interface + * An interface representing UebaSettings. + * Represents settings for User and Entity Behavior Analytics enablement. + * + */ +export interface UebaSettings { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "UebaSettings"; + /** + * @member {string} [id] Azure resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] Azure resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] Azure resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {boolean} [isEnabled] Determines whether User and Entity Behavior + * Analytics is enabled for this workspace. + */ + isEnabled?: boolean; + /** + * @member {StatusInMcas} [statusInMcas] Determines whether User and Entity + * Behavior Analytics is enabled from MCAS (Microsoft Cloud App Security). + * Possible values include: 'Enabled', 'Disabled' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly statusInMcas?: StatusInMcas; + /** + * @member {boolean} [atpLicenseStatus] Determines whether the tenant has ATP + * (Advanced Threat Protection) license. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly atpLicenseStatus?: boolean; +} + +/** + * @interface + * An interface representing ToggleSettings. + * Settings with single toggle. + * + */ +export interface ToggleSettings { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "ToggleSettings"; + /** + * @member {string} [id] Azure resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] Azure resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] Azure resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {boolean} [isEnabled] Determines whether the setting is enable or + * disabled. + */ + isEnabled?: boolean; +} + +/** + * @interface + * An interface representing Aggregations. + * The aggregation. + * + */ +export interface Aggregations { + /** + * @member {string} kind Polymorphic Discriminator + */ + kind: "Aggregations"; + /** + * @member {string} [id] Azure resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] Azure resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] Azure resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; +} + +/** + * @interface + * An interface representing AggregationsKind1. + * Describes an Azure resource with kind. + * + */ +export interface AggregationsKind1 { + /** + * @member {AggregationsKind} [kind] The kind of the setting. Possible values + * include: 'CasesAggregation' + */ + kind?: AggregationsKind; +} + +/** + * @interface + * An interface representing SecurityInsightsOptions. + * @extends AzureServiceClientOptions + */ +export interface SecurityInsightsOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + + +/** + * @interface + * An interface representing the OperationsList. + * Lists the operations available in the SecurityInsights RP. + * + * @extends Array + */ +export interface OperationsList extends Array { + /** + * @member {string} [nextLink] URL to fetch the next set of operations. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the AlertRulesList. + * List all the alert rules. + * + * @extends Array + */ +export interface AlertRulesList extends Array { + /** + * @member {string} [nextLink] URL to fetch the next set of alert rules. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the ActionsList. + * List all the actions. + * + * @extends Array + */ +export interface ActionsList extends Array { + /** + * @member {string} [nextLink] URL to fetch the next set of actions. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the CaseList. + * List all the cases. + * + * @extends Array + */ +export interface CaseList extends Array { + /** + * @member {string} [nextLink] URL to fetch the next set of cases. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the BookmarkList. + * List all the bookmarks. + * + * @extends Array + */ +export interface BookmarkList extends Array { + /** + * @member {string} [nextLink] URL to fetch the next set of cases. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the DataConnectorList. + * List all the data connectors. + * + * @extends Array + */ +export interface DataConnectorList extends Array { + /** + * @member {string} [nextLink] URL to fetch the next set of data connectors. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the EntityList. + * List of all the entities. + * + * @extends Array + */ +export interface EntityList extends Array { + /** + * @member {string} [nextLink] URL to fetch the next set of entities. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the OfficeConsentList. + * List of all the office365 consents. + * + * @extends Array + */ +export interface OfficeConsentList extends Array { + /** + * @member {string} [nextLink] URL to fetch the next set of office consents. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * Defines values for AlertRuleKind. + * Possible values include: 'Scheduled' + * @readonly + * @enum {string} + */ +export type AlertRuleKind = 'Scheduled'; + +/** + * Defines values for AlertSeverity. + * Possible values include: 'High', 'Medium', 'Low', 'Informational' + * @readonly + * @enum {string} + */ +export type AlertSeverity = 'High' | 'Medium' | 'Low' | 'Informational'; + +/** + * Defines values for TriggerOperator. + * Possible values include: 'GreaterThan', 'LessThan', 'Equal', 'NotEqual' + * @readonly + * @enum {string} + */ +export type TriggerOperator = 'GreaterThan' | 'LessThan' | 'Equal' | 'NotEqual'; + +/** + * Defines values for CaseSeverity. + * Possible values include: 'Critical', 'High', 'Medium', 'Low', 'Informational' + * @readonly + * @enum {string} + */ +export type CaseSeverity = 'Critical' | 'High' | 'Medium' | 'Low' | 'Informational'; + +/** + * Defines values for CaseStatus. + * Possible values include: 'Draft', 'Open', 'InProgress', 'Closed' + * @readonly + * @enum {string} + */ +export type CaseStatus = 'Draft' | 'Open' | 'InProgress' | 'Closed'; + +/** + * Defines values for CloseReason. + * Possible values include: 'Resolved', 'Dismissed', 'Other' + * @readonly + * @enum {string} + */ +export type CloseReason = 'Resolved' | 'Dismissed' | 'Other'; + +/** + * Defines values for DataConnectorKind. + * Possible values include: 'AzureActiveDirectory', 'AzureSecurityCenter', + * 'MicrosoftCloudAppSecurity', 'ThreatIntelligence', 'Office365' + * @readonly + * @enum {string} + */ +export type DataConnectorKind = 'AzureActiveDirectory' | 'AzureSecurityCenter' | 'MicrosoftCloudAppSecurity' | 'ThreatIntelligence' | 'Office365'; + +/** + * Defines values for DataTypeState. + * Possible values include: 'Enabled', 'Disabled' + * @readonly + * @enum {string} + */ +export type DataTypeState = 'Enabled' | 'Disabled'; + +/** + * Defines values for EntityKind. + * Possible values include: 'Account', 'Host', 'File' + * @readonly + * @enum {string} + */ +export type EntityKind = 'Account' | 'Host' | 'File'; + +/** + * Defines values for OSFamily. + * Possible values include: 'Linux', 'Windows', 'Android', 'IOS' + * @readonly + * @enum {string} + */ +export type OSFamily = 'Linux' | 'Windows' | 'Android' | 'IOS'; + +/** + * Defines values for SettingKind. + * Possible values include: 'UebaSettings', 'ToggleSettings' + * @readonly + * @enum {string} + */ +export type SettingKind = 'UebaSettings' | 'ToggleSettings'; + +/** + * Defines values for StatusInMcas. + * Possible values include: 'Enabled', 'Disabled' + * @readonly + * @enum {string} + */ +export type StatusInMcas = 'Enabled' | 'Disabled'; + +/** + * Defines values for AggregationsKind. + * Possible values include: 'CasesAggregation' + * @readonly + * @enum {string} + */ +export type AggregationsKind = 'CasesAggregation'; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationsList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationsList; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type OperationsListNextResponse = OperationsList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationsList; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type AlertRulesListResponse = AlertRulesList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: AlertRulesList; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type AlertRulesGetResponse = AlertRuleUnion & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: AlertRuleUnion; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type AlertRulesCreateOrUpdateResponse = AlertRuleUnion & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: AlertRuleUnion; + }; +}; + +/** + * Contains response data for the getAction operation. + */ +export type AlertRulesGetActionResponse = Action & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Action; + }; +}; + +/** + * Contains response data for the createOrUpdateAction operation. + */ +export type AlertRulesCreateOrUpdateActionResponse = Action & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Action; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type AlertRulesListNextResponse = AlertRulesList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: AlertRulesList; + }; +}; + +/** + * Contains response data for the listByAlertRule operation. + */ +export type ActionsListByAlertRuleResponse = ActionsList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ActionsList; + }; +}; + +/** + * Contains response data for the listByAlertRuleNext operation. + */ +export type ActionsListByAlertRuleNextResponse = ActionsList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ActionsList; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type CasesListResponse = CaseList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: CaseList; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type CasesGetResponse = CaseModel & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: CaseModel; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type CasesCreateOrUpdateResponse = CaseModel & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: CaseModel; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type CasesListNextResponse = CaseList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: CaseList; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type BookmarksListResponse = BookmarkList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: BookmarkList; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type BookmarksGetResponse = Bookmark & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Bookmark; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type BookmarksCreateOrUpdateResponse = Bookmark & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Bookmark; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type BookmarksListNextResponse = BookmarkList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: BookmarkList; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type DataConnectorsListResponse = DataConnectorList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: DataConnectorList; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type DataConnectorsGetResponse = DataConnectorUnion & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: DataConnectorUnion; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type DataConnectorsCreateOrUpdateResponse = DataConnectorUnion & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: DataConnectorUnion; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type DataConnectorsListNextResponse = DataConnectorList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: DataConnectorList; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type EntitiesListResponse = EntityList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: EntityList; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type EntitiesGetResponse = EntityUnion & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: EntityUnion; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type EntitiesListNextResponse = EntityList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: EntityList; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type OfficeConsentsListResponse = OfficeConsentList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: OfficeConsentList; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type OfficeConsentsGetResponse = OfficeConsent & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: OfficeConsent; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type OfficeConsentsListNextResponse = OfficeConsentList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: OfficeConsentList; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ProductSettingsGetResponse = SettingsUnion & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: SettingsUnion; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type ProductSettingsUpdateResponse = SettingsUnion & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: SettingsUnion; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type CasesAggregationsGetResponse = Aggregations & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Aggregations; + }; +}; diff --git a/packages/@azure/arm-securityinsight/lib/models/mappers.ts b/packages/@azure/arm-securityinsight/lib/models/mappers.ts new file mode 100644 index 000000000000..a0791e77b290 --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/models/mappers.ts @@ -0,0 +1,1535 @@ +/* + * 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. + */ + +import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +export const AlertRule: msRest.CompositeMapper = { + serializedName: "AlertRule", + type: { + name: "Composite", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + uberParent: "AlertRule", + className: "AlertRule", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + etag: { + serializedName: "etag", + type: { + name: "String" + } + }, + kind: { + required: true, + serializedName: "kind", + type: { + name: "String" + } + } + } + } +}; + +export const AlertRuleKind1: msRest.CompositeMapper = { + serializedName: "AlertRuleKind", + type: { + name: "Composite", + className: "AlertRuleKind1", + modelProperties: { + kind: { + serializedName: "kind", + type: { + name: "String" + } + } + } + } +}; + +export const ScheduledAlertRule: msRest.CompositeMapper = { + serializedName: "Scheduled", + type: { + name: "Composite", + polymorphicDiscriminator: AlertRule.type.polymorphicDiscriminator, + uberParent: "AlertRule", + className: "ScheduledAlertRule", + modelProperties: { + ...AlertRule.type.modelProperties, + displayName: { + required: true, + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + description: { + required: true, + serializedName: "properties.description", + type: { + name: "String" + } + }, + severity: { + required: true, + serializedName: "properties.severity", + type: { + name: "Enum", + allowedValues: [ + "High", + "Medium", + "Low", + "Informational" + ] + } + }, + enabled: { + required: true, + serializedName: "properties.enabled", + type: { + name: "Boolean" + } + }, + query: { + required: true, + serializedName: "properties.query", + type: { + name: "String" + } + }, + queryFrequency: { + required: true, + serializedName: "properties.queryFrequency", + type: { + name: "TimeSpan" + } + }, + queryPeriod: { + required: true, + serializedName: "properties.queryPeriod", + type: { + name: "TimeSpan" + } + }, + triggerOperator: { + required: true, + serializedName: "properties.triggerOperator", + type: { + name: "Enum", + allowedValues: [ + "GreaterThan", + "LessThan", + "Equal", + "NotEqual" + ] + } + }, + triggerThreshold: { + required: true, + serializedName: "properties.triggerThreshold", + type: { + name: "Number" + } + }, + suppressionEnabled: { + required: true, + serializedName: "properties.suppressionEnabled", + type: { + name: "Boolean" + } + }, + suppressionDuration: { + required: true, + serializedName: "properties.suppressionDuration", + type: { + name: "TimeSpan" + } + }, + lastModifiedUtc: { + readOnly: true, + serializedName: "properties.lastModifiedUtc", + type: { + name: "String" + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const Action: msRest.CompositeMapper = { + serializedName: "Action", + type: { + name: "Composite", + className: "Action", + modelProperties: { + ...Resource.type.modelProperties, + etag: { + serializedName: "etag", + type: { + name: "String" + } + }, + triggerUri: { + serializedName: "properties.triggerUri", + type: { + name: "String" + } + } + } + } +}; + +export const UserInfo: msRest.CompositeMapper = { + serializedName: "UserInfo", + type: { + name: "Composite", + className: "UserInfo", + modelProperties: { + objectId: { + serializedName: "objectId", + type: { + name: "Uuid" + } + }, + email: { + serializedName: "email", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const CaseModel: msRest.CompositeMapper = { + serializedName: "Case", + type: { + name: "Composite", + className: "CaseModel", + modelProperties: { + ...Resource.type.modelProperties, + etag: { + serializedName: "etag", + type: { + name: "String" + } + }, + lastUpdatedTimeUtc: { + serializedName: "properties.lastUpdatedTimeUtc", + type: { + name: "DateTime" + } + }, + createdTimeUtc: { + serializedName: "properties.createdTimeUtc", + type: { + name: "DateTime" + } + }, + endTimeUtc: { + serializedName: "properties.endTimeUtc", + type: { + name: "DateTime" + } + }, + startTimeUtc: { + serializedName: "properties.startTimeUtc", + type: { + name: "DateTime" + } + }, + labels: { + serializedName: "properties.labels", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + title: { + required: true, + serializedName: "properties.title", + type: { + name: "String" + } + }, + assignedTo: { + serializedName: "properties.assignedTo", + type: { + name: "Composite", + className: "UserInfo" + } + }, + severity: { + required: true, + serializedName: "properties.severity", + type: { + name: "String" + } + }, + status: { + required: true, + serializedName: "properties.status", + type: { + name: "String" + } + }, + closeReason: { + serializedName: "properties.closeReason", + type: { + name: "String" + } + } + } + } +}; + +export const Bookmark: msRest.CompositeMapper = { + serializedName: "Bookmark", + type: { + name: "Composite", + className: "Bookmark", + modelProperties: { + ...Resource.type.modelProperties, + etag: { + serializedName: "etag", + type: { + name: "String" + } + }, + displayName: { + required: true, + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + lastUpdatedTimeUtc: { + serializedName: "properties.lastUpdatedTimeUtc", + type: { + name: "DateTime" + } + }, + createdTimeUtc: { + serializedName: "properties.createdTimeUtc", + type: { + name: "DateTime" + } + }, + createdBy: { + serializedName: "properties.createdBy", + type: { + name: "Composite", + className: "UserInfo" + } + }, + updatedBy: { + serializedName: "properties.updatedBy", + type: { + name: "Composite", + className: "UserInfo" + } + }, + notes: { + serializedName: "properties.notes", + type: { + name: "String" + } + }, + labels: { + serializedName: "properties.labels", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + query: { + required: true, + serializedName: "properties.query", + type: { + name: "String" + } + } + } + } +}; + +export const DataConnector: msRest.CompositeMapper = { + serializedName: "DataConnector", + type: { + name: "Composite", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + uberParent: "DataConnector", + className: "DataConnector", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + etag: { + serializedName: "etag", + type: { + name: "String" + } + }, + kind: { + required: true, + serializedName: "kind", + type: { + name: "String" + } + } + } + } +}; + +export const DataConnectorKind1: msRest.CompositeMapper = { + serializedName: "DataConnectorKind", + type: { + name: "Composite", + className: "DataConnectorKind1", + modelProperties: { + kind: { + serializedName: "kind", + type: { + name: "String" + } + } + } + } +}; + +export const DataConnectorTenantId: msRest.CompositeMapper = { + serializedName: "DataConnectorTenantId", + type: { + name: "Composite", + className: "DataConnectorTenantId", + modelProperties: { + tenantId: { + serializedName: "tenantId", + type: { + name: "String" + } + } + } + } +}; + +export const DataConnectorDataTypeCommon: msRest.CompositeMapper = { + serializedName: "DataConnectorDataTypeCommon", + type: { + name: "Composite", + className: "DataConnectorDataTypeCommon", + modelProperties: { + state: { + serializedName: "state", + type: { + name: "String" + } + } + } + } +}; + +export const OfficeDataConnectorDataTypesSharePoint: msRest.CompositeMapper = { + serializedName: "OfficeDataConnectorDataTypes_sharePoint", + type: { + name: "Composite", + className: "OfficeDataConnectorDataTypesSharePoint", + modelProperties: { + ...DataConnectorDataTypeCommon.type.modelProperties + } + } +}; + +export const OfficeDataConnectorDataTypesExchange: msRest.CompositeMapper = { + serializedName: "OfficeDataConnectorDataTypes_exchange", + type: { + name: "Composite", + className: "OfficeDataConnectorDataTypesExchange", + modelProperties: { + ...DataConnectorDataTypeCommon.type.modelProperties + } + } +}; + +export const OfficeDataConnectorDataTypes: msRest.CompositeMapper = { + serializedName: "OfficeDataConnectorDataTypes", + type: { + name: "Composite", + className: "OfficeDataConnectorDataTypes", + modelProperties: { + sharePoint: { + serializedName: "sharePoint", + type: { + name: "Composite", + className: "OfficeDataConnectorDataTypesSharePoint" + } + }, + exchange: { + serializedName: "exchange", + type: { + name: "Composite", + className: "OfficeDataConnectorDataTypesExchange" + } + } + } + } +}; + +export const OfficeDataConnector: msRest.CompositeMapper = { + serializedName: "Office365", + type: { + name: "Composite", + polymorphicDiscriminator: DataConnector.type.polymorphicDiscriminator, + uberParent: "DataConnector", + className: "OfficeDataConnector", + modelProperties: { + ...DataConnector.type.modelProperties, + tenantId: { + serializedName: "properties.tenantId", + type: { + name: "String" + } + }, + dataTypes: { + serializedName: "properties.dataTypes", + type: { + name: "Composite", + className: "OfficeDataConnectorDataTypes" + } + } + } + } +}; + +export const TIDataConnectorDataTypesIndicators: msRest.CompositeMapper = { + serializedName: "TIDataConnectorDataTypes_indicators", + type: { + name: "Composite", + className: "TIDataConnectorDataTypesIndicators", + modelProperties: { + ...DataConnectorDataTypeCommon.type.modelProperties + } + } +}; + +export const TIDataConnectorDataTypes: msRest.CompositeMapper = { + serializedName: "TIDataConnectorDataTypes", + type: { + name: "Composite", + className: "TIDataConnectorDataTypes", + modelProperties: { + indicators: { + serializedName: "indicators", + type: { + name: "Composite", + className: "TIDataConnectorDataTypesIndicators" + } + } + } + } +}; + +export const TIDataConnector: msRest.CompositeMapper = { + serializedName: "ThreatIntelligence", + type: { + name: "Composite", + polymorphicDiscriminator: DataConnector.type.polymorphicDiscriminator, + uberParent: "DataConnector", + className: "TIDataConnector", + modelProperties: { + ...DataConnector.type.modelProperties, + tenantId: { + serializedName: "properties.tenantId", + type: { + name: "String" + } + }, + dataTypes: { + serializedName: "properties.dataTypes", + type: { + name: "Composite", + className: "TIDataConnectorDataTypes" + } + } + } + } +}; + +export const AlertsDataTypeOfDataConnectorAlerts: msRest.CompositeMapper = { + serializedName: "AlertsDataTypeOfDataConnector_alerts", + type: { + name: "Composite", + className: "AlertsDataTypeOfDataConnectorAlerts", + modelProperties: { + ...DataConnectorDataTypeCommon.type.modelProperties + } + } +}; + +export const AlertsDataTypeOfDataConnector: msRest.CompositeMapper = { + serializedName: "AlertsDataTypeOfDataConnector", + type: { + name: "Composite", + className: "AlertsDataTypeOfDataConnector", + modelProperties: { + alerts: { + serializedName: "alerts", + type: { + name: "Composite", + className: "AlertsDataTypeOfDataConnectorAlerts" + } + } + } + } +}; + +export const AADDataConnector: msRest.CompositeMapper = { + serializedName: "AzureActiveDirectory", + type: { + name: "Composite", + polymorphicDiscriminator: DataConnector.type.polymorphicDiscriminator, + uberParent: "DataConnector", + className: "AADDataConnector", + modelProperties: { + ...DataConnector.type.modelProperties, + tenantId: { + serializedName: "properties.tenantId", + type: { + name: "String" + } + }, + dataTypes: { + serializedName: "properties.dataTypes", + type: { + name: "Composite", + className: "AlertsDataTypeOfDataConnector" + } + } + } + } +}; + +export const ASCDataConnector: msRest.CompositeMapper = { + serializedName: "AzureSecurityCenter", + type: { + name: "Composite", + polymorphicDiscriminator: DataConnector.type.polymorphicDiscriminator, + uberParent: "DataConnector", + className: "ASCDataConnector", + modelProperties: { + ...DataConnector.type.modelProperties, + dataTypes: { + serializedName: "properties.dataTypes", + type: { + name: "Composite", + className: "AlertsDataTypeOfDataConnector" + } + }, + subscriptionId: { + serializedName: "properties.subscriptionId", + type: { + name: "String" + } + } + } + } +}; + +export const MCASDataConnector: msRest.CompositeMapper = { + serializedName: "MicrosoftCloudAppSecurity", + type: { + name: "Composite", + polymorphicDiscriminator: DataConnector.type.polymorphicDiscriminator, + uberParent: "DataConnector", + className: "MCASDataConnector", + modelProperties: { + ...DataConnector.type.modelProperties, + tenantId: { + serializedName: "properties.tenantId", + type: { + name: "String" + } + }, + dataTypes: { + serializedName: "properties.dataTypes", + type: { + name: "Composite", + className: "AlertsDataTypeOfDataConnector" + } + } + } + } +}; + +export const DataConnectorWithAlertsProperties: msRest.CompositeMapper = { + serializedName: "DataConnectorWithAlertsProperties", + type: { + name: "Composite", + className: "DataConnectorWithAlertsProperties", + modelProperties: { + dataTypes: { + serializedName: "dataTypes", + type: { + name: "Composite", + className: "AlertsDataTypeOfDataConnector" + } + } + } + } +}; + +export const Entity: msRest.CompositeMapper = { + serializedName: "Entity", + type: { + name: "Composite", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + uberParent: "Entity", + className: "Entity", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + kind: { + required: true, + serializedName: "kind", + type: { + name: "String" + } + } + } + } +}; + +export const EntityKind1: msRest.CompositeMapper = { + serializedName: "EntityKind", + type: { + name: "Composite", + className: "EntityKind1", + modelProperties: { + kind: { + serializedName: "kind", + type: { + name: "String" + } + } + } + } +}; + +export const AccountEntity: msRest.CompositeMapper = { + serializedName: "Account", + type: { + name: "Composite", + polymorphicDiscriminator: Entity.type.polymorphicDiscriminator, + uberParent: "Entity", + className: "AccountEntity", + modelProperties: { + ...Entity.type.modelProperties, + accountName: { + readOnly: true, + serializedName: "properties.accountName", + type: { + name: "String" + } + }, + ntDomain: { + readOnly: true, + serializedName: "properties.ntDomain", + type: { + name: "String" + } + }, + upnSuffix: { + readOnly: true, + serializedName: "properties.upnSuffix", + type: { + name: "String" + } + }, + sid: { + readOnly: true, + serializedName: "properties.sid", + type: { + name: "String" + } + }, + aadTenantId: { + readOnly: true, + serializedName: "properties.aadTenantId", + type: { + name: "String" + } + }, + aadUserId: { + readOnly: true, + serializedName: "properties.aadUserId", + type: { + name: "String" + } + }, + puid: { + readOnly: true, + serializedName: "properties.puid", + type: { + name: "String" + } + }, + isDomainJoined: { + readOnly: true, + serializedName: "properties.isDomainJoined", + type: { + name: "Boolean" + } + }, + objectGuid: { + readOnly: true, + serializedName: "properties.objectGuid", + type: { + name: "Uuid" + } + } + } + } +}; + +export const HostEntity: msRest.CompositeMapper = { + serializedName: "Host", + type: { + name: "Composite", + polymorphicDiscriminator: Entity.type.polymorphicDiscriminator, + uberParent: "Entity", + className: "HostEntity", + modelProperties: { + ...Entity.type.modelProperties, + dnsDomain: { + readOnly: true, + serializedName: "properties.dnsDomain", + type: { + name: "String" + } + }, + ntDomain: { + readOnly: true, + serializedName: "properties.ntDomain", + type: { + name: "String" + } + }, + hostName: { + readOnly: true, + serializedName: "properties.hostName", + type: { + name: "String" + } + }, + netBiosName: { + readOnly: true, + serializedName: "properties.netBiosName", + type: { + name: "String" + } + }, + azureID: { + readOnly: true, + serializedName: "properties.azureID", + type: { + name: "String" + } + }, + omsAgentID: { + readOnly: true, + serializedName: "properties.omsAgentID", + type: { + name: "String" + } + }, + osFamily: { + serializedName: "properties.osFamily", + type: { + name: "Enum", + allowedValues: [ + "Linux", + "Windows", + "Android", + "IOS" + ] + } + }, + osVersion: { + readOnly: true, + serializedName: "properties.osVersion", + type: { + name: "String" + } + }, + isDomainJoined: { + readOnly: true, + serializedName: "properties.isDomainJoined", + type: { + name: "Boolean" + } + } + } + } +}; + +export const FileEntity: msRest.CompositeMapper = { + serializedName: "File", + type: { + name: "Composite", + polymorphicDiscriminator: Entity.type.polymorphicDiscriminator, + uberParent: "Entity", + className: "FileEntity", + modelProperties: { + ...Entity.type.modelProperties, + directory: { + readOnly: true, + serializedName: "properties.directory", + type: { + name: "String" + } + }, + fileName: { + readOnly: true, + serializedName: "properties.fileName", + type: { + name: "String" + } + } + } + } +}; + +export const OfficeConsent: msRest.CompositeMapper = { + serializedName: "OfficeConsent", + type: { + name: "Composite", + className: "OfficeConsent", + modelProperties: { + ...Resource.type.modelProperties, + tenantId: { + serializedName: "properties.tenantId", + type: { + name: "String" + } + }, + tenantName: { + readOnly: true, + serializedName: "properties.tenantName", + type: { + name: "String" + } + } + } + } +}; + +export const Settings: msRest.CompositeMapper = { + serializedName: "Settings", + type: { + name: "Composite", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + uberParent: "Settings", + className: "Settings", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + kind: { + required: true, + serializedName: "kind", + type: { + name: "String" + } + } + } + } +}; + +export const SettingsKind: msRest.CompositeMapper = { + serializedName: "SettingsKind", + type: { + name: "Composite", + className: "SettingsKind", + modelProperties: { + kind: { + serializedName: "kind", + type: { + name: "String" + } + } + } + } +}; + +export const UebaSettings: msRest.CompositeMapper = { + serializedName: "UebaSettings", + type: { + name: "Composite", + polymorphicDiscriminator: Settings.type.polymorphicDiscriminator, + uberParent: "Settings", + className: "UebaSettings", + modelProperties: { + ...Settings.type.modelProperties, + isEnabled: { + serializedName: "properties.isEnabled", + type: { + name: "Boolean" + } + }, + statusInMcas: { + readOnly: true, + serializedName: "properties.statusInMcas", + type: { + name: "String" + } + }, + atpLicenseStatus: { + readOnly: true, + serializedName: "properties.atpLicenseStatus", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ToggleSettings: msRest.CompositeMapper = { + serializedName: "ToggleSettings", + type: { + name: "Composite", + polymorphicDiscriminator: Settings.type.polymorphicDiscriminator, + uberParent: "Settings", + className: "ToggleSettings", + modelProperties: { + ...Settings.type.modelProperties, + isEnabled: { + serializedName: "properties.isEnabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const Aggregations: msRest.CompositeMapper = { + serializedName: "Aggregations", + type: { + name: "Composite", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind" + }, + uberParent: "Aggregations", + className: "Aggregations", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + kind: { + required: true, + serializedName: "kind", + type: { + name: "String" + } + } + } + } +}; + +export const AggregationsKind1: msRest.CompositeMapper = { + serializedName: "AggregationsKind", + type: { + name: "Composite", + className: "AggregationsKind1", + modelProperties: { + kind: { + serializedName: "kind", + type: { + name: "String" + } + } + } + } +}; + +export const OperationsList: msRest.CompositeMapper = { + serializedName: "operationsList", + type: { + name: "Composite", + className: "OperationsList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + } + } + } +}; + +export const AlertRulesList: msRest.CompositeMapper = { + serializedName: "AlertRulesList", + type: { + name: "Composite", + className: "AlertRulesList", + modelProperties: { + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AlertRule" + } + } + } + } + } + } +}; + +export const ActionsList: msRest.CompositeMapper = { + serializedName: "ActionsList", + type: { + name: "Composite", + className: "ActionsList", + modelProperties: { + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Action" + } + } + } + } + } + } +}; + +export const CaseList: msRest.CompositeMapper = { + serializedName: "CaseList", + type: { + name: "Composite", + className: "CaseList", + modelProperties: { + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CaseModel" + } + } + } + } + } + } +}; + +export const BookmarkList: msRest.CompositeMapper = { + serializedName: "BookmarkList", + type: { + name: "Composite", + className: "BookmarkList", + modelProperties: { + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Bookmark" + } + } + } + } + } + } +}; + +export const DataConnectorList: msRest.CompositeMapper = { + serializedName: "DataConnectorList", + type: { + name: "Composite", + className: "DataConnectorList", + modelProperties: { + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataConnector" + } + } + } + } + } + } +}; + +export const EntityList: msRest.CompositeMapper = { + serializedName: "EntityList", + type: { + name: "Composite", + className: "EntityList", + modelProperties: { + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Entity" + } + } + } + } + } + } +}; + +export const OfficeConsentList: msRest.CompositeMapper = { + serializedName: "OfficeConsentList", + type: { + name: "Composite", + className: "OfficeConsentList", + modelProperties: { + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OfficeConsent" + } + } + } + } + } + } +}; + +export const discriminators = { + 'AlertRule' : AlertRule, + 'AlertRule.Scheduled' : ScheduledAlertRule, + 'DataConnector' : DataConnector, + 'DataConnector.Office365' : OfficeDataConnector, + 'DataConnector.ThreatIntelligence' : TIDataConnector, + 'DataConnector.AzureActiveDirectory' : AADDataConnector, + 'DataConnector.AzureSecurityCenter' : ASCDataConnector, + 'DataConnector.MicrosoftCloudAppSecurity' : MCASDataConnector, + 'Entity' : Entity, + 'Entity.Account' : AccountEntity, + 'Entity.Host' : HostEntity, + 'Entity.File' : FileEntity, + 'Settings' : Settings, + 'Settings.UebaSettings' : UebaSettings, + 'Settings.ToggleSettings' : ToggleSettings, + 'Aggregations' : Aggregations +}; diff --git a/packages/@azure/arm-securityinsight/lib/models/officeConsentsMappers.ts b/packages/@azure/arm-securityinsight/lib/models/officeConsentsMappers.ts new file mode 100644 index 000000000000..bfd244e67c0b --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/models/officeConsentsMappers.ts @@ -0,0 +1,23 @@ +/* + * 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. + */ + +export { + discriminators, + OfficeConsentList, + OfficeConsent, + Resource, + BaseResource, + CloudError, + Action, + CaseModel, + UserInfo, + Bookmark +} from "../models/mappers"; + diff --git a/packages/@azure/arm-securityinsight/lib/models/operationsMappers.ts b/packages/@azure/arm-securityinsight/lib/models/operationsMappers.ts new file mode 100644 index 000000000000..8e5fece22260 --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/models/operationsMappers.ts @@ -0,0 +1,18 @@ +/* + * 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. + */ + +export { + discriminators, + OperationsList, + Operation, + OperationDisplay, + CloudError +} from "../models/mappers"; + diff --git a/packages/@azure/arm-securityinsight/lib/models/parameters.ts b/packages/@azure/arm-securityinsight/lib/models/parameters.ts new file mode 100644 index 000000000000..266de3226e13 --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/models/parameters.ts @@ -0,0 +1,187 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const actionId: msRest.OperationURLParameter = { + parameterPath: "actionId", + mapper: { + required: true, + serializedName: "actionId", + type: { + name: "String" + } + } +}; +export const aggregationsName: msRest.OperationURLParameter = { + parameterPath: "aggregationsName", + mapper: { + required: true, + serializedName: "aggregationsName", + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + isConstant: true, + serializedName: "api-version", + defaultValue: '2019-01-01-preview', + type: { + name: "String" + } + } +}; +export const bookmarkId: msRest.OperationURLParameter = { + parameterPath: "bookmarkId", + mapper: { + required: true, + serializedName: "bookmarkId", + type: { + name: "String" + } + } +}; +export const caseId: msRest.OperationURLParameter = { + parameterPath: "caseId", + mapper: { + required: true, + serializedName: "caseId", + type: { + name: "String" + } + } +}; +export const consentId: msRest.OperationURLParameter = { + parameterPath: "consentId", + mapper: { + required: true, + serializedName: "consentId", + type: { + name: "String" + } + } +}; +export const dataConnectorId: msRest.OperationURLParameter = { + parameterPath: "dataConnectorId", + mapper: { + required: true, + serializedName: "dataConnectorId", + type: { + name: "String" + } + } +}; +export const entityId: msRest.OperationURLParameter = { + parameterPath: "entityId", + mapper: { + required: true, + serializedName: "entityId", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const operationalInsightsResourceProvider: msRest.OperationURLParameter = { + parameterPath: "operationalInsightsResourceProvider", + mapper: { + required: true, + serializedName: "operationalInsightsResourceProvider", + type: { + name: "String" + } + } +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, + type: { + name: "String" + } + } +}; +export const ruleId: msRest.OperationURLParameter = { + parameterPath: "ruleId", + mapper: { + required: true, + serializedName: "ruleId", + type: { + name: "String" + } + } +}; +export const settingsName: msRest.OperationURLParameter = { + parameterPath: "settingsName", + mapper: { + required: true, + serializedName: "settingsName", + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + constraints: { + Pattern: /^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$/ + }, + type: { + name: "String" + } + } +}; +export const workspaceName: msRest.OperationURLParameter = { + parameterPath: "workspaceName", + mapper: { + required: true, + serializedName: "workspaceName", + constraints: { + MaxLength: 90, + MinLength: 1 + }, + type: { + name: "String" + } + } +}; diff --git a/packages/@azure/arm-securityinsight/lib/models/productSettingsMappers.ts b/packages/@azure/arm-securityinsight/lib/models/productSettingsMappers.ts new file mode 100644 index 000000000000..0fd588a310f7 --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/models/productSettingsMappers.ts @@ -0,0 +1,18 @@ +/* + * 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. + */ + +export { + discriminators, + Settings, + CloudError, + UebaSettings, + ToggleSettings +} from "../models/mappers"; + diff --git a/packages/@azure/arm-securityinsight/lib/operations/actions.ts b/packages/@azure/arm-securityinsight/lib/operations/actions.ts new file mode 100644 index 000000000000..679efae09223 --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/operations/actions.ts @@ -0,0 +1,152 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/actionsMappers"; +import * as Parameters from "../models/parameters"; +import { SecurityInsightsContext } from "../securityInsightsContext"; + +/** Class representing a Actions. */ +export class Actions { + private readonly client: SecurityInsightsContext; + + /** + * Create a Actions. + * @param {SecurityInsightsContext} client Reference to the service client. + */ + constructor(client: SecurityInsightsContext) { + this.client = client; + } + + /** + * Gets all actions of alert rule. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param [options] The optional parameters + * @returns Promise + */ + listByAlertRule(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param callback The callback + */ + listByAlertRule(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param options The optional parameters + * @param callback The callback + */ + listByAlertRule(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByAlertRule(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + ruleId, + options + }, + listByAlertRuleOperationSpec, + callback) as Promise; + } + + /** + * Gets all actions of alert rule. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByAlertRuleNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByAlertRuleNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByAlertRuleNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByAlertRuleNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByAlertRuleNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByAlertRuleOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.ruleId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ActionsList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByAlertRuleNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ActionsList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-securityinsight/lib/operations/alertRules.ts b/packages/@azure/arm-securityinsight/lib/operations/alertRules.ts new file mode 100644 index 000000000000..5d97be6be595 --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/operations/alertRules.ts @@ -0,0 +1,626 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/alertRulesMappers"; +import * as Parameters from "../models/parameters"; +import { SecurityInsightsContext } from "../securityInsightsContext"; + +/** Class representing a AlertRules. */ +export class AlertRules { + private readonly client: SecurityInsightsContext; + + /** + * Create a AlertRules. + * @param {SecurityInsightsContext} client Reference to the service client. + */ + constructor(client: SecurityInsightsContext) { + this.client = client; + } + + /** + * Gets all alert rules. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param callback The callback + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets the alert rule. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param callback The callback + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + ruleId, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates the alert rule. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param alertRule The alert rule + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, alertRule: Models.AlertRuleUnion, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param alertRule The alert rule + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, alertRule: Models.AlertRuleUnion, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param alertRule The alert rule + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, alertRule: Models.AlertRuleUnion, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, alertRule: Models.AlertRuleUnion, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + ruleId, + alertRule, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Delete the alert rule. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + ruleId, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Gets the action of alert rule. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param actionId Action ID + * @param [options] The optional parameters + * @returns Promise + */ + getAction(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, actionId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param actionId Action ID + * @param callback The callback + */ + getAction(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, actionId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param actionId Action ID + * @param options The optional parameters + * @param callback The callback + */ + getAction(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, actionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAction(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, actionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + ruleId, + actionId, + options + }, + getActionOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates the action of alert rule. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param actionId Action ID + * @param action The action + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateAction(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, actionId: string, action: Models.Action, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param actionId Action ID + * @param action The action + * @param callback The callback + */ + createOrUpdateAction(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, actionId: string, action: Models.Action, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param actionId Action ID + * @param action The action + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateAction(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, actionId: string, action: Models.Action, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateAction(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, actionId: string, action: Models.Action, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + ruleId, + actionId, + action, + options + }, + createOrUpdateActionOperationSpec, + callback) as Promise; + } + + /** + * Delete the action of alert rule. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param actionId Action ID + * @param [options] The optional parameters + * @returns Promise + */ + deleteAction(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, actionId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param actionId Action ID + * @param callback The callback + */ + deleteAction(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, actionId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param ruleId Alert rule ID + * @param actionId Action ID + * @param options The optional parameters + * @param callback The callback + */ + deleteAction(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, actionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteAction(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, ruleId: string, actionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + ruleId, + actionId, + options + }, + deleteActionOperationSpec, + callback); + } + + /** + * Gets all alert rules. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AlertRulesList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.ruleId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AlertRule + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.ruleId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "alertRule", + mapper: { + ...Mappers.AlertRule, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.AlertRule + }, + 201: { + bodyMapper: Mappers.AlertRule + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.ruleId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getActionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.ruleId, + Parameters.actionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Action + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateActionOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.ruleId, + Parameters.actionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "action", + mapper: { + ...Mappers.Action, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Action + }, + 201: { + bodyMapper: Mappers.Action + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteActionOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.ruleId, + Parameters.actionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AlertRulesList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-securityinsight/lib/operations/bookmarks.ts b/packages/@azure/arm-securityinsight/lib/operations/bookmarks.ts new file mode 100644 index 000000000000..676aaeefc1ad --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/operations/bookmarks.ts @@ -0,0 +1,379 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/bookmarksMappers"; +import * as Parameters from "../models/parameters"; +import { SecurityInsightsContext } from "../securityInsightsContext"; + +/** Class representing a Bookmarks. */ +export class Bookmarks { + private readonly client: SecurityInsightsContext; + + /** + * Create a Bookmarks. + * @param {SecurityInsightsContext} client Reference to the service client. + */ + constructor(client: SecurityInsightsContext) { + this.client = client; + } + + /** + * Gets all bookmarks. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param callback The callback + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets a bookmark. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, bookmarkId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID + * @param callback The callback + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, bookmarkId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, bookmarkId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, bookmarkId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + bookmarkId, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates the bookmark. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID + * @param bookmark The bookmark + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, bookmarkId: string, bookmark: Models.Bookmark, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID + * @param bookmark The bookmark + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, bookmarkId: string, bookmark: Models.Bookmark, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID + * @param bookmark The bookmark + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, bookmarkId: string, bookmark: Models.Bookmark, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, bookmarkId: string, bookmark: Models.Bookmark, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + bookmarkId, + bookmark, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Delete the bookmark. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, bookmarkId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, bookmarkId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param bookmarkId Bookmark ID + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, bookmarkId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, bookmarkId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + bookmarkId, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Gets all bookmarks. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BookmarkList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.bookmarkId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Bookmark + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.bookmarkId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "bookmark", + mapper: { + ...Mappers.Bookmark, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Bookmark + }, + 201: { + bodyMapper: Mappers.Bookmark + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.bookmarkId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BookmarkList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-securityinsight/lib/operations/cases.ts b/packages/@azure/arm-securityinsight/lib/operations/cases.ts new file mode 100644 index 000000000000..205734375e79 --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/operations/cases.ts @@ -0,0 +1,379 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/casesMappers"; +import * as Parameters from "../models/parameters"; +import { SecurityInsightsContext } from "../securityInsightsContext"; + +/** Class representing a Cases. */ +export class Cases { + private readonly client: SecurityInsightsContext; + + /** + * Create a Cases. + * @param {SecurityInsightsContext} client Reference to the service client. + */ + constructor(client: SecurityInsightsContext) { + this.client = client; + } + + /** + * Gets all cases. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param callback The callback + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets a case. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param caseId Case ID + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, caseId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param caseId Case ID + * @param callback The callback + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, caseId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param caseId Case ID + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, caseId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, caseId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + caseId, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates the case. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param caseId Case ID + * @param caseParameter The case + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, caseId: string, caseParameter: Models.CaseModel, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param caseId Case ID + * @param caseParameter The case + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, caseId: string, caseParameter: Models.CaseModel, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param caseId Case ID + * @param caseParameter The case + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, caseId: string, caseParameter: Models.CaseModel, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, caseId: string, caseParameter: Models.CaseModel, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + caseId, + caseParameter, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Delete the case. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param caseId Case ID + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, caseId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param caseId Case ID + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, caseId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param caseId Case ID + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, caseId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, caseId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + caseId, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Gets all cases. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/cases", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CaseList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/cases/{caseId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.caseId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CaseModel + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/cases/{caseId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.caseId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "caseParameter", + mapper: { + ...Mappers.CaseModel, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.CaseModel + }, + 201: { + bodyMapper: Mappers.CaseModel + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/cases/{caseId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.caseId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CaseList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-securityinsight/lib/operations/casesAggregations.ts b/packages/@azure/arm-securityinsight/lib/operations/casesAggregations.ts new file mode 100644 index 000000000000..bba67af490e3 --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/operations/casesAggregations.ts @@ -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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/casesAggregationsMappers"; +import * as Parameters from "../models/parameters"; +import { SecurityInsightsContext } from "../securityInsightsContext"; + +/** Class representing a CasesAggregations. */ +export class CasesAggregations { + private readonly client: SecurityInsightsContext; + + /** + * Create a CasesAggregations. + * @param {SecurityInsightsContext} client Reference to the service client. + */ + constructor(client: SecurityInsightsContext) { + this.client = client; + } + + /** + * Get aggregative result for the given resources under the defined workspace + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param aggregationsName The aggregation name. Supports - Cases + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, aggregationsName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param aggregationsName The aggregation name. Supports - Cases + * @param callback The callback + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, aggregationsName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param aggregationsName The aggregation name. Supports - Cases + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, aggregationsName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, aggregationsName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + aggregationsName, + options + }, + getOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/aggregations/{AggregationsName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.aggregationsName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Aggregations + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-securityinsight/lib/operations/dataConnectors.ts b/packages/@azure/arm-securityinsight/lib/operations/dataConnectors.ts new file mode 100644 index 000000000000..299ded13950d --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/operations/dataConnectors.ts @@ -0,0 +1,379 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/dataConnectorsMappers"; +import * as Parameters from "../models/parameters"; +import { SecurityInsightsContext } from "../securityInsightsContext"; + +/** Class representing a DataConnectors. */ +export class DataConnectors { + private readonly client: SecurityInsightsContext; + + /** + * Create a DataConnectors. + * @param {SecurityInsightsContext} client Reference to the service client. + */ + constructor(client: SecurityInsightsContext) { + this.client = client; + } + + /** + * Gets all data connectors. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param callback The callback + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets a data connector. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, dataConnectorId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID + * @param callback The callback + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, dataConnectorId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, dataConnectorId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, dataConnectorId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + dataConnectorId, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates the data connector. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID + * @param dataConnector The data connector + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, dataConnectorId: string, dataConnector: Models.DataConnectorUnion, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID + * @param dataConnector The data connector + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, dataConnectorId: string, dataConnector: Models.DataConnectorUnion, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID + * @param dataConnector The data connector + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, dataConnectorId: string, dataConnector: Models.DataConnectorUnion, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, dataConnectorId: string, dataConnector: Models.DataConnectorUnion, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + dataConnectorId, + dataConnector, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Delete the data connector. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, dataConnectorId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, dataConnectorId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param dataConnectorId Connector ID + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, dataConnectorId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, dataConnectorId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + dataConnectorId, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Gets all data connectors. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DataConnectorList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.dataConnectorId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DataConnector + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.dataConnectorId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "dataConnector", + mapper: { + ...Mappers.DataConnector, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.DataConnector + }, + 201: { + bodyMapper: Mappers.DataConnector + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.dataConnectorId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DataConnectorList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-securityinsight/lib/operations/entities.ts b/packages/@azure/arm-securityinsight/lib/operations/entities.ts new file mode 100644 index 000000000000..d3d92b05f872 --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/operations/entities.ts @@ -0,0 +1,220 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/entitiesMappers"; +import * as Parameters from "../models/parameters"; +import { SecurityInsightsContext } from "../securityInsightsContext"; + +/** Class representing a Entities. */ +export class Entities { + private readonly client: SecurityInsightsContext; + + /** + * Create a Entities. + * @param {SecurityInsightsContext} client Reference to the service client. + */ + constructor(client: SecurityInsightsContext) { + this.client = client; + } + + /** + * Gets all entities. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param callback The callback + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets an entity. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param entityId entity ID + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, entityId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param entityId entity ID + * @param callback The callback + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, entityId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param entityId entity ID + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, entityId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, entityId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + entityId, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Gets all entities. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.EntityList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.entityId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Entity + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.EntityList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-securityinsight/lib/operations/index.ts b/packages/@azure/arm-securityinsight/lib/operations/index.ts new file mode 100644 index 000000000000..9540ddc0c8d9 --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/operations/index.ts @@ -0,0 +1,20 @@ +/* + * 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. + */ + +export * from "./operations"; +export * from "./alertRules"; +export * from "./actions"; +export * from "./cases"; +export * from "./bookmarks"; +export * from "./dataConnectors"; +export * from "./entities"; +export * from "./officeConsents"; +export * from "./productSettings"; +export * from "./casesAggregations"; diff --git a/packages/@azure/arm-securityinsight/lib/operations/officeConsents.ts b/packages/@azure/arm-securityinsight/lib/operations/officeConsents.ts new file mode 100644 index 000000000000..1f35de73bb4b --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/operations/officeConsents.ts @@ -0,0 +1,292 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/officeConsentsMappers"; +import * as Parameters from "../models/parameters"; +import { SecurityInsightsContext } from "../securityInsightsContext"; + +/** Class representing a OfficeConsents. */ +export class OfficeConsents { + private readonly client: SecurityInsightsContext; + + /** + * Create a OfficeConsents. + * @param {SecurityInsightsContext} client Reference to the service client. + */ + constructor(client: SecurityInsightsContext) { + this.client = client; + } + + /** + * Gets all office365 consents. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param callback The callback + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets an office365 consent. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param consentId consent ID + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, consentId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param consentId consent ID + * @param callback The callback + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, consentId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param consentId consent ID + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, consentId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, consentId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + consentId, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Delete the office365 consent. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param consentId consent ID + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, consentId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param consentId consent ID + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, consentId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param consentId consent ID + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, consentId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, consentId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + consentId, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Gets all office365 consents. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OfficeConsentList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.consentId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OfficeConsent + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.consentId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OfficeConsentList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-securityinsight/lib/operations/operations.ts b/packages/@azure/arm-securityinsight/lib/operations/operations.ts new file mode 100644 index 000000000000..f348fd26d4a7 --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/operations/operations.ts @@ -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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/operationsMappers"; +import * as Parameters from "../models/parameters"; +import { SecurityInsightsContext } from "../securityInsightsContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: SecurityInsightsContext; + + /** + * Create a Operations. + * @param {SecurityInsightsContext} client Reference to the service client. + */ + constructor(client: SecurityInsightsContext) { + this.client = client; + } + + /** + * Lists all operations available Azure Security Insights Resource Provider. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all operations available Azure Security Insights Resource Provider. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.SecurityInsights/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationsList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationsList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-securityinsight/lib/operations/productSettings.ts b/packages/@azure/arm-securityinsight/lib/operations/productSettings.ts new file mode 100644 index 000000000000..8edaaa8b70ca --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/operations/productSettings.ts @@ -0,0 +1,187 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/productSettingsMappers"; +import * as Parameters from "../models/parameters"; +import { SecurityInsightsContext } from "../securityInsightsContext"; + +/** Class representing a ProductSettings. */ +export class ProductSettings { + private readonly client: SecurityInsightsContext; + + /** + * Create a ProductSettings. + * @param {SecurityInsightsContext} client Reference to the service client. + */ + constructor(client: SecurityInsightsContext) { + this.client = client; + } + + /** + * Gets a setting. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports- Fusion, UEBA + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, settingsName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports- Fusion, UEBA + * @param callback The callback + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, settingsName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports- Fusion, UEBA + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, settingsName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, settingsName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + settingsName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Updates the setting. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports- Fusion, UEBA + * @param settings The setting + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, settingsName: string, settings: Models.SettingsUnion, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports- Fusion, UEBA + * @param settings The setting + * @param callback The callback + */ + update(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, settingsName: string, settings: Models.SettingsUnion, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param operationalInsightsResourceProvider The namespace of workspaces resource provider- + * Microsoft.OperationalInsights. + * @param workspaceName The name of the workspace. + * @param settingsName The setting name. Supports- Fusion, UEBA + * @param settings The setting + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, settingsName: string, settings: Models.SettingsUnion, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, operationalInsightsResourceProvider: string, workspaceName: string, settingsName: string, settings: Models.SettingsUnion, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + operationalInsightsResourceProvider, + workspaceName, + settingsName, + settings, + options + }, + updateOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.settingsName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Settings + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.operationalInsightsResourceProvider, + Parameters.workspaceName, + Parameters.settingsName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "settings", + mapper: { + ...Mappers.Settings, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Settings + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-securityinsight/lib/securityInsights.ts b/packages/@azure/arm-securityinsight/lib/securityInsights.ts new file mode 100644 index 000000000000..758b138db66d --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/securityInsights.ts @@ -0,0 +1,60 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { SecurityInsightsContext } from "./securityInsightsContext"; + + +class SecurityInsights extends SecurityInsightsContext { + // Operation groups + operations: operations.Operations; + alertRules: operations.AlertRules; + actions: operations.Actions; + cases: operations.Cases; + bookmarks: operations.Bookmarks; + dataConnectors: operations.DataConnectors; + entities: operations.Entities; + officeConsents: operations.OfficeConsents; + productSettings: operations.ProductSettings; + casesAggregations: operations.CasesAggregations; + + /** + * Initializes a new instance of the SecurityInsights class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Azure subscription ID + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.SecurityInsightsOptions) { + super(credentials, subscriptionId, options); + this.operations = new operations.Operations(this); + this.alertRules = new operations.AlertRules(this); + this.actions = new operations.Actions(this); + this.cases = new operations.Cases(this); + this.bookmarks = new operations.Bookmarks(this); + this.dataConnectors = new operations.DataConnectors(this); + this.entities = new operations.Entities(this); + this.officeConsents = new operations.OfficeConsents(this); + this.productSettings = new operations.ProductSettings(this); + this.casesAggregations = new operations.CasesAggregations(this); + } +} + +// Operation Specifications + +export { + SecurityInsights, + SecurityInsightsContext, + Models as SecurityInsightsModels, + Mappers as SecurityInsightsMappers +}; +export * from "./operations"; diff --git a/packages/@azure/arm-securityinsight/lib/securityInsightsContext.ts b/packages/@azure/arm-securityinsight/lib/securityInsightsContext.ts new file mode 100644 index 000000000000..5a0eccf52271 --- /dev/null +++ b/packages/@azure/arm-securityinsight/lib/securityInsightsContext.ts @@ -0,0 +1,62 @@ +/* + * 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. + */ + +import * as Models from "./models"; +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-securityinsight"; +const packageVersion = "1.0.0"; + +export class SecurityInsightsContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * Initializes a new instance of the SecurityInsights class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Azure subscription ID + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.SecurityInsightsOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(credentials, options); + + this.apiVersion = '2019-01-01-preview'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/packages/@azure/arm-securityinsight/package.json b/packages/@azure/arm-securityinsight/package.json new file mode 100644 index 000000000000..6e3454634a87 --- /dev/null +++ b/packages/@azure/arm-securityinsight/package.json @@ -0,0 +1,56 @@ +{ + "name": "@azure/arm-securityinsight", + "author": "Microsoft Corporation", + "description": "SecurityInsights Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "@azure/ms-rest-azure-js": "^1.2.0", + "@azure/ms-rest-js": "^1.2.0", + "tslib": "^1.9.3" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-securityinsight.js", + "module": "./esm/securityInsights.js", + "types": "./esm/securityInsights.d.ts", + "devDependencies": { + "typescript": "^3.1.1", + "rollup": "^0.66.2", + "rollup-plugin-node-resolve": "^3.4.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.4.9" + }, + "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/arm-securityinsight", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "esm/**/*.js", + "esm/**/*.js.map", + "esm/**/*.d.ts", + "esm/**/*.d.ts.map", + "lib/**/*.ts", + "rollup.config.js", + "tsconfig.json" + ], + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-securityinsight.js.map'\" -o ./dist/arm-securityinsight.min.js ./dist/arm-securityinsight.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false +} diff --git a/packages/@azure/arm-securityinsight/rollup.config.js b/packages/@azure/arm-securityinsight/rollup.config.js new file mode 100644 index 000000000000..0a8f2bec7019 --- /dev/null +++ b/packages/@azure/arm-securityinsight/rollup.config.js @@ -0,0 +1,37 @@ +import rollup from "rollup"; +import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + +/** + * @type {rollup.RollupFileOptions} + */ +const config = { + input: "./esm/securityInsights.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], + output: { + file: "./dist/arm-securityinsight.js", + format: "umd", + name: "Azure.ArmSecurityinsight", + sourcemap: true, + globals: { + "@azure/ms-rest-js": "msRest", + "@azure/ms-rest-azure-js": "msRestAzure" + }, + banner: `/* + * 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. + */` + }, + plugins: [ + nodeResolve({ module: true }), + sourcemaps() + ] +}; + +export default config; diff --git a/packages/@azure/arm-securityinsight/tsconfig.json b/packages/@azure/arm-securityinsight/tsconfig.json new file mode 100644 index 000000000000..51ea90961ce5 --- /dev/null +++ b/packages/@azure/arm-securityinsight/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./lib/**/*.ts"], + "exclude": ["node_modules"] +}