diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 8e099cee31d4..31a8d589d163 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3925,7 +3925,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.1.0-dev.20230227 + typescript: 5.1.0-dev.20230301 dev: false /ecdsa-sig-formatter/1.0.11: @@ -8644,8 +8644,8 @@ packages: hasBin: true dev: false - /typescript/5.1.0-dev.20230227: - resolution: {integrity: sha512-nPxrgb/3C40X3eXsCPUpiVEgQltswKoAh3Zwm7tDIVE4ldDr3flXq63odqyWUuOZFc/+NCFdm80RpTB0nz2M8w==} + /typescript/5.1.0-dev.20230301: + resolution: {integrity: sha512-aJ0PIgQ00zlf9npD2tri7MWDAooMoh3iIn4v0hAMSRCSKqJjTzt7fVopvdtbvWPKripipxeXnX5mhkBZcGrEKQ==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -14353,15 +14353,15 @@ packages: dev: false file:projects/arm-securityinsight.tgz: - resolution: {integrity: sha512-QLgaNYlU1jCQOkeNUJC6ElUwlSfM5RGb5NqlbnlKMRKXmqmcKW1F+GvE4MT6E2RrR6F4oEjDhuPKsoi58EQm5g==, tarball: file:projects/arm-securityinsight.tgz} + resolution: {integrity: sha512-rQhiJTl5w7atrsTjMkE5GK/EBbcqmME0Xm0L/O4/lWl+hE/vXIBfggL/PRiqkQepoPUlutqxXAAcWdNu0FSijw==, tarball: file:projects/arm-securityinsight.tgz} name: '@rush-temp/arm-securityinsight' version: 0.0.0 dependencies: '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.34.4_@types+node@14.18.36 - '@rollup/plugin-commonjs': 24.0.1_rollup@2.79.1 - '@rollup/plugin-json': 6.0.0_rollup@2.79.1 - '@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 + '@rollup/plugin-json': 4.1.0_rollup@2.79.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 '@types/node': 14.18.36 @@ -19076,7 +19076,7 @@ packages: dev: false file:projects/storage-file-datalake.tgz: - resolution: {integrity: sha512-xuXx7xw2PY3EfFu3Y2ZhtncwocIC2pYEbZudC76SeEw2+SFX58NBKRvspIr6XKH0CYFLtIeflkeCwmjc1WsCdw==, tarball: file:projects/storage-file-datalake.tgz} + resolution: {integrity: sha512-H+1+hOCQ8fol8EJZj522Y1j1k5pE72nNkgDzgnP+gUOIh0KlNsHDjHCh2+keKPNZcq6fU1joESBcwUbHoZ7QKw==, tarball: file:projects/storage-file-datalake.tgz} name: '@rush-temp/storage-file-datalake' version: 0.0.0 dependencies: diff --git a/sdk/securityinsight/arm-securityinsight/CHANGELOG.md b/sdk/securityinsight/arm-securityinsight/CHANGELOG.md index 7e10d8fce8ba..9e714ace6f87 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.7 (2023-03-01) + +**Features** -## 1.0.0-beta.7 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group WorkspaceManagerAssignmentJobs + - Added operation group WorkspaceManagerAssignments + - Added Interface AlertPropertyMapping + - Added Interface AssignmentItem + - Added Interface AzureEntityResource + - Added Interface ErrorAdditionalInfo + - Added Interface ErrorDetail + - Added Interface ErrorModel + - Added Interface ErrorResponse + - Added Interface Job + - Added Interface JobItem + - Added Interface JobList + - Added Interface SentinelEntityMapping + - Added Interface WorkspaceManagerAssignment + - Added Interface WorkspaceManagerAssignmentJobsCreateOptionalParams + - Added Interface WorkspaceManagerAssignmentJobsDeleteOptionalParams + - Added Interface WorkspaceManagerAssignmentJobsGetOptionalParams + - Added Interface WorkspaceManagerAssignmentJobsListNextOptionalParams + - Added Interface WorkspaceManagerAssignmentJobsListOptionalParams + - Added Interface WorkspaceManagerAssignmentList + - Added Interface WorkspaceManagerAssignmentsCreateOrUpdateOptionalParams + - Added Interface WorkspaceManagerAssignmentsDeleteOptionalParams + - Added Interface WorkspaceManagerAssignmentsGetOptionalParams + - Added Interface WorkspaceManagerAssignmentsListNextOptionalParams + - Added Interface WorkspaceManagerAssignmentsListOptionalParams + - Added Type Alias AlertProperty + - Added Type Alias ProvisioningState + - Added Type Alias Status + - Added Type Alias WorkspaceManagerAssignmentJobsCreateResponse + - Added Type Alias WorkspaceManagerAssignmentJobsGetResponse + - Added Type Alias WorkspaceManagerAssignmentJobsListNextResponse + - Added Type Alias WorkspaceManagerAssignmentJobsListResponse + - Added Type Alias WorkspaceManagerAssignmentsCreateOrUpdateResponse + - Added Type Alias WorkspaceManagerAssignmentsGetResponse + - Added Type Alias WorkspaceManagerAssignmentsListNextResponse + - Added Type Alias WorkspaceManagerAssignmentsListResponse + - Interface AlertDetailsOverride has a new optional parameter alertDynamicProperties + - Interface NrtAlertRule has a new optional parameter sentinelEntitiesMappings + - Interface NrtAlertRuleTemplate has a new optional parameter sentinelEntitiesMappings + - Interface QueryBasedAlertRuleTemplateProperties has a new optional parameter sentinelEntitiesMappings + - Interface ScheduledAlertRule has a new optional parameter sentinelEntitiesMappings + - Interface ScheduledAlertRuleCommonProperties has a new optional parameter sentinelEntitiesMappings + - Interface ScheduledAlertRuleTemplate has a new optional parameter sentinelEntitiesMappings + - Interface SecurityAlertTimelineItem has a new optional parameter intent + - Interface SecurityAlertTimelineItem has a new optional parameter techniques + - Added Enum KnownAlertProperty + - Added Enum KnownProvisioningState + - Added Enum KnownStatus + + ## 1.0.0-beta.6 (2023-02-03) **Features** diff --git a/sdk/securityinsight/arm-securityinsight/_meta.json b/sdk/securityinsight/arm-securityinsight/_meta.json index 46308dd072f2..9cab08c8e56d 100644 --- a/sdk/securityinsight/arm-securityinsight/_meta.json +++ b/sdk/securityinsight/arm-securityinsight/_meta.json @@ -1,8 +1,8 @@ { - "commit": "b41f929626289b59e31be8a1091c99994864b096", - "readme": "specification\\securityinsights\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\securityinsights\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.7 --generate-sample=true", + "commit": "699ac3480d9ecf099c88c01f2319a000b8b4c51f", + "readme": "specification/securityinsights/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.3 --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.5", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.0", - "use": "@autorest/typescript@6.0.0-rc.7" + "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", + "use": "@autorest/typescript@6.0.0-rc.5" } \ No newline at end of file diff --git a/sdk/securityinsight/arm-securityinsight/package.json b/sdk/securityinsight/arm-securityinsight/package.json index 2a397ac0f528..a10e50f899b9 100644 --- a/sdk/securityinsight/arm-securityinsight/package.json +++ b/sdk/securityinsight/arm-securityinsight/package.json @@ -29,9 +29,9 @@ "types": "./types/arm-securityinsight.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.31.1", - "@rollup/plugin-commonjs": "^24.0.0", - "@rollup/plugin-json": "^6.0.0", - "@rollup/plugin-multi-entry": "^6.0.0", + "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-multi-entry": "^4.1.0", "@rollup/plugin-node-resolve": "^13.1.3", "mkdirp": "^1.0.4", "rollup": "^2.66.1", @@ -39,7 +39,6 @@ "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", - "dotenv": "^8.2.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^2.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -50,6 +49,7 @@ "@types/node": "^14.0.0", "@azure/dev-tool": "^1.0.0" }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/securityinsight/arm-securityinsight", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -110,14 +110,5 @@ } ] }, - "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/securityinsight/arm-securityinsight", - "//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 96c4b0c5595f..b0dce01cd75b 100644 --- a/sdk/securityinsight/arm-securityinsight/review/arm-securityinsight.api.md +++ b/sdk/securityinsight/arm-securityinsight/review/arm-securityinsight.api.md @@ -246,10 +246,20 @@ export type AlertDetail = string; export interface AlertDetailsOverride { alertDescriptionFormat?: string; alertDisplayNameFormat?: string; + alertDynamicProperties?: AlertPropertyMapping[]; alertSeverityColumnName?: string; alertTacticsColumnName?: string; } +// @public +export type AlertProperty = string; + +// @public +export interface AlertPropertyMapping { + alertProperty?: AlertProperty; + value?: string; +} + // @public export interface AlertRule extends ResourceWithEtag { kind: AlertRuleKind; @@ -444,6 +454,11 @@ export interface ASCDataConnectorProperties extends DataConnectorWithAlertsPrope subscriptionId?: string; } +// @public +export interface AssignmentItem { + resourceId?: string; +} + // @public export type AttackTactic = string; @@ -684,6 +699,11 @@ export interface AzureDevOpsResourceInfo { serviceConnectionId?: string; } +// @public +export interface AzureEntityResource extends Resource { + readonly etag?: string; +} + // @public export interface AzureResourceEntity extends Entity { readonly additionalData?: { @@ -1759,6 +1779,32 @@ export type EntityUnion = Entity | SecurityAlert | HuntingBookmark | AccountEnti // @public export type Enum13 = string; +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorModel { + errorMessage: string; + memberResourceName: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + // @public export type EventGroupingAggregationKind = string; @@ -2654,6 +2700,29 @@ export interface IPGeodataGetOptionalParams extends coreClient.OperationOptions // @public export type IPGeodataGetResponse = EnrichmentIpGeodata; +// @public +export interface Job extends ResourceWithEtag { + readonly endTime?: Date; + errorMessage?: string; + items?: JobItem[]; + provisioningState?: ProvisioningState; + startTime?: Date; +} + +// @public +export interface JobItem { + errors?: ErrorModel[]; + executionTime?: Date; + resourceId?: string; + status?: Status; +} + +// @public +export interface JobList { + readonly nextLink?: string; + value: Job[]; +} + // @public export type KillChainIntent = string; @@ -2672,6 +2741,19 @@ export enum KnownAlertDetail { Severity = "Severity" } +// @public +export enum KnownAlertProperty { + AlertLink = "AlertLink", + ConfidenceLevel = "ConfidenceLevel", + ConfidenceScore = "ConfidenceScore", + ExtendedLinks = "ExtendedLinks", + ProductComponentName = "ProductComponentName", + ProductName = "ProductName", + ProviderName = "ProviderName", + RemediationSteps = "RemediationSteps", + Techniques = "Techniques" +} + // @public export enum KnownAlertRuleKind { Fusion = "Fusion", @@ -3282,6 +3364,14 @@ export enum KnownProviderName { MicrosoftOperationalInsightsWorkspacesSharedKeys = "Microsoft.OperationalInsights/workspaces/sharedKeys" } +// @public +export enum KnownProvisioningState { + Canceled = "Canceled", + Failed = "Failed", + InProgress = "InProgress", + Succeeded = "Succeeded" +} + // @public export enum KnownRegistryHive { HkeyA = "HKEY_A", @@ -3354,6 +3444,13 @@ export enum KnownSourceType { RemoteStorage = "Remote storage" } +// @public +export enum KnownStatus { + Failed = "Failed", + InProgress = "InProgress", + Succeeded = "Succeeded" +} + // @public export enum KnownSupportTier { Community = "Community", @@ -3956,6 +4053,7 @@ export interface NrtAlertRule extends AlertRule { kind: "NRT"; readonly lastModifiedUtc?: Date; query?: string; + sentinelEntitiesMappings?: SentinelEntityMapping[]; severity?: AlertSeverity; suppressionDuration?: string; suppressionEnabled?: boolean; @@ -3980,6 +4078,7 @@ export interface NrtAlertRuleTemplate extends AlertRuleTemplate { readonly lastUpdatedDateUTC?: Date; query?: string; requiredDataConnectors?: AlertRuleTemplateDataSource[]; + sentinelEntitiesMappings?: SentinelEntityMapping[]; severity?: AlertSeverity; status?: TemplateStatus; tactics?: AttackTactic[]; @@ -4345,6 +4444,9 @@ export interface PropertyConditionProperties extends AutomationRuleCondition { // @public export type ProviderName = string; +// @public +export type ProvisioningState = string; + // @public export interface QueryBasedAlertRuleTemplateProperties { alertDetailsOverride?: AlertDetailsOverride; @@ -4354,6 +4456,7 @@ export interface QueryBasedAlertRuleTemplateProperties { entityMappings?: EntityMapping[]; eventGroupingSettings?: EventGroupingSettings; query?: string; + sentinelEntitiesMappings?: SentinelEntityMapping[]; severity?: AlertSeverity; version?: string; } @@ -4502,6 +4605,7 @@ export interface ScheduledAlertRule extends AlertRule { query?: string; queryFrequency?: string; queryPeriod?: string; + sentinelEntitiesMappings?: SentinelEntityMapping[]; severity?: AlertSeverity; suppressionDuration?: string; suppressionEnabled?: boolean; @@ -4523,6 +4627,7 @@ export interface ScheduledAlertRuleCommonProperties { query?: string; queryFrequency?: string; queryPeriod?: string; + sentinelEntitiesMappings?: SentinelEntityMapping[]; severity?: AlertSeverity; triggerOperator?: TriggerOperator; triggerThreshold?: number; @@ -4561,6 +4666,7 @@ export interface ScheduledAlertRuleTemplate extends AlertRuleTemplate { queryFrequency?: string; queryPeriod?: string; requiredDataConnectors?: AlertRuleTemplateDataSource[]; + sentinelEntitiesMappings?: SentinelEntityMapping[]; severity?: AlertSeverity; status?: TemplateStatus; tactics?: AttackTactic[]; @@ -4646,10 +4752,12 @@ export interface SecurityAlertTimelineItem extends EntityTimelineItem { description?: string; displayName: string; endTimeUtc: Date; + readonly intent?: KillChainIntent; kind: "SecurityAlert"; productName?: string; severity: AlertSeverity; startTimeUtc: Date; + techniques?: string[]; timeGenerated: Date; } @@ -4749,6 +4857,10 @@ export class SecurityInsights extends coreClient.ServiceClient { watchlistItems: WatchlistItems; // (undocumented) watchlists: Watchlists; + // (undocumented) + workspaceManagerAssignmentJobs: WorkspaceManagerAssignmentJobs; + // (undocumented) + workspaceManagerAssignments: WorkspaceManagerAssignments; } // @public @@ -4821,6 +4933,11 @@ export type SecurityMLAnalyticsSettingsListResponse = SecurityMLAnalyticsSetting // @public (undocumented) export type SecurityMLAnalyticsSettingUnion = SecurityMLAnalyticsSetting | AnomalySecurityMLAnalyticsSettings; +// @public +export interface SentinelEntityMapping { + columnName?: string; +} + // @public export interface SentinelOnboardingState extends ResourceWithEtag { customerManagedKey?: boolean; @@ -4971,6 +5088,9 @@ export type SourceKind = string; // @public export type SourceType = string; +// @public +export type Status = string; + // @public export interface SubmissionMailEntity extends Entity { readonly additionalData?: { @@ -5664,6 +5784,106 @@ export interface Webhook { webhookUrl?: string; } +// @public +export interface WorkspaceManagerAssignment extends AzureEntityResource { + items?: AssignmentItem[]; + readonly lastJobEndTime?: Date; + readonly lastJobProvisioningState?: ProvisioningState; + targetResourceName?: string; +} + +// @public +export interface WorkspaceManagerAssignmentJobs { + create(resourceGroupName: string, workspaceName: string, workspaceManagerAssignmentName: string, options?: WorkspaceManagerAssignmentJobsCreateOptionalParams): Promise; + delete(resourceGroupName: string, workspaceName: string, workspaceManagerAssignmentName: string, jobName: string, options?: WorkspaceManagerAssignmentJobsDeleteOptionalParams): Promise; + get(resourceGroupName: string, workspaceName: string, workspaceManagerAssignmentName: string, jobName: string, options?: WorkspaceManagerAssignmentJobsGetOptionalParams): Promise; + list(resourceGroupName: string, workspaceName: string, workspaceManagerAssignmentName: string, options?: WorkspaceManagerAssignmentJobsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface WorkspaceManagerAssignmentJobsCreateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkspaceManagerAssignmentJobsCreateResponse = Job; + +// @public +export interface WorkspaceManagerAssignmentJobsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface WorkspaceManagerAssignmentJobsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkspaceManagerAssignmentJobsGetResponse = Job; + +// @public +export interface WorkspaceManagerAssignmentJobsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkspaceManagerAssignmentJobsListNextResponse = JobList; + +// @public +export interface WorkspaceManagerAssignmentJobsListOptionalParams extends coreClient.OperationOptions { + orderby?: string; + skipToken?: string; + top?: number; +} + +// @public +export type WorkspaceManagerAssignmentJobsListResponse = JobList; + +// @public +export interface WorkspaceManagerAssignmentList { + readonly nextLink?: string; + value: WorkspaceManagerAssignment[]; +} + +// @public +export interface WorkspaceManagerAssignments { + createOrUpdate(resourceGroupName: string, workspaceName: string, workspaceManagerAssignmentName: string, workspaceManagerAssignment: WorkspaceManagerAssignment, options?: WorkspaceManagerAssignmentsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, workspaceName: string, workspaceManagerAssignmentName: string, options?: WorkspaceManagerAssignmentsDeleteOptionalParams): Promise; + get(resourceGroupName: string, workspaceName: string, workspaceManagerAssignmentName: string, options?: WorkspaceManagerAssignmentsGetOptionalParams): Promise; + list(resourceGroupName: string, workspaceName: string, options?: WorkspaceManagerAssignmentsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface WorkspaceManagerAssignmentsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkspaceManagerAssignmentsCreateOrUpdateResponse = WorkspaceManagerAssignment; + +// @public +export interface WorkspaceManagerAssignmentsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface WorkspaceManagerAssignmentsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkspaceManagerAssignmentsGetResponse = WorkspaceManagerAssignment; + +// @public +export interface WorkspaceManagerAssignmentsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkspaceManagerAssignmentsListNextResponse = WorkspaceManagerAssignmentList; + +// @public +export interface WorkspaceManagerAssignmentsListOptionalParams extends coreClient.OperationOptions { + orderby?: string; + skipToken?: string; + top?: number; +} + +// @public +export type WorkspaceManagerAssignmentsListResponse = WorkspaceManagerAssignmentList; + // (No @packageDocumentation comment for this package) ``` diff --git a/sdk/securityinsight/arm-securityinsight/src/models/index.ts b/sdk/securityinsight/arm-securityinsight/src/models/index.ts index ce2c0ea1f1ab..2a2e0e55013c 100644 --- a/sdk/securityinsight/arm-securityinsight/src/models/index.ts +++ b/sdk/securityinsight/arm-securityinsight/src/models/index.ts @@ -1329,6 +1329,103 @@ export interface WatchlistItemList { value: WatchlistItem[]; } +/** List of all the workspace manager assignments. */ +export interface WorkspaceManagerAssignmentList { + /** + * URL to fetch the next set of workspace manager assignments. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; + /** Array of workspace manager assignments. */ + value: WorkspaceManagerAssignment[]; +} + +/** Object to describe the resource added */ +export interface AssignmentItem { + /** The resource id */ + resourceId?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** List of all the jobs */ +export interface JobList { + /** + * URL to fetch the next set of jobs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; + /** Array of jobs. */ + value: Job[]; +} + +/** Object to describe the item added */ +export interface JobItem { + /** The resource id */ + resourceId?: string; + /** Status of the item publication */ + status?: Status; + /** The time the item publishing was executed */ + executionTime?: Date; + /** The list of error descriptions if the item publication fails. */ + errors?: ErrorModel[]; +} + +/** The error description for why a publication failed */ +export interface ErrorModel { + /** The member resource name for which the publication error occured */ + memberResourceName: string; + /** The error message */ + errorMessage: string; +} + /** List all the data connectors. */ export interface DataConnectorList { /** @@ -1479,6 +1576,8 @@ export interface QueryBasedAlertRuleTemplateProperties { alertDetailsOverride?: AlertDetailsOverride; /** The event grouping settings. */ eventGroupingSettings?: EventGroupingSettings; + /** Array of the sentinel entity mappings of the alert rule */ + sentinelEntitiesMappings?: SentinelEntityMapping[]; } /** Single entity mapping for the alert rule */ @@ -1507,6 +1606,16 @@ export interface AlertDetailsOverride { alertTacticsColumnName?: string; /** the column name to take the alert severity from */ alertSeverityColumnName?: string; + /** List of additional dynamic properties to override */ + alertDynamicProperties?: AlertPropertyMapping[]; +} + +/** A single alert property mapping to override */ +export interface AlertPropertyMapping { + /** The V3 alert property */ + alertProperty?: AlertProperty; + /** the column name to use to override this property */ + value?: string; } /** Event grouping settings property bag. */ @@ -1515,6 +1624,12 @@ export interface EventGroupingSettings { aggregationKind?: EventGroupingAggregationKind; } +/** A single sentinel entity mapping */ +export interface SentinelEntityMapping { + /** the column name to be mapped to the SentinelEntities */ + columnName?: string; +} + /** Represents a supported source signal configuration in Fusion detection. */ export interface FusionSourceSettings { /** Determines whether this source signal is enabled or disabled in Fusion detection. */ @@ -1656,6 +1771,8 @@ export interface ScheduledAlertRuleCommonProperties { entityMappings?: EntityMapping[]; /** The alert details override settings */ alertDetailsOverride?: AlertDetailsOverride; + /** Array of the sentinel entity mappings of the alert rule */ + sentinelEntitiesMappings?: SentinelEntityMapping[]; } export interface AutomationRuleBooleanCondition { @@ -2302,6 +2419,15 @@ export interface OfficeConsent extends Resource { consentId?: string; } +/** The resource model definition for an Azure Resource Manager resource with an etag. */ +export interface AzureEntityResource extends Resource { + /** + * Resource Etag. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly etag?: string; +} + /** Action property bag. */ export interface ActionResponseProperties extends ActionPropertiesBase { /** The name of the logic app's workflow. */ @@ -2459,6 +2585,13 @@ export interface SecurityAlertTimelineItem extends EntityTimelineItem { timeGenerated: Date; /** The name of the alert type. */ alertType: string; + /** + * The intent of the alert. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly intent?: KillChainIntent; + /** The techniques of the alert. */ + techniques?: string[]; } /** Represents Insight Query. */ @@ -4357,6 +4490,23 @@ export interface WatchlistItem extends ResourceWithEtag { entityMapping?: { [propertyName: string]: any }; } +/** The assignment job */ +export interface Job extends ResourceWithEtag { + /** + * The time the job completed + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly endTime?: Date; + /** List of items published by the job */ + items?: JobItem[]; + /** State of the job */ + provisioningState?: ProvisioningState; + /** The time the job started */ + startTime?: Date; + /** Message to describe error, if an error exists */ + errorMessage?: string; +} + /** Data connector */ export interface DataConnector extends ResourceWithEtag { /** The data connector kind */ @@ -4547,6 +4697,8 @@ export interface ScheduledAlertRuleTemplate extends AlertRuleTemplate { entityMappings?: EntityMapping[]; /** The alert details override settings */ alertDetailsOverride?: AlertDetailsOverride; + /** Array of the sentinel entity mappings of the alert rule */ + sentinelEntitiesMappings?: SentinelEntityMapping[]; } /** Represents NRT alert rule template. */ @@ -4591,6 +4743,8 @@ export interface NrtAlertRuleTemplate extends AlertRuleTemplate { alertDetailsOverride?: AlertDetailsOverride; /** The event grouping settings. */ eventGroupingSettings?: EventGroupingSettings; + /** Array of the sentinel entity mappings of the alert rule */ + sentinelEntitiesMappings?: SentinelEntityMapping[]; } /** Represents a security alert entity. */ @@ -5813,6 +5967,24 @@ export interface ActivityEntityQueryTemplate extends EntityQueryTemplate { entitiesFilter?: { [propertyName: string]: string[] }; } +/** The workspace manager assignment */ +export interface WorkspaceManagerAssignment extends AzureEntityResource { + /** The name of the workspace manager group targeted by the workspace manager assignment */ + targetResourceName?: string; + /** + * The time the last job associated to this assignment ended at + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastJobEndTime?: Date; + /** + * State of the last job associated to this assignment + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastJobProvisioningState?: ProvisioningState; + /** List of resources included in this workspace manager assignment */ + items?: AssignmentItem[]; +} + /** MLBehaviorAnalytics alert rule template properties. */ export interface MLBehaviorAnalyticsAlertRuleTemplateProperties extends AlertRuleTemplateWithMitreProperties { @@ -6004,6 +6176,8 @@ export interface ScheduledAlertRule extends AlertRule { entityMappings?: EntityMapping[]; /** The alert details override settings */ alertDetailsOverride?: AlertDetailsOverride; + /** Array of the sentinel entity mappings of the alert rule */ + sentinelEntitiesMappings?: SentinelEntityMapping[]; /** The Name of the alert rule template used to create this rule. */ alertRuleTemplateName?: string; /** The version of the alert rule template used to create this rule - in format , where all are numbers, for example 0 <1.0.2> */ @@ -6072,6 +6246,8 @@ export interface NrtAlertRule extends AlertRule { alertDetailsOverride?: AlertDetailsOverride; /** The event grouping settings. */ eventGroupingSettings?: EventGroupingSettings; + /** Array of the sentinel entity mappings of the alert rule */ + sentinelEntitiesMappings?: SentinelEntityMapping[]; } /** Represents Expansion entity query. */ @@ -7678,6 +7854,51 @@ export enum KnownSourceType { */ export type SourceType = string; +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + /** The job succeeded */ + Succeeded = "Succeeded", + /** The job was canceled */ + Canceled = "Canceled", + /** The job is in progress */ + InProgress = "InProgress", + /** The job failed */ + Failed = "Failed" +} + +/** + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: The job succeeded \ + * **Canceled**: The job was canceled \ + * **InProgress**: The job is in progress \ + * **Failed**: The job failed + */ +export type ProvisioningState = string; + +/** Known values of {@link Status} that the service accepts. */ +export enum KnownStatus { + /** The item publication succeeded */ + Succeeded = "Succeeded", + /** The item publication failed */ + Failed = "Failed", + /** The item publication is in progress */ + InProgress = "InProgress" +} + +/** + * Defines values for Status. \ + * {@link KnownStatus} can be used interchangeably with Status, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: The item publication succeeded \ + * **Failed**: The item publication failed \ + * **InProgress**: The item publication is in progress + */ +export type Status = string; + /** Known values of {@link DataConnectorKind} that the service accepts. */ export enum KnownDataConnectorKind { /** AzureActiveDirectory */ @@ -7897,6 +8118,45 @@ export enum KnownEntityMappingType { */ export type EntityMappingType = string; +/** Known values of {@link AlertProperty} that the service accepts. */ +export enum KnownAlertProperty { + /** Alert's link */ + AlertLink = "AlertLink", + /** Confidence level property */ + ConfidenceLevel = "ConfidenceLevel", + /** Confidence score */ + ConfidenceScore = "ConfidenceScore", + /** Extended links to the alert */ + ExtendedLinks = "ExtendedLinks", + /** Product name alert property */ + ProductName = "ProductName", + /** Provider name alert property */ + ProviderName = "ProviderName", + /** Product component name alert property */ + ProductComponentName = "ProductComponentName", + /** Remediation steps alert property */ + RemediationSteps = "RemediationSteps", + /** Techniques alert property */ + Techniques = "Techniques" +} + +/** + * Defines values for AlertProperty. \ + * {@link KnownAlertProperty} can be used interchangeably with AlertProperty, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AlertLink**: Alert's link \ + * **ConfidenceLevel**: Confidence level property \ + * **ConfidenceScore**: Confidence score \ + * **ExtendedLinks**: Extended links to the alert \ + * **ProductName**: Product name alert property \ + * **ProviderName**: Provider name alert property \ + * **ProductComponentName**: Product component name alert property \ + * **RemediationSteps**: Remediation steps alert property \ + * **Techniques**: Techniques alert property + */ +export type AlertProperty = string; + /** Known values of {@link EventGroupingAggregationKind} that the service accepts. */ export enum KnownEventGroupingAggregationKind { /** SingleAlert */ @@ -9720,6 +9980,84 @@ export interface WatchlistItemsListNextOptionalParams /** Contains response data for the listNext operation. */ export type WatchlistItemsListNextResponse = WatchlistItemList; +/** Optional parameters. */ +export interface WorkspaceManagerAssignmentsListOptionalParams + extends coreClient.OperationOptions { + /** 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 WorkspaceManagerAssignmentsListResponse = WorkspaceManagerAssignmentList; + +/** Optional parameters. */ +export interface WorkspaceManagerAssignmentsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type WorkspaceManagerAssignmentsGetResponse = WorkspaceManagerAssignment; + +/** Optional parameters. */ +export interface WorkspaceManagerAssignmentsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type WorkspaceManagerAssignmentsCreateOrUpdateResponse = WorkspaceManagerAssignment; + +/** Optional parameters. */ +export interface WorkspaceManagerAssignmentsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface WorkspaceManagerAssignmentsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type WorkspaceManagerAssignmentsListNextResponse = WorkspaceManagerAssignmentList; + +/** Optional parameters. */ +export interface WorkspaceManagerAssignmentJobsListOptionalParams + extends coreClient.OperationOptions { + /** 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 WorkspaceManagerAssignmentJobsListResponse = JobList; + +/** Optional parameters. */ +export interface WorkspaceManagerAssignmentJobsCreateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the create operation. */ +export type WorkspaceManagerAssignmentJobsCreateResponse = Job; + +/** Optional parameters. */ +export interface WorkspaceManagerAssignmentJobsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type WorkspaceManagerAssignmentJobsGetResponse = Job; + +/** Optional parameters. */ +export interface WorkspaceManagerAssignmentJobsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface WorkspaceManagerAssignmentJobsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type WorkspaceManagerAssignmentJobsListNextResponse = JobList; + /** Optional parameters. */ export interface DataConnectorsListOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/securityinsight/arm-securityinsight/src/models/mappers.ts b/sdk/securityinsight/arm-securityinsight/src/models/mappers.ts index 6f5b1105eada..681a52166b53 100644 --- a/sdk/securityinsight/arm-securityinsight/src/models/mappers.ts +++ b/sdk/securityinsight/arm-securityinsight/src/models/mappers.ts @@ -3432,6 +3432,237 @@ export const WatchlistItemList: coreClient.CompositeMapper = { } }; +export const WorkspaceManagerAssignmentList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkspaceManagerAssignmentList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WorkspaceManagerAssignment" + } + } + } + } + } + } +}; + +export const AssignmentItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AssignmentItem", + modelProperties: { + resourceId: { + serializedName: "resourceId", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const JobList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "JobList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Job" + } + } + } + } + } + } +}; + +export const JobItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "JobItem", + modelProperties: { + resourceId: { + serializedName: "resourceId", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + executionTime: { + serializedName: "executionTime", + type: { + name: "DateTime" + } + }, + errors: { + serializedName: "errors", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorModel" + } + } + } + } + } + } +}; + +export const ErrorModel: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorModel", + modelProperties: { + memberResourceName: { + serializedName: "memberResourceName", + required: true, + type: { + name: "String" + } + }, + errorMessage: { + serializedName: "errorMessage", + required: true, + type: { + name: "String" + } + } + } + } +}; + export const DataConnectorList: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3820,6 +4051,18 @@ export const QueryBasedAlertRuleTemplateProperties: coreClient.CompositeMapper = name: "Composite", className: "EventGroupingSettings" } + }, + sentinelEntitiesMappings: { + serializedName: "sentinelEntitiesMappings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SentinelEntityMapping" + } + } + } } } } @@ -3901,6 +4144,39 @@ export const AlertDetailsOverride: coreClient.CompositeMapper = { type: { name: "String" } + }, + alertDynamicProperties: { + serializedName: "alertDynamicProperties", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AlertPropertyMapping" + } + } + } + } + } + } +}; + +export const AlertPropertyMapping: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AlertPropertyMapping", + modelProperties: { + alertProperty: { + serializedName: "alertProperty", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } } } } @@ -3921,6 +4197,21 @@ export const EventGroupingSettings: coreClient.CompositeMapper = { } }; +export const SentinelEntityMapping: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SentinelEntityMapping", + modelProperties: { + columnName: { + serializedName: "columnName", + type: { + name: "String" + } + } + } + } +}; + export const FusionSourceSettings: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4368,6 +4659,18 @@ export const ScheduledAlertRuleCommonProperties: coreClient.CompositeMapper = { name: "Composite", className: "AlertDetailsOverride" } + }, + sentinelEntitiesMappings: { + serializedName: "sentinelEntitiesMappings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SentinelEntityMapping" + } + } + } } } } @@ -6247,6 +6550,23 @@ export const OfficeConsent: coreClient.CompositeMapper = { } }; +export const AzureEntityResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureEntityResource", + modelProperties: { + ...Resource.type.modelProperties, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const ActionResponseProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -6720,6 +7040,24 @@ export const SecurityAlertTimelineItem: coreClient.CompositeMapper = { type: { name: "String" } + }, + intent: { + serializedName: "intent", + readOnly: true, + type: { + name: "String" + } + }, + techniques: { + serializedName: "techniques", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } } } } @@ -11106,6 +11444,53 @@ export const WatchlistItem: coreClient.CompositeMapper = { } }; +export const Job: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Job", + modelProperties: { + ...ResourceWithEtag.type.modelProperties, + endTime: { + serializedName: "properties.endTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + items: { + serializedName: "properties.items", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "JobItem" + } + } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + startTime: { + serializedName: "properties.startTime", + type: { + name: "DateTime" + } + }, + errorMessage: { + serializedName: "properties.errorMessage", + type: { + name: "String" + } + } + } + } +}; + export const DataConnector: coreClient.CompositeMapper = { serializedName: "DataConnector", type: { @@ -11672,6 +12057,18 @@ export const ScheduledAlertRuleTemplate: coreClient.CompositeMapper = { name: "Composite", className: "AlertDetailsOverride" } + }, + sentinelEntitiesMappings: { + serializedName: "properties.sentinelEntitiesMappings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SentinelEntityMapping" + } + } + } } } } @@ -11808,6 +12205,18 @@ export const NrtAlertRuleTemplate: coreClient.CompositeMapper = { name: "Composite", className: "EventGroupingSettings" } + }, + sentinelEntitiesMappings: { + serializedName: "properties.sentinelEntitiesMappings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SentinelEntityMapping" + } + } + } } } } @@ -13947,6 +14356,48 @@ export const ActivityEntityQueryTemplate: coreClient.CompositeMapper = { } }; +export const WorkspaceManagerAssignment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkspaceManagerAssignment", + modelProperties: { + ...AzureEntityResource.type.modelProperties, + targetResourceName: { + serializedName: "properties.targetResourceName", + type: { + name: "String" + } + }, + lastJobEndTime: { + serializedName: "properties.lastJobEndTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + lastJobProvisioningState: { + serializedName: "properties.lastJobProvisioningState", + readOnly: true, + type: { + name: "String" + } + }, + items: { + serializedName: "properties.items", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AssignmentItem" + } + } + } + } + } + } +}; + export const MLBehaviorAnalyticsAlertRuleTemplateProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -14408,6 +14859,18 @@ export const ScheduledAlertRule: coreClient.CompositeMapper = { className: "AlertDetailsOverride" } }, + sentinelEntitiesMappings: { + serializedName: "properties.sentinelEntitiesMappings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SentinelEntityMapping" + } + } + } + }, alertRuleTemplateName: { serializedName: "properties.alertRuleTemplateName", type: { @@ -14621,6 +15084,18 @@ export const NrtAlertRule: coreClient.CompositeMapper = { name: "Composite", className: "EventGroupingSettings" } + }, + sentinelEntitiesMappings: { + serializedName: "properties.sentinelEntitiesMappings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SentinelEntityMapping" + } + } + } } } } diff --git a/sdk/securityinsight/arm-securityinsight/src/models/parameters.ts b/sdk/securityinsight/arm-securityinsight/src/models/parameters.ts index dd3bcead9d0b..a16dfff3e36a 100644 --- a/sdk/securityinsight/arm-securityinsight/src/models/parameters.ts +++ b/sdk/securityinsight/arm-securityinsight/src/models/parameters.ts @@ -38,6 +38,7 @@ import { ThreatIntelligenceAppendTags as ThreatIntelligenceAppendTagsMapper, Watchlist as WatchlistMapper, WatchlistItem as WatchlistItemMapper, + WorkspaceManagerAssignment as WorkspaceManagerAssignmentMapper, DataConnector as DataConnectorMapper, DataConnectorConnectBody as DataConnectorConnectBodyMapper, DataConnectorsCheckRequirements as DataConnectorsCheckRequirementsMapper @@ -70,7 +71,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-09-01-preview", + defaultValue: "2023-03-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -112,6 +113,7 @@ export const workspaceName: OperationURLParameter = { parameterPath: "workspaceName", mapper: { constraints: { + Pattern: new RegExp("^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"), MaxLength: 90, MinLength: 1 }, @@ -640,6 +642,39 @@ export const watchlistItem: OperationParameter = { mapper: WatchlistItemMapper }; +export const workspaceManagerAssignmentName: OperationURLParameter = { + parameterPath: "workspaceManagerAssignmentName", + mapper: { + constraints: { + Pattern: new RegExp("^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$") + }, + serializedName: "workspaceManagerAssignmentName", + required: true, + type: { + name: "String" + } + } +}; + +export const workspaceManagerAssignment: OperationParameter = { + parameterPath: "workspaceManagerAssignment", + mapper: WorkspaceManagerAssignmentMapper +}; + +export const jobName: OperationURLParameter = { + parameterPath: "jobName", + mapper: { + constraints: { + Pattern: new RegExp("^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$") + }, + serializedName: "jobName", + required: true, + type: { + name: "String" + } + } +}; + export const dataConnectorId: OperationURLParameter = { parameterPath: "dataConnectorId", mapper: { diff --git a/sdk/securityinsight/arm-securityinsight/src/operations/index.ts b/sdk/securityinsight/arm-securityinsight/src/operations/index.ts index 6f66d834535e..f49a5df30708 100644 --- a/sdk/securityinsight/arm-securityinsight/src/operations/index.ts +++ b/sdk/securityinsight/arm-securityinsight/src/operations/index.ts @@ -37,6 +37,8 @@ export * from "./threatIntelligenceIndicators"; export * from "./threatIntelligenceIndicatorMetrics"; export * from "./watchlists"; export * from "./watchlistItems"; +export * from "./workspaceManagerAssignments"; +export * from "./workspaceManagerAssignmentJobs"; export * from "./dataConnectors"; export * from "./dataConnectorsCheckRequirementsOperations"; export * from "./operations"; diff --git a/sdk/securityinsight/arm-securityinsight/src/operations/workspaceManagerAssignmentJobs.ts b/sdk/securityinsight/arm-securityinsight/src/operations/workspaceManagerAssignmentJobs.ts new file mode 100644 index 000000000000..1f933d3ffb19 --- /dev/null +++ b/sdk/securityinsight/arm-securityinsight/src/operations/workspaceManagerAssignmentJobs.ts @@ -0,0 +1,387 @@ +/* + * 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, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { WorkspaceManagerAssignmentJobs } 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 { + Job, + WorkspaceManagerAssignmentJobsListNextOptionalParams, + WorkspaceManagerAssignmentJobsListOptionalParams, + WorkspaceManagerAssignmentJobsListResponse, + WorkspaceManagerAssignmentJobsCreateOptionalParams, + WorkspaceManagerAssignmentJobsCreateResponse, + WorkspaceManagerAssignmentJobsGetOptionalParams, + WorkspaceManagerAssignmentJobsGetResponse, + WorkspaceManagerAssignmentJobsDeleteOptionalParams, + WorkspaceManagerAssignmentJobsListNextResponse +} from "../models"; + +/// +/** Class containing WorkspaceManagerAssignmentJobs operations. */ +export class WorkspaceManagerAssignmentJobsImpl + implements WorkspaceManagerAssignmentJobs { + private readonly client: SecurityInsights; + + /** + * Initialize a new instance of the class WorkspaceManagerAssignmentJobs class. + * @param client Reference to the service client + */ + constructor(client: SecurityInsights) { + this.client = client; + } + + /** + * Get all jobs for the specified workspace manager assignment + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + options?: WorkspaceManagerAssignmentJobsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + workspaceName, + workspaceManagerAssignmentName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + workspaceName, + workspaceManagerAssignmentName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + options?: WorkspaceManagerAssignmentJobsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: WorkspaceManagerAssignmentJobsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + workspaceName, + workspaceManagerAssignmentName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + workspaceName, + workspaceManagerAssignmentName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + options?: WorkspaceManagerAssignmentJobsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + workspaceName, + workspaceManagerAssignmentName, + options + )) { + yield* page; + } + } + + /** + * Get all jobs for the specified workspace manager assignment + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + options?: WorkspaceManagerAssignmentJobsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + workspaceManagerAssignmentName, + options + }, + listOperationSpec + ); + } + + /** + * Create a job for the specified workspace manager assignment + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment + * @param options The options parameters. + */ + create( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + options?: WorkspaceManagerAssignmentJobsCreateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + workspaceManagerAssignmentName, + options + }, + createOperationSpec + ); + } + + /** + * Gets a job + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment + * @param jobName The job name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + jobName: string, + options?: WorkspaceManagerAssignmentJobsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + workspaceManagerAssignmentName, + jobName, + options + }, + getOperationSpec + ); + } + + /** + * Deletes the specified job from the specified workspace manager assignment + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment + * @param jobName The job name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + jobName: string, + options?: WorkspaceManagerAssignmentJobsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + workspaceManagerAssignmentName, + jobName, + options + }, + deleteOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + nextLink: string, + options?: WorkspaceManagerAssignmentJobsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + workspaceManagerAssignmentName, + 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/workspaceManagerAssignments/{workspaceManagerAssignmentName}/jobs", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.JobList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.orderby, + Parameters.top, + Parameters.skipToken + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.workspaceManagerAssignmentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}/jobs", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.Job + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.workspaceManagerAssignmentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}/jobs/{jobName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Job + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.workspaceManagerAssignmentName, + Parameters.jobName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}/jobs/{jobName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.workspaceManagerAssignmentName, + Parameters.jobName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.JobList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.nextLink, + Parameters.workspaceManagerAssignmentName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/securityinsight/arm-securityinsight/src/operations/workspaceManagerAssignments.ts b/sdk/securityinsight/arm-securityinsight/src/operations/workspaceManagerAssignments.ts new file mode 100644 index 000000000000..2e3b3be3faca --- /dev/null +++ b/sdk/securityinsight/arm-securityinsight/src/operations/workspaceManagerAssignments.ts @@ -0,0 +1,353 @@ +/* + * 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, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { WorkspaceManagerAssignments } 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 { + WorkspaceManagerAssignment, + WorkspaceManagerAssignmentsListNextOptionalParams, + WorkspaceManagerAssignmentsListOptionalParams, + WorkspaceManagerAssignmentsListResponse, + WorkspaceManagerAssignmentsGetOptionalParams, + WorkspaceManagerAssignmentsGetResponse, + WorkspaceManagerAssignmentsCreateOrUpdateOptionalParams, + WorkspaceManagerAssignmentsCreateOrUpdateResponse, + WorkspaceManagerAssignmentsDeleteOptionalParams, + WorkspaceManagerAssignmentsListNextResponse +} from "../models"; + +/// +/** Class containing WorkspaceManagerAssignments operations. */ +export class WorkspaceManagerAssignmentsImpl + implements WorkspaceManagerAssignments { + private readonly client: SecurityInsights; + + /** + * Initialize a new instance of the class WorkspaceManagerAssignments class. + * @param client Reference to the service client + */ + constructor(client: SecurityInsights) { + this.client = client; + } + + /** + * Get all workspace manager assignments for the Sentinel workspace manager. + * @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?: WorkspaceManagerAssignmentsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, workspaceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + workspaceName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + workspaceName: string, + options?: WorkspaceManagerAssignmentsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: WorkspaceManagerAssignmentsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, workspaceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + workspaceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + workspaceName: string, + options?: WorkspaceManagerAssignmentsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + workspaceName, + options + )) { + yield* page; + } + } + + /** + * Get all workspace manager assignments for the Sentinel workspace manager. + * @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?: WorkspaceManagerAssignmentsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, options }, + listOperationSpec + ); + } + + /** + * Gets a workspace manager assignment + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + options?: WorkspaceManagerAssignmentsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + workspaceManagerAssignmentName, + options + }, + getOperationSpec + ); + } + + /** + * Creates or updates a workspace manager assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment + * @param workspaceManagerAssignment The workspace manager assignment + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + workspaceManagerAssignment: WorkspaceManagerAssignment, + options?: WorkspaceManagerAssignmentsCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + workspaceManagerAssignmentName, + workspaceManagerAssignment, + options + }, + createOrUpdateOperationSpec + ); + } + + /** + * Deletes a workspace manager assignment + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + options?: WorkspaceManagerAssignmentsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + workspaceManagerAssignmentName, + options + }, + deleteOperationSpec + ); + } + + /** + * 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?: WorkspaceManagerAssignmentsListNextOptionalParams + ): 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/workspaceManagerAssignments", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkspaceManagerAssignmentList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + 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/workspaceManagerAssignments/{workspaceManagerAssignmentName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkspaceManagerAssignment + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.workspaceManagerAssignmentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.WorkspaceManagerAssignment + }, + 201: { + bodyMapper: Mappers.WorkspaceManagerAssignment + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.workspaceManagerAssignment, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.workspaceManagerAssignmentName + ], + 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/workspaceManagerAssignments/{workspaceManagerAssignmentName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.workspaceManagerAssignmentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkspaceManagerAssignmentList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/index.ts b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/index.ts index 6f66d834535e..f49a5df30708 100644 --- a/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/index.ts +++ b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/index.ts @@ -37,6 +37,8 @@ export * from "./threatIntelligenceIndicators"; export * from "./threatIntelligenceIndicatorMetrics"; export * from "./watchlists"; export * from "./watchlistItems"; +export * from "./workspaceManagerAssignments"; +export * from "./workspaceManagerAssignmentJobs"; export * from "./dataConnectors"; export * from "./dataConnectorsCheckRequirementsOperations"; export * from "./operations"; diff --git a/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/workspaceManagerAssignmentJobs.ts b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/workspaceManagerAssignmentJobs.ts new file mode 100644 index 000000000000..614caf3b8fa1 --- /dev/null +++ b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/workspaceManagerAssignmentJobs.ts @@ -0,0 +1,79 @@ +/* + * 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 { + Job, + WorkspaceManagerAssignmentJobsListOptionalParams, + WorkspaceManagerAssignmentJobsCreateOptionalParams, + WorkspaceManagerAssignmentJobsCreateResponse, + WorkspaceManagerAssignmentJobsGetOptionalParams, + WorkspaceManagerAssignmentJobsGetResponse, + WorkspaceManagerAssignmentJobsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a WorkspaceManagerAssignmentJobs. */ +export interface WorkspaceManagerAssignmentJobs { + /** + * Get all jobs for the specified workspace manager assignment + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment + * @param options The options parameters. + */ + list( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + options?: WorkspaceManagerAssignmentJobsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create a job for the specified workspace manager assignment + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment + * @param options The options parameters. + */ + create( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + options?: WorkspaceManagerAssignmentJobsCreateOptionalParams + ): Promise; + /** + * Gets a job + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment + * @param jobName The job name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + jobName: string, + options?: WorkspaceManagerAssignmentJobsGetOptionalParams + ): Promise; + /** + * Deletes the specified job from the specified workspace manager assignment + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment + * @param jobName The job name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + jobName: string, + options?: WorkspaceManagerAssignmentJobsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/workspaceManagerAssignments.ts b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/workspaceManagerAssignments.ts new file mode 100644 index 000000000000..37751de45aa1 --- /dev/null +++ b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/workspaceManagerAssignments.ts @@ -0,0 +1,75 @@ +/* + * 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 { + WorkspaceManagerAssignment, + WorkspaceManagerAssignmentsListOptionalParams, + WorkspaceManagerAssignmentsGetOptionalParams, + WorkspaceManagerAssignmentsGetResponse, + WorkspaceManagerAssignmentsCreateOrUpdateOptionalParams, + WorkspaceManagerAssignmentsCreateOrUpdateResponse, + WorkspaceManagerAssignmentsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a WorkspaceManagerAssignments. */ +export interface WorkspaceManagerAssignments { + /** + * Get all workspace manager assignments for the Sentinel workspace manager. + * @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?: WorkspaceManagerAssignmentsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a workspace manager assignment + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + options?: WorkspaceManagerAssignmentsGetOptionalParams + ): Promise; + /** + * Creates or updates a workspace manager assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment + * @param workspaceManagerAssignment The workspace manager assignment + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + workspaceManagerAssignment: WorkspaceManagerAssignment, + options?: WorkspaceManagerAssignmentsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a workspace manager assignment + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + workspaceName: string, + workspaceManagerAssignmentName: string, + options?: WorkspaceManagerAssignmentsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/securityinsight/arm-securityinsight/src/securityInsights.ts b/sdk/securityinsight/arm-securityinsight/src/securityInsights.ts index 20a358af6b03..bc662cc30112 100644 --- a/sdk/securityinsight/arm-securityinsight/src/securityInsights.ts +++ b/sdk/securityinsight/arm-securityinsight/src/securityInsights.ts @@ -46,6 +46,8 @@ import { ThreatIntelligenceIndicatorMetricsImpl, WatchlistsImpl, WatchlistItemsImpl, + WorkspaceManagerAssignmentsImpl, + WorkspaceManagerAssignmentJobsImpl, DataConnectorsImpl, DataConnectorsCheckRequirementsOperationsImpl, OperationsImpl @@ -82,6 +84,8 @@ import { ThreatIntelligenceIndicatorMetrics, Watchlists, WatchlistItems, + WorkspaceManagerAssignments, + WorkspaceManagerAssignmentJobs, DataConnectors, DataConnectorsCheckRequirementsOperations, Operations @@ -173,7 +177,7 @@ export class SecurityInsights extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-09-01-preview"; + this.apiVersion = options.apiVersion || "2023-03-01-preview"; this.alertRules = new AlertRulesImpl(this); this.actions = new ActionsImpl(this); this.alertRuleTemplates = new AlertRuleTemplatesImpl(this); @@ -213,6 +217,12 @@ export class SecurityInsights extends coreClient.ServiceClient { ); this.watchlists = new WatchlistsImpl(this); this.watchlistItems = new WatchlistItemsImpl(this); + this.workspaceManagerAssignments = new WorkspaceManagerAssignmentsImpl( + this + ); + this.workspaceManagerAssignmentJobs = new WorkspaceManagerAssignmentJobsImpl( + this + ); this.dataConnectors = new DataConnectorsImpl(this); this.dataConnectorsCheckRequirementsOperations = new DataConnectorsCheckRequirementsOperationsImpl( this @@ -280,6 +290,8 @@ export class SecurityInsights extends coreClient.ServiceClient { threatIntelligenceIndicatorMetrics: ThreatIntelligenceIndicatorMetrics; watchlists: Watchlists; watchlistItems: WatchlistItems; + workspaceManagerAssignments: WorkspaceManagerAssignments; + workspaceManagerAssignmentJobs: WorkspaceManagerAssignmentJobs; dataConnectors: DataConnectors; dataConnectorsCheckRequirementsOperations: DataConnectorsCheckRequirementsOperations; operations: Operations; diff --git a/sdk/securityinsight/arm-securityinsight/test/sampleTest.ts b/sdk/securityinsight/arm-securityinsight/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/securityinsight/arm-securityinsight/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * 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 { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); 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"