diff --git a/sdk/securityinsight/arm-securityinsight/CHANGELOG.md b/sdk/securityinsight/arm-securityinsight/CHANGELOG.md index 457f3dc6179b..c1f07683db00 100644 --- a/sdk/securityinsight/arm-securityinsight/CHANGELOG.md +++ b/sdk/securityinsight/arm-securityinsight/CHANGELOG.md @@ -1,15 +1,59 @@ # Release History + +## 1.0.0-beta.5 (2022-09-08) + +**Features** -## 1.0.0-beta.5 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added operation group FileImports + - Added Interface AutomationRuleBooleanCondition + - Added Interface AutomationRulePropertyArrayValuesCondition + - Added Interface BooleanConditionProperties + - Added Interface FileImport + - Added Interface FileImportList + - Added Interface FileImportsCreateOptionalParams + - Added Interface FileImportsDeleteOptionalParams + - Added Interface FileImportsGetOptionalParams + - Added Interface FileImportsListNextOptionalParams + - Added Interface FileImportsListOptionalParams + - Added Interface FileMetadata + - Added Interface PropertyArrayConditionProperties + - Added Interface ValidationError + - Added Type Alias AutomationRuleBooleanConditionSupportedOperator + - Added Type Alias AutomationRulePropertyArrayConditionSupportedArrayConditionType + - Added Type Alias AutomationRulePropertyArrayConditionSupportedArrayType + - Added Type Alias DeleteStatus + - Added Type Alias FileFormat + - Added Type Alias FileImportContentType + - Added Type Alias FileImportsCreateResponse + - Added Type Alias FileImportsDeleteResponse + - Added Type Alias FileImportsGetResponse + - Added Type Alias FileImportsListNextResponse + - Added Type Alias FileImportsListResponse + - Added Type Alias FileImportState + - Added Type Alias IngestionMode + - Interface NrtAlertRule has a new optional parameter eventGroupingSettings + - Interface NrtAlertRuleTemplate has a new optional parameter eventGroupingSettings + - Interface QueryBasedAlertRuleTemplateProperties has a new optional parameter eventGroupingSettings + - Class SecurityInsights has a new parameter fileImports + - Added Enum KnownAutomationRuleBooleanConditionSupportedOperator + - Added Enum KnownAutomationRulePropertyArrayConditionSupportedArrayConditionType + - Added Enum KnownAutomationRulePropertyArrayConditionSupportedArrayType + - Added Enum KnownDeleteStatus + - Added Enum KnownFileFormat + - Added Enum KnownFileImportContentType + - Added Enum KnownFileImportState + - Added Enum KnownIngestionMode + - Enum KnownAutomationRulePropertyConditionSupportedProperty has a new value IncidentCustomDetailsKey + - Enum KnownAutomationRulePropertyConditionSupportedProperty has a new value IncidentCustomDetailsValue + - Enum KnownAutomationRulePropertyConditionSupportedProperty has a new value IncidentUpdatedBySource + - Enum KnownConditionType has a new value Boolean + - Enum KnownConditionType has a new value PropertyArray -### Other Changes +**Breaking Changes** + - Parameter logicAppsResourceId of interface ManualTriggerRequestBody is now required + + ## 1.0.0-beta.4 (2022-07-11) **Features** diff --git a/sdk/securityinsight/arm-securityinsight/_meta.json b/sdk/securityinsight/arm-securityinsight/_meta.json index 3a1a3722b6bc..9950b596eff0 100644 --- a/sdk/securityinsight/arm-securityinsight/_meta.json +++ b/sdk/securityinsight/arm-securityinsight/_meta.json @@ -1,8 +1,8 @@ { - "commit": "64496bd64b0376dc4b45e3193a39f7bcdd4b28da", + "commit": "8b038e983041dd7778998860fbb218c4e84e5cc6", "readme": "specification/securityinsights/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\securityinsights\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1.20220707.1 --generate-sample=true", + "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/securityinsights/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.0", - "use": "@autorest/typescript@6.0.0-rc.1.20220707.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", + "use": "@autorest/typescript@6.0.0-rc.1" } \ No newline at end of file diff --git a/sdk/securityinsight/arm-securityinsight/package.json b/sdk/securityinsight/arm-securityinsight/package.json index c2561caed140..9c03843cdd84 100644 --- a/sdk/securityinsight/arm-securityinsight/package.json +++ b/sdk/securityinsight/arm-securityinsight/package.json @@ -8,6 +8,8 @@ "node": ">=12.0.0" }, "dependencies": { + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.5.0", "@azure/core-auth": "^1.3.0", @@ -107,13 +109,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-securityinsight?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/securityinsight/arm-securityinsight/review/arm-securityinsight.api.md b/sdk/securityinsight/arm-securityinsight/review/arm-securityinsight.api.md index 0fc0b87afde0..9e200f2abcc4 100644 --- a/sdk/securityinsight/arm-securityinsight/review/arm-securityinsight.api.md +++ b/sdk/securityinsight/arm-securityinsight/review/arm-securityinsight.api.md @@ -7,6 +7,8 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; // @public export interface AADCheckRequirements extends DataConnectorsCheckRequirements { @@ -458,13 +460,24 @@ export interface AutomationRuleAction { // @public (undocumented) export type AutomationRuleActionUnion = AutomationRuleAction | AutomationRuleModifyPropertiesAction | AutomationRuleRunPlaybookAction; +// @public (undocumented) +export interface AutomationRuleBooleanCondition { + // (undocumented) + innerConditions?: AutomationRuleConditionUnion[]; + // (undocumented) + operator?: AutomationRuleBooleanConditionSupportedOperator; +} + +// @public +export type AutomationRuleBooleanConditionSupportedOperator = string; + // @public export interface AutomationRuleCondition { - conditionType: "PropertyArrayChanged" | "PropertyChanged" | "Property"; + conditionType: "Boolean" | "PropertyArrayChanged" | "PropertyArray" | "PropertyChanged" | "Property"; } // @public (undocumented) -export type AutomationRuleConditionUnion = AutomationRuleCondition | PropertyArrayChangedConditionProperties | PropertyChangedConditionProperties | PropertyConditionProperties; +export type AutomationRuleConditionUnion = AutomationRuleCondition | BooleanConditionProperties | PropertyArrayChangedConditionProperties | PropertyArrayConditionProperties | PropertyChangedConditionProperties | PropertyConditionProperties; // @public export interface AutomationRuleModifyPropertiesAction extends AutomationRuleAction { @@ -487,6 +500,22 @@ export interface AutomationRulePropertyArrayChangedValuesCondition { changeType?: AutomationRulePropertyArrayChangedConditionSupportedChangeType; } +// @public +export type AutomationRulePropertyArrayConditionSupportedArrayConditionType = string; + +// @public +export type AutomationRulePropertyArrayConditionSupportedArrayType = string; + +// @public (undocumented) +export interface AutomationRulePropertyArrayValuesCondition { + // (undocumented) + arrayConditionType?: AutomationRulePropertyArrayConditionSupportedArrayConditionType; + // (undocumented) + arrayType?: AutomationRulePropertyArrayConditionSupportedArrayType; + // (undocumented) + itemConditions?: AutomationRuleConditionUnion[]; +} + // @public export type AutomationRulePropertyChangedConditionSupportedChangedType = string; @@ -824,6 +853,13 @@ export interface BookmarkTimelineItem extends EntityTimelineItem { startTimeUtc?: Date; } +// @public +export interface BooleanConditionProperties extends AutomationRuleCondition { + // (undocumented) + conditionProperties?: AutomationRuleBooleanCondition; + conditionType: "Boolean"; +} + // @public export interface ClientInfo { email?: string; @@ -1175,6 +1211,9 @@ export interface DataTypeDefinitions { // @public export type DataTypeState = string; +// @public +export type DeleteStatus = string; + // @public export type DeliveryAction = "Unknown" | "DeliveredAsSpam" | "Delivered" | "Blocked" | "Replaced"; @@ -1773,6 +1812,9 @@ export interface FileEntityProperties extends EntityCommonProperties { readonly hostEntityId?: string; } +// @public +export type FileFormat = string; + // @public export type FileHashAlgorithm = string; @@ -1792,6 +1834,98 @@ export interface FileHashEntityProperties extends EntityCommonProperties { readonly hashValue?: string; } +// @public +export interface FileImport extends Resource { + contentType?: FileImportContentType; + readonly createdTimeUTC?: Date; + readonly errorFile?: FileMetadata; + readonly errorsPreview?: ValidationError[]; + readonly filesValidUntilTimeUTC?: Date; + importFile?: FileMetadata; + readonly importValidUntilTimeUTC?: Date; + readonly ingestedRecordCount?: number; + ingestionMode?: IngestionMode; + source?: string; + readonly state?: FileImportState; + readonly totalRecordCount?: number; + readonly validRecordCount?: number; +} + +// @public +export type FileImportContentType = string; + +// @public +export interface FileImportList { + readonly nextLink?: string; + value: FileImport[]; +} + +// @public +export interface FileImports { + beginDelete(resourceGroupName: string, workspaceName: string, fileImportId: string, options?: FileImportsDeleteOptionalParams): Promise, FileImportsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, workspaceName: string, fileImportId: string, options?: FileImportsDeleteOptionalParams): Promise; + create(resourceGroupName: string, workspaceName: string, fileImportId: string, fileImport: FileImport, options?: FileImportsCreateOptionalParams): Promise; + get(resourceGroupName: string, workspaceName: string, fileImportId: string, options?: FileImportsGetOptionalParams): Promise; + list(resourceGroupName: string, workspaceName: string, options?: FileImportsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface FileImportsCreateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileImportsCreateResponse = FileImport; + +// @public +export interface FileImportsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type FileImportsDeleteResponse = FileImport; + +// @public +export interface FileImportsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileImportsGetResponse = FileImport; + +// @public +export interface FileImportsListNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + orderby?: string; + skipToken?: string; + top?: number; +} + +// @public +export type FileImportsListNextResponse = FileImportList; + +// @public +export interface FileImportsListOptionalParams extends coreClient.OperationOptions { + filter?: string; + orderby?: string; + skipToken?: string; + top?: number; +} + +// @public +export type FileImportsListResponse = FileImportList; + +// @public +export type FileImportState = string; + +// @public +export interface FileMetadata { + readonly deleteStatus?: DeleteStatus; + readonly fileContentUri?: string; + fileFormat?: FileFormat; + fileName?: string; + fileSize?: number; +} + // @public export interface FusionAlertRule extends AlertRule { alertRuleTemplateName?: string; @@ -2310,6 +2444,9 @@ export type IncidentsRunPlaybookResponse = Record; // @public export type IncidentStatus = string; +// @public +export type IngestionMode = string; + // @public export interface InsightQueryItem extends EntityQueryItem { kind: "Insight"; @@ -2584,6 +2721,12 @@ export enum KnownAttackTactic { ResourceDevelopment = "ResourceDevelopment" } +// @public +export enum KnownAutomationRuleBooleanConditionSupportedOperator { + And = "And", + Or = "Or" +} + // @public export enum KnownAutomationRulePropertyArrayChangedConditionSupportedArrayType { Alerts = "Alerts", @@ -2597,6 +2740,17 @@ export enum KnownAutomationRulePropertyArrayChangedConditionSupportedChangeType Added = "Added" } +// @public +export enum KnownAutomationRulePropertyArrayConditionSupportedArrayConditionType { + AnyItem = "AnyItem" +} + +// @public +export enum KnownAutomationRulePropertyArrayConditionSupportedArrayType { + CustomDetails = "CustomDetails", + CustomDetailValues = "CustomDetailValues" +} + // @public export enum KnownAutomationRulePropertyChangedConditionSupportedChangedType { ChangedFrom = "ChangedFrom", @@ -2647,6 +2801,8 @@ export enum KnownAutomationRulePropertyConditionSupportedProperty { HostNetBiosName = "HostNetBiosName", HostNTDomain = "HostNTDomain", HostOSVersion = "HostOSVersion", + IncidentCustomDetailsKey = "IncidentCustomDetailsKey", + IncidentCustomDetailsValue = "IncidentCustomDetailsValue", IncidentDescription = "IncidentDescription", IncidentLabel = "IncidentLabel", IncidentProviderName = "IncidentProviderName", @@ -2655,6 +2811,7 @@ export enum KnownAutomationRulePropertyConditionSupportedProperty { IncidentStatus = "IncidentStatus", IncidentTactics = "IncidentTactics", IncidentTitle = "IncidentTitle", + IncidentUpdatedBySource = "IncidentUpdatedBySource", IoTDeviceId = "IoTDeviceId", IoTDeviceModel = "IoTDeviceModel", IoTDeviceName = "IoTDeviceName", @@ -2683,7 +2840,9 @@ export enum KnownAutomationRulePropertyConditionSupportedProperty { // @public export enum KnownConditionType { + Boolean = "Boolean", Property = "Property", + PropertyArray = "PropertyArray", PropertyArrayChanged = "PropertyArrayChanged", PropertyChanged = "PropertyChanged" } @@ -2777,6 +2936,13 @@ export enum KnownDataTypeState { Enabled = "Enabled" } +// @public +export enum KnownDeleteStatus { + Deleted = "Deleted", + NotDeleted = "NotDeleted", + Unspecified = "Unspecified" +} + // @public export enum KnownDeploymentFetchStatus { NotFound = "NotFound", @@ -2924,6 +3090,13 @@ export enum KnownEventGroupingAggregationKind { SingleAlert = "SingleAlert" } +// @public +export enum KnownFileFormat { + CSV = "CSV", + Json = "JSON", + Unspecified = "Unspecified" +} + // @public export enum KnownFileHashAlgorithm { MD5 = "MD5", @@ -2933,6 +3106,24 @@ export enum KnownFileHashAlgorithm { Unknown = "Unknown" } +// @public +export enum KnownFileImportContentType { + BasicIndicator = "BasicIndicator", + StixIndicator = "StixIndicator", + Unspecified = "Unspecified" +} + +// @public +export enum KnownFileImportState { + FatalError = "FatalError", + Ingested = "Ingested", + IngestedWithErrors = "IngestedWithErrors", + InProgress = "InProgress", + Invalid = "Invalid", + Unspecified = "Unspecified", + WaitingForUpload = "WaitingForUpload" +} + // @public export enum KnownGetInsightsError { Insight = "Insight" @@ -2975,6 +3166,13 @@ export enum KnownIncidentStatus { New = "New" } +// @public +export enum KnownIngestionMode { + IngestAnyValidRecords = "IngestAnyValidRecords", + IngestOnlyIfAllAreValid = "IngestOnlyIfAllAreValid", + Unspecified = "Unspecified" +} + // @public export enum KnownKillChainIntent { Collection = "Collection", @@ -3354,7 +3552,7 @@ export interface MalwareEntityProperties extends EntityCommonProperties { // @public (undocumented) export interface ManualTriggerRequestBody { // (undocumented) - logicAppsResourceId?: string; + logicAppsResourceId: string; // (undocumented) tenantId?: string; } @@ -3737,6 +3935,7 @@ export interface NrtAlertRule extends AlertRule { displayName?: string; enabled?: boolean; entityMappings?: EntityMapping[]; + eventGroupingSettings?: EventGroupingSettings; incidentConfiguration?: IncidentConfiguration; readonly lastModifiedUtc?: Date; query?: string; @@ -3759,6 +3958,7 @@ export interface NrtAlertRuleTemplate extends AlertRuleTemplate { description?: string; displayName?: string; entityMappings?: EntityMapping[]; + eventGroupingSettings?: EventGroupingSettings; readonly lastUpdatedDateUTC?: Date; query?: string; requiredDataConnectors?: AlertRuleTemplateDataSource[]; @@ -4097,6 +4297,13 @@ export interface PropertyArrayChangedConditionProperties extends AutomationRuleC conditionType: "PropertyArrayChanged"; } +// @public +export interface PropertyArrayConditionProperties extends AutomationRuleCondition { + // (undocumented) + conditionProperties?: AutomationRulePropertyArrayValuesCondition; + conditionType: "PropertyArray"; +} + // @public export interface PropertyChangedConditionProperties extends AutomationRuleCondition { // (undocumented) @@ -4121,6 +4328,7 @@ export interface QueryBasedAlertRuleTemplateProperties { [propertyName: string]: string; }; entityMappings?: EntityMapping[]; + eventGroupingSettings?: EventGroupingSettings; query?: string; severity?: AlertSeverity; version?: string; @@ -4474,6 +4682,8 @@ export class SecurityInsights extends coreClient.ServiceClient { // (undocumented) entityRelations: EntityRelations; // (undocumented) + fileImports: FileImports; + // (undocumented) incidentComments: IncidentComments; // (undocumented) incidentRelations: IncidentRelations; @@ -5253,6 +5463,12 @@ export interface UserInfo { objectId?: string; } +// @public +export interface ValidationError { + readonly errorMessages?: string[]; + recordIndex?: number; +} + // @public export type Version = string; diff --git a/sdk/securityinsight/arm-securityinsight/src/lroImpl.ts b/sdk/securityinsight/arm-securityinsight/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/securityinsight/arm-securityinsight/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/securityinsight/arm-securityinsight/src/models/index.ts b/sdk/securityinsight/arm-securityinsight/src/models/index.ts index 955be7527e0d..656b603fc5e8 100644 --- a/sdk/securityinsight/arm-securityinsight/src/models/index.ts +++ b/sdk/securityinsight/arm-securityinsight/src/models/index.ts @@ -10,7 +10,9 @@ import * as coreClient from "@azure/core-client"; export type AutomationRuleConditionUnion = | AutomationRuleCondition + | BooleanConditionProperties | PropertyArrayChangedConditionProperties + | PropertyArrayConditionProperties | PropertyChangedConditionProperties | PropertyConditionProperties; export type AutomationRuleActionUnion = @@ -242,7 +244,12 @@ export interface AutomationRuleTriggeringLogic { /** Describes an automation rule condition. */ export interface AutomationRuleCondition { /** Polymorphic discriminator, which specifies the different types this object can be */ - conditionType: "PropertyArrayChanged" | "PropertyChanged" | "Property"; + conditionType: + | "Boolean" + | "PropertyArrayChanged" + | "PropertyArray" + | "PropertyChanged" + | "Property"; } /** Describes an automation rule action. */ @@ -271,7 +278,7 @@ export interface AutomationRulesList { export interface ManualTriggerRequestBody { tenantId?: string; - logicAppsResourceId?: string; + logicAppsResourceId: string; } /** List all the bookmarks. */ @@ -725,6 +732,48 @@ export interface EntityQueryTemplateList { value: EntityQueryTemplateUnion[]; } +/** List all the file imports. */ +export interface FileImportList { + /** + * URL to fetch the next set of file imports. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; + /** Array of file imports. */ + value: FileImport[]; +} + +/** Represents a file. */ +export interface FileMetadata { + /** The format of the file */ + fileFormat?: FileFormat; + /** The name of the file. */ + fileName?: string; + /** The size of the file. */ + fileSize?: number; + /** + * A URI with a valid SAS token to allow uploading / downloading the file. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly fileContentUri?: string; + /** + * Indicates whether the file was deleted from the storage account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly deleteStatus?: DeleteStatus; +} + +/** Describes an error encountered in the file during validation. */ +export interface ValidationError { + /** The number of the record that has the error. */ + recordIndex?: number; + /** + * A list of descriptions of the error. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errorMessages?: string[]; +} + /** List all the incidents. */ export interface IncidentList { /** @@ -1428,6 +1477,8 @@ export interface QueryBasedAlertRuleTemplateProperties { entityMappings?: EntityMapping[]; /** The alert details override settings */ alertDetailsOverride?: AlertDetailsOverride; + /** The event grouping settings. */ + eventGroupingSettings?: EventGroupingSettings; } /** Single entity mapping for the alert rule */ @@ -1458,6 +1509,12 @@ export interface AlertDetailsOverride { alertSeverityColumnName?: string; } +/** Event grouping settings property bag. */ +export interface EventGroupingSettings { + /** The event grouping aggregation kinds */ + aggregationKind?: EventGroupingAggregationKind; +} + /** Represents a supported source signal configuration in Fusion detection. */ export interface FusionSourceSettings { /** Determines whether this source signal is enabled or disabled in Fusion detection. */ @@ -1601,10 +1658,9 @@ export interface ScheduledAlertRuleCommonProperties { alertDetailsOverride?: AlertDetailsOverride; } -/** Event grouping settings property bag. */ -export interface EventGroupingSettings { - /** The event grouping aggregation kinds */ - aggregationKind?: EventGroupingAggregationKind; +export interface AutomationRuleBooleanCondition { + operator?: AutomationRuleBooleanConditionSupportedOperator; + innerConditions?: AutomationRuleConditionUnion[]; } export interface IncidentPropertiesAction { @@ -1629,6 +1685,12 @@ export interface AutomationRulePropertyArrayChangedValuesCondition { changeType?: AutomationRulePropertyArrayChangedConditionSupportedChangeType; } +export interface AutomationRulePropertyArrayValuesCondition { + arrayType?: AutomationRulePropertyArrayConditionSupportedArrayType; + arrayConditionType?: AutomationRulePropertyArrayConditionSupportedArrayConditionType; + itemConditions?: AutomationRuleConditionUnion[]; +} + export interface AutomationRulePropertyValuesChangedCondition { propertyName?: AutomationRulePropertyChangedConditionSupportedPropertyType; changeType?: AutomationRulePropertyChangedConditionSupportedChangedType; @@ -2175,6 +2237,63 @@ export interface EntityQueryTemplate extends Resource { kind: EntityQueryTemplateKind; } +/** Represents a file import in Azure Security Insights. */ +export interface FileImport extends Resource { + /** Describes how to ingest the records in the file. */ + ingestionMode?: IngestionMode; + /** The content type of this file. */ + contentType?: FileImportContentType; + /** + * The time the file was imported. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdTimeUTC?: Date; + /** + * Represents the error file (if the import was ingested with errors or failed the validation). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errorFile?: FileMetadata; + /** + * An ordered list of some of the errors that were encountered during validation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errorsPreview?: ValidationError[]; + /** Represents the imported file. */ + importFile?: FileMetadata; + /** + * The number of records that have been successfully ingested. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly ingestedRecordCount?: number; + /** The source for the data in the file. */ + source?: string; + /** + * The state of the file import. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly state?: FileImportState; + /** + * The number of records in the file. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalRecordCount?: number; + /** + * The number of records that have passed validation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly validRecordCount?: number; + /** + * The time the files associated with this import are deleted from the storage account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly filesValidUntilTimeUTC?: Date; + /** + * The time the file import record is soft deleted from the database and history. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly importValidUntilTimeUTC?: Date; +} + /** Consent for Office365 tenant that already made. */ export interface OfficeConsent extends Resource { /** The tenantId of the Office365 with the consent. */ @@ -2195,6 +2314,13 @@ export interface ActionRequestProperties extends ActionPropertiesBase { triggerUri: string; } +/** Describes an automation rule condition that applies a boolean operator (e.g AND, OR) to conditions */ +export interface BooleanConditionProperties extends AutomationRuleCondition { + /** Polymorphic discriminator, which specifies the different types this object can be */ + conditionType: "Boolean"; + conditionProperties?: AutomationRuleBooleanCondition; +} + /** Describes an automation rule condition that evaluates an array property's value change */ export interface PropertyArrayChangedConditionProperties extends AutomationRuleCondition { @@ -2203,6 +2329,14 @@ export interface PropertyArrayChangedConditionProperties conditionProperties?: AutomationRulePropertyArrayChangedValuesCondition; } +/** Describes an automation rule condition that evaluates an array property's value */ +export interface PropertyArrayConditionProperties + extends AutomationRuleCondition { + /** Polymorphic discriminator, which specifies the different types this object can be */ + conditionType: "PropertyArray"; + conditionProperties?: AutomationRulePropertyArrayValuesCondition; +} + /** Describes an automation rule condition that evaluates a property's value change */ export interface PropertyChangedConditionProperties extends AutomationRuleCondition { @@ -4443,6 +4577,8 @@ export interface NrtAlertRuleTemplate extends AlertRuleTemplate { entityMappings?: EntityMapping[]; /** The alert details override settings */ alertDetailsOverride?: AlertDetailsOverride; + /** The event grouping settings. */ + eventGroupingSettings?: EventGroupingSettings; } /** Represents a security alert entity. */ @@ -5864,6 +6000,8 @@ export interface NrtAlertRule extends AlertRule { entityMappings?: EntityMapping[]; /** The alert details override settings */ alertDetailsOverride?: AlertDetailsOverride; + /** The event grouping settings. */ + eventGroupingSettings?: EventGroupingSettings; } /** Represents Expansion entity query. */ @@ -6369,10 +6507,14 @@ export type TriggersWhen = string; export enum KnownConditionType { /** Evaluate an object property value */ Property = "Property", + /** Evaluate an object array property value */ + PropertyArray = "PropertyArray", /** Evaluate an object property changed value */ PropertyChanged = "PropertyChanged", /** Evaluate an object array property changed value */ - PropertyArrayChanged = "PropertyArrayChanged" + PropertyArrayChanged = "PropertyArrayChanged", + /** Apply a boolean operator (e.g AND, OR) to conditions */ + Boolean = "Boolean" } /** @@ -6381,8 +6523,10 @@ export enum KnownConditionType { * this enum contains the known values that the service supports. * ### Known values supported by the service * **Property**: Evaluate an object property value \ + * **PropertyArray**: Evaluate an object array property value \ * **PropertyChanged**: Evaluate an object property changed value \ - * **PropertyArrayChanged**: Evaluate an object array property changed value + * **PropertyArrayChanged**: Evaluate an object array property changed value \ + * **Boolean**: Apply a boolean operator (e.g AND, OR) to conditions */ export type ConditionType = string; @@ -6692,6 +6836,123 @@ export enum KnownEntityQueryTemplateKind { */ export type EntityQueryTemplateKind = string; +/** Known values of {@link IngestionMode} that the service accepts. */ +export enum KnownIngestionMode { + /** No records should be ingested when invalid records are detected. */ + IngestOnlyIfAllAreValid = "IngestOnlyIfAllAreValid", + /** Valid records should still be ingested when invalid records are detected. */ + IngestAnyValidRecords = "IngestAnyValidRecords", + /** Unspecified */ + Unspecified = "Unspecified" +} + +/** + * Defines values for IngestionMode. \ + * {@link KnownIngestionMode} can be used interchangeably with IngestionMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **IngestOnlyIfAllAreValid**: No records should be ingested when invalid records are detected. \ + * **IngestAnyValidRecords**: Valid records should still be ingested when invalid records are detected. \ + * **Unspecified**: Unspecified + */ +export type IngestionMode = string; + +/** Known values of {@link FileImportContentType} that the service accepts. */ +export enum KnownFileImportContentType { + /** File containing records with the core fields of an indicator, plus the observables to construct the STIX pattern. */ + BasicIndicator = "BasicIndicator", + /** File containing STIX indicators. */ + StixIndicator = "StixIndicator", + /** File containing other records. */ + Unspecified = "Unspecified" +} + +/** + * Defines values for FileImportContentType. \ + * {@link KnownFileImportContentType} can be used interchangeably with FileImportContentType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **BasicIndicator**: File containing records with the core fields of an indicator, plus the observables to construct the STIX pattern. \ + * **StixIndicator**: File containing STIX indicators. \ + * **Unspecified**: File containing other records. + */ +export type FileImportContentType = string; + +/** Known values of {@link FileFormat} that the service accepts. */ +export enum KnownFileFormat { + /** A CSV file. */ + CSV = "CSV", + /** A JSON file. */ + Json = "JSON", + /** A file of other format. */ + Unspecified = "Unspecified" +} + +/** + * Defines values for FileFormat. \ + * {@link KnownFileFormat} can be used interchangeably with FileFormat, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CSV**: A CSV file. \ + * **JSON**: A JSON file. \ + * **Unspecified**: A file of other format. + */ +export type FileFormat = string; + +/** Known values of {@link DeleteStatus} that the service accepts. */ +export enum KnownDeleteStatus { + /** The file was deleted. */ + Deleted = "Deleted", + /** The file was not deleted. */ + NotDeleted = "NotDeleted", + /** Unspecified */ + Unspecified = "Unspecified" +} + +/** + * Defines values for DeleteStatus. \ + * {@link KnownDeleteStatus} can be used interchangeably with DeleteStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Deleted**: The file was deleted. \ + * **NotDeleted**: The file was not deleted. \ + * **Unspecified**: Unspecified + */ +export type DeleteStatus = string; + +/** Known values of {@link FileImportState} that the service accepts. */ +export enum KnownFileImportState { + /** A fatal error has occurred while ingesting the file. */ + FatalError = "FatalError", + /** The file has been ingested. */ + Ingested = "Ingested", + /** The file has been ingested with errors. */ + IngestedWithErrors = "IngestedWithErrors", + /** The file ingestion is in progress. */ + InProgress = "InProgress", + /** The file is invalid. */ + Invalid = "Invalid", + /** Waiting for the file to be uploaded. */ + WaitingForUpload = "WaitingForUpload", + /** Unspecified state. */ + Unspecified = "Unspecified" +} + +/** + * Defines values for FileImportState. \ + * {@link KnownFileImportState} can be used interchangeably with FileImportState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **FatalError**: A fatal error has occurred while ingesting the file. \ + * **Ingested**: The file has been ingested. \ + * **IngestedWithErrors**: The file has been ingested with errors. \ + * **InProgress**: The file ingestion is in progress. \ + * **Invalid**: The file is invalid. \ + * **WaitingForUpload**: Waiting for the file to be uploaded. \ + * **Unspecified**: Unspecified state. + */ +export type FileImportState = string; + /** Known values of {@link IncidentClassification} that the service accepts. */ export enum KnownIncidentClassification { /** Incident classification was undetermined */ @@ -7508,6 +7769,24 @@ export enum KnownEntityMappingType { */ export type EntityMappingType = string; +/** Known values of {@link EventGroupingAggregationKind} that the service accepts. */ +export enum KnownEventGroupingAggregationKind { + /** SingleAlert */ + SingleAlert = "SingleAlert", + /** AlertPerResult */ + AlertPerResult = "AlertPerResult" +} + +/** + * Defines values for EventGroupingAggregationKind. \ + * {@link KnownEventGroupingAggregationKind} can be used interchangeably with EventGroupingAggregationKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SingleAlert** \ + * **AlertPerResult** + */ +export type EventGroupingAggregationKind = string; + /** Known values of {@link MicrosoftSecurityProductName} that the service accepts. */ export enum KnownMicrosoftSecurityProductName { /** MicrosoftCloudAppSecurity */ @@ -7580,23 +7859,23 @@ export enum KnownAlertDetail { */ export type AlertDetail = string; -/** Known values of {@link EventGroupingAggregationKind} that the service accepts. */ -export enum KnownEventGroupingAggregationKind { - /** SingleAlert */ - SingleAlert = "SingleAlert", - /** AlertPerResult */ - AlertPerResult = "AlertPerResult" +/** Known values of {@link AutomationRuleBooleanConditionSupportedOperator} that the service accepts. */ +export enum KnownAutomationRuleBooleanConditionSupportedOperator { + /** Evaluates as true if all the item conditions are evaluated as true */ + And = "And", + /** Evaluates as true if at least one of the item conditions are evaluated as true */ + Or = "Or" } /** - * Defines values for EventGroupingAggregationKind. \ - * {@link KnownEventGroupingAggregationKind} can be used interchangeably with EventGroupingAggregationKind, + * Defines values for AutomationRuleBooleanConditionSupportedOperator. \ + * {@link KnownAutomationRuleBooleanConditionSupportedOperator} can be used interchangeably with AutomationRuleBooleanConditionSupportedOperator, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **SingleAlert** \ - * **AlertPerResult** + * **And**: Evaluates as true if all the item conditions are evaluated as true \ + * **Or**: Evaluates as true if at least one of the item conditions are evaluated as true */ -export type EventGroupingAggregationKind = string; +export type AutomationRuleBooleanConditionSupportedOperator = string; /** Known values of {@link AutomationRulePropertyArrayChangedConditionSupportedArrayType} that the service accepts. */ export enum KnownAutomationRulePropertyArrayChangedConditionSupportedArrayType { @@ -7637,6 +7916,39 @@ export enum KnownAutomationRulePropertyArrayChangedConditionSupportedChangeType */ export type AutomationRulePropertyArrayChangedConditionSupportedChangeType = string; +/** Known values of {@link AutomationRulePropertyArrayConditionSupportedArrayType} that the service accepts. */ +export enum KnownAutomationRulePropertyArrayConditionSupportedArrayType { + /** Evaluate the condition on the custom detail keys */ + CustomDetails = "CustomDetails", + /** Evaluate the condition on a custom detail's values */ + CustomDetailValues = "CustomDetailValues" +} + +/** + * Defines values for AutomationRulePropertyArrayConditionSupportedArrayType. \ + * {@link KnownAutomationRulePropertyArrayConditionSupportedArrayType} can be used interchangeably with AutomationRulePropertyArrayConditionSupportedArrayType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CustomDetails**: Evaluate the condition on the custom detail keys \ + * **CustomDetailValues**: Evaluate the condition on a custom detail's values + */ +export type AutomationRulePropertyArrayConditionSupportedArrayType = string; + +/** Known values of {@link AutomationRulePropertyArrayConditionSupportedArrayConditionType} that the service accepts. */ +export enum KnownAutomationRulePropertyArrayConditionSupportedArrayConditionType { + /** Evaluate the condition as true if any item fulfills it */ + AnyItem = "AnyItem" +} + +/** + * Defines values for AutomationRulePropertyArrayConditionSupportedArrayConditionType. \ + * {@link KnownAutomationRulePropertyArrayConditionSupportedArrayConditionType} can be used interchangeably with AutomationRulePropertyArrayConditionSupportedArrayConditionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AnyItem**: Evaluate the condition as true if any item fulfills it + */ +export type AutomationRulePropertyArrayConditionSupportedArrayConditionType = string; + /** Known values of {@link AutomationRulePropertyChangedConditionSupportedPropertyType} that the service accepts. */ export enum KnownAutomationRulePropertyChangedConditionSupportedPropertyType { /** Evaluate the condition on the incident severity */ @@ -7730,6 +8042,12 @@ export enum KnownAutomationRulePropertyConditionSupportedProperty { IncidentLabel = "IncidentLabel", /** The provider name of the incident */ IncidentProviderName = "IncidentProviderName", + /** The update source of the incident */ + IncidentUpdatedBySource = "IncidentUpdatedBySource", + /** The incident custom detail key */ + IncidentCustomDetailsKey = "IncidentCustomDetailsKey", + /** The incident custom detail value */ + IncidentCustomDetailsValue = "IncidentCustomDetailsValue", /** The account Azure Active Directory tenant id */ AccountAadTenantId = "AccountAadTenantId", /** The account Azure Active Directory user id */ @@ -7839,6 +8157,9 @@ export enum KnownAutomationRulePropertyConditionSupportedProperty { * **IncidentTactics**: The tactics of the incident \ * **IncidentLabel**: The labels of the incident \ * **IncidentProviderName**: The provider name of the incident \ + * **IncidentUpdatedBySource**: The update source of the incident \ + * **IncidentCustomDetailsKey**: The incident custom detail key \ + * **IncidentCustomDetailsValue**: The incident custom detail value \ * **AccountAadTenantId**: The account Azure Active Directory tenant id \ * **AccountAadUserId**: The account Azure Active Directory user id \ * **AccountName**: The account name \ @@ -8813,6 +9134,64 @@ export interface EntityQueryTemplatesListNextOptionalParams /** Contains response data for the listNext operation. */ export type EntityQueryTemplatesListNextResponse = EntityQueryTemplateList; +/** Optional parameters. */ +export interface FileImportsListOptionalParams + extends coreClient.OperationOptions { + /** Filters the results, based on a Boolean condition. Optional. */ + filter?: string; + /** Sorts the results. Optional. */ + orderby?: string; + /** Returns only the first n results. Optional. */ + top?: number; + /** Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional. */ + skipToken?: string; +} + +/** Contains response data for the list operation. */ +export type FileImportsListResponse = FileImportList; + +/** Optional parameters. */ +export interface FileImportsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type FileImportsGetResponse = FileImport; + +/** Optional parameters. */ +export interface FileImportsCreateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the create operation. */ +export type FileImportsCreateResponse = FileImport; + +/** Optional parameters. */ +export interface FileImportsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type FileImportsDeleteResponse = FileImport; + +/** Optional parameters. */ +export interface FileImportsListNextOptionalParams + extends coreClient.OperationOptions { + /** Filters the results, based on a Boolean condition. Optional. */ + filter?: string; + /** Sorts the results. Optional. */ + orderby?: string; + /** Returns only the first n results. Optional. */ + top?: number; + /** Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional. */ + skipToken?: string; +} + +/** Contains response data for the listNext operation. */ +export type FileImportsListNextResponse = FileImportList; + /** Optional parameters. */ export interface IncidentCommentsListOptionalParams extends coreClient.OperationOptions { diff --git a/sdk/securityinsight/arm-securityinsight/src/models/mappers.ts b/sdk/securityinsight/arm-securityinsight/src/models/mappers.ts index 6a5a7d831fa4..769cb6447b69 100644 --- a/sdk/securityinsight/arm-securityinsight/src/models/mappers.ts +++ b/sdk/securityinsight/arm-securityinsight/src/models/mappers.ts @@ -405,6 +405,7 @@ export const ManualTriggerRequestBody: coreClient.CompositeMapper = { }, logicAppsResourceId: { serializedName: "logicAppsResourceId", + required: true, type: { name: "String" } @@ -1783,6 +1784,103 @@ export const EntityQueryTemplateList: coreClient.CompositeMapper = { } }; +export const FileImportList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileImportList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FileImport" + } + } + } + } + } + } +}; + +export const FileMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileMetadata", + modelProperties: { + fileFormat: { + serializedName: "fileFormat", + type: { + name: "String" + } + }, + fileName: { + serializedName: "fileName", + type: { + name: "String" + } + }, + fileSize: { + serializedName: "fileSize", + type: { + name: "Number" + } + }, + fileContentUri: { + serializedName: "fileContentUri", + readOnly: true, + type: { + name: "String" + } + }, + deleteStatus: { + serializedName: "deleteStatus", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ValidationError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ValidationError", + modelProperties: { + recordIndex: { + serializedName: "recordIndex", + type: { + name: "Number" + } + }, + errorMessages: { + serializedName: "errorMessages", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + export const IncidentList: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3715,6 +3813,13 @@ export const QueryBasedAlertRuleTemplateProperties: coreClient.CompositeMapper = name: "Composite", className: "AlertDetailsOverride" } + }, + eventGroupingSettings: { + serializedName: "eventGroupingSettings", + type: { + name: "Composite", + className: "EventGroupingSettings" + } } } } @@ -3801,6 +3906,21 @@ export const AlertDetailsOverride: coreClient.CompositeMapper = { } }; +export const EventGroupingSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventGroupingSettings", + modelProperties: { + aggregationKind: { + serializedName: "aggregationKind", + type: { + name: "String" + } + } + } + } +}; + export const FusionSourceSettings: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4253,16 +4373,32 @@ export const ScheduledAlertRuleCommonProperties: coreClient.CompositeMapper = { } }; -export const EventGroupingSettings: coreClient.CompositeMapper = { +export const AutomationRuleBooleanCondition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EventGroupingSettings", + className: "AutomationRuleBooleanCondition", modelProperties: { - aggregationKind: { - serializedName: "aggregationKind", + operator: { + serializedName: "operator", type: { name: "String" } + }, + innerConditions: { + constraints: { + MinItems: 2, + MaxItems: 10 + }, + serializedName: "innerConditions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AutomationRuleCondition" + } + } + } } } } @@ -4347,6 +4483,42 @@ export const AutomationRulePropertyArrayChangedValuesCondition: coreClient.Compo } }; +export const AutomationRulePropertyArrayValuesCondition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutomationRulePropertyArrayValuesCondition", + modelProperties: { + arrayType: { + serializedName: "arrayType", + type: { + name: "String" + } + }, + arrayConditionType: { + serializedName: "arrayConditionType", + type: { + name: "String" + } + }, + itemConditions: { + constraints: { + MaxItems: 10 + }, + serializedName: "itemConditions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AutomationRuleCondition" + } + } + } + } + } + } +}; + export const AutomationRulePropertyValuesChangedCondition: coreClient.CompositeMapper = { type: { name: "Composite", @@ -5949,6 +6121,110 @@ export const EntityQueryTemplate: coreClient.CompositeMapper = { } }; +export const FileImport: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileImport", + modelProperties: { + ...Resource.type.modelProperties, + ingestionMode: { + serializedName: "properties.ingestionMode", + type: { + name: "String" + } + }, + contentType: { + serializedName: "properties.contentType", + type: { + name: "String" + } + }, + createdTimeUTC: { + serializedName: "properties.createdTimeUTC", + readOnly: true, + type: { + name: "DateTime" + } + }, + errorFile: { + serializedName: "properties.errorFile", + type: { + name: "Composite", + className: "FileMetadata" + } + }, + errorsPreview: { + serializedName: "properties.errorsPreview", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ValidationError" + } + } + } + }, + importFile: { + serializedName: "properties.importFile", + type: { + name: "Composite", + className: "FileMetadata" + } + }, + ingestedRecordCount: { + serializedName: "properties.ingestedRecordCount", + readOnly: true, + type: { + name: "Number" + } + }, + source: { + serializedName: "properties.source", + type: { + name: "String" + } + }, + state: { + serializedName: "properties.state", + readOnly: true, + type: { + name: "String" + } + }, + totalRecordCount: { + serializedName: "properties.totalRecordCount", + readOnly: true, + type: { + name: "Number" + } + }, + validRecordCount: { + serializedName: "properties.validRecordCount", + readOnly: true, + type: { + name: "Number" + } + }, + filesValidUntilTimeUTC: { + serializedName: "properties.filesValidUntilTimeUTC", + readOnly: true, + type: { + name: "DateTime" + } + }, + importValidUntilTimeUTC: { + serializedName: "properties.importValidUntilTimeUTC", + readOnly: true, + type: { + name: "DateTime" + } + } + } + } +}; + export const OfficeConsent: coreClient.CompositeMapper = { type: { name: "Composite", @@ -6004,6 +6280,27 @@ export const ActionRequestProperties: coreClient.CompositeMapper = { } }; +export const BooleanConditionProperties: coreClient.CompositeMapper = { + serializedName: "Boolean", + type: { + name: "Composite", + className: "BooleanConditionProperties", + uberParent: "AutomationRuleCondition", + polymorphicDiscriminator: + AutomationRuleCondition.type.polymorphicDiscriminator, + modelProperties: { + ...AutomationRuleCondition.type.modelProperties, + conditionProperties: { + serializedName: "conditionProperties", + type: { + name: "Composite", + className: "AutomationRuleBooleanCondition" + } + } + } + } +}; + export const PropertyArrayChangedConditionProperties: coreClient.CompositeMapper = { serializedName: "PropertyArrayChanged", type: { @@ -6025,6 +6322,27 @@ export const PropertyArrayChangedConditionProperties: coreClient.CompositeMapper } }; +export const PropertyArrayConditionProperties: coreClient.CompositeMapper = { + serializedName: "PropertyArray", + type: { + name: "Composite", + className: "PropertyArrayConditionProperties", + uberParent: "AutomationRuleCondition", + polymorphicDiscriminator: + AutomationRuleCondition.type.polymorphicDiscriminator, + modelProperties: { + ...AutomationRuleCondition.type.modelProperties, + conditionProperties: { + serializedName: "conditionProperties", + type: { + name: "Composite", + className: "AutomationRulePropertyArrayValuesCondition" + } + } + } + } +}; + export const PropertyChangedConditionProperties: coreClient.CompositeMapper = { serializedName: "PropertyChanged", type: { @@ -11483,6 +11801,13 @@ export const NrtAlertRuleTemplate: coreClient.CompositeMapper = { name: "Composite", className: "AlertDetailsOverride" } + }, + eventGroupingSettings: { + serializedName: "properties.eventGroupingSettings", + type: { + name: "Composite", + className: "EventGroupingSettings" + } } } } @@ -14289,6 +14614,13 @@ export const NrtAlertRule: coreClient.CompositeMapper = { name: "Composite", className: "AlertDetailsOverride" } + }, + eventGroupingSettings: { + serializedName: "properties.eventGroupingSettings", + type: { + name: "Composite", + className: "EventGroupingSettings" + } } } } @@ -15627,7 +15959,9 @@ export let discriminators = { "Resource.AlertRuleTemplate": AlertRuleTemplate, "Resource.Entity": Entity, "Resource.EntityQueryTemplate": EntityQueryTemplate, + "AutomationRuleCondition.Boolean": BooleanConditionProperties, "AutomationRuleCondition.PropertyArrayChanged": PropertyArrayChangedConditionProperties, + "AutomationRuleCondition.PropertyArray": PropertyArrayConditionProperties, "AutomationRuleCondition.PropertyChanged": PropertyChangedConditionProperties, "AutomationRuleCondition.Property": PropertyConditionProperties, "AutomationRuleAction.ModifyProperties": AutomationRuleModifyPropertiesAction, diff --git a/sdk/securityinsight/arm-securityinsight/src/models/parameters.ts b/sdk/securityinsight/arm-securityinsight/src/models/parameters.ts index 6cc47755758b..8b833a37c6da 100644 --- a/sdk/securityinsight/arm-securityinsight/src/models/parameters.ts +++ b/sdk/securityinsight/arm-securityinsight/src/models/parameters.ts @@ -25,6 +25,7 @@ import { EntityGetInsightsParameters as EntityGetInsightsParametersMapper, EntityTimelineParameters as EntityTimelineParametersMapper, CustomEntityQuery as CustomEntityQueryMapper, + FileImport as FileImportMapper, IncidentComment as IncidentCommentMapper, MetadataModel as MetadataModelMapper, MetadataPatch as MetadataPatchMapper, @@ -69,7 +70,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-07-01-preview", + defaultValue: "2022-10-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -427,6 +428,22 @@ export const entityQueryTemplateId: OperationURLParameter = { } }; +export const fileImportId: OperationURLParameter = { + parameterPath: "fileImportId", + mapper: { + serializedName: "fileImportId", + required: true, + type: { + name: "String" + } + } +}; + +export const fileImport: OperationParameter = { + parameterPath: "fileImport", + mapper: FileImportMapper +}; + export const incidentCommentId: OperationURLParameter = { parameterPath: "incidentCommentId", mapper: { diff --git a/sdk/securityinsight/arm-securityinsight/src/operations/fileImports.ts b/sdk/securityinsight/arm-securityinsight/src/operations/fileImports.ts new file mode 100644 index 000000000000..85d011403732 --- /dev/null +++ b/sdk/securityinsight/arm-securityinsight/src/operations/fileImports.ts @@ -0,0 +1,410 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { FileImports } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { SecurityInsights } from "../securityInsights"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + FileImport, + FileImportsListNextOptionalParams, + FileImportsListOptionalParams, + FileImportsListResponse, + FileImportsGetOptionalParams, + FileImportsGetResponse, + FileImportsCreateOptionalParams, + FileImportsCreateResponse, + FileImportsDeleteOptionalParams, + FileImportsDeleteResponse, + FileImportsListNextResponse +} from "../models"; + +/// +/** Class containing FileImports operations. */ +export class FileImportsImpl implements FileImports { + private readonly client: SecurityInsights; + + /** + * Initialize a new instance of the class FileImports class. + * @param client Reference to the service client + */ + constructor(client: SecurityInsights) { + this.client = client; + } + + /** + * Gets all file imports. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + workspaceName: string, + options?: FileImportsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, workspaceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, workspaceName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + workspaceName: string, + options?: FileImportsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, workspaceName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + workspaceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + workspaceName: string, + options?: FileImportsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + workspaceName, + options + )) { + yield* page; + } + } + + /** + * Gets all file imports. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + workspaceName: string, + options?: FileImportsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, options }, + listOperationSpec + ); + } + + /** + * Gets a file import. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import ID + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + fileImportId: string, + options?: FileImportsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, fileImportId, options }, + getOperationSpec + ); + } + + /** + * Creates the file import. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import ID + * @param fileImport The file import + * @param options The options parameters. + */ + create( + resourceGroupName: string, + workspaceName: string, + fileImportId: string, + fileImport: FileImport, + options?: FileImportsCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, fileImportId, fileImport, options }, + createOperationSpec + ); + } + + /** + * Delete the file import. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import ID + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + workspaceName: string, + fileImportId: string, + options?: FileImportsDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + FileImportsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, workspaceName, fileImportId, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Delete the file import. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import ID + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + workspaceName: string, + fileImportId: string, + options?: FileImportsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + workspaceName, + fileImportId, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + workspaceName: string, + nextLink: string, + options?: FileImportsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FileImportList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderby, + Parameters.top, + Parameters.skipToken + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FileImport + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.fileImportId + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}", + httpMethod: "PUT", + responses: { + 201: { + bodyMapper: Mappers.FileImport + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.fileImport, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.fileImportId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}", + httpMethod: "DELETE", + responses: { + 200: { + bodyMapper: Mappers.FileImport + }, + 201: { + bodyMapper: Mappers.FileImport + }, + 202: { + bodyMapper: Mappers.FileImport + }, + 204: { + bodyMapper: Mappers.FileImport + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.fileImportId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FileImportList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderby, + Parameters.top, + Parameters.skipToken + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/securityinsight/arm-securityinsight/src/operations/index.ts b/sdk/securityinsight/arm-securityinsight/src/operations/index.ts index 953a63a9a9d9..6f66d834535e 100644 --- a/sdk/securityinsight/arm-securityinsight/src/operations/index.ts +++ b/sdk/securityinsight/arm-securityinsight/src/operations/index.ts @@ -22,6 +22,7 @@ export * from "./entitiesRelations"; export * from "./entityRelations"; export * from "./entityQueries"; export * from "./entityQueryTemplates"; +export * from "./fileImports"; export * from "./incidentComments"; export * from "./incidentRelations"; export * from "./metadata"; diff --git a/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/fileImports.ts b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/fileImports.ts new file mode 100644 index 000000000000..4cd0209b551b --- /dev/null +++ b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/fileImports.ts @@ -0,0 +1,95 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + FileImport, + FileImportsListOptionalParams, + FileImportsGetOptionalParams, + FileImportsGetResponse, + FileImportsCreateOptionalParams, + FileImportsCreateResponse, + FileImportsDeleteOptionalParams, + FileImportsDeleteResponse +} from "../models"; + +/// +/** Interface representing a FileImports. */ +export interface FileImports { + /** + * Gets all file imports. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + workspaceName: string, + options?: FileImportsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a file import. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import ID + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + fileImportId: string, + options?: FileImportsGetOptionalParams + ): Promise; + /** + * Creates the file import. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import ID + * @param fileImport The file import + * @param options The options parameters. + */ + create( + resourceGroupName: string, + workspaceName: string, + fileImportId: string, + fileImport: FileImport, + options?: FileImportsCreateOptionalParams + ): Promise; + /** + * Delete the file import. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import ID + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + workspaceName: string, + fileImportId: string, + options?: FileImportsDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + FileImportsDeleteResponse + > + >; + /** + * Delete the file import. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import ID + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + workspaceName: string, + fileImportId: string, + options?: FileImportsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/index.ts b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/index.ts index 953a63a9a9d9..6f66d834535e 100644 --- a/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/index.ts +++ b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/index.ts @@ -22,6 +22,7 @@ export * from "./entitiesRelations"; export * from "./entityRelations"; export * from "./entityQueries"; export * from "./entityQueryTemplates"; +export * from "./fileImports"; export * from "./incidentComments"; export * from "./incidentRelations"; export * from "./metadata"; diff --git a/sdk/securityinsight/arm-securityinsight/src/securityInsights.ts b/sdk/securityinsight/arm-securityinsight/src/securityInsights.ts index c14ec96746b3..27d89c60314f 100644 --- a/sdk/securityinsight/arm-securityinsight/src/securityInsights.ts +++ b/sdk/securityinsight/arm-securityinsight/src/securityInsights.ts @@ -31,6 +31,7 @@ import { EntityRelationsImpl, EntityQueriesImpl, EntityQueryTemplatesImpl, + FileImportsImpl, IncidentCommentsImpl, IncidentRelationsImpl, MetadataImpl, @@ -66,6 +67,7 @@ import { EntityRelations, EntityQueries, EntityQueryTemplates, + FileImports, IncidentComments, IncidentRelations, Metadata, @@ -138,41 +140,34 @@ export class SecurityInsights extends coreClient.ServiceClient { }; super(optionsWithDefaults); - let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName ); - } - if ( - !options || - !options.pipeline || - options.pipeline.getOrderedPolicies().length == 0 || - !bearerTokenAuthenticationPolicyFound - ) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential: credentials, - scopes: `${optionsWithDefaults.credentialScopes}`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) - ); + if (!bearerTokenAuthenticationPolicyFound) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + scopes: `${optionsWithDefaults.baseUri}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); + } } // Parameter assignments this.subscriptionId = subscriptionId; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-07-01-preview"; + this.apiVersion = options.apiVersion || "2022-10-01-preview"; this.alertRules = new AlertRulesImpl(this); this.actions = new ActionsImpl(this); this.alertRuleTemplates = new AlertRuleTemplatesImpl(this); @@ -189,6 +184,7 @@ export class SecurityInsights extends coreClient.ServiceClient { this.entityRelations = new EntityRelationsImpl(this); this.entityQueries = new EntityQueriesImpl(this); this.entityQueryTemplates = new EntityQueryTemplatesImpl(this); + this.fileImports = new FileImportsImpl(this); this.incidentComments = new IncidentCommentsImpl(this); this.incidentRelations = new IncidentRelationsImpl(this); this.metadata = new MetadataImpl(this); @@ -263,6 +259,7 @@ export class SecurityInsights extends coreClient.ServiceClient { entityRelations: EntityRelations; entityQueries: EntityQueries; entityQueryTemplates: EntityQueryTemplates; + fileImports: FileImports; incidentComments: IncidentComments; incidentRelations: IncidentRelations; metadata: Metadata; diff --git a/sdk/securityinsight/arm-securityinsight/tsconfig.json b/sdk/securityinsight/arm-securityinsight/tsconfig.json index 6c7875caddba..3e6ae96443f3 100644 --- a/sdk/securityinsight/arm-securityinsight/tsconfig.json +++ b/sdk/securityinsight/arm-securityinsight/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-securityinsight": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"