diff --git a/sdk/securityinsight/arm-securityinsight/CHANGELOG.md b/sdk/securityinsight/arm-securityinsight/CHANGELOG.md index d41abf445193..3cf668347141 100644 --- a/sdk/securityinsight/arm-securityinsight/CHANGELOG.md +++ b/sdk/securityinsight/arm-securityinsight/CHANGELOG.md @@ -1,15 +1,50 @@ # Release History + +## 1.0.0-beta.6 (2022-11-17) + +**Features** -## 1.0.0-beta.6 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group Get + - Added operation group GetRecommendations + - Added operation group Update + - Added Interface AlertPropertyMapping + - Added Interface Content + - Added Interface GetRecommendationsListOptionalParams + - Added Interface GetSingleRecommendationOptionalParams + - Added Interface Instructions + - Added Interface Recommendation + - Added Interface RecommendationList + - Added Interface RecommendationPatch + - Added Interface RecommendedAction + - Added Interface SentinelEntityMapping + - Added Interface UpdateRecommendationOptionalParams + - Added Type Alias AlertProperty + - Added Type Alias Category + - Added Type Alias Context + - Added Type Alias GetRecommendationsListResponse + - Added Type Alias GetSingleRecommendationResponse + - Added Type Alias Priority + - Added Type Alias State + - Added Type Alias UpdateRecommendationResponse + - 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 + - Class SecurityInsights has a new parameter get + - Class SecurityInsights has a new parameter getRecommendations + - Class SecurityInsights has a new parameter update + - Added Enum KnownAlertProperty + - Added Enum KnownCategory + - Added Enum KnownContext + - Added Enum KnownPriority + - Added Enum KnownState + + ## 1.0.0-beta.5 (2022-09-27) **Features** diff --git a/sdk/securityinsight/arm-securityinsight/README.md b/sdk/securityinsight/arm-securityinsight/README.md index 7181392099b1..d4b3978f58fa 100644 --- a/sdk/securityinsight/arm-securityinsight/README.md +++ b/sdk/securityinsight/arm-securityinsight/README.md @@ -13,7 +13,7 @@ API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provi ### Currently supported environments -- [LTS versions of Node.js](https://nodejs.org/about/releases/) +- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) - Latest versions of Safari, Chrome, Edge and Firefox. See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. diff --git a/sdk/securityinsight/arm-securityinsight/_meta.json b/sdk/securityinsight/arm-securityinsight/_meta.json index efd1ec43a862..38d9f11d34d7 100644 --- a/sdk/securityinsight/arm-securityinsight/_meta.json +++ b/sdk/securityinsight/arm-securityinsight/_meta.json @@ -1,8 +1,8 @@ { - "commit": "b41f929626289b59e31be8a1091c99994864b096", + "commit": "b300cfa556724786e9c4dbec7e837b860298d791", "readme": "specification/securityinsights/resource-manager/readme.md", - "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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\securityinsights\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1.20220727.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.2", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.1.20220727.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.5.1", + "use": "@autorest/typescript@6.0.0-rc.2" } \ No newline at end of file diff --git a/sdk/securityinsight/arm-securityinsight/package.json b/sdk/securityinsight/arm-securityinsight/package.json index 9a999cddda13..e7f19ecf5858 100644 --- a/sdk/securityinsight/arm-securityinsight/package.json +++ b/sdk/securityinsight/arm-securityinsight/package.json @@ -109,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 44b02eb0987b..493ab564f970 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; @@ -872,6 +882,9 @@ export interface BooleanConditionProperties extends AutomationRuleCondition { conditionType: "Boolean"; } +// @public +export type Category = string; + // @public export interface ClientInfo { email?: string; @@ -1055,6 +1068,12 @@ export interface ConnectorInstructionModelBase { type: SettingType; } +// @public +export interface Content { + description: string; + title: string; +} + // @public export interface ContentPathMap { contentType?: ContentType; @@ -1064,6 +1083,9 @@ export interface ContentPathMap { // @public export type ContentType = string; +// @public +export type Context = string; + // @public export type CreatedByType = string; @@ -2042,6 +2064,11 @@ export interface GeoLocation { readonly state?: string; } +// @public +export interface Get { + singleRecommendation(resourceGroupName: string, workspaceName: string, recommendationId: string, options?: GetSingleRecommendationOptionalParams): Promise; +} + // @public export type GetInsightsError = string; @@ -2063,6 +2090,25 @@ export interface GetQueriesResponse { value?: EntityQueryItemUnion[]; } +// @public +export interface GetRecommendations { + list(resourceGroupName: string, workspaceName: string, options?: GetRecommendationsListOptionalParams): Promise; +} + +// @public +export interface GetRecommendationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GetRecommendationsListResponse = RecommendationList; + +// @public +export interface GetSingleRecommendationOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GetSingleRecommendationResponse = Recommendation; + // @public export interface GitHubResourceInfo { appInstallationId?: string; @@ -2547,6 +2593,13 @@ export interface InsightsTableResultColumnsItem { type?: string; } +// @public +export interface Instructions { + actionsToBePerformed: string; + howToPerformActionDetails?: string; + recommendationImportance: string; +} + // @public export interface InstructionSteps { description?: string; @@ -2694,6 +2747,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", @@ -2867,6 +2933,15 @@ export enum KnownAutomationRulePropertyConditionSupportedProperty { Url = "Url" } +// @public +export enum KnownCategory { + CostOptimization = "CostOptimization", + Demo = "Demo", + NewFeature = "NewFeature", + Onboarding = "Onboarding", + SocEfficiency = "SocEfficiency" +} + // @public export enum KnownConditionType { Boolean = "Boolean", @@ -2909,6 +2984,14 @@ export enum KnownContentType { Workbook = "Workbook" } +// @public +export enum KnownContext { + Analytics = "Analytics", + Incidents = "Incidents", + None = "None", + Overview = "Overview" +} + // @public export enum KnownCreatedByType { Application = "Application", @@ -3294,6 +3377,13 @@ export enum KnownPollingFrequency { OnceAnHour = "OnceAnHour" } +// @public +export enum KnownPriority { + High = "High", + Low = "Low", + Medium = "Medium" +} + // @public export enum KnownProviderName { MicrosoftAadiamDiagnosticSettings = "microsoft.aadiam/diagnosticSettings", @@ -3376,6 +3466,15 @@ export enum KnownSourceType { RemoteStorage = "Remote storage" } +// @public +export enum KnownState { + Active = "Active", + CompletedByAction = "CompletedByAction", + CompletedByUser = "CompletedByUser", + Disabled = "Disabled", + Hidden = "Hidden" +} + // @public export enum KnownSupportTier { Community = "Community", @@ -3982,6 +4081,7 @@ export interface NrtAlertRule extends AlertRule { kind: "NRT"; readonly lastModifiedUtc?: Date; query?: string; + sentinelEntitiesMappings?: SentinelEntityMapping[]; severity?: AlertSeverity; suppressionDuration?: string; suppressionEnabled?: boolean; @@ -4006,6 +4106,7 @@ export interface NrtAlertRuleTemplate extends AlertRuleTemplate { readonly lastUpdatedDateUTC?: Date; query?: string; requiredDataConnectors?: AlertRuleTemplateDataSource[]; + sentinelEntitiesMappings?: SentinelEntityMapping[]; severity?: AlertSeverity; status?: TemplateStatus; tactics?: AttackTactic[]; @@ -4276,6 +4377,9 @@ export interface PlaybookActionProperties { // @public export type PollingFrequency = string; +// @public +export type Priority = string; + // @public export interface ProcessEntity extends Entity { readonly accountEntityId?: string; @@ -4380,10 +4484,54 @@ export interface QueryBasedAlertRuleTemplateProperties { entityMappings?: EntityMapping[]; eventGroupingSettings?: EventGroupingSettings; query?: string; + sentinelEntitiesMappings?: SentinelEntityMapping[]; severity?: AlertSeverity; version?: string; } +// @public +export interface Recommendation { + actions: RecommendedAction[]; + additionalProperties?: { + [propertyName: string]: string; + }; + category: Category; + content?: Content; + context: Context; + description: string; + displayUntilTimeUtc?: Date; + hideUntilTimeUtc?: Date; + id: string; + instructions: Instructions; + lastEvaluatedTimeUtc: Date; + priority: Priority; + recommendationTypeId: string; + recommendationTypeTitle: string; + resourceId?: string; + state: State; + title: string; + visible?: boolean; + workspaceId: string; +} + +// @public +export interface RecommendationList { + value?: Recommendation[]; +} + +// @public +export interface RecommendationPatch { + hideUntilTimeUtc?: Date; + state?: State; +} + +// @public +export interface RecommendedAction { + linkText: string; + linkUrl: string; + state?: Priority; +} + // @public export type RegistryHive = string; @@ -4528,6 +4676,7 @@ export interface ScheduledAlertRule extends AlertRule { query?: string; queryFrequency?: string; queryPeriod?: string; + sentinelEntitiesMappings?: SentinelEntityMapping[]; severity?: AlertSeverity; suppressionDuration?: string; suppressionEnabled?: boolean; @@ -4549,6 +4698,7 @@ export interface ScheduledAlertRuleCommonProperties { query?: string; queryFrequency?: string; queryPeriod?: string; + sentinelEntitiesMappings?: SentinelEntityMapping[]; severity?: AlertSeverity; triggerOperator?: TriggerOperator; triggerThreshold?: number; @@ -4587,6 +4737,7 @@ export interface ScheduledAlertRuleTemplate extends AlertRuleTemplate { queryFrequency?: string; queryPeriod?: string; requiredDataConnectors?: AlertRuleTemplateDataSource[]; + sentinelEntitiesMappings?: SentinelEntityMapping[]; severity?: AlertSeverity; status?: TemplateStatus; tactics?: AttackTactic[]; @@ -4672,10 +4823,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; } @@ -4740,6 +4893,10 @@ export class SecurityInsights extends coreClient.ServiceClient { // (undocumented) fileImports: FileImports; // (undocumented) + get: Get; + // (undocumented) + getRecommendations: GetRecommendations; + // (undocumented) incidentComments: IncidentComments; // (undocumented) incidentRelations: IncidentRelations; @@ -4772,6 +4929,8 @@ export class SecurityInsights extends coreClient.ServiceClient { // (undocumented) threatIntelligenceIndicators: ThreatIntelligenceIndicators; // (undocumented) + update: Update; + // (undocumented) watchlistItems: WatchlistItems; // (undocumented) watchlists: Watchlists; @@ -4847,6 +5006,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; @@ -4997,6 +5161,9 @@ export type SourceKind = string; // @public export type SourceType = string; +// @public +export type State = string; + // @public export interface SubmissionMailEntity extends Entity { readonly additionalData?: { @@ -5505,6 +5672,21 @@ export interface Ueba extends Settings { // @public export type UebaDataSources = string; +// @public +export interface Update { + beginRecommendation(resourceGroupName: string, workspaceName: string, recommendationId: string, recommendationPatch: RecommendationPatch[], options?: UpdateRecommendationOptionalParams): Promise, UpdateRecommendationResponse>>; + beginRecommendationAndWait(resourceGroupName: string, workspaceName: string, recommendationId: string, recommendationPatch: RecommendationPatch[], options?: UpdateRecommendationOptionalParams): Promise; +} + +// @public +export interface UpdateRecommendationOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type UpdateRecommendationResponse = Recommendation; + // @public export interface UrlEntity extends Entity { readonly additionalData?: { diff --git a/sdk/securityinsight/arm-securityinsight/src/models/index.ts b/sdk/securityinsight/arm-securityinsight/src/models/index.ts index 0ce7824a0d80..873a5657f3df 100644 --- a/sdk/securityinsight/arm-securityinsight/src/models/index.ts +++ b/sdk/securityinsight/arm-securityinsight/src/models/index.ts @@ -1172,6 +1172,90 @@ export interface Deployment { deploymentLogsUrl?: string; } +/** A list of recommendations */ +export interface RecommendationList { + /** An list of recommendations */ + value?: Recommendation[]; +} + +/** Recommendation object. */ +export interface Recommendation { + /** id of recommendation. */ + id: string; + /** Instructions of the recommendation. */ + instructions: Instructions; + /** Content of the recommendation. */ + content?: Content; + /** Id of the resource this recommendation refers to. */ + resourceId?: string; + /** Collection of additional properties for the recommendation. */ + additionalProperties?: { [propertyName: string]: string }; + /** Title of the recommendation. */ + title: string; + /** Description of the recommendation. */ + description: string; + /** Title of the recommendation type. */ + recommendationTypeTitle: string; + /** Id of the recommendation type. */ + recommendationTypeId: string; + /** Category of the recommendation. */ + category: Category; + /** Context of the recommendation. */ + context: Context; + /** Id of the workspace this recommendation refers to. */ + workspaceId: string; + /** List of actions to take for this recommendation. */ + actions: RecommendedAction[]; + /** State of the recommendation. */ + state: State; + /** Priority of the recommendation. */ + priority: Priority; + /** The time stamp (UTC) when the recommendation was last evaluated. */ + lastEvaluatedTimeUtc: Date; + /** The time stamp (UTC) when the recommendation should be displayed again. */ + hideUntilTimeUtc?: Date; + /** The timestamp (UTC) after which the recommendation should not be displayed anymore. */ + displayUntilTimeUtc?: Date; + /** Value indicating if the recommendation should be displayed or not. */ + visible?: boolean; +} + +/** Instructions section of a recommendation. */ +export interface Instructions { + /** What actions should be taken to complete the recommendation. */ + actionsToBePerformed: string; + /** Explains why the recommendation is important. */ + recommendationImportance: string; + /** How should the user complete the recommendation. */ + howToPerformActionDetails?: string; +} + +/** Content section of the recommendation. */ +export interface Content { + /** Title of the content. */ + title: string; + /** Description of the content. */ + description: string; +} + +/** What actions should be taken to complete the recommendation. */ +export interface RecommendedAction { + /** Text of the link to complete the action. */ + linkText: string; + /** The Link to complete the action. */ + linkUrl: string; + /** The state of the action. */ + state?: Priority; +} + +/** Recommendation Fields to update. */ +export interface RecommendationPatch { + /** State of the recommendation. */ + state?: State; + /** The time stamp (UTC) when the recommendation should be displayed again. */ + hideUntilTimeUtc?: Date; +} + /** Describes threat kill chain phase entity */ export interface ThreatIntelligenceKillChainPhase { /** Kill chainName name */ @@ -1479,6 +1563,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 +1593,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 +1611,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 +1758,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 { @@ -2459,6 +2563,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. */ @@ -4547,6 +4658,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 +4704,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. */ @@ -6004,6 +6119,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 +6189,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. */ @@ -7624,6 +7743,105 @@ export enum KnownDeploymentResult { */ export type DeploymentResult = string; +/** Known values of {@link Category} that the service accepts. */ +export enum KnownCategory { + /** Onboarding recommendation. */ + Onboarding = "Onboarding", + /** New feature recommendation. */ + NewFeature = "NewFeature", + /** Soc Efficiency recommendation. */ + SocEfficiency = "SocEfficiency", + /** Cost optimization recommendation. */ + CostOptimization = "CostOptimization", + /** Demo recommendation. */ + Demo = "Demo" +} + +/** + * Defines values for Category. \ + * {@link KnownCategory} can be used interchangeably with Category, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Onboarding**: Onboarding recommendation. \ + * **NewFeature**: New feature recommendation. \ + * **SocEfficiency**: Soc Efficiency recommendation. \ + * **CostOptimization**: Cost optimization recommendation. \ + * **Demo**: Demo recommendation. + */ +export type Category = string; + +/** Known values of {@link Context} that the service accepts. */ +export enum KnownContext { + /** Analytics context. */ + Analytics = "Analytics", + /** Incidents context. */ + Incidents = "Incidents", + /** Overview context. */ + Overview = "Overview", + /** No context. */ + None = "None" +} + +/** + * Defines values for Context. \ + * {@link KnownContext} can be used interchangeably with Context, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Analytics**: Analytics context. \ + * **Incidents**: Incidents context. \ + * **Overview**: Overview context. \ + * **None**: No context. + */ +export type Context = string; + +/** Known values of {@link Priority} that the service accepts. */ +export enum KnownPriority { + /** Low priority for recommendation. */ + Low = "Low", + /** Medium priority for recommendation. */ + Medium = "Medium", + /** High priority for recommendation. */ + High = "High" +} + +/** + * Defines values for Priority. \ + * {@link KnownPriority} can be used interchangeably with Priority, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Low**: Low priority for recommendation. \ + * **Medium**: Medium priority for recommendation. \ + * **High**: High priority for recommendation. + */ +export type Priority = string; + +/** Known values of {@link State} that the service accepts. */ +export enum KnownState { + /** Recommendation is active. */ + Active = "Active", + /** Recommendation is disabled. */ + Disabled = "Disabled", + /** Recommendation has been completed by user. */ + CompletedByUser = "CompletedByUser", + /** Recommendation has been completed by action. */ + CompletedByAction = "CompletedByAction", + /** Recommendation is hidden. */ + Hidden = "Hidden" +} + +/** + * Defines values for State. \ + * {@link KnownState} can be used interchangeably with State, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Active**: Recommendation is active. \ + * **Disabled**: Recommendation is disabled. \ + * **CompletedByUser**: Recommendation has been completed by user. \ + * **CompletedByAction**: Recommendation has been completed by action. \ + * **Hidden**: Recommendation is hidden. + */ +export type State = string; + /** Known values of {@link ThreatIntelligenceResourceKindEnum} that the service accepts. */ export enum KnownThreatIntelligenceResourceKindEnum { /** Entity represents threat intelligence indicator in the system. */ @@ -7897,6 +8115,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 */ @@ -9633,6 +9890,32 @@ export interface SourceControlsListNextOptionalParams /** Contains response data for the listNext operation. */ export type SourceControlsListNextResponse = SourceControlList; +/** Optional parameters. */ +export interface GetRecommendationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type GetRecommendationsListResponse = RecommendationList; + +/** Optional parameters. */ +export interface GetSingleRecommendationOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the singleRecommendation operation. */ +export type GetSingleRecommendationResponse = Recommendation; + +/** Optional parameters. */ +export interface UpdateRecommendationOptionalParams + 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 recommendation operation. */ +export type UpdateRecommendationResponse = Recommendation; + /** Optional parameters. */ export interface ThreatIntelligenceIndicatorCreateIndicatorOptionalParams 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..c75b2dae1fad 100644 --- a/sdk/securityinsight/arm-securityinsight/src/models/mappers.ts +++ b/sdk/securityinsight/arm-securityinsight/src/models/mappers.ts @@ -2935,6 +2935,278 @@ export const Deployment: coreClient.CompositeMapper = { } }; +export const RecommendationList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RecommendationList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Recommendation" + } + } + } + } + } + } +}; + +export const Recommendation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Recommendation", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "Uuid" + } + }, + instructions: { + serializedName: "instructions", + type: { + name: "Composite", + className: "Instructions" + } + }, + content: { + serializedName: "content", + type: { + name: "Composite", + className: "Content" + } + }, + resourceId: { + serializedName: "resourceId", + nullable: true, + type: { + name: "String" + } + }, + additionalProperties: { + serializedName: "additionalProperties", + nullable: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + title: { + serializedName: "title", + required: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + required: true, + type: { + name: "String" + } + }, + recommendationTypeTitle: { + serializedName: "recommendationTypeTitle", + required: true, + type: { + name: "String" + } + }, + recommendationTypeId: { + serializedName: "recommendationTypeId", + required: true, + type: { + name: "String" + } + }, + category: { + serializedName: "category", + required: true, + type: { + name: "String" + } + }, + context: { + serializedName: "context", + required: true, + type: { + name: "String" + } + }, + workspaceId: { + serializedName: "workspaceId", + required: true, + type: { + name: "Uuid" + } + }, + actions: { + serializedName: "actions", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RecommendedAction" + } + } + } + }, + state: { + serializedName: "state", + required: true, + type: { + name: "String" + } + }, + priority: { + serializedName: "priority", + required: true, + type: { + name: "String" + } + }, + lastEvaluatedTimeUtc: { + serializedName: "lastEvaluatedTimeUtc", + required: true, + type: { + name: "DateTime" + } + }, + hideUntilTimeUtc: { + serializedName: "hideUntilTimeUtc", + nullable: true, + type: { + name: "DateTime" + } + }, + displayUntilTimeUtc: { + serializedName: "displayUntilTimeUtc", + nullable: true, + type: { + name: "DateTime" + } + }, + visible: { + serializedName: "visible", + type: { + name: "Boolean" + } + } + } + } +}; + +export const Instructions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Instructions", + modelProperties: { + actionsToBePerformed: { + serializedName: "actionsToBePerformed", + required: true, + type: { + name: "String" + } + }, + recommendationImportance: { + serializedName: "recommendationImportance", + required: true, + type: { + name: "String" + } + }, + howToPerformActionDetails: { + serializedName: "howToPerformActionDetails", + nullable: true, + type: { + name: "String" + } + } + } + } +}; + +export const Content: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Content", + modelProperties: { + title: { + serializedName: "title", + required: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const RecommendedAction: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RecommendedAction", + modelProperties: { + linkText: { + serializedName: "linkText", + required: true, + type: { + name: "String" + } + }, + linkUrl: { + serializedName: "linkUrl", + required: true, + type: { + name: "String" + } + }, + state: { + serializedName: "state", + type: { + name: "String" + } + } + } + } +}; + +export const RecommendationPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RecommendationPatch", + modelProperties: { + state: { + serializedName: "state", + type: { + name: "String" + } + }, + hideUntilTimeUtc: { + serializedName: "hideUntilTimeUtc", + type: { + name: "DateTime" + } + } + } + } +}; + export const ThreatIntelligenceKillChainPhase: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3820,6 +4092,18 @@ export const QueryBasedAlertRuleTemplateProperties: coreClient.CompositeMapper = name: "Composite", className: "EventGroupingSettings" } + }, + sentinelEntitiesMappings: { + serializedName: "sentinelEntitiesMappings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SentinelEntityMapping" + } + } + } } } } @@ -3901,6 +4185,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 +4238,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 +4700,18 @@ export const ScheduledAlertRuleCommonProperties: coreClient.CompositeMapper = { name: "Composite", className: "AlertDetailsOverride" } + }, + sentinelEntitiesMappings: { + serializedName: "sentinelEntitiesMappings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SentinelEntityMapping" + } + } + } } } } @@ -6720,6 +7064,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" + } + } + } } } } @@ -11672,6 +12034,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 +12182,18 @@ export const NrtAlertRuleTemplate: coreClient.CompositeMapper = { name: "Composite", className: "EventGroupingSettings" } + }, + sentinelEntitiesMappings: { + serializedName: "properties.sentinelEntitiesMappings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SentinelEntityMapping" + } + } + } } } } @@ -14408,6 +14794,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 +15019,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..964fcee84d0c 100644 --- a/sdk/securityinsight/arm-securityinsight/src/models/parameters.ts +++ b/sdk/securityinsight/arm-securityinsight/src/models/parameters.ts @@ -70,7 +70,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-09-01-preview", + defaultValue: "2022-11-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -577,6 +577,34 @@ export const sourceControl: OperationParameter = { mapper: SourceControlMapper }; +export const recommendationId: OperationURLParameter = { + parameterPath: "recommendationId", + mapper: { + serializedName: "recommendationId", + required: true, + type: { + name: "Uuid" + } + } +}; + +export const recommendationPatch: OperationParameter = { + parameterPath: "recommendationPatch", + mapper: { + serializedName: "recommendationPatch", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RecommendationPatch" + } + } + } + } +}; + export const threatIntelligenceProperties: OperationParameter = { parameterPath: "threatIntelligenceProperties", mapper: ThreatIntelligenceIndicatorModelMapper diff --git a/sdk/securityinsight/arm-securityinsight/src/operations/get.ts b/sdk/securityinsight/arm-securityinsight/src/operations/get.ts new file mode 100644 index 000000000000..3b420b7b9785 --- /dev/null +++ b/sdk/securityinsight/arm-securityinsight/src/operations/get.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 { Get } 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 { + GetSingleRecommendationOptionalParams, + GetSingleRecommendationResponse +} from "../models"; + +/** Class containing Get operations. */ +export class GetImpl implements Get { + private readonly client: SecurityInsights; + + /** + * Initialize a new instance of the class Get class. + * @param client Reference to the service client + */ + constructor(client: SecurityInsights) { + this.client = client; + } + + /** + * Gets a recommendation by its id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation Id. + * @param options The options parameters. + */ + singleRecommendation( + resourceGroupName: string, + workspaceName: string, + recommendationId: string, + options?: GetSingleRecommendationOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, recommendationId, options }, + singleRecommendationOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const singleRecommendationOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Recommendation + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.recommendationId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/securityinsight/arm-securityinsight/src/operations/getRecommendations.ts b/sdk/securityinsight/arm-securityinsight/src/operations/getRecommendations.ts new file mode 100644 index 000000000000..b354ff342f93 --- /dev/null +++ b/sdk/securityinsight/arm-securityinsight/src/operations/getRecommendations.ts @@ -0,0 +1,72 @@ +/* + * 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 { GetRecommendations } 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 { + GetRecommendationsListOptionalParams, + GetRecommendationsListResponse +} from "../models"; + +/** Class containing GetRecommendations operations. */ +export class GetRecommendationsImpl implements GetRecommendations { + private readonly client: SecurityInsights; + + /** + * Initialize a new instance of the class GetRecommendations class. + * @param client Reference to the service client + */ + constructor(client: SecurityInsights) { + this.client = client; + } + + /** + * Gets a list of all recommendations. + * @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?: GetRecommendationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, options }, + listOperationSpec + ); + } +} +// 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/recommendations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RecommendationList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName + ], + 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 6f66d834535e..8b1aad3c088c 100644 --- a/sdk/securityinsight/arm-securityinsight/src/operations/index.ts +++ b/sdk/securityinsight/arm-securityinsight/src/operations/index.ts @@ -32,6 +32,9 @@ export * from "./securityMLAnalyticsSettings"; export * from "./productSettings"; export * from "./sourceControlOperations"; export * from "./sourceControls"; +export * from "./getRecommendations"; +export * from "./get"; +export * from "./update"; export * from "./threatIntelligenceIndicator"; export * from "./threatIntelligenceIndicators"; export * from "./threatIntelligenceIndicatorMetrics"; diff --git a/sdk/securityinsight/arm-securityinsight/src/operations/update.ts b/sdk/securityinsight/arm-securityinsight/src/operations/update.ts new file mode 100644 index 000000000000..cb73ea25842d --- /dev/null +++ b/sdk/securityinsight/arm-securityinsight/src/operations/update.ts @@ -0,0 +1,173 @@ +/* + * 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 { Update } 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 { + RecommendationPatch, + UpdateRecommendationOptionalParams, + UpdateRecommendationResponse +} from "../models"; + +/** Class containing Update operations. */ +export class UpdateImpl implements Update { + private readonly client: SecurityInsights; + + /** + * Initialize a new instance of the class Update class. + * @param client Reference to the service client + */ + constructor(client: SecurityInsights) { + this.client = client; + } + + /** + * Patch a recommendation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation Id. + * @param recommendationPatch Recommendation Fields to Update. + * @param options The options parameters. + */ + async beginRecommendation( + resourceGroupName: string, + workspaceName: string, + recommendationId: string, + recommendationPatch: RecommendationPatch[], + options?: UpdateRecommendationOptionalParams + ): Promise< + PollerLike< + PollOperationState, + UpdateRecommendationResponse + > + > { + 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, + recommendationId, + recommendationPatch, + options + }, + recommendationOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Patch a recommendation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation Id. + * @param recommendationPatch Recommendation Fields to Update. + * @param options The options parameters. + */ + async beginRecommendationAndWait( + resourceGroupName: string, + workspaceName: string, + recommendationId: string, + recommendationPatch: RecommendationPatch[], + options?: UpdateRecommendationOptionalParams + ): Promise { + const poller = await this.beginRecommendation( + resourceGroupName, + workspaceName, + recommendationId, + recommendationPatch, + options + ); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const recommendationOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Recommendation + }, + 201: { + bodyMapper: Mappers.Recommendation + }, + 202: { + bodyMapper: Mappers.Recommendation + }, + 204: { + bodyMapper: Mappers.Recommendation + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.recommendationPatch, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.recommendationId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/get.ts b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/get.ts new file mode 100644 index 000000000000..8384596c454c --- /dev/null +++ b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/get.ts @@ -0,0 +1,29 @@ +/* + * 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 { + GetSingleRecommendationOptionalParams, + GetSingleRecommendationResponse +} from "../models"; + +/** Interface representing a Get. */ +export interface Get { + /** + * Gets a recommendation by its id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation Id. + * @param options The options parameters. + */ + singleRecommendation( + resourceGroupName: string, + workspaceName: string, + recommendationId: string, + options?: GetSingleRecommendationOptionalParams + ): Promise; +} diff --git a/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/getRecommendations.ts b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/getRecommendations.ts new file mode 100644 index 000000000000..3c68d7feb9c2 --- /dev/null +++ b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/getRecommendations.ts @@ -0,0 +1,27 @@ +/* + * 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 { + GetRecommendationsListOptionalParams, + GetRecommendationsListResponse +} from "../models"; + +/** Interface representing a GetRecommendations. */ +export interface GetRecommendations { + /** + * Gets a list of all recommendations. + * @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?: GetRecommendationsListOptionalParams + ): Promise; +} diff --git a/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/index.ts b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/index.ts index 6f66d834535e..8b1aad3c088c 100644 --- a/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/index.ts +++ b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/index.ts @@ -32,6 +32,9 @@ export * from "./securityMLAnalyticsSettings"; export * from "./productSettings"; export * from "./sourceControlOperations"; export * from "./sourceControls"; +export * from "./getRecommendations"; +export * from "./get"; +export * from "./update"; export * from "./threatIntelligenceIndicator"; export * from "./threatIntelligenceIndicators"; export * from "./threatIntelligenceIndicatorMetrics"; diff --git a/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/update.ts b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/update.ts new file mode 100644 index 000000000000..af860bcdf8e5 --- /dev/null +++ b/sdk/securityinsight/arm-securityinsight/src/operationsInterfaces/update.ts @@ -0,0 +1,53 @@ +/* + * 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + RecommendationPatch, + UpdateRecommendationOptionalParams, + UpdateRecommendationResponse +} from "../models"; + +/** Interface representing a Update. */ +export interface Update { + /** + * Patch a recommendation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation Id. + * @param recommendationPatch Recommendation Fields to Update. + * @param options The options parameters. + */ + beginRecommendation( + resourceGroupName: string, + workspaceName: string, + recommendationId: string, + recommendationPatch: RecommendationPatch[], + options?: UpdateRecommendationOptionalParams + ): Promise< + PollerLike< + PollOperationState, + UpdateRecommendationResponse + > + >; + /** + * Patch a recommendation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation Id. + * @param recommendationPatch Recommendation Fields to Update. + * @param options The options parameters. + */ + beginRecommendationAndWait( + resourceGroupName: string, + workspaceName: string, + recommendationId: string, + recommendationPatch: RecommendationPatch[], + options?: UpdateRecommendationOptionalParams + ): Promise; +} diff --git a/sdk/securityinsight/arm-securityinsight/src/securityInsights.ts b/sdk/securityinsight/arm-securityinsight/src/securityInsights.ts index 240c03409f08..b3bc801eff28 100644 --- a/sdk/securityinsight/arm-securityinsight/src/securityInsights.ts +++ b/sdk/securityinsight/arm-securityinsight/src/securityInsights.ts @@ -41,6 +41,9 @@ import { ProductSettingsImpl, SourceControlOperationsImpl, SourceControlsImpl, + GetRecommendationsImpl, + GetImpl, + UpdateImpl, ThreatIntelligenceIndicatorImpl, ThreatIntelligenceIndicatorsImpl, ThreatIntelligenceIndicatorMetricsImpl, @@ -77,6 +80,9 @@ import { ProductSettings, SourceControlOperations, SourceControls, + GetRecommendations, + Get, + Update, ThreatIntelligenceIndicator, ThreatIntelligenceIndicators, ThreatIntelligenceIndicatorMetrics, @@ -174,7 +180,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 || "2022-11-01-preview"; this.alertRules = new AlertRulesImpl(this); this.actions = new ActionsImpl(this); this.alertRuleTemplates = new AlertRuleTemplatesImpl(this); @@ -203,6 +209,9 @@ export class SecurityInsights extends coreClient.ServiceClient { this.productSettings = new ProductSettingsImpl(this); this.sourceControlOperations = new SourceControlOperationsImpl(this); this.sourceControls = new SourceControlsImpl(this); + this.getRecommendations = new GetRecommendationsImpl(this); + this.get = new GetImpl(this); + this.update = new UpdateImpl(this); this.threatIntelligenceIndicator = new ThreatIntelligenceIndicatorImpl( this ); @@ -276,6 +285,9 @@ export class SecurityInsights extends coreClient.ServiceClient { productSettings: ProductSettings; sourceControlOperations: SourceControlOperations; sourceControls: SourceControls; + getRecommendations: GetRecommendations; + get: Get; + update: Update; threatIntelligenceIndicator: ThreatIntelligenceIndicator; threatIntelligenceIndicators: ThreatIntelligenceIndicators; threatIntelligenceIndicatorMetrics: ThreatIntelligenceIndicatorMetrics; 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"