diff --git a/sdk/security/arm-security/CHANGELOG.md b/sdk/security/arm-security/CHANGELOG.md index 2199fb8928b1..872e459c9f01 100644 --- a/sdk/security/arm-security/CHANGELOG.md +++ b/sdk/security/arm-security/CHANGELOG.md @@ -1,16 +1,6 @@ # Release History - -## 6.0.0-beta.3 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 6.0.0-beta.2 (2022-11-15) + +## 6.0.0-beta.3 (2022-12-26) **Features** @@ -22,12 +12,15 @@ - Added operation group GovernanceAssignments - Added operation group GovernanceRuleOperations - Added operation group GovernanceRules + - Added operation group ManagementGroupGovernanceRule + - Added operation group ManagementGroupGovernanceRules + - Added operation group ManagementGroupGovernanceRulesOperationResult - Added operation group SecurityConnectorApplication - Added operation group SecurityConnectorApplications - Added operation group SecurityConnectorGovernanceRule - Added operation group SecurityConnectorGovernanceRules - - Added operation group SecurityConnectorGovernanceRulesExecuteStatus - - Added operation group SubscriptionGovernanceRulesExecuteStatus + - Added operation group SecurityConnectorGovernanceRulesOperationResult + - Added operation group SubscriptionGovernanceRulesOperationResult - Added operation Alerts.beginSimulate - Added operation Alerts.beginSimulateAndWait - Added operation Alerts.updateResourceGroupLevelStateToInProgress @@ -141,7 +134,6 @@ - Added Interface ErrorDetail - Added Interface ErrorResponse - Added Interface ExecuteGovernanceRuleParams - - Added Interface ExecuteRuleStatus - Added Interface ExternalSecuritySolution - Added Interface FailedLocalLoginsNotInAllowedRange - Added Interface FileUploadsNotInAllowedRange @@ -166,10 +158,13 @@ - Added Interface GovernanceRuleList - Added Interface GovernanceRuleListNextOptionalParams - Added Interface GovernanceRuleListOptionalParams + - Added Interface GovernanceRuleMetadata - Added Interface GovernanceRuleOwnerSource - Added Interface GovernanceRulesCreateOrUpdateOptionalParams - Added Interface GovernanceRulesDeleteOptionalParams - Added Interface GovernanceRulesGetOptionalParams + - Added Interface GovernanceRulesRuleIdExecuteSingleManagementGroupHeaders + - Added Interface GovernanceRulesRuleIdExecuteSingleManagementGroupOptionalParams - Added Interface GovernanceRulesRuleIdExecuteSingleSecurityConnectorHeaders - Added Interface GovernanceRulesRuleIdExecuteSingleSecurityConnectorOptionalParams - Added Interface GovernanceRulesRuleIdExecuteSingleSubscriptionHeaders @@ -188,12 +183,21 @@ - Added Interface ListCustomAlertRule - Added Interface LocalUserNotAllowed - Added Interface LogAnalyticsIdentifier + - Added Interface ManagementGroupGovernanceRuleListNextOptionalParams + - Added Interface ManagementGroupGovernanceRuleListOptionalParams + - Added Interface ManagementGroupGovernanceRulesCreateOrUpdateOptionalParams + - Added Interface ManagementGroupGovernanceRulesDeleteHeaders + - Added Interface ManagementGroupGovernanceRulesDeleteOptionalParams + - Added Interface ManagementGroupGovernanceRulesGetOptionalParams + - Added Interface ManagementGroupGovernanceRulesOperationResultGetHeaders + - Added Interface ManagementGroupGovernanceRulesOperationResultGetOptionalParams - Added Interface MdeOnboardingData - Added Interface MqttC2DMessagesNotInAllowedRange - Added Interface MqttC2DRejectedMessagesNotInAllowedRange - Added Interface MqttD2CMessagesNotInAllowedRange - Added Interface OnPremiseResourceDetails - Added Interface OnPremiseSqlResourceDetails + - Added Interface OperationResultAutoGenerated - Added Interface Pricing - Added Interface ProcessNotAllowed - Added Interface QueuePurgesNotInAllowedRange @@ -223,10 +227,11 @@ - Added Interface SecurityConnectorGovernanceRuleListNextOptionalParams - Added Interface SecurityConnectorGovernanceRuleListOptionalParams - Added Interface SecurityConnectorGovernanceRulesCreateOrUpdateOptionalParams + - Added Interface SecurityConnectorGovernanceRulesDeleteHeaders - Added Interface SecurityConnectorGovernanceRulesDeleteOptionalParams - - Added Interface SecurityConnectorGovernanceRulesExecuteStatusGetHeaders - - Added Interface SecurityConnectorGovernanceRulesExecuteStatusGetOptionalParams - Added Interface SecurityConnectorGovernanceRulesGetOptionalParams + - Added Interface SecurityConnectorGovernanceRulesOperationResultGetHeaders + - Added Interface SecurityConnectorGovernanceRulesOperationResultGetOptionalParams - Added Interface SecurityContact - Added Interface SecurityContactPropertiesAlertNotifications - Added Interface SecurityContactPropertiesNotificationsByRole @@ -239,8 +244,8 @@ - Added Interface Setting - Added Interface Software - Added Interface SqlServerVulnerabilityProperties - - Added Interface SubscriptionGovernanceRulesExecuteStatusGetHeaders - - Added Interface SubscriptionGovernanceRulesExecuteStatusGetOptionalParams + - Added Interface SubscriptionGovernanceRulesOperationResultGetHeaders + - Added Interface SubscriptionGovernanceRulesOperationResultGetOptionalParams - Added Interface ThresholdCustomAlertRule - Added Interface TimeWindowCustomAlertRule - Added Interface TopologyResource @@ -275,10 +280,18 @@ - Added Type Alias GovernanceRulesCreateOrUpdateResponse - Added Type Alias GovernanceRulesGetResponse - Added Type Alias GovernanceRuleSourceResourceType + - Added Type Alias GovernanceRulesRuleIdExecuteSingleManagementGroupResponse - Added Type Alias GovernanceRulesRuleIdExecuteSingleSecurityConnectorResponse - Added Type Alias GovernanceRulesRuleIdExecuteSingleSubscriptionResponse - Added Type Alias GovernanceRuleType + - Added Type Alias ManagementGroupGovernanceRuleListNextResponse + - Added Type Alias ManagementGroupGovernanceRuleListResponse + - Added Type Alias ManagementGroupGovernanceRulesCreateOrUpdateResponse + - Added Type Alias ManagementGroupGovernanceRulesDeleteResponse + - Added Type Alias ManagementGroupGovernanceRulesGetResponse + - Added Type Alias ManagementGroupGovernanceRulesOperationResultGetResponse - Added Type Alias MinimalSeverity + - Added Type Alias OperationResult - Added Type Alias Roles - Added Type Alias ScanningMode - Added Type Alias SecurityConnectorApplicationCreateOrUpdateResponse @@ -288,28 +301,14 @@ - Added Type Alias SecurityConnectorGovernanceRuleListNextResponse - Added Type Alias SecurityConnectorGovernanceRuleListResponse - Added Type Alias SecurityConnectorGovernanceRulesCreateOrUpdateResponse - - Added Type Alias SecurityConnectorGovernanceRulesExecuteStatusGetResponse - Added Type Alias SecurityConnectorGovernanceRulesGetResponse + - Added Type Alias SecurityConnectorGovernanceRulesOperationResultGetResponse - Added Type Alias SubPlan - - Added Type Alias SubscriptionGovernanceRulesExecuteStatusGetResponse + - Added Type Alias SubscriptionGovernanceRulesOperationResultGetResponse - Added Type Alias Type - Interface AlertsSimulateOptionalParams has a new optional parameter resumeFrom - Interface AlertsSimulateOptionalParams has a new optional parameter updateIntervalInMs - Interface DefenderForServersAwsOfferingArcAutoProvisioning has a new optional parameter cloudRoleArn - - Class SecurityCenter has a new parameter aPICollection - - Class SecurityCenter has a new parameter aPICollectionOffboarding - - Class SecurityCenter has a new parameter aPICollectionOnboarding - - Class SecurityCenter has a new parameter applicationOperations - - Class SecurityCenter has a new parameter applications - - Class SecurityCenter has a new parameter governanceAssignments - - Class SecurityCenter has a new parameter governanceRuleOperations - - Class SecurityCenter has a new parameter governanceRules - - Class SecurityCenter has a new parameter securityConnectorApplication - - Class SecurityCenter has a new parameter securityConnectorApplications - - Class SecurityCenter has a new parameter securityConnectorGovernanceRule - - Class SecurityCenter has a new parameter securityConnectorGovernanceRules - - Class SecurityCenter has a new parameter securityConnectorGovernanceRulesExecuteStatus - - Class SecurityCenter has a new parameter subscriptionGovernanceRulesExecuteStatus - Added Enum KnownApplicationConditionOperator - Added Enum KnownApplicationSourceResourceType - Added Enum KnownEnvironmentType @@ -318,6 +317,7 @@ - Added Enum KnownGovernanceRuleSourceResourceType - Added Enum KnownGovernanceRuleType - Added Enum KnownMinimalSeverity + - Added Enum KnownOperationResult - Added Enum KnownRoles - Added Enum KnownScanningMode - Added Enum KnownSubPlan @@ -338,13 +338,30 @@ - Enum KnownOfferingType has a new value DefenderForDevOpsGithub - Enum KnownOfferingType has a new value DefenderForServersGcp - Enum KnownSettingName has a new value WdatpUnifiedSolution + - Added function getContinuationToken **Breaking Changes** - Removed operation Alerts.simulate - Removed operation SecurityContacts.update - Operation AllowedConnections.get has a new signature + - Class SecurityCenter has a new signature + - Interface AlertsSuppressionRulesListNextOptionalParams no longer has parameter alertType - Interface DefenderForServersAwsOfferingArcAutoProvisioning no longer has parameter servicePrincipalSecretMetadata + - Interface IotSecuritySolutionListByResourceGroupNextOptionalParams no longer has parameter filter + - Interface IotSecuritySolutionListBySubscriptionNextOptionalParams no longer has parameter filter + - Interface IotSecuritySolutionsAnalyticsAggregatedAlertListNextOptionalParams no longer has parameter top + - Interface IotSecuritySolutionsAnalyticsRecommendationListNextOptionalParams no longer has parameter top + - Interface RegulatoryComplianceAssessmentsListNextOptionalParams no longer has parameter filter + - Interface RegulatoryComplianceControlsListNextOptionalParams no longer has parameter filter + - Interface RegulatoryComplianceStandardsListNextOptionalParams no longer has parameter filter + - Interface SecureScoreControlsListBySecureScoreNextOptionalParams no longer has parameter expand + - Interface SecureScoreControlsListNextOptionalParams no longer has parameter expand + - Interface TasksListByHomeRegionNextOptionalParams no longer has parameter filter + - Interface TasksListByResourceGroupNextOptionalParams no longer has parameter filter + - Interface TasksListNextOptionalParams no longer has parameter filter + - Type of parameter offeringType of interface CloudOffering is changed from "CspmMonitorAws" | "DefenderForContainersAws" | "DefenderForServersAws" | "InformationProtectionAws" to "CspmMonitorAws" | "DefenderForContainersAws" | "DefenderForServersAws" | "DefenderForDatabasesAws" | "InformationProtectionAws" | "CspmMonitorGcp" | "DefenderForServersGcp" | "DefenderForDatabasesGcp" | "DefenderForContainersGcp" | "CspmMonitorGithub" | "CspmMonitorAzureDevOps" | "DefenderCspmAws" | "DefenderCspmGcp" | "DefenderForDevOpsGithub" | "DefenderForDevOpsAzureDevOps" + - Type of parameter value of interface ExternalSecuritySolutionList is changed from ExternalSecuritySolutionUnion[] to ExternalSecuritySolution[] - Removed Enum KnownAlertNotifications - Removed Enum KnownAlertsToAdmins diff --git a/sdk/security/arm-security/_meta.json b/sdk/security/arm-security/_meta.json index 5a4c130037f8..6b2699dfcafb 100644 --- a/sdk/security/arm-security/_meta.json +++ b/sdk/security/arm-security/_meta.json @@ -1,8 +1,8 @@ { - "commit": "d8461c6480ba57b5163c48795e917e7c1d99d4fd", + "commit": "6be9905597d8b6eb4b0c88dc619270dd27e9ac0b", "readme": "specification/security/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\\security\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221108.1 --generate-sample=true", + "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/security/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.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.5.4", + "use": "@autorest/typescript@6.0.0-rc.5" } \ No newline at end of file diff --git a/sdk/security/arm-security/package.json b/sdk/security/arm-security/package.json index 0362e683bf43..77d58c51e8e3 100644 --- a/sdk/security/arm-security/package.json +++ b/sdk/security/arm-security/package.json @@ -110,13 +110,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-security?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/security/arm-security/review/arm-security.api.md b/sdk/security/arm-security/review/arm-security.api.md index 887688a4dfad..42239965ed88 100644 --- a/sdk/security/arm-security/review/arm-security.api.md +++ b/sdk/security/arm-security/review/arm-security.api.md @@ -410,7 +410,6 @@ export interface AlertsSuppressionRulesList { // @public export interface AlertsSuppressionRulesListNextOptionalParams extends coreClient.OperationOptions { - alertType?: string; } // @public @@ -2032,11 +2031,6 @@ export interface ExecuteGovernanceRuleParams { override?: boolean; } -// @public -export interface ExecuteRuleStatus { - readonly operationId?: string; -} - // @public export type ExpandControlsEnum = string; @@ -2265,14 +2259,18 @@ export interface GovernanceRule extends Resource { conditionSets?: Record[]; description?: string; displayName?: string; + excludedScopes?: string[]; governanceEmailNotification?: GovernanceRuleEmailNotification; + includeMemberScopes?: boolean; isDisabled?: boolean; isGracePeriod?: boolean; + metadata?: GovernanceRuleMetadata; ownerSource?: GovernanceRuleOwnerSource; remediationTimeframe?: string; rulePriority?: number; ruleType?: GovernanceRuleType; sourceResourceType?: GovernanceRuleSourceResourceType; + readonly tenantId?: string; } // @public @@ -2304,6 +2302,14 @@ export interface GovernanceRuleListOptionalParams extends coreClient.OperationOp // @public export type GovernanceRuleListResponse = GovernanceRuleList; +// @public +export interface GovernanceRuleMetadata { + readonly createdBy?: string; + readonly createdOn?: Date; + readonly updatedBy?: string; + readonly updatedOn?: Date; +} + // @public export interface GovernanceRuleOperations { list(options?: GovernanceRuleListOptionalParams): PagedAsyncIterableIterator; @@ -2320,6 +2326,8 @@ export type GovernanceRuleOwnerSourceType = string; // @public export interface GovernanceRules { + beginRuleIdExecuteSingleManagementGroup(ruleId: string, options?: GovernanceRulesRuleIdExecuteSingleManagementGroupOptionalParams): Promise, GovernanceRulesRuleIdExecuteSingleManagementGroupResponse>>; + beginRuleIdExecuteSingleManagementGroupAndWait(ruleId: string, options?: GovernanceRulesRuleIdExecuteSingleManagementGroupOptionalParams): Promise; beginRuleIdExecuteSingleSecurityConnector(resourceGroupName: string, securityConnectorName: string, ruleId: string, options?: GovernanceRulesRuleIdExecuteSingleSecurityConnectorOptionalParams): Promise, GovernanceRulesRuleIdExecuteSingleSecurityConnectorResponse>>; beginRuleIdExecuteSingleSecurityConnectorAndWait(resourceGroupName: string, securityConnectorName: string, ruleId: string, options?: GovernanceRulesRuleIdExecuteSingleSecurityConnectorOptionalParams): Promise; beginRuleIdExecuteSingleSubscription(ruleId: string, options?: GovernanceRulesRuleIdExecuteSingleSubscriptionOptionalParams): Promise, GovernanceRulesRuleIdExecuteSingleSubscriptionResponse>>; @@ -2350,6 +2358,21 @@ export type GovernanceRulesGetResponse = GovernanceRule; // @public export type GovernanceRuleSourceResourceType = string; +// @public +export interface GovernanceRulesRuleIdExecuteSingleManagementGroupHeaders { + location?: string; +} + +// @public +export interface GovernanceRulesRuleIdExecuteSingleManagementGroupOptionalParams extends coreClient.OperationOptions { + executeGovernanceRuleParams?: ExecuteGovernanceRuleParams; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type GovernanceRulesRuleIdExecuteSingleManagementGroupResponse = GovernanceRulesRuleIdExecuteSingleManagementGroupHeaders; + // @public export interface GovernanceRulesRuleIdExecuteSingleSecurityConnectorHeaders { location?: string; @@ -2723,7 +2746,6 @@ export type IotSecuritySolutionGetResponse = IoTSecuritySolutionModel; // @public export interface IotSecuritySolutionListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -2739,7 +2761,6 @@ export type IotSecuritySolutionListByResourceGroupResponse = IoTSecuritySolution // @public export interface IotSecuritySolutionListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -2790,7 +2811,6 @@ export type IotSecuritySolutionsAnalyticsAggregatedAlertGetResponse = IoTSecurit // @public export interface IotSecuritySolutionsAnalyticsAggregatedAlertListNextOptionalParams extends coreClient.OperationOptions { - top?: number; } // @public @@ -2819,7 +2839,6 @@ export type IotSecuritySolutionsAnalyticsRecommendationGetResponse = IoTSecurity // @public export interface IotSecuritySolutionsAnalyticsRecommendationListNextOptionalParams extends coreClient.OperationOptions { - top?: number; } // @public @@ -3384,6 +3403,13 @@ export enum KnownOfferingType { InformationProtectionAws = "InformationProtectionAws" } +// @public +export enum KnownOperationResult { + Canceled = "Canceled", + Failed = "Failed", + Succeeded = "Succeeded" +} + // @public export enum KnownOperator { Contains = "Contains", @@ -3896,6 +3922,78 @@ export interface LogAnalyticsIdentifier extends ResourceIdentifier { readonly workspaceSubscriptionId?: string; } +// @public +export interface ManagementGroupGovernanceRule { + list(options?: ManagementGroupGovernanceRuleListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ManagementGroupGovernanceRuleListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagementGroupGovernanceRuleListNextResponse = GovernanceRuleList; + +// @public +export interface ManagementGroupGovernanceRuleListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagementGroupGovernanceRuleListResponse = GovernanceRuleList; + +// @public +export interface ManagementGroupGovernanceRules { + beginDelete(ruleId: string, options?: ManagementGroupGovernanceRulesDeleteOptionalParams): Promise, ManagementGroupGovernanceRulesDeleteResponse>>; + beginDeleteAndWait(ruleId: string, options?: ManagementGroupGovernanceRulesDeleteOptionalParams): Promise; + createOrUpdate(ruleId: string, governanceRule: GovernanceRule, options?: ManagementGroupGovernanceRulesCreateOrUpdateOptionalParams): Promise; + get(ruleId: string, options?: ManagementGroupGovernanceRulesGetOptionalParams): Promise; +} + +// @public +export interface ManagementGroupGovernanceRulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagementGroupGovernanceRulesCreateOrUpdateResponse = GovernanceRule; + +// @public +export interface ManagementGroupGovernanceRulesDeleteHeaders { + location?: string; +} + +// @public +export interface ManagementGroupGovernanceRulesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ManagementGroupGovernanceRulesDeleteResponse = ManagementGroupGovernanceRulesDeleteHeaders; + +// @public +export interface ManagementGroupGovernanceRulesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagementGroupGovernanceRulesGetResponse = GovernanceRule; + +// @public +export interface ManagementGroupGovernanceRulesOperationResult { + get(ruleId: string, operationId: string, options?: ManagementGroupGovernanceRulesOperationResultGetOptionalParams): Promise; +} + +// @public +export interface ManagementGroupGovernanceRulesOperationResultGetHeaders { + location?: string; +} + +// @public +export interface ManagementGroupGovernanceRulesOperationResultGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagementGroupGovernanceRulesOperationResultGetResponse = OperationResultAutoGenerated; + // @public export interface MdeOnboardingData extends Resource { onboardingPackageLinux?: Uint8Array; @@ -3988,6 +4086,14 @@ export interface OperationList { value?: Operation[]; } +// @public +export type OperationResult = string; + +// @public +export interface OperationResultAutoGenerated { + readonly status?: OperationResult; +} + // @public export interface Operations { list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; @@ -4180,7 +4286,6 @@ export type RegulatoryComplianceAssessmentsGetResponse = RegulatoryComplianceAss // @public export interface RegulatoryComplianceAssessmentsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -4224,7 +4329,6 @@ export type RegulatoryComplianceControlsGetResponse = RegulatoryComplianceContro // @public export interface RegulatoryComplianceControlsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -4269,7 +4373,6 @@ export type RegulatoryComplianceStandardsGetResponse = RegulatoryComplianceStand // @public export interface RegulatoryComplianceStandardsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -4534,7 +4637,6 @@ export interface SecureScoreControlScore { // @public export interface SecureScoreControlsListBySecureScoreNextOptionalParams extends coreClient.OperationOptions { - expand?: ExpandControlsEnum; } // @public @@ -4550,7 +4652,6 @@ export type SecureScoreControlsListBySecureScoreResponse = SecureScoreControlLis // @public export interface SecureScoreControlsListNextOptionalParams extends coreClient.OperationOptions { - expand?: ExpandControlsEnum; } // @public @@ -4765,7 +4866,7 @@ export interface SecurityAssessmentResponse extends Resource { export class SecurityCenter extends coreClient.ServiceClient { // (undocumented) $host: string; - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: SecurityCenterOptionalParams); + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, managementGroupId: string, options?: SecurityCenterOptionalParams); // (undocumented) adaptiveApplicationControls: AdaptiveApplicationControls; // (undocumented) @@ -4835,6 +4936,14 @@ export class SecurityCenter extends coreClient.ServiceClient { // (undocumented) locations: Locations; // (undocumented) + managementGroupGovernanceRule: ManagementGroupGovernanceRule; + // (undocumented) + managementGroupGovernanceRules: ManagementGroupGovernanceRules; + // (undocumented) + managementGroupGovernanceRulesOperationResult: ManagementGroupGovernanceRulesOperationResult; + // (undocumented) + managementGroupId: string; + // (undocumented) mdeOnboardings: MdeOnboardings; // (undocumented) operations: Operations; @@ -4861,7 +4970,7 @@ export class SecurityCenter extends coreClient.ServiceClient { // (undocumented) securityConnectorGovernanceRules: SecurityConnectorGovernanceRules; // (undocumented) - securityConnectorGovernanceRulesExecuteStatus: SecurityConnectorGovernanceRulesExecuteStatus; + securityConnectorGovernanceRulesOperationResult: SecurityConnectorGovernanceRulesOperationResult; // (undocumented) securityConnectors: SecurityConnectors; // (undocumented) @@ -4885,7 +4994,7 @@ export class SecurityCenter extends coreClient.ServiceClient { // (undocumented) subAssessments: SubAssessments; // (undocumented) - subscriptionGovernanceRulesExecuteStatus: SubscriptionGovernanceRulesExecuteStatus; + subscriptionGovernanceRulesOperationResult: SubscriptionGovernanceRulesOperationResult; // (undocumented) subscriptionId: string; // (undocumented) @@ -4977,8 +5086,9 @@ export type SecurityConnectorGovernanceRuleListResponse = GovernanceRuleList; // @public export interface SecurityConnectorGovernanceRules { + beginDelete(resourceGroupName: string, securityConnectorName: string, ruleId: string, options?: SecurityConnectorGovernanceRulesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, securityConnectorName: string, ruleId: string, options?: SecurityConnectorGovernanceRulesDeleteOptionalParams): Promise; createOrUpdate(resourceGroupName: string, securityConnectorName: string, ruleId: string, governanceRule: GovernanceRule, options?: SecurityConnectorGovernanceRulesCreateOrUpdateOptionalParams): Promise; - delete(resourceGroupName: string, securityConnectorName: string, ruleId: string, options?: SecurityConnectorGovernanceRulesDeleteOptionalParams): Promise; get(resourceGroupName: string, securityConnectorName: string, ruleId: string, options?: SecurityConnectorGovernanceRulesGetOptionalParams): Promise; } @@ -4990,35 +5100,39 @@ export interface SecurityConnectorGovernanceRulesCreateOrUpdateOptionalParams ex export type SecurityConnectorGovernanceRulesCreateOrUpdateResponse = GovernanceRule; // @public -export interface SecurityConnectorGovernanceRulesDeleteOptionalParams extends coreClient.OperationOptions { +export interface SecurityConnectorGovernanceRulesDeleteHeaders { + location?: string; } // @public -export interface SecurityConnectorGovernanceRulesExecuteStatus { - beginGet(resourceGroupName: string, securityConnectorName: string, ruleId: string, operationId: string, options?: SecurityConnectorGovernanceRulesExecuteStatusGetOptionalParams): Promise, SecurityConnectorGovernanceRulesExecuteStatusGetResponse>>; - beginGetAndWait(resourceGroupName: string, securityConnectorName: string, ruleId: string, operationId: string, options?: SecurityConnectorGovernanceRulesExecuteStatusGetOptionalParams): Promise; +export interface SecurityConnectorGovernanceRulesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public -export interface SecurityConnectorGovernanceRulesExecuteStatusGetHeaders { - location?: string; +export interface SecurityConnectorGovernanceRulesGetOptionalParams extends coreClient.OperationOptions { } // @public -export interface SecurityConnectorGovernanceRulesExecuteStatusGetOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; +export type SecurityConnectorGovernanceRulesGetResponse = GovernanceRule; + +// @public +export interface SecurityConnectorGovernanceRulesOperationResult { + get(resourceGroupName: string, securityConnectorName: string, ruleId: string, operationId: string, options?: SecurityConnectorGovernanceRulesOperationResultGetOptionalParams): Promise; } // @public -export type SecurityConnectorGovernanceRulesExecuteStatusGetResponse = ExecuteRuleStatus; +export interface SecurityConnectorGovernanceRulesOperationResultGetHeaders { + location?: string; +} // @public -export interface SecurityConnectorGovernanceRulesGetOptionalParams extends coreClient.OperationOptions { +export interface SecurityConnectorGovernanceRulesOperationResultGetOptionalParams extends coreClient.OperationOptions { } // @public -export type SecurityConnectorGovernanceRulesGetResponse = GovernanceRule; +export type SecurityConnectorGovernanceRulesOperationResultGetResponse = OperationResultAutoGenerated; // @public export interface SecurityConnectors { @@ -5645,24 +5759,21 @@ export type SubAssessmentStatusCode = string; export type SubPlan = string; // @public -export interface SubscriptionGovernanceRulesExecuteStatus { - beginGet(ruleId: string, operationId: string, options?: SubscriptionGovernanceRulesExecuteStatusGetOptionalParams): Promise, SubscriptionGovernanceRulesExecuteStatusGetResponse>>; - beginGetAndWait(ruleId: string, operationId: string, options?: SubscriptionGovernanceRulesExecuteStatusGetOptionalParams): Promise; +export interface SubscriptionGovernanceRulesOperationResult { + get(ruleId: string, operationId: string, options?: SubscriptionGovernanceRulesOperationResultGetOptionalParams): Promise; } // @public -export interface SubscriptionGovernanceRulesExecuteStatusGetHeaders { +export interface SubscriptionGovernanceRulesOperationResultGetHeaders { location?: string; } // @public -export interface SubscriptionGovernanceRulesExecuteStatusGetOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; +export interface SubscriptionGovernanceRulesOperationResultGetOptionalParams extends coreClient.OperationOptions { } // @public -export type SubscriptionGovernanceRulesExecuteStatusGetResponse = ExecuteRuleStatus; +export type SubscriptionGovernanceRulesOperationResultGetResponse = OperationResultAutoGenerated; // @public export type SupportedCloudEnum = string; @@ -5726,7 +5837,6 @@ export type TasksGetSubscriptionLevelTaskResponse = SecurityTask; // @public export interface TasksListByHomeRegionNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -5742,7 +5852,6 @@ export type TasksListByHomeRegionResponse = SecurityTaskList; // @public export interface TasksListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -5758,7 +5867,6 @@ export type TasksListByResourceGroupResponse = SecurityTaskList; // @public export interface TasksListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public diff --git a/sdk/security/arm-security/src/models/index.ts b/sdk/security/arm-security/src/models/index.ts index a4e105602890..db7a5aa8726d 100644 --- a/sdk/security/arm-security/src/models/index.ts +++ b/sdk/security/arm-security/src/models/index.ts @@ -1820,10 +1820,10 @@ export interface EnvironmentData { | "AzureDevOpsScope"; } -/** Page of a security governanceRules list */ +/** Page of a governance rules list */ export interface GovernanceRuleList { /** - * Collection of governanceRules in this page + * Collection of governance rules in this page * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly value?: GovernanceRule[]; @@ -1842,30 +1842,54 @@ export interface GovernanceRuleOwnerSource { value?: string; } -/** The governance email weekly notification configuration. */ +/** The governance email weekly notification configuration */ export interface GovernanceRuleEmailNotification { - /** Defines whether manager email notifications are disabled. */ + /** Defines whether manager email notifications are disabled */ disableManagerEmailNotification?: boolean; - /** Defines whether owner email notifications are disabled. */ + /** Defines whether owner email notifications are disabled */ disableOwnerEmailNotification?: boolean; } +/** The governance rule metadata */ +export interface GovernanceRuleMetadata { + /** + * Governance rule Created by object id (GUID) + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdBy?: string; + /** + * Governance rule creation date + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdOn?: Date; + /** + * Governance rule last updated by object id (GUID) + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly updatedBy?: string; + /** + * Governance rule last update date + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly updatedOn?: Date; +} + /** Governance rule execution parameters */ export interface ExecuteGovernanceRuleParams { /** Describe if governance rule should be override */ override?: boolean; } -/** Execute status of Security GovernanceRule over a given scope */ -export interface ExecuteRuleStatus { +/** Long run operation status of governance rule over a given scope */ +export interface OperationResultAutoGenerated { /** - * Unique key for the execution of GovernanceRule + * The status of the long run operation result of governance rule * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly operationId?: string; + readonly status?: OperationResult; } -/** Page of a security governance assignments list */ +/** Page of a governance assignments list */ export interface GovernanceAssignmentsList { /** * Collection of governance assignments in this page @@ -1895,13 +1919,13 @@ export interface GovernanceEmailNotification { disableOwnerEmailNotification?: boolean; } -/** Describe the additional data of GovernanceAssignment - optional */ +/** Describe the additional data of governance assignment - optional */ export interface GovernanceAssignmentAdditionalData { - /** Ticket number associated with this GovernanceAssignment */ + /** Ticket number associated with this governance assignment */ ticketNumber?: number; - /** Ticket link associated with this GovernanceAssignment - for example: https://snow.com */ + /** Ticket link associated with this governance assignment - for example: https://snow.com */ ticketLink?: string; - /** The ticket status associated with this GovernanceAssignment - for example: Active */ + /** The ticket status associated with this governance assignment - for example: Active */ ticketStatus?: string; } @@ -3377,11 +3401,16 @@ export interface Software extends Resource { firstSeenAt?: string; } -/** Security GovernanceRule over a given scope */ +/** Governance rule over a given scope */ export interface GovernanceRule extends Resource { - /** display name of the governanceRule */ + /** + * The tenantId (GUID) + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** Display name of the governance rule */ displayName?: string; - /** description of the governanceRule */ + /** Description of the governance rule */ description?: string; /** Governance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. 7.00:00:00 - means 7 days */ remediationTimeframe?: string; @@ -3395,15 +3424,21 @@ export interface GovernanceRule extends Resource { ruleType?: GovernanceRuleType; /** The governance rule source, what the rule affects, e.g. Assessments */ sourceResourceType?: GovernanceRuleSourceResourceType; + /** Excluded scopes, filter out the descendants of the scope (on management scopes) */ + excludedScopes?: string[]; /** The governance rule conditionSets - see examples */ conditionSets?: Record[]; - /** The Owner source for the governance rule - e.g. Manually by user@contoso.com - see example */ + /** Defines whether the rule is management scope rule (master connector as a single scope or management scope) */ + includeMemberScopes?: boolean; + /** The owner source for the governance rule - e.g. Manually by user@contoso.com - see example */ ownerSource?: GovernanceRuleOwnerSource; /** The email notifications settings for the governance rule, states whether to disable notifications for mangers and owners */ governanceEmailNotification?: GovernanceRuleEmailNotification; + /** The governance rule metadata */ + metadata?: GovernanceRuleMetadata; } -/** Security GovernanceAssignment over a given scope */ +/** Governance assignment over a given scope */ export interface GovernanceAssignment extends Resource { /** The Owner for the governance assignment - e.g. user@contoso.com - see example */ owner?: string; @@ -4343,14 +4378,38 @@ export interface GovernanceRulesRuleIdExecuteSingleSecurityConnectorHeaders { location?: string; } -/** Defines headers for SubscriptionGovernanceRulesExecuteStatus_get operation. */ -export interface SubscriptionGovernanceRulesExecuteStatusGetHeaders { +/** Defines headers for GovernanceRules_ruleIdExecuteSingleManagementGroup operation. */ +export interface GovernanceRulesRuleIdExecuteSingleManagementGroupHeaders { + /** Location URL for the execution status */ + location?: string; +} + +/** Defines headers for SecurityConnectorGovernanceRules_delete operation. */ +export interface SecurityConnectorGovernanceRulesDeleteHeaders { + /** Location URL for the deletion status */ + location?: string; +} + +/** Defines headers for ManagementGroupGovernanceRules_delete operation. */ +export interface ManagementGroupGovernanceRulesDeleteHeaders { + /** Location URL for the deletion status */ + location?: string; +} + +/** Defines headers for SubscriptionGovernanceRulesOperationResult_get operation. */ +export interface SubscriptionGovernanceRulesOperationResultGetHeaders { /** Location URL for the execution status */ location?: string; } -/** Defines headers for SecurityConnectorGovernanceRulesExecuteStatus_get operation. */ -export interface SecurityConnectorGovernanceRulesExecuteStatusGetHeaders { +/** Defines headers for SecurityConnectorGovernanceRulesOperationResult_get operation. */ +export interface SecurityConnectorGovernanceRulesOperationResultGetHeaders { + /** Location URL for the execution status */ + location?: string; +} + +/** Defines headers for ManagementGroupGovernanceRulesOperationResult_get operation. */ +export interface ManagementGroupGovernanceRulesOperationResultGetHeaders { /** Location URL for the execution status */ location?: string; } @@ -6590,6 +6649,27 @@ export enum KnownGovernanceRuleOwnerSourceType { */ export type GovernanceRuleOwnerSourceType = string; +/** Known values of {@link OperationResult} that the service accepts. */ +export enum KnownOperationResult { + /** The operation succeeded */ + Succeeded = "Succeeded", + /** The operation failed */ + Failed = "Failed", + /** The operation canceled */ + Canceled = "Canceled" +} + +/** + * Defines values for OperationResult. \ + * {@link KnownOperationResult} can be used interchangeably with OperationResult, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: The operation succeeded \ + * **Failed**: The operation failed \ + * **Canceled**: The operation canceled + */ +export type OperationResult = string; + /** Known values of {@link ApplicationSourceResourceType} that the service accepts. */ export enum KnownApplicationSourceResourceType { /** The source of the application is assessments */ @@ -7018,20 +7098,14 @@ export interface IotSecuritySolutionDeleteOptionalParams /** Optional parameters. */ export interface IotSecuritySolutionListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions { - /** Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listBySubscriptionNext operation. */ export type IotSecuritySolutionListBySubscriptionNextResponse = IoTSecuritySolutionsList; /** Optional parameters. */ export interface IotSecuritySolutionListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions { - /** Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByResourceGroupNext operation. */ export type IotSecuritySolutionListByResourceGroupNextResponse = IoTSecuritySolutionsList; @@ -7073,10 +7147,7 @@ export interface IotSecuritySolutionsAnalyticsAggregatedAlertDismissOptionalPara /** Optional parameters. */ export interface IotSecuritySolutionsAnalyticsAggregatedAlertListNextOptionalParams - extends coreClient.OperationOptions { - /** Number of results to retrieve. */ - top?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type IotSecuritySolutionsAnalyticsAggregatedAlertListNextResponse = IoTSecurityAggregatedAlertList; @@ -7100,10 +7171,7 @@ export type IotSecuritySolutionsAnalyticsRecommendationListResponse = IoTSecurit /** Optional parameters. */ export interface IotSecuritySolutionsAnalyticsRecommendationListNextOptionalParams - extends coreClient.OperationOptions { - /** Number of results to retrieve. */ - top?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type IotSecuritySolutionsAnalyticsRecommendationListNextResponse = IoTSecurityAggregatedRecommendationList; @@ -7196,30 +7264,21 @@ export interface TasksUpdateResourceGroupLevelTaskStateOptionalParams /** Optional parameters. */ export interface TasksListNextOptionalParams - extends coreClient.OperationOptions { - /** OData filter. Optional. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type TasksListNextResponse = SecurityTaskList; /** Optional parameters. */ export interface TasksListByHomeRegionNextOptionalParams - extends coreClient.OperationOptions { - /** OData filter. Optional. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByHomeRegionNext operation. */ export type TasksListByHomeRegionNextResponse = SecurityTaskList; /** Optional parameters. */ export interface TasksListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions { - /** OData filter. Optional. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByResourceGroupNext operation. */ export type TasksListByResourceGroupNextResponse = SecurityTaskList; @@ -7391,10 +7450,7 @@ export type RegulatoryComplianceStandardsGetResponse = RegulatoryComplianceStand /** Optional parameters. */ export interface RegulatoryComplianceStandardsListNextOptionalParams - extends coreClient.OperationOptions { - /** OData filter. Optional. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type RegulatoryComplianceStandardsListNextResponse = RegulatoryComplianceStandardList; @@ -7418,10 +7474,7 @@ export type RegulatoryComplianceControlsGetResponse = RegulatoryComplianceContro /** Optional parameters. */ export interface RegulatoryComplianceControlsListNextOptionalParams - extends coreClient.OperationOptions { - /** OData filter. Optional. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type RegulatoryComplianceControlsListNextResponse = RegulatoryComplianceControlList; @@ -7445,10 +7498,7 @@ export type RegulatoryComplianceAssessmentsGetResponse = RegulatoryComplianceAss /** Optional parameters. */ export interface RegulatoryComplianceAssessmentsListNextOptionalParams - extends coreClient.OperationOptions { - /** OData filter. Optional. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type RegulatoryComplianceAssessmentsListNextResponse = RegulatoryComplianceAssessmentList; @@ -7571,10 +7621,7 @@ export interface AlertsSuppressionRulesDeleteOptionalParams /** Optional parameters. */ export interface AlertsSuppressionRulesListNextOptionalParams - extends coreClient.OperationOptions { - /** Type of the alert to get rules for */ - alertType?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type AlertsSuppressionRulesListNextResponse = AlertsSuppressionRulesList; @@ -8035,20 +8082,14 @@ export type SecureScoreControlsListResponse = SecureScoreControlList; /** Optional parameters. */ export interface SecureScoreControlsListBySecureScoreNextOptionalParams - extends coreClient.OperationOptions { - /** OData expand. Optional. */ - expand?: ExpandControlsEnum; -} + extends coreClient.OperationOptions {} /** Contains response data for the listBySecureScoreNext operation. */ export type SecureScoreControlsListBySecureScoreNextResponse = SecureScoreControlList; /** Optional parameters. */ export interface SecureScoreControlsListNextOptionalParams - extends coreClient.OperationOptions { - /** OData expand. Optional. */ - expand?: ExpandControlsEnum; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type SecureScoreControlsListNextResponse = SecureScoreControlList; @@ -8507,7 +8548,7 @@ export interface GovernanceRulesDeleteOptionalParams /** Optional parameters. */ export interface GovernanceRulesRuleIdExecuteSingleSubscriptionOptionalParams extends coreClient.OperationOptions { - /** GovernanceRule over a subscription scope */ + /** Execute governance rule over a given scope */ executeGovernanceRuleParams?: ExecuteGovernanceRuleParams; /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -8521,7 +8562,7 @@ export type GovernanceRulesRuleIdExecuteSingleSubscriptionResponse = GovernanceR /** Optional parameters. */ export interface GovernanceRulesRuleIdExecuteSingleSecurityConnectorOptionalParams extends coreClient.OperationOptions { - /** GovernanceRule over a subscription scope */ + /** Execute governance rule over a given scope */ executeGovernanceRuleParams?: ExecuteGovernanceRuleParams; /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -8532,6 +8573,20 @@ export interface GovernanceRulesRuleIdExecuteSingleSecurityConnectorOptionalPara /** Contains response data for the ruleIdExecuteSingleSecurityConnector operation. */ export type GovernanceRulesRuleIdExecuteSingleSecurityConnectorResponse = GovernanceRulesRuleIdExecuteSingleSecurityConnectorHeaders; +/** Optional parameters. */ +export interface GovernanceRulesRuleIdExecuteSingleManagementGroupOptionalParams + extends coreClient.OperationOptions { + /** Execute governance rule over a given scope */ + executeGovernanceRuleParams?: ExecuteGovernanceRuleParams; + /** 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 ruleIdExecuteSingleManagementGroup operation. */ +export type GovernanceRulesRuleIdExecuteSingleManagementGroupResponse = GovernanceRulesRuleIdExecuteSingleManagementGroupHeaders; + /** Optional parameters. */ export interface SecurityConnectorGovernanceRuleListOptionalParams extends coreClient.OperationOptions {} @@ -8562,10 +8617,6 @@ export type SecurityConnectorGovernanceRulesCreateOrUpdateResponse = GovernanceR /** Optional parameters. */ export interface SecurityConnectorGovernanceRulesDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface SubscriptionGovernanceRulesExecuteStatusGetOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -8573,11 +8624,36 @@ export interface SubscriptionGovernanceRulesExecuteStatusGetOptionalParams resumeFrom?: string; } +/** Optional parameters. */ +export interface ManagementGroupGovernanceRuleListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ManagementGroupGovernanceRuleListResponse = GovernanceRuleList; + +/** Optional parameters. */ +export interface ManagementGroupGovernanceRuleListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ManagementGroupGovernanceRuleListNextResponse = GovernanceRuleList; + +/** Optional parameters. */ +export interface ManagementGroupGovernanceRulesGetOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the get operation. */ -export type SubscriptionGovernanceRulesExecuteStatusGetResponse = ExecuteRuleStatus; +export type ManagementGroupGovernanceRulesGetResponse = GovernanceRule; /** Optional parameters. */ -export interface SecurityConnectorGovernanceRulesExecuteStatusGetOptionalParams +export interface ManagementGroupGovernanceRulesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type ManagementGroupGovernanceRulesCreateOrUpdateResponse = GovernanceRule; + +/** Optional parameters. */ +export interface ManagementGroupGovernanceRulesDeleteOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -8585,8 +8661,29 @@ export interface SecurityConnectorGovernanceRulesExecuteStatusGetOptionalParams resumeFrom?: string; } +/** Contains response data for the delete operation. */ +export type ManagementGroupGovernanceRulesDeleteResponse = ManagementGroupGovernanceRulesDeleteHeaders; + +/** Optional parameters. */ +export interface SubscriptionGovernanceRulesOperationResultGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SubscriptionGovernanceRulesOperationResultGetResponse = OperationResultAutoGenerated; + +/** Optional parameters. */ +export interface SecurityConnectorGovernanceRulesOperationResultGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SecurityConnectorGovernanceRulesOperationResultGetResponse = OperationResultAutoGenerated; + +/** Optional parameters. */ +export interface ManagementGroupGovernanceRulesOperationResultGetOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the get operation. */ -export type SecurityConnectorGovernanceRulesExecuteStatusGetResponse = ExecuteRuleStatus; +export type ManagementGroupGovernanceRulesOperationResultGetResponse = OperationResultAutoGenerated; /** Optional parameters. */ export interface GovernanceAssignmentsListOptionalParams diff --git a/sdk/security/arm-security/src/models/mappers.ts b/sdk/security/arm-security/src/models/mappers.ts index b4ba00cdc7ad..d87579400910 100644 --- a/sdk/security/arm-security/src/models/mappers.ts +++ b/sdk/security/arm-security/src/models/mappers.ts @@ -4532,6 +4532,43 @@ export const GovernanceRuleEmailNotification: coreClient.CompositeMapper = { } }; +export const GovernanceRuleMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GovernanceRuleMetadata", + modelProperties: { + createdBy: { + serializedName: "createdBy", + readOnly: true, + type: { + name: "String" + } + }, + createdOn: { + serializedName: "createdOn", + readOnly: true, + type: { + name: "DateTime" + } + }, + updatedBy: { + serializedName: "updatedBy", + readOnly: true, + type: { + name: "String" + } + }, + updatedOn: { + serializedName: "updatedOn", + readOnly: true, + type: { + name: "DateTime" + } + } + } + } +}; + export const ExecuteGovernanceRuleParams: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4547,13 +4584,13 @@ export const ExecuteGovernanceRuleParams: coreClient.CompositeMapper = { } }; -export const ExecuteRuleStatus: coreClient.CompositeMapper = { +export const OperationResultAutoGenerated: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ExecuteRuleStatus", + className: "OperationResultAutoGenerated", modelProperties: { - operationId: { - serializedName: "operationId", + status: { + serializedName: "status", readOnly: true, type: { name: "String" @@ -8127,6 +8164,13 @@ export const GovernanceRule: coreClient.CompositeMapper = { className: "GovernanceRule", modelProperties: { ...Resource.type.modelProperties, + tenantId: { + serializedName: "properties.tenantId", + readOnly: true, + type: { + name: "String" + } + }, displayName: { serializedName: "properties.displayName", type: { @@ -8140,6 +8184,9 @@ export const GovernanceRule: coreClient.CompositeMapper = { } }, remediationTimeframe: { + constraints: { + Pattern: new RegExp("^[0-9]+\\.[0-9]{2}:[0-9]{2}:[0-9]{2}$") + }, serializedName: "properties.remediationTimeframe", type: { name: "String" @@ -8179,6 +8226,17 @@ export const GovernanceRule: coreClient.CompositeMapper = { name: "String" } }, + excludedScopes: { + serializedName: "properties.excludedScopes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, conditionSets: { serializedName: "properties.conditionSets", type: { @@ -8191,6 +8249,12 @@ export const GovernanceRule: coreClient.CompositeMapper = { } } }, + includeMemberScopes: { + serializedName: "properties.includeMemberScopes", + type: { + name: "Boolean" + } + }, ownerSource: { serializedName: "properties.ownerSource", type: { @@ -8204,6 +8268,13 @@ export const GovernanceRule: coreClient.CompositeMapper = { name: "Composite", className: "GovernanceRuleEmailNotification" } + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "Composite", + className: "GovernanceRuleMetadata" + } } } } @@ -10483,10 +10554,70 @@ export const GovernanceRulesRuleIdExecuteSingleSecurityConnectorHeaders: coreCli } }; -export const SubscriptionGovernanceRulesExecuteStatusGetHeaders: coreClient.CompositeMapper = { +export const GovernanceRulesRuleIdExecuteSingleManagementGroupHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GovernanceRulesRuleIdExecuteSingleManagementGroupHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const SecurityConnectorGovernanceRulesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SecurityConnectorGovernanceRulesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ManagementGroupGovernanceRulesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagementGroupGovernanceRulesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const SubscriptionGovernanceRulesOperationResultGetHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubscriptionGovernanceRulesOperationResultGetHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const SecurityConnectorGovernanceRulesOperationResultGetHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SubscriptionGovernanceRulesExecuteStatusGetHeaders", + className: "SecurityConnectorGovernanceRulesOperationResultGetHeaders", modelProperties: { location: { serializedName: "location", @@ -10498,10 +10629,10 @@ export const SubscriptionGovernanceRulesExecuteStatusGetHeaders: coreClient.Comp } }; -export const SecurityConnectorGovernanceRulesExecuteStatusGetHeaders: coreClient.CompositeMapper = { +export const ManagementGroupGovernanceRulesOperationResultGetHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SecurityConnectorGovernanceRulesExecuteStatusGetHeaders", + className: "ManagementGroupGovernanceRulesOperationResultGetHeaders", modelProperties: { location: { serializedName: "location", diff --git a/sdk/security/arm-security/src/models/parameters.ts b/sdk/security/arm-security/src/models/parameters.ts index 29b7aecd6c98..9408e794cbe1 100644 --- a/sdk/security/arm-security/src/models/parameters.ts +++ b/sdk/security/arm-security/src/models/parameters.ts @@ -1140,6 +1140,31 @@ export const executeGovernanceRuleParams: OperationParameter = { mapper: ExecuteGovernanceRuleParamsMapper }; +export const securityConnectorName1: OperationURLParameter = { + parameterPath: "securityConnectorName", + mapper: { + constraints: { + Pattern: new RegExp("^[-\\w\\._\\(\\)]+$") + }, + serializedName: "securityConnectorName", + required: true, + type: { + name: "String" + } + } +}; + +export const managementGroupId: OperationURLParameter = { + parameterPath: "managementGroupId", + mapper: { + serializedName: "managementGroupId", + required: true, + type: { + name: "String" + } + } +}; + export const operationId: OperationURLParameter = { parameterPath: "operationId", mapper: { @@ -1151,6 +1176,20 @@ export const operationId: OperationURLParameter = { } }; +export const assessmentName1: OperationURLParameter = { + parameterPath: "assessmentName", + mapper: { + constraints: { + Pattern: new RegExp("^[-\\w\\._\\(\\)]+$") + }, + serializedName: "assessmentName", + required: true, + type: { + name: "String" + } + } +}; + export const assignmentKey: OperationURLParameter = { parameterPath: "assignmentKey", mapper: { diff --git a/sdk/security/arm-security/src/operations/aPICollection.ts b/sdk/security/arm-security/src/operations/aPICollection.ts index 39ccc106ba86..d0d3ffc2d719 100644 --- a/sdk/security/arm-security/src/operations/aPICollection.ts +++ b/sdk/security/arm-security/src/operations/aPICollection.ts @@ -236,7 +236,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion20], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/adaptiveNetworkHardenings.ts b/sdk/security/arm-security/src/operations/adaptiveNetworkHardenings.ts index 969049678fd5..4cafeeab68fb 100644 --- a/sdk/security/arm-security/src/operations/adaptiveNetworkHardenings.ts +++ b/sdk/security/arm-security/src/operations/adaptiveNetworkHardenings.ts @@ -438,7 +438,6 @@ const listByExtendedResourceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/alerts.ts b/sdk/security/arm-security/src/operations/alerts.ts index 3c611b84603b..76cc977d62e8 100644 --- a/sdk/security/arm-security/src/operations/alerts.ts +++ b/sdk/security/arm-security/src/operations/alerts.ts @@ -1089,7 +1089,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1109,7 +1108,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1130,7 +1128,6 @@ const listSubscriptionLevelByRegionNextOperationSpec: coreClient.OperationSpec = bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1151,7 +1148,6 @@ const listResourceGroupLevelByRegionNextOperationSpec: coreClient.OperationSpec bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion13], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/alertsSuppressionRules.ts b/sdk/security/arm-security/src/operations/alertsSuppressionRules.ts index b90563386809..9707f392e809 100644 --- a/sdk/security/arm-security/src/operations/alertsSuppressionRules.ts +++ b/sdk/security/arm-security/src/operations/alertsSuppressionRules.ts @@ -259,7 +259,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion9, Parameters.alertType], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/allowedConnections.ts b/sdk/security/arm-security/src/operations/allowedConnections.ts index 74c87b498b2d..b215dfc24d43 100644 --- a/sdk/security/arm-security/src/operations/allowedConnections.ts +++ b/sdk/security/arm-security/src/operations/allowedConnections.ts @@ -317,7 +317,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -337,7 +336,6 @@ const listByHomeRegionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/applications.ts b/sdk/security/arm-security/src/operations/applications.ts index 089098026c88..6966dc836383 100644 --- a/sdk/security/arm-security/src/operations/applications.ts +++ b/sdk/security/arm-security/src/operations/applications.ts @@ -144,7 +144,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion19], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/assessments.ts b/sdk/security/arm-security/src/operations/assessments.ts index 1c9aaadd1d22..110da9064271 100644 --- a/sdk/security/arm-security/src/operations/assessments.ts +++ b/sdk/security/arm-security/src/operations/assessments.ts @@ -288,7 +288,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion11], urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope], headerParameters: [Parameters.accept], serializer diff --git a/sdk/security/arm-security/src/operations/assessmentsMetadata.ts b/sdk/security/arm-security/src/operations/assessmentsMetadata.ts index 7ba2627c3d1b..9d98a0c7c3c0 100644 --- a/sdk/security/arm-security/src/operations/assessmentsMetadata.ts +++ b/sdk/security/arm-security/src/operations/assessmentsMetadata.ts @@ -396,7 +396,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion11], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer @@ -412,7 +411,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion11], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/autoProvisioningSettings.ts b/sdk/security/arm-security/src/operations/autoProvisioningSettings.ts index 477d3951fb1b..3a858981f895 100644 --- a/sdk/security/arm-security/src/operations/autoProvisioningSettings.ts +++ b/sdk/security/arm-security/src/operations/autoProvisioningSettings.ts @@ -224,7 +224,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion7], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/automations.ts b/sdk/security/arm-security/src/operations/automations.ts index 68b96a1066c3..d1ae70f8e892 100644 --- a/sdk/security/arm-security/src/operations/automations.ts +++ b/sdk/security/arm-security/src/operations/automations.ts @@ -455,7 +455,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion9], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -475,7 +474,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion9], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/complianceResults.ts b/sdk/security/arm-security/src/operations/complianceResults.ts index 658300395eed..44cadb1805ba 100644 --- a/sdk/security/arm-security/src/operations/complianceResults.ts +++ b/sdk/security/arm-security/src/operations/complianceResults.ts @@ -200,7 +200,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion2], urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope], headerParameters: [Parameters.accept], serializer diff --git a/sdk/security/arm-security/src/operations/compliances.ts b/sdk/security/arm-security/src/operations/compliances.ts index 3881d6b2afd0..54c541dbb0e3 100644 --- a/sdk/security/arm-security/src/operations/compliances.ts +++ b/sdk/security/arm-security/src/operations/compliances.ts @@ -201,7 +201,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion7], urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope], headerParameters: [Parameters.accept], serializer diff --git a/sdk/security/arm-security/src/operations/connectors.ts b/sdk/security/arm-security/src/operations/connectors.ts index f158339dbadc..5995d526584a 100644 --- a/sdk/security/arm-security/src/operations/connectors.ts +++ b/sdk/security/arm-security/src/operations/connectors.ts @@ -262,7 +262,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion8], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/customAssessmentAutomations.ts b/sdk/security/arm-security/src/operations/customAssessmentAutomations.ts index 5cb27bd84b4d..205651bcc128 100644 --- a/sdk/security/arm-security/src/operations/customAssessmentAutomations.ts +++ b/sdk/security/arm-security/src/operations/customAssessmentAutomations.ts @@ -415,7 +415,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -436,7 +435,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/customEntityStoreAssignments.ts b/sdk/security/arm-security/src/operations/customEntityStoreAssignments.ts index 6053f992baee..9d1635250f18 100644 --- a/sdk/security/arm-security/src/operations/customEntityStoreAssignments.ts +++ b/sdk/security/arm-security/src/operations/customEntityStoreAssignments.ts @@ -418,7 +418,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -439,7 +438,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/deviceSecurityGroups.ts b/sdk/security/arm-security/src/operations/deviceSecurityGroups.ts index 1973fed41420..dff72ed8831d 100644 --- a/sdk/security/arm-security/src/operations/deviceSecurityGroups.ts +++ b/sdk/security/arm-security/src/operations/deviceSecurityGroups.ts @@ -282,7 +282,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion5], urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.resourceId], headerParameters: [Parameters.accept], serializer diff --git a/sdk/security/arm-security/src/operations/discoveredSecuritySolutions.ts b/sdk/security/arm-security/src/operations/discoveredSecuritySolutions.ts index 0bc7fd9e81b1..5987441df671 100644 --- a/sdk/security/arm-security/src/operations/discoveredSecuritySolutions.ts +++ b/sdk/security/arm-security/src/operations/discoveredSecuritySolutions.ts @@ -321,7 +321,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -341,7 +340,6 @@ const listByHomeRegionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/externalSecuritySolutions.ts b/sdk/security/arm-security/src/operations/externalSecuritySolutions.ts index 4c6438c391c9..e0e2b19cf495 100644 --- a/sdk/security/arm-security/src/operations/externalSecuritySolutions.ts +++ b/sdk/security/arm-security/src/operations/externalSecuritySolutions.ts @@ -321,7 +321,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -341,7 +340,6 @@ const listByHomeRegionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/governanceAssignments.ts b/sdk/security/arm-security/src/operations/governanceAssignments.ts index 31f0228ed73e..6adbc6f358b0 100644 --- a/sdk/security/arm-security/src/operations/governanceAssignments.ts +++ b/sdk/security/arm-security/src/operations/governanceAssignments.ts @@ -40,11 +40,11 @@ export class GovernanceAssignmentsImpl implements GovernanceAssignments { } /** - * Get security governanceAssignments on all your resources inside a scope + * Get governance assignments on all of your resources inside a scope * @param scope Scope of the query, can be subscription * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group * (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type + * @param assessmentName The Assessment Key - A unique key for the assessment type * @param options The options parameters. */ public list( @@ -113,11 +113,11 @@ export class GovernanceAssignmentsImpl implements GovernanceAssignments { } /** - * Get security governanceAssignments on all your resources inside a scope + * Get governance assignments on all of your resources inside a scope * @param scope Scope of the query, can be subscription * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group * (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type + * @param assessmentName The Assessment Key - A unique key for the assessment type * @param options The options parameters. */ private _list( @@ -136,9 +136,9 @@ export class GovernanceAssignmentsImpl implements GovernanceAssignments { * @param scope Scope of the query, can be subscription * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group * (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type - * @param assignmentKey The security governance assignment key - the assessment key of the required - * governance assignment + * @param assessmentName The Assessment Key - A unique key for the assessment type + * @param assignmentKey The governance assignment key - the assessment key of the required governance + * assignment * @param options The options parameters. */ get( @@ -154,14 +154,14 @@ export class GovernanceAssignmentsImpl implements GovernanceAssignments { } /** - * Creates or update a security GovernanceAssignment on the given subscription. + * Creates or updates a governance assignment on the given subscription. * @param scope Scope of the query, can be subscription * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group * (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type - * @param assignmentKey The security governance assignment key - the assessment key of the required - * governance assignment - * @param governanceAssignment GovernanceAssignment over a subscription scope + * @param assessmentName The Assessment Key - A unique key for the assessment type + * @param assignmentKey The governance assignment key - the assessment key of the required governance + * assignment + * @param governanceAssignment Governance assignment over a subscription scope * @param options The options parameters. */ createOrUpdate( @@ -182,9 +182,9 @@ export class GovernanceAssignmentsImpl implements GovernanceAssignments { * @param scope Scope of the query, can be subscription * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group * (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type - * @param assignmentKey The security governance assignment key - the assessment key of the required - * governance assignment + * @param assessmentName The Assessment Key - A unique key for the assessment type + * @param assignmentKey The governance assignment key - the assessment key of the required governance + * assignment * @param options The options parameters. */ delete( @@ -204,7 +204,7 @@ export class GovernanceAssignmentsImpl implements GovernanceAssignments { * @param scope Scope of the query, can be subscription * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group * (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type + * @param assessmentName The Assessment Key - A unique key for the assessment type * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ @@ -239,7 +239,7 @@ const listOperationSpec: coreClient.OperationSpec = { urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.assessmentName + Parameters.assessmentName1 ], headerParameters: [Parameters.accept], serializer @@ -260,7 +260,7 @@ const getOperationSpec: coreClient.OperationSpec = { urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.assessmentName, + Parameters.assessmentName1, Parameters.assignmentKey ], headerParameters: [Parameters.accept], @@ -286,7 +286,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.assessmentName, + Parameters.assessmentName1, Parameters.assignmentKey ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -302,7 +302,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { urlParameters: [ Parameters.$host, Parameters.scope, - Parameters.assessmentName, + Parameters.assessmentName1, Parameters.assignmentKey ], serializer @@ -318,12 +318,11 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion18], urlParameters: [ Parameters.$host, Parameters.nextLink, Parameters.scope, - Parameters.assessmentName + Parameters.assessmentName1 ], headerParameters: [Parameters.accept], serializer diff --git a/sdk/security/arm-security/src/operations/governanceRuleOperations.ts b/sdk/security/arm-security/src/operations/governanceRuleOperations.ts index 7570f62f879b..85952a16bf81 100644 --- a/sdk/security/arm-security/src/operations/governanceRuleOperations.ts +++ b/sdk/security/arm-security/src/operations/governanceRuleOperations.ts @@ -35,7 +35,7 @@ export class GovernanceRuleOperationsImpl implements GovernanceRuleOperations { } /** - * Get a list of all relevant governanceRules over a subscription level scope + * Get a list of the governance rules on the subscription level scope * @param options The options parameters. */ public list( @@ -89,7 +89,7 @@ export class GovernanceRuleOperationsImpl implements GovernanceRuleOperations { } /** - * Get a list of all relevant governanceRules over a subscription level scope + * Get a list of the governance rules on the subscription level scope * @param options The options parameters. */ private _list( @@ -144,7 +144,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion18], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/governanceRules.ts b/sdk/security/arm-security/src/operations/governanceRules.ts index ddba6a77af68..e45e7fa2067e 100644 --- a/sdk/security/arm-security/src/operations/governanceRules.ts +++ b/sdk/security/arm-security/src/operations/governanceRules.ts @@ -23,7 +23,9 @@ import { GovernanceRulesRuleIdExecuteSingleSubscriptionOptionalParams, GovernanceRulesRuleIdExecuteSingleSubscriptionResponse, GovernanceRulesRuleIdExecuteSingleSecurityConnectorOptionalParams, - GovernanceRulesRuleIdExecuteSingleSecurityConnectorResponse + GovernanceRulesRuleIdExecuteSingleSecurityConnectorResponse, + GovernanceRulesRuleIdExecuteSingleManagementGroupOptionalParams, + GovernanceRulesRuleIdExecuteSingleManagementGroupResponse } from "../models"; /** Class containing GovernanceRules operations. */ @@ -39,8 +41,8 @@ export class GovernanceRulesImpl implements GovernanceRules { } /** - * Get a specific governanceRule for the requested scope by ruleId - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule + * Get a specific governance rule for the requested scope by ruleId + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) * @param options The options parameters. */ get( @@ -54,9 +56,9 @@ export class GovernanceRulesImpl implements GovernanceRules { } /** - * Creates or update a security GovernanceRule on the given subscription. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule - * @param governanceRule GovernanceRule over a subscription scope + * Creates or updates a governance rule on a subscription + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param governanceRule Governance rule over a given scope * @param options The options parameters. */ createOrUpdate( @@ -71,8 +73,8 @@ export class GovernanceRulesImpl implements GovernanceRules { } /** - * Delete a GovernanceRule over a given scope - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule + * Delete a Governance rule over a given scope + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) * @param options The options parameters. */ delete( @@ -86,8 +88,8 @@ export class GovernanceRulesImpl implements GovernanceRules { } /** - * Execute a security GovernanceRule on the given subscription. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule + * Execute a governance rule on a subscription + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) * @param options The options parameters. */ async beginRuleIdExecuteSingleSubscription( @@ -147,15 +149,16 @@ export class GovernanceRulesImpl implements GovernanceRules { ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" }); await poller.poll(); return poller; } /** - * Execute a security GovernanceRule on the given subscription. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule + * Execute a governance rule on a subscription + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) * @param options The options parameters. */ async beginRuleIdExecuteSingleSubscriptionAndWait( @@ -170,11 +173,11 @@ export class GovernanceRulesImpl implements GovernanceRules { } /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule on the given security connector * @param resourceGroupName The name of the resource group within the user's subscription. The name is * case insensitive. * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) * @param options The options parameters. */ async beginRuleIdExecuteSingleSecurityConnector( @@ -236,18 +239,19 @@ export class GovernanceRulesImpl implements GovernanceRules { ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" }); await poller.poll(); return poller; } /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule on the given security connector * @param resourceGroupName The name of the resource group within the user's subscription. The name is * case insensitive. * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) * @param options The options parameters. */ async beginRuleIdExecuteSingleSecurityConnectorAndWait( @@ -264,6 +268,91 @@ export class GovernanceRulesImpl implements GovernanceRules { ); return poller.pollUntilDone(); } + + /** + * Execute governance rule on the given management group + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param options The options parameters. + */ + async beginRuleIdExecuteSingleManagementGroup( + ruleId: string, + options?: GovernanceRulesRuleIdExecuteSingleManagementGroupOptionalParams + ): Promise< + PollerLike< + PollOperationState< + GovernanceRulesRuleIdExecuteSingleManagementGroupResponse + >, + GovernanceRulesRuleIdExecuteSingleManagementGroupResponse + > + > { + 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, + { ruleId, options }, + ruleIdExecuteSingleManagementGroupOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Execute governance rule on the given management group + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param options The options parameters. + */ + async beginRuleIdExecuteSingleManagementGroupAndWait( + ruleId: string, + options?: GovernanceRulesRuleIdExecuteSingleManagementGroupOptionalParams + ): Promise { + const poller = await this.beginRuleIdExecuteSingleManagementGroup( + ruleId, + options + ); + return poller.pollUntilDone(); + } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); @@ -396,7 +485,43 @@ const ruleIdExecuteSingleSecurityConnectorOperationSpec: coreClient.OperationSpe Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.ruleId, - Parameters.securityConnectorName + Parameters.securityConnectorName1 + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const ruleIdExecuteSingleManagementGroupOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute", + httpMethod: "POST", + responses: { + 200: { + headersMapper: + Mappers.GovernanceRulesRuleIdExecuteSingleManagementGroupHeaders + }, + 201: { + headersMapper: + Mappers.GovernanceRulesRuleIdExecuteSingleManagementGroupHeaders + }, + 202: { + headersMapper: + Mappers.GovernanceRulesRuleIdExecuteSingleManagementGroupHeaders + }, + 204: { + headersMapper: + Mappers.GovernanceRulesRuleIdExecuteSingleManagementGroupHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.executeGovernanceRuleParams, + queryParameters: [Parameters.apiVersion18], + urlParameters: [ + Parameters.$host, + Parameters.ruleId, + Parameters.managementGroupId ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", diff --git a/sdk/security/arm-security/src/operations/index.ts b/sdk/security/arm-security/src/operations/index.ts index ffcf4dbbb7d0..488f7fdc253a 100644 --- a/sdk/security/arm-security/src/operations/index.ts +++ b/sdk/security/arm-security/src/operations/index.ts @@ -59,8 +59,11 @@ export * from "./governanceRuleOperations"; export * from "./governanceRules"; export * from "./securityConnectorGovernanceRule"; export * from "./securityConnectorGovernanceRules"; -export * from "./subscriptionGovernanceRulesExecuteStatus"; -export * from "./securityConnectorGovernanceRulesExecuteStatus"; +export * from "./managementGroupGovernanceRule"; +export * from "./managementGroupGovernanceRules"; +export * from "./subscriptionGovernanceRulesOperationResult"; +export * from "./securityConnectorGovernanceRulesOperationResult"; +export * from "./managementGroupGovernanceRulesOperationResult"; export * from "./governanceAssignments"; export * from "./applications"; export * from "./applicationOperations"; diff --git a/sdk/security/arm-security/src/operations/informationProtectionPolicies.ts b/sdk/security/arm-security/src/operations/informationProtectionPolicies.ts index 308b5aad1276..b84d1057f415 100644 --- a/sdk/security/arm-security/src/operations/informationProtectionPolicies.ts +++ b/sdk/security/arm-security/src/operations/informationProtectionPolicies.ts @@ -258,7 +258,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion7], urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope], headerParameters: [Parameters.accept], serializer diff --git a/sdk/security/arm-security/src/operations/ingestionSettings.ts b/sdk/security/arm-security/src/operations/ingestionSettings.ts index 20e49b6265d6..a5a70435a413 100644 --- a/sdk/security/arm-security/src/operations/ingestionSettings.ts +++ b/sdk/security/arm-security/src/operations/ingestionSettings.ts @@ -341,7 +341,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion15], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/iotSecuritySolution.ts b/sdk/security/arm-security/src/operations/iotSecuritySolution.ts index da2006151614..c739e757ffd8 100644 --- a/sdk/security/arm-security/src/operations/iotSecuritySolution.ts +++ b/sdk/security/arm-security/src/operations/iotSecuritySolution.ts @@ -460,7 +460,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion5, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -480,7 +479,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion5, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/iotSecuritySolutionsAnalyticsAggregatedAlert.ts b/sdk/security/arm-security/src/operations/iotSecuritySolutionsAnalyticsAggregatedAlert.ts index 591232afc82d..e146144ab92b 100644 --- a/sdk/security/arm-security/src/operations/iotSecuritySolutionsAnalyticsAggregatedAlert.ts +++ b/sdk/security/arm-security/src/operations/iotSecuritySolutionsAnalyticsAggregatedAlert.ts @@ -274,7 +274,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion5, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/iotSecuritySolutionsAnalyticsRecommendation.ts b/sdk/security/arm-security/src/operations/iotSecuritySolutionsAnalyticsRecommendation.ts index 17f16039df73..afd26f8fa0f0 100644 --- a/sdk/security/arm-security/src/operations/iotSecuritySolutionsAnalyticsRecommendation.ts +++ b/sdk/security/arm-security/src/operations/iotSecuritySolutionsAnalyticsRecommendation.ts @@ -239,7 +239,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion5, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/jitNetworkAccessPolicies.ts b/sdk/security/arm-security/src/operations/jitNetworkAccessPolicies.ts index d1787f5f575f..695dade9ea3d 100644 --- a/sdk/security/arm-security/src/operations/jitNetworkAccessPolicies.ts +++ b/sdk/security/arm-security/src/operations/jitNetworkAccessPolicies.ts @@ -755,7 +755,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -775,7 +774,6 @@ const listByRegionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -796,7 +794,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -817,7 +814,6 @@ const listByResourceGroupAndRegionNextOperationSpec: coreClient.OperationSpec = bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/locations.ts b/sdk/security/arm-security/src/operations/locations.ts index 4331121b098f..0fb76877e4af 100644 --- a/sdk/security/arm-security/src/operations/locations.ts +++ b/sdk/security/arm-security/src/operations/locations.ts @@ -187,7 +187,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion6], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/managementGroupGovernanceRule.ts b/sdk/security/arm-security/src/operations/managementGroupGovernanceRule.ts new file mode 100644 index 000000000000..d40351eba45c --- /dev/null +++ b/sdk/security/arm-security/src/operations/managementGroupGovernanceRule.ts @@ -0,0 +1,155 @@ +/* + * 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 { ManagementGroupGovernanceRule } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { SecurityCenter } from "../securityCenter"; +import { + GovernanceRule, + ManagementGroupGovernanceRuleListNextOptionalParams, + ManagementGroupGovernanceRuleListOptionalParams, + ManagementGroupGovernanceRuleListResponse, + ManagementGroupGovernanceRuleListNextResponse +} from "../models"; + +/// +/** Class containing ManagementGroupGovernanceRule operations. */ +export class ManagementGroupGovernanceRuleImpl + implements ManagementGroupGovernanceRule { + private readonly client: SecurityCenter; + + /** + * Initialize a new instance of the class ManagementGroupGovernanceRule class. + * @param client Reference to the service client + */ + constructor(client: SecurityCenter) { + this.client = client; + } + + /** + * Get a list of all relevant governance rules over a management group level scope + * @param options The options parameters. + */ + public list( + options?: ManagementGroupGovernanceRuleListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(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(options, settings); + } + }; + } + + private async *listPagingPage( + options?: ManagementGroupGovernanceRuleListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ManagementGroupGovernanceRuleListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: ManagementGroupGovernanceRuleListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Get a list of all relevant governance rules over a management group level scope + * @param options The options parameters. + */ + private _list( + options?: ManagementGroupGovernanceRuleListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: ManagementGroupGovernanceRuleListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GovernanceRuleList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion18], + urlParameters: [Parameters.$host, Parameters.managementGroupId], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GovernanceRuleList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.managementGroupId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/security/arm-security/src/operations/managementGroupGovernanceRules.ts b/sdk/security/arm-security/src/operations/managementGroupGovernanceRules.ts new file mode 100644 index 000000000000..e72b00990712 --- /dev/null +++ b/sdk/security/arm-security/src/operations/managementGroupGovernanceRules.ts @@ -0,0 +1,227 @@ +/* + * 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 { ManagementGroupGovernanceRules } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { SecurityCenter } from "../securityCenter"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ManagementGroupGovernanceRulesGetOptionalParams, + ManagementGroupGovernanceRulesGetResponse, + GovernanceRule, + ManagementGroupGovernanceRulesCreateOrUpdateOptionalParams, + ManagementGroupGovernanceRulesCreateOrUpdateResponse, + ManagementGroupGovernanceRulesDeleteOptionalParams, + ManagementGroupGovernanceRulesDeleteResponse +} from "../models"; + +/** Class containing ManagementGroupGovernanceRules operations. */ +export class ManagementGroupGovernanceRulesImpl + implements ManagementGroupGovernanceRules { + private readonly client: SecurityCenter; + + /** + * Initialize a new instance of the class ManagementGroupGovernanceRules class. + * @param client Reference to the service client + */ + constructor(client: SecurityCenter) { + this.client = client; + } + + /** + * Get a specific governance rule for the requested scope by ruleId + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param options The options parameters. + */ + get( + ruleId: string, + options?: ManagementGroupGovernanceRulesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { ruleId, options }, + getOperationSpec + ); + } + + /** + * Creates or updates governance rule on the given management group + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param governanceRule Governance rule over a given scope + * @param options The options parameters. + */ + createOrUpdate( + ruleId: string, + governanceRule: GovernanceRule, + options?: ManagementGroupGovernanceRulesCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { ruleId, governanceRule, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Delete a Governance rule over a given scope + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param options The options parameters. + */ + async beginDelete( + ruleId: string, + options?: ManagementGroupGovernanceRulesDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ManagementGroupGovernanceRulesDeleteResponse + > + > { + 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, + { ruleId, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Delete a Governance rule over a given scope + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param options The options parameters. + */ + async beginDeleteAndWait( + ruleId: string, + options?: ManagementGroupGovernanceRulesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete(ruleId, options); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GovernanceRule + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion18], + urlParameters: [ + Parameters.$host, + Parameters.ruleId, + Parameters.managementGroupId + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.GovernanceRule + }, + 201: { + bodyMapper: Mappers.GovernanceRule + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.governanceRule, + queryParameters: [Parameters.apiVersion18], + urlParameters: [ + Parameters.$host, + Parameters.ruleId, + Parameters.managementGroupId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.ManagementGroupGovernanceRulesDeleteHeaders + }, + 201: { + headersMapper: Mappers.ManagementGroupGovernanceRulesDeleteHeaders + }, + 202: { + headersMapper: Mappers.ManagementGroupGovernanceRulesDeleteHeaders + }, + 204: { + headersMapper: Mappers.ManagementGroupGovernanceRulesDeleteHeaders + }, + default: {} + }, + queryParameters: [Parameters.apiVersion18], + urlParameters: [ + Parameters.$host, + Parameters.ruleId, + Parameters.managementGroupId + ], + serializer +}; diff --git a/sdk/security/arm-security/src/operations/managementGroupGovernanceRulesOperationResult.ts b/sdk/security/arm-security/src/operations/managementGroupGovernanceRulesOperationResult.ts new file mode 100644 index 000000000000..2527f3ddcccd --- /dev/null +++ b/sdk/security/arm-security/src/operations/managementGroupGovernanceRulesOperationResult.ts @@ -0,0 +1,78 @@ +/* + * 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 { ManagementGroupGovernanceRulesOperationResult } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { SecurityCenter } from "../securityCenter"; +import { + ManagementGroupGovernanceRulesOperationResultGetOptionalParams, + ManagementGroupGovernanceRulesOperationResultGetResponse +} from "../models"; + +/** Class containing ManagementGroupGovernanceRulesOperationResult operations. */ +export class ManagementGroupGovernanceRulesOperationResultImpl + implements ManagementGroupGovernanceRulesOperationResult { + private readonly client: SecurityCenter; + + /** + * Initialize a new instance of the class ManagementGroupGovernanceRulesOperationResult class. + * @param client Reference to the service client + */ + constructor(client: SecurityCenter) { + this.client = client; + } + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param operationId The governance rule execution key - unique key for the execution of governance + * rule + * @param options The options parameters. + */ + get( + ruleId: string, + operationId: string, + options?: ManagementGroupGovernanceRulesOperationResultGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { ruleId, operationId, options }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationResultAutoGenerated + }, + 202: { + headersMapper: + Mappers.ManagementGroupGovernanceRulesOperationResultGetHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion18], + urlParameters: [ + Parameters.$host, + Parameters.ruleId, + Parameters.managementGroupId, + Parameters.operationId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/security/arm-security/src/operations/operations.ts b/sdk/security/arm-security/src/operations/operations.ts index 5d26baaa3bc5..ed9a01091a19 100644 --- a/sdk/security/arm-security/src/operations/operations.ts +++ b/sdk/security/arm-security/src/operations/operations.ts @@ -143,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion6], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer diff --git a/sdk/security/arm-security/src/operations/regulatoryComplianceAssessments.ts b/sdk/security/arm-security/src/operations/regulatoryComplianceAssessments.ts index 257e1f1ed673..5ec66a21bbd3 100644 --- a/sdk/security/arm-security/src/operations/regulatoryComplianceAssessments.ts +++ b/sdk/security/arm-security/src/operations/regulatoryComplianceAssessments.ts @@ -249,7 +249,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion9], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/regulatoryComplianceControls.ts b/sdk/security/arm-security/src/operations/regulatoryComplianceControls.ts index eac6a49052c7..74695b81a4f2 100644 --- a/sdk/security/arm-security/src/operations/regulatoryComplianceControls.ts +++ b/sdk/security/arm-security/src/operations/regulatoryComplianceControls.ts @@ -216,7 +216,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion9], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/regulatoryComplianceStandards.ts b/sdk/security/arm-security/src/operations/regulatoryComplianceStandards.ts index 2bd2b46c852f..e8d0465dd088 100644 --- a/sdk/security/arm-security/src/operations/regulatoryComplianceStandards.ts +++ b/sdk/security/arm-security/src/operations/regulatoryComplianceStandards.ts @@ -183,7 +183,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion9], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/secureScoreControlDefinitions.ts b/sdk/security/arm-security/src/operations/secureScoreControlDefinitions.ts index 920a0d6dc310..a717baec1347 100644 --- a/sdk/security/arm-security/src/operations/secureScoreControlDefinitions.ts +++ b/sdk/security/arm-security/src/operations/secureScoreControlDefinitions.ts @@ -249,7 +249,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer @@ -265,7 +264,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/secureScoreControls.ts b/sdk/security/arm-security/src/operations/secureScoreControls.ts index 554b30125fcb..4416bf891b4a 100644 --- a/sdk/security/arm-security/src/operations/secureScoreControls.ts +++ b/sdk/security/arm-security/src/operations/secureScoreControls.ts @@ -273,7 +273,6 @@ const listBySecureScoreNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10, Parameters.expand1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -294,7 +293,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10, Parameters.expand1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/secureScores.ts b/sdk/security/arm-security/src/operations/secureScores.ts index cd92d5be5942..3a56bf03f5ae 100644 --- a/sdk/security/arm-security/src/operations/secureScores.ts +++ b/sdk/security/arm-security/src/operations/secureScores.ts @@ -184,7 +184,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/securityConnectorApplications.ts b/sdk/security/arm-security/src/operations/securityConnectorApplications.ts index 2b73284961b7..36adcf0c2084 100644 --- a/sdk/security/arm-security/src/operations/securityConnectorApplications.ts +++ b/sdk/security/arm-security/src/operations/securityConnectorApplications.ts @@ -194,7 +194,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion19], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/securityConnectorGovernanceRule.ts b/sdk/security/arm-security/src/operations/securityConnectorGovernanceRule.ts index 20863977505a..a2eb2dd81ced 100644 --- a/sdk/security/arm-security/src/operations/securityConnectorGovernanceRule.ts +++ b/sdk/security/arm-security/src/operations/securityConnectorGovernanceRule.ts @@ -36,7 +36,7 @@ export class SecurityConnectorGovernanceRuleImpl } /** - * Get a list of all relevant governanceRules over a security connector level scope + * Get a list of all relevant governance rules over a security connector level scope * @param resourceGroupName The name of the resource group within the user's subscription. The name is * case insensitive. * @param securityConnectorName The security connector name. @@ -121,7 +121,7 @@ export class SecurityConnectorGovernanceRuleImpl } /** - * Get a list of all relevant governanceRules over a security connector level scope + * Get a list of all relevant governance rules over a security connector level scope * @param resourceGroupName The name of the resource group within the user's subscription. The name is * case insensitive. * @param securityConnectorName The security connector name. @@ -178,7 +178,7 @@ const listOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.securityConnectorName + Parameters.securityConnectorName1 ], headerParameters: [Parameters.accept], serializer @@ -194,13 +194,12 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion18], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.nextLink, - Parameters.securityConnectorName + Parameters.securityConnectorName1 ], headerParameters: [Parameters.accept], serializer diff --git a/sdk/security/arm-security/src/operations/securityConnectorGovernanceRules.ts b/sdk/security/arm-security/src/operations/securityConnectorGovernanceRules.ts index 7496358d926b..ce9bdd1b2f1b 100644 --- a/sdk/security/arm-security/src/operations/securityConnectorGovernanceRules.ts +++ b/sdk/security/arm-security/src/operations/securityConnectorGovernanceRules.ts @@ -11,6 +11,8 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { SecurityCenter } from "../securityCenter"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; import { SecurityConnectorGovernanceRulesGetOptionalParams, SecurityConnectorGovernanceRulesGetResponse, @@ -34,11 +36,11 @@ export class SecurityConnectorGovernanceRulesImpl } /** - * Get a specific governanceRule for the requested scope by ruleId + * Get a specific governance rule for the requested scope by ruleId * @param resourceGroupName The name of the resource group within the user's subscription. The name is * case insensitive. * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) * @param options The options parameters. */ get( @@ -54,12 +56,12 @@ export class SecurityConnectorGovernanceRulesImpl } /** - * Creates or update a security GovernanceRule on the given security connector. + * Creates or updates a governance rule on the given security connector * @param resourceGroupName The name of the resource group within the user's subscription. The name is * case insensitive. * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule - * @param governanceRule GovernanceRule over a subscription scope + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param governanceRule Governance rule over a given scope * @param options The options parameters. */ createOrUpdate( @@ -82,23 +84,93 @@ export class SecurityConnectorGovernanceRulesImpl } /** - * Delete a GovernanceRule over a given scope + * Delete a Governance rule over a given scope * @param resourceGroupName The name of the resource group within the user's subscription. The name is * case insensitive. * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) * @param options The options parameters. */ - delete( + async beginDelete( resourceGroupName: string, securityConnectorName: string, ruleId: string, options?: SecurityConnectorGovernanceRulesDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( + ): Promise, void>> { + 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, securityConnectorName, ruleId, options }, deleteOperationSpec ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Delete a Governance rule over a given scope + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param securityConnectorName The security connector name. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + securityConnectorName: string, + ruleId: string, + options?: SecurityConnectorGovernanceRulesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + securityConnectorName, + ruleId, + options + ); + return poller.pollUntilDone(); } } // Operation Specifications @@ -122,7 +194,7 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.ruleId, - Parameters.securityConnectorName + Parameters.securityConnectorName1 ], headerParameters: [Parameters.accept], serializer @@ -149,7 +221,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.ruleId, - Parameters.securityConnectorName + Parameters.securityConnectorName1 ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", @@ -159,14 +231,14 @@ const deleteOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}", httpMethod: "DELETE", - responses: { 200: {}, 204: {}, default: {} }, + responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} }, queryParameters: [Parameters.apiVersion18], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.ruleId, - Parameters.securityConnectorName + Parameters.securityConnectorName1 ], serializer }; diff --git a/sdk/security/arm-security/src/operations/securityConnectorGovernanceRulesExecuteStatus.ts b/sdk/security/arm-security/src/operations/securityConnectorGovernanceRulesExecuteStatus.ts deleted file mode 100644 index 07be6bd51c7d..000000000000 --- a/sdk/security/arm-security/src/operations/securityConnectorGovernanceRulesExecuteStatus.ts +++ /dev/null @@ -1,178 +0,0 @@ -/* - * 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 { SecurityConnectorGovernanceRulesExecuteStatus } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { SecurityCenter } from "../securityCenter"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; -import { - SecurityConnectorGovernanceRulesExecuteStatusGetOptionalParams, - SecurityConnectorGovernanceRulesExecuteStatusGetResponse -} from "../models"; - -/** Class containing SecurityConnectorGovernanceRulesExecuteStatus operations. */ -export class SecurityConnectorGovernanceRulesExecuteStatusImpl - implements SecurityConnectorGovernanceRulesExecuteStatus { - private readonly client: SecurityCenter; - - /** - * Initialize a new instance of the class SecurityConnectorGovernanceRulesExecuteStatus class. - * @param client Reference to the service client - */ - constructor(client: SecurityCenter) { - this.client = client; - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId - * @param resourceGroupName The name of the resource group within the user's subscription. The name is - * case insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule - * @param operationId The security GovernanceRule execution key - unique key for the execution of - * GovernanceRule - * @param options The options parameters. - */ - async beginGet( - resourceGroupName: string, - securityConnectorName: string, - ruleId: string, - operationId: string, - options?: SecurityConnectorGovernanceRulesExecuteStatusGetOptionalParams - ): Promise< - PollerLike< - PollOperationState< - SecurityConnectorGovernanceRulesExecuteStatusGetResponse - >, - SecurityConnectorGovernanceRulesExecuteStatusGetResponse - > - > { - 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, - securityConnectorName, - ruleId, - operationId, - options - }, - getOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs - }); - await poller.poll(); - return poller; - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId - * @param resourceGroupName The name of the resource group within the user's subscription. The name is - * case insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule - * @param operationId The security GovernanceRule execution key - unique key for the execution of - * GovernanceRule - * @param options The options parameters. - */ - async beginGetAndWait( - resourceGroupName: string, - securityConnectorName: string, - ruleId: string, - operationId: string, - options?: SecurityConnectorGovernanceRulesExecuteStatusGetOptionalParams - ): Promise { - const poller = await this.beginGet( - resourceGroupName, - securityConnectorName, - ruleId, - operationId, - options - ); - return poller.pollUntilDone(); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ExecuteRuleStatus - }, - 201: { - bodyMapper: Mappers.ExecuteRuleStatus - }, - 202: { - bodyMapper: Mappers.ExecuteRuleStatus - }, - 204: { - bodyMapper: Mappers.ExecuteRuleStatus - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion18], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.ruleId, - Parameters.securityConnectorName, - Parameters.operationId - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/security/arm-security/src/operations/securityConnectorGovernanceRulesOperationResult.ts b/sdk/security/arm-security/src/operations/securityConnectorGovernanceRulesOperationResult.ts new file mode 100644 index 000000000000..dfb81239fb69 --- /dev/null +++ b/sdk/security/arm-security/src/operations/securityConnectorGovernanceRulesOperationResult.ts @@ -0,0 +1,91 @@ +/* + * 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 { SecurityConnectorGovernanceRulesOperationResult } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { SecurityCenter } from "../securityCenter"; +import { + SecurityConnectorGovernanceRulesOperationResultGetOptionalParams, + SecurityConnectorGovernanceRulesOperationResultGetResponse +} from "../models"; + +/** Class containing SecurityConnectorGovernanceRulesOperationResult operations. */ +export class SecurityConnectorGovernanceRulesOperationResultImpl + implements SecurityConnectorGovernanceRulesOperationResult { + private readonly client: SecurityCenter; + + /** + * Initialize a new instance of the class SecurityConnectorGovernanceRulesOperationResult class. + * @param client Reference to the service client + */ + constructor(client: SecurityCenter) { + this.client = client; + } + + /** + * Get governance rule long run operation result for the requested scope by ruleId and operationId + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param securityConnectorName The security connector name. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param operationId The governance rule execution key - unique key for the execution of governance + * rule + * @param options The options parameters. + */ + get( + resourceGroupName: string, + securityConnectorName: string, + ruleId: string, + operationId: string, + options?: SecurityConnectorGovernanceRulesOperationResultGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + securityConnectorName, + ruleId, + operationId, + options + }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationResultAutoGenerated + }, + 202: { + headersMapper: + Mappers.SecurityConnectorGovernanceRulesOperationResultGetHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion18], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.ruleId, + Parameters.securityConnectorName1, + Parameters.operationId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/security/arm-security/src/operations/securityConnectors.ts b/sdk/security/arm-security/src/operations/securityConnectors.ts index 6399e0059845..5e6738c403a5 100644 --- a/sdk/security/arm-security/src/operations/securityConnectors.ts +++ b/sdk/security/arm-security/src/operations/securityConnectors.ts @@ -455,7 +455,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion17], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -475,7 +474,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion17], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/securityContacts.ts b/sdk/security/arm-security/src/operations/securityContacts.ts index d78aa8f67604..f378d1032a07 100644 --- a/sdk/security/arm-security/src/operations/securityContacts.ts +++ b/sdk/security/arm-security/src/operations/securityContacts.ts @@ -263,7 +263,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion8], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/securitySolutions.ts b/sdk/security/arm-security/src/operations/securitySolutions.ts index b1823fa4227f..9fb03eb72019 100644 --- a/sdk/security/arm-security/src/operations/securitySolutions.ts +++ b/sdk/security/arm-security/src/operations/securitySolutions.ts @@ -190,7 +190,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/settings.ts b/sdk/security/arm-security/src/operations/settings.ts index a252cca2152e..028a8cd55c8e 100644 --- a/sdk/security/arm-security/src/operations/settings.ts +++ b/sdk/security/arm-security/src/operations/settings.ts @@ -224,7 +224,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion14], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/softwareInventories.ts b/sdk/security/arm-security/src/operations/softwareInventories.ts index 1cbe05bb487e..f4814c85e2bd 100644 --- a/sdk/security/arm-security/src/operations/softwareInventories.ts +++ b/sdk/security/arm-security/src/operations/softwareInventories.ts @@ -395,7 +395,6 @@ const listByExtendedResourceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion16], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -419,7 +418,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion16], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/subAssessments.ts b/sdk/security/arm-security/src/operations/subAssessments.ts index b7de6f7eeb88..f9906bd9a39a 100644 --- a/sdk/security/arm-security/src/operations/subAssessments.ts +++ b/sdk/security/arm-security/src/operations/subAssessments.ts @@ -343,7 +343,6 @@ const listAllNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion9], urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope], headerParameters: [Parameters.accept], serializer @@ -359,7 +358,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion9], urlParameters: [ Parameters.$host, Parameters.nextLink, diff --git a/sdk/security/arm-security/src/operations/subscriptionGovernanceRulesExecuteStatus.ts b/sdk/security/arm-security/src/operations/subscriptionGovernanceRulesExecuteStatus.ts deleted file mode 100644 index 5a7947e2a89d..000000000000 --- a/sdk/security/arm-security/src/operations/subscriptionGovernanceRulesExecuteStatus.ts +++ /dev/null @@ -1,152 +0,0 @@ -/* - * 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 { SubscriptionGovernanceRulesExecuteStatus } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { SecurityCenter } from "../securityCenter"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; -import { - SubscriptionGovernanceRulesExecuteStatusGetOptionalParams, - SubscriptionGovernanceRulesExecuteStatusGetResponse -} from "../models"; - -/** Class containing SubscriptionGovernanceRulesExecuteStatus operations. */ -export class SubscriptionGovernanceRulesExecuteStatusImpl - implements SubscriptionGovernanceRulesExecuteStatus { - private readonly client: SecurityCenter; - - /** - * Initialize a new instance of the class SubscriptionGovernanceRulesExecuteStatus class. - * @param client Reference to the service client - */ - constructor(client: SecurityCenter) { - this.client = client; - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule - * @param operationId The security GovernanceRule execution key - unique key for the execution of - * GovernanceRule - * @param options The options parameters. - */ - async beginGet( - ruleId: string, - operationId: string, - options?: SubscriptionGovernanceRulesExecuteStatusGetOptionalParams - ): Promise< - PollerLike< - PollOperationState, - SubscriptionGovernanceRulesExecuteStatusGetResponse - > - > { - 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, - { ruleId, operationId, options }, - getOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs - }); - await poller.poll(); - return poller; - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule - * @param operationId The security GovernanceRule execution key - unique key for the execution of - * GovernanceRule - * @param options The options parameters. - */ - async beginGetAndWait( - ruleId: string, - operationId: string, - options?: SubscriptionGovernanceRulesExecuteStatusGetOptionalParams - ): Promise { - const poller = await this.beginGet(ruleId, operationId, options); - return poller.pollUntilDone(); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ExecuteRuleStatus - }, - 201: { - bodyMapper: Mappers.ExecuteRuleStatus - }, - 202: { - bodyMapper: Mappers.ExecuteRuleStatus - }, - 204: { - bodyMapper: Mappers.ExecuteRuleStatus - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - queryParameters: [Parameters.apiVersion18], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.ruleId, - Parameters.operationId - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/security/arm-security/src/operations/subscriptionGovernanceRulesOperationResult.ts b/sdk/security/arm-security/src/operations/subscriptionGovernanceRulesOperationResult.ts new file mode 100644 index 000000000000..09a45fde3552 --- /dev/null +++ b/sdk/security/arm-security/src/operations/subscriptionGovernanceRulesOperationResult.ts @@ -0,0 +1,78 @@ +/* + * 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 { SubscriptionGovernanceRulesOperationResult } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { SecurityCenter } from "../securityCenter"; +import { + SubscriptionGovernanceRulesOperationResultGetOptionalParams, + SubscriptionGovernanceRulesOperationResultGetResponse +} from "../models"; + +/** Class containing SubscriptionGovernanceRulesOperationResult operations. */ +export class SubscriptionGovernanceRulesOperationResultImpl + implements SubscriptionGovernanceRulesOperationResult { + private readonly client: SecurityCenter; + + /** + * Initialize a new instance of the class SubscriptionGovernanceRulesOperationResult class. + * @param client Reference to the service client + */ + constructor(client: SecurityCenter) { + this.client = client; + } + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param operationId The governance rule execution key - unique key for the execution of governance + * rule + * @param options The options parameters. + */ + get( + ruleId: string, + operationId: string, + options?: SubscriptionGovernanceRulesOperationResultGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { ruleId, operationId, options }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationResultAutoGenerated + }, + 202: { + headersMapper: + Mappers.SubscriptionGovernanceRulesOperationResultGetHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion18], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.ruleId, + Parameters.operationId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/security/arm-security/src/operations/tasks.ts b/sdk/security/arm-security/src/operations/tasks.ts index c47865dc9c0c..c3f87db872c0 100644 --- a/sdk/security/arm-security/src/operations/tasks.ts +++ b/sdk/security/arm-security/src/operations/tasks.ts @@ -601,7 +601,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion6], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -621,7 +620,6 @@ const listByHomeRegionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion6], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -642,7 +640,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion6], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/topology.ts b/sdk/security/arm-security/src/operations/topology.ts index 9cac9af0fec4..59500e309e6d 100644 --- a/sdk/security/arm-security/src/operations/topology.ts +++ b/sdk/security/arm-security/src/operations/topology.ts @@ -315,7 +315,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -335,7 +334,6 @@ const listByHomeRegionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion10], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operations/workspaceSettings.ts b/sdk/security/arm-security/src/operations/workspaceSettings.ts index 1bf77edbda23..7e712dae40f2 100644 --- a/sdk/security/arm-security/src/operations/workspaceSettings.ts +++ b/sdk/security/arm-security/src/operations/workspaceSettings.ts @@ -305,7 +305,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion7], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/security/arm-security/src/operationsInterfaces/governanceAssignments.ts b/sdk/security/arm-security/src/operationsInterfaces/governanceAssignments.ts index 367898165d13..0d94e71a909c 100644 --- a/sdk/security/arm-security/src/operationsInterfaces/governanceAssignments.ts +++ b/sdk/security/arm-security/src/operationsInterfaces/governanceAssignments.ts @@ -21,11 +21,11 @@ import { /** Interface representing a GovernanceAssignments. */ export interface GovernanceAssignments { /** - * Get security governanceAssignments on all your resources inside a scope + * Get governance assignments on all of your resources inside a scope * @param scope Scope of the query, can be subscription * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group * (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type + * @param assessmentName The Assessment Key - A unique key for the assessment type * @param options The options parameters. */ list( @@ -38,9 +38,9 @@ export interface GovernanceAssignments { * @param scope Scope of the query, can be subscription * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group * (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type - * @param assignmentKey The security governance assignment key - the assessment key of the required - * governance assignment + * @param assessmentName The Assessment Key - A unique key for the assessment type + * @param assignmentKey The governance assignment key - the assessment key of the required governance + * assignment * @param options The options parameters. */ get( @@ -50,14 +50,14 @@ export interface GovernanceAssignments { options?: GovernanceAssignmentsGetOptionalParams ): Promise; /** - * Creates or update a security GovernanceAssignment on the given subscription. + * Creates or updates a governance assignment on the given subscription. * @param scope Scope of the query, can be subscription * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group * (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type - * @param assignmentKey The security governance assignment key - the assessment key of the required - * governance assignment - * @param governanceAssignment GovernanceAssignment over a subscription scope + * @param assessmentName The Assessment Key - A unique key for the assessment type + * @param assignmentKey The governance assignment key - the assessment key of the required governance + * assignment + * @param governanceAssignment Governance assignment over a subscription scope * @param options The options parameters. */ createOrUpdate( @@ -72,9 +72,9 @@ export interface GovernanceAssignments { * @param scope Scope of the query, can be subscription * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group * (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type - * @param assignmentKey The security governance assignment key - the assessment key of the required - * governance assignment + * @param assessmentName The Assessment Key - A unique key for the assessment type + * @param assignmentKey The governance assignment key - the assessment key of the required governance + * assignment * @param options The options parameters. */ delete( diff --git a/sdk/security/arm-security/src/operationsInterfaces/governanceRuleOperations.ts b/sdk/security/arm-security/src/operationsInterfaces/governanceRuleOperations.ts index db471f8f1802..ced821500ff0 100644 --- a/sdk/security/arm-security/src/operationsInterfaces/governanceRuleOperations.ts +++ b/sdk/security/arm-security/src/operationsInterfaces/governanceRuleOperations.ts @@ -13,7 +13,7 @@ import { GovernanceRule, GovernanceRuleListOptionalParams } from "../models"; /** Interface representing a GovernanceRuleOperations. */ export interface GovernanceRuleOperations { /** - * Get a list of all relevant governanceRules over a subscription level scope + * Get a list of the governance rules on the subscription level scope * @param options The options parameters. */ list( diff --git a/sdk/security/arm-security/src/operationsInterfaces/governanceRules.ts b/sdk/security/arm-security/src/operationsInterfaces/governanceRules.ts index c34e6f9ee9ff..013d8dd75aec 100644 --- a/sdk/security/arm-security/src/operationsInterfaces/governanceRules.ts +++ b/sdk/security/arm-security/src/operationsInterfaces/governanceRules.ts @@ -17,14 +17,16 @@ import { GovernanceRulesRuleIdExecuteSingleSubscriptionOptionalParams, GovernanceRulesRuleIdExecuteSingleSubscriptionResponse, GovernanceRulesRuleIdExecuteSingleSecurityConnectorOptionalParams, - GovernanceRulesRuleIdExecuteSingleSecurityConnectorResponse + GovernanceRulesRuleIdExecuteSingleSecurityConnectorResponse, + GovernanceRulesRuleIdExecuteSingleManagementGroupOptionalParams, + GovernanceRulesRuleIdExecuteSingleManagementGroupResponse } from "../models"; /** Interface representing a GovernanceRules. */ export interface GovernanceRules { /** - * Get a specific governanceRule for the requested scope by ruleId - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule + * Get a specific governance rule for the requested scope by ruleId + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) * @param options The options parameters. */ get( @@ -32,9 +34,9 @@ export interface GovernanceRules { options?: GovernanceRulesGetOptionalParams ): Promise; /** - * Creates or update a security GovernanceRule on the given subscription. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule - * @param governanceRule GovernanceRule over a subscription scope + * Creates or updates a governance rule on a subscription + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param governanceRule Governance rule over a given scope * @param options The options parameters. */ createOrUpdate( @@ -43,8 +45,8 @@ export interface GovernanceRules { options?: GovernanceRulesCreateOrUpdateOptionalParams ): Promise; /** - * Delete a GovernanceRule over a given scope - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule + * Delete a Governance rule over a given scope + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) * @param options The options parameters. */ delete( @@ -52,8 +54,8 @@ export interface GovernanceRules { options?: GovernanceRulesDeleteOptionalParams ): Promise; /** - * Execute a security GovernanceRule on the given subscription. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule + * Execute a governance rule on a subscription + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) * @param options The options parameters. */ beginRuleIdExecuteSingleSubscription( @@ -68,8 +70,8 @@ export interface GovernanceRules { > >; /** - * Execute a security GovernanceRule on the given subscription. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule + * Execute a governance rule on a subscription + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) * @param options The options parameters. */ beginRuleIdExecuteSingleSubscriptionAndWait( @@ -77,11 +79,11 @@ export interface GovernanceRules { options?: GovernanceRulesRuleIdExecuteSingleSubscriptionOptionalParams ): Promise; /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule on the given security connector * @param resourceGroupName The name of the resource group within the user's subscription. The name is * case insensitive. * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) * @param options The options parameters. */ beginRuleIdExecuteSingleSecurityConnector( @@ -98,11 +100,11 @@ export interface GovernanceRules { > >; /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule on the given security connector * @param resourceGroupName The name of the resource group within the user's subscription. The name is * case insensitive. * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) * @param options The options parameters. */ beginRuleIdExecuteSingleSecurityConnectorAndWait( @@ -111,4 +113,29 @@ export interface GovernanceRules { ruleId: string, options?: GovernanceRulesRuleIdExecuteSingleSecurityConnectorOptionalParams ): Promise; + /** + * Execute governance rule on the given management group + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param options The options parameters. + */ + beginRuleIdExecuteSingleManagementGroup( + ruleId: string, + options?: GovernanceRulesRuleIdExecuteSingleManagementGroupOptionalParams + ): Promise< + PollerLike< + PollOperationState< + GovernanceRulesRuleIdExecuteSingleManagementGroupResponse + >, + GovernanceRulesRuleIdExecuteSingleManagementGroupResponse + > + >; + /** + * Execute governance rule on the given management group + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param options The options parameters. + */ + beginRuleIdExecuteSingleManagementGroupAndWait( + ruleId: string, + options?: GovernanceRulesRuleIdExecuteSingleManagementGroupOptionalParams + ): Promise; } diff --git a/sdk/security/arm-security/src/operationsInterfaces/index.ts b/sdk/security/arm-security/src/operationsInterfaces/index.ts index ffcf4dbbb7d0..488f7fdc253a 100644 --- a/sdk/security/arm-security/src/operationsInterfaces/index.ts +++ b/sdk/security/arm-security/src/operationsInterfaces/index.ts @@ -59,8 +59,11 @@ export * from "./governanceRuleOperations"; export * from "./governanceRules"; export * from "./securityConnectorGovernanceRule"; export * from "./securityConnectorGovernanceRules"; -export * from "./subscriptionGovernanceRulesExecuteStatus"; -export * from "./securityConnectorGovernanceRulesExecuteStatus"; +export * from "./managementGroupGovernanceRule"; +export * from "./managementGroupGovernanceRules"; +export * from "./subscriptionGovernanceRulesOperationResult"; +export * from "./securityConnectorGovernanceRulesOperationResult"; +export * from "./managementGroupGovernanceRulesOperationResult"; export * from "./governanceAssignments"; export * from "./applications"; export * from "./applicationOperations"; diff --git a/sdk/security/arm-security/src/operationsInterfaces/managementGroupGovernanceRule.ts b/sdk/security/arm-security/src/operationsInterfaces/managementGroupGovernanceRule.ts new file mode 100644 index 000000000000..02ced3ae5579 --- /dev/null +++ b/sdk/security/arm-security/src/operationsInterfaces/managementGroupGovernanceRule.ts @@ -0,0 +1,25 @@ +/* + * 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 { + GovernanceRule, + ManagementGroupGovernanceRuleListOptionalParams +} from "../models"; + +/// +/** Interface representing a ManagementGroupGovernanceRule. */ +export interface ManagementGroupGovernanceRule { + /** + * Get a list of all relevant governance rules over a management group level scope + * @param options The options parameters. + */ + list( + options?: ManagementGroupGovernanceRuleListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/security/arm-security/src/operationsInterfaces/managementGroupGovernanceRules.ts b/sdk/security/arm-security/src/operationsInterfaces/managementGroupGovernanceRules.ts new file mode 100644 index 000000000000..c9c71ac1c91a --- /dev/null +++ b/sdk/security/arm-security/src/operationsInterfaces/managementGroupGovernanceRules.ts @@ -0,0 +1,65 @@ +/* + * 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 { + ManagementGroupGovernanceRulesGetOptionalParams, + ManagementGroupGovernanceRulesGetResponse, + GovernanceRule, + ManagementGroupGovernanceRulesCreateOrUpdateOptionalParams, + ManagementGroupGovernanceRulesCreateOrUpdateResponse, + ManagementGroupGovernanceRulesDeleteOptionalParams, + ManagementGroupGovernanceRulesDeleteResponse +} from "../models"; + +/** Interface representing a ManagementGroupGovernanceRules. */ +export interface ManagementGroupGovernanceRules { + /** + * Get a specific governance rule for the requested scope by ruleId + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param options The options parameters. + */ + get( + ruleId: string, + options?: ManagementGroupGovernanceRulesGetOptionalParams + ): Promise; + /** + * Creates or updates governance rule on the given management group + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param governanceRule Governance rule over a given scope + * @param options The options parameters. + */ + createOrUpdate( + ruleId: string, + governanceRule: GovernanceRule, + options?: ManagementGroupGovernanceRulesCreateOrUpdateOptionalParams + ): Promise; + /** + * Delete a Governance rule over a given scope + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param options The options parameters. + */ + beginDelete( + ruleId: string, + options?: ManagementGroupGovernanceRulesDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ManagementGroupGovernanceRulesDeleteResponse + > + >; + /** + * Delete a Governance rule over a given scope + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param options The options parameters. + */ + beginDeleteAndWait( + ruleId: string, + options?: ManagementGroupGovernanceRulesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/security/arm-security/src/operationsInterfaces/managementGroupGovernanceRulesOperationResult.ts b/sdk/security/arm-security/src/operationsInterfaces/managementGroupGovernanceRulesOperationResult.ts new file mode 100644 index 000000000000..01d45e09b042 --- /dev/null +++ b/sdk/security/arm-security/src/operationsInterfaces/managementGroupGovernanceRulesOperationResult.ts @@ -0,0 +1,28 @@ +/* + * 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 { + ManagementGroupGovernanceRulesOperationResultGetOptionalParams, + ManagementGroupGovernanceRulesOperationResultGetResponse +} from "../models"; + +/** Interface representing a ManagementGroupGovernanceRulesOperationResult. */ +export interface ManagementGroupGovernanceRulesOperationResult { + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param operationId The governance rule execution key - unique key for the execution of governance + * rule + * @param options The options parameters. + */ + get( + ruleId: string, + operationId: string, + options?: ManagementGroupGovernanceRulesOperationResultGetOptionalParams + ): Promise; +} diff --git a/sdk/security/arm-security/src/operationsInterfaces/securityConnectorGovernanceRule.ts b/sdk/security/arm-security/src/operationsInterfaces/securityConnectorGovernanceRule.ts index 3915eb144a6f..e3b5c44cacc2 100644 --- a/sdk/security/arm-security/src/operationsInterfaces/securityConnectorGovernanceRule.ts +++ b/sdk/security/arm-security/src/operationsInterfaces/securityConnectorGovernanceRule.ts @@ -16,7 +16,7 @@ import { /** Interface representing a SecurityConnectorGovernanceRule. */ export interface SecurityConnectorGovernanceRule { /** - * Get a list of all relevant governanceRules over a security connector level scope + * Get a list of all relevant governance rules over a security connector level scope * @param resourceGroupName The name of the resource group within the user's subscription. The name is * case insensitive. * @param securityConnectorName The security connector name. diff --git a/sdk/security/arm-security/src/operationsInterfaces/securityConnectorGovernanceRules.ts b/sdk/security/arm-security/src/operationsInterfaces/securityConnectorGovernanceRules.ts index 3a13eefc1357..78779792a901 100644 --- a/sdk/security/arm-security/src/operationsInterfaces/securityConnectorGovernanceRules.ts +++ b/sdk/security/arm-security/src/operationsInterfaces/securityConnectorGovernanceRules.ts @@ -6,6 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import { PollerLike, PollOperationState } from "@azure/core-lro"; import { SecurityConnectorGovernanceRulesGetOptionalParams, SecurityConnectorGovernanceRulesGetResponse, @@ -18,11 +19,11 @@ import { /** Interface representing a SecurityConnectorGovernanceRules. */ export interface SecurityConnectorGovernanceRules { /** - * Get a specific governanceRule for the requested scope by ruleId + * Get a specific governance rule for the requested scope by ruleId * @param resourceGroupName The name of the resource group within the user's subscription. The name is * case insensitive. * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) * @param options The options parameters. */ get( @@ -32,12 +33,12 @@ export interface SecurityConnectorGovernanceRules { options?: SecurityConnectorGovernanceRulesGetOptionalParams ): Promise; /** - * Creates or update a security GovernanceRule on the given security connector. + * Creates or updates a governance rule on the given security connector * @param resourceGroupName The name of the resource group within the user's subscription. The name is * case insensitive. * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule - * @param governanceRule GovernanceRule over a subscription scope + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param governanceRule Governance rule over a given scope * @param options The options parameters. */ createOrUpdate( @@ -48,14 +49,28 @@ export interface SecurityConnectorGovernanceRules { options?: SecurityConnectorGovernanceRulesCreateOrUpdateOptionalParams ): Promise; /** - * Delete a GovernanceRule over a given scope + * Delete a Governance rule over a given scope * @param resourceGroupName The name of the resource group within the user's subscription. The name is * case insensitive. * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) * @param options The options parameters. */ - delete( + beginDelete( + resourceGroupName: string, + securityConnectorName: string, + ruleId: string, + options?: SecurityConnectorGovernanceRulesDeleteOptionalParams + ): Promise, void>>; + /** + * Delete a Governance rule over a given scope + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param securityConnectorName The security connector name. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param options The options parameters. + */ + beginDeleteAndWait( resourceGroupName: string, securityConnectorName: string, ruleId: string, diff --git a/sdk/security/arm-security/src/operationsInterfaces/securityConnectorGovernanceRulesExecuteStatus.ts b/sdk/security/arm-security/src/operationsInterfaces/securityConnectorGovernanceRulesExecuteStatus.ts deleted file mode 100644 index 8620f1d2b067..000000000000 --- a/sdk/security/arm-security/src/operationsInterfaces/securityConnectorGovernanceRulesExecuteStatus.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 { - SecurityConnectorGovernanceRulesExecuteStatusGetOptionalParams, - SecurityConnectorGovernanceRulesExecuteStatusGetResponse -} from "../models"; - -/** Interface representing a SecurityConnectorGovernanceRulesExecuteStatus. */ -export interface SecurityConnectorGovernanceRulesExecuteStatus { - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId - * @param resourceGroupName The name of the resource group within the user's subscription. The name is - * case insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule - * @param operationId The security GovernanceRule execution key - unique key for the execution of - * GovernanceRule - * @param options The options parameters. - */ - beginGet( - resourceGroupName: string, - securityConnectorName: string, - ruleId: string, - operationId: string, - options?: SecurityConnectorGovernanceRulesExecuteStatusGetOptionalParams - ): Promise< - PollerLike< - PollOperationState< - SecurityConnectorGovernanceRulesExecuteStatusGetResponse - >, - SecurityConnectorGovernanceRulesExecuteStatusGetResponse - > - >; - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId - * @param resourceGroupName The name of the resource group within the user's subscription. The name is - * case insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule - * @param operationId The security GovernanceRule execution key - unique key for the execution of - * GovernanceRule - * @param options The options parameters. - */ - beginGetAndWait( - resourceGroupName: string, - securityConnectorName: string, - ruleId: string, - operationId: string, - options?: SecurityConnectorGovernanceRulesExecuteStatusGetOptionalParams - ): Promise; -} diff --git a/sdk/security/arm-security/src/operationsInterfaces/securityConnectorGovernanceRulesOperationResult.ts b/sdk/security/arm-security/src/operationsInterfaces/securityConnectorGovernanceRulesOperationResult.ts new file mode 100644 index 000000000000..be96d9c2b24a --- /dev/null +++ b/sdk/security/arm-security/src/operationsInterfaces/securityConnectorGovernanceRulesOperationResult.ts @@ -0,0 +1,33 @@ +/* + * 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 { + SecurityConnectorGovernanceRulesOperationResultGetOptionalParams, + SecurityConnectorGovernanceRulesOperationResultGetResponse +} from "../models"; + +/** Interface representing a SecurityConnectorGovernanceRulesOperationResult. */ +export interface SecurityConnectorGovernanceRulesOperationResult { + /** + * Get governance rule long run operation result for the requested scope by ruleId and operationId + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param securityConnectorName The security connector name. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param operationId The governance rule execution key - unique key for the execution of governance + * rule + * @param options The options parameters. + */ + get( + resourceGroupName: string, + securityConnectorName: string, + ruleId: string, + operationId: string, + options?: SecurityConnectorGovernanceRulesOperationResultGetOptionalParams + ): Promise; +} diff --git a/sdk/security/arm-security/src/operationsInterfaces/subscriptionGovernanceRulesExecuteStatus.ts b/sdk/security/arm-security/src/operationsInterfaces/subscriptionGovernanceRulesExecuteStatus.ts deleted file mode 100644 index 9dda1f5c5373..000000000000 --- a/sdk/security/arm-security/src/operationsInterfaces/subscriptionGovernanceRulesExecuteStatus.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 { - SubscriptionGovernanceRulesExecuteStatusGetOptionalParams, - SubscriptionGovernanceRulesExecuteStatusGetResponse -} from "../models"; - -/** Interface representing a SubscriptionGovernanceRulesExecuteStatus. */ -export interface SubscriptionGovernanceRulesExecuteStatus { - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule - * @param operationId The security GovernanceRule execution key - unique key for the execution of - * GovernanceRule - * @param options The options parameters. - */ - beginGet( - ruleId: string, - operationId: string, - options?: SubscriptionGovernanceRulesExecuteStatusGetOptionalParams - ): Promise< - PollerLike< - PollOperationState, - SubscriptionGovernanceRulesExecuteStatusGetResponse - > - >; - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule - * @param operationId The security GovernanceRule execution key - unique key for the execution of - * GovernanceRule - * @param options The options parameters. - */ - beginGetAndWait( - ruleId: string, - operationId: string, - options?: SubscriptionGovernanceRulesExecuteStatusGetOptionalParams - ): Promise; -} diff --git a/sdk/security/arm-security/src/operationsInterfaces/subscriptionGovernanceRulesOperationResult.ts b/sdk/security/arm-security/src/operationsInterfaces/subscriptionGovernanceRulesOperationResult.ts new file mode 100644 index 000000000000..9629a3091121 --- /dev/null +++ b/sdk/security/arm-security/src/operationsInterfaces/subscriptionGovernanceRulesOperationResult.ts @@ -0,0 +1,28 @@ +/* + * 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 { + SubscriptionGovernanceRulesOperationResultGetOptionalParams, + SubscriptionGovernanceRulesOperationResultGetResponse +} from "../models"; + +/** Interface representing a SubscriptionGovernanceRulesOperationResult. */ +export interface SubscriptionGovernanceRulesOperationResult { + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID) + * @param operationId The governance rule execution key - unique key for the execution of governance + * rule + * @param options The options parameters. + */ + get( + ruleId: string, + operationId: string, + options?: SubscriptionGovernanceRulesOperationResultGetOptionalParams + ): Promise; +} diff --git a/sdk/security/arm-security/src/pagingHelper.ts b/sdk/security/arm-security/src/pagingHelper.ts index d85fc13bce1e..269a2b9814b5 100644 --- a/sdk/security/arm-security/src/pagingHelper.ts +++ b/sdk/security/arm-security/src/pagingHelper.ts @@ -13,11 +13,11 @@ export interface PageInfo { const pageMap = new WeakMap(); /** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from * that point later. - * @param page A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. */ export function getContinuationToken(page: unknown): string | undefined { if (typeof page !== "object" || page === null) { diff --git a/sdk/security/arm-security/src/securityCenter.ts b/sdk/security/arm-security/src/securityCenter.ts index e73ae63bcda7..05bc6819ebf7 100644 --- a/sdk/security/arm-security/src/securityCenter.ts +++ b/sdk/security/arm-security/src/securityCenter.ts @@ -63,8 +63,11 @@ import { GovernanceRulesImpl, SecurityConnectorGovernanceRuleImpl, SecurityConnectorGovernanceRulesImpl, - SubscriptionGovernanceRulesExecuteStatusImpl, - SecurityConnectorGovernanceRulesExecuteStatusImpl, + ManagementGroupGovernanceRuleImpl, + ManagementGroupGovernanceRulesImpl, + SubscriptionGovernanceRulesOperationResultImpl, + SecurityConnectorGovernanceRulesOperationResultImpl, + ManagementGroupGovernanceRulesOperationResultImpl, GovernanceAssignmentsImpl, ApplicationsImpl, ApplicationOperationsImpl, @@ -128,8 +131,11 @@ import { GovernanceRules, SecurityConnectorGovernanceRule, SecurityConnectorGovernanceRules, - SubscriptionGovernanceRulesExecuteStatus, - SecurityConnectorGovernanceRulesExecuteStatus, + ManagementGroupGovernanceRule, + ManagementGroupGovernanceRules, + SubscriptionGovernanceRulesOperationResult, + SecurityConnectorGovernanceRulesOperationResult, + ManagementGroupGovernanceRulesOperationResult, GovernanceAssignments, Applications, ApplicationOperations, @@ -144,16 +150,19 @@ import { SecurityCenterOptionalParams } from "./models"; export class SecurityCenter extends coreClient.ServiceClient { $host: string; subscriptionId: string; + managementGroupId: string; /** * Initializes a new instance of the SecurityCenter class. * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId Azure subscription ID + * @param managementGroupId Azure Management Group ID * @param options The parameter options */ constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, + managementGroupId: string, options?: SecurityCenterOptionalParams ) { if (credentials === undefined) { @@ -162,6 +171,9 @@ export class SecurityCenter extends coreClient.ServiceClient { if (subscriptionId === undefined) { throw new Error("'subscriptionId' cannot be null"); } + if (managementGroupId === undefined) { + throw new Error("'managementGroupId' cannot be null"); + } // Initializing default values for options if (!options) { @@ -222,6 +234,7 @@ export class SecurityCenter extends coreClient.ServiceClient { } // Parameter assignments this.subscriptionId = subscriptionId; + this.managementGroupId = managementGroupId; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; @@ -316,10 +329,19 @@ export class SecurityCenter extends coreClient.ServiceClient { this.securityConnectorGovernanceRules = new SecurityConnectorGovernanceRulesImpl( this ); - this.subscriptionGovernanceRulesExecuteStatus = new SubscriptionGovernanceRulesExecuteStatusImpl( + this.managementGroupGovernanceRule = new ManagementGroupGovernanceRuleImpl( + this + ); + this.managementGroupGovernanceRules = new ManagementGroupGovernanceRulesImpl( + this + ); + this.subscriptionGovernanceRulesOperationResult = new SubscriptionGovernanceRulesOperationResultImpl( + this + ); + this.securityConnectorGovernanceRulesOperationResult = new SecurityConnectorGovernanceRulesOperationResultImpl( this ); - this.securityConnectorGovernanceRulesExecuteStatus = new SecurityConnectorGovernanceRulesExecuteStatusImpl( + this.managementGroupGovernanceRulesOperationResult = new ManagementGroupGovernanceRulesOperationResultImpl( this ); this.governanceAssignments = new GovernanceAssignmentsImpl(this); @@ -389,8 +411,11 @@ export class SecurityCenter extends coreClient.ServiceClient { governanceRules: GovernanceRules; securityConnectorGovernanceRule: SecurityConnectorGovernanceRule; securityConnectorGovernanceRules: SecurityConnectorGovernanceRules; - subscriptionGovernanceRulesExecuteStatus: SubscriptionGovernanceRulesExecuteStatus; - securityConnectorGovernanceRulesExecuteStatus: SecurityConnectorGovernanceRulesExecuteStatus; + managementGroupGovernanceRule: ManagementGroupGovernanceRule; + managementGroupGovernanceRules: ManagementGroupGovernanceRules; + subscriptionGovernanceRulesOperationResult: SubscriptionGovernanceRulesOperationResult; + securityConnectorGovernanceRulesOperationResult: SecurityConnectorGovernanceRulesOperationResult; + managementGroupGovernanceRulesOperationResult: ManagementGroupGovernanceRulesOperationResult; governanceAssignments: GovernanceAssignments; applications: Applications; applicationOperations: ApplicationOperations; diff --git a/sdk/security/arm-security/test/sampleTest.ts b/sdk/security/arm-security/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/security/arm-security/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/security/arm-security/tsconfig.json b/sdk/security/arm-security/tsconfig.json index 3f5144384125..3e6ae96443f3 100644 --- a/sdk/security/arm-security/tsconfig.json +++ b/sdk/security/arm-security/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-security": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"