diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index ec3426cf9bd6..b277de5108c1 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -629,6 +629,21 @@ packages: - supports-color dev: false + /@azure/arm-network/26.0.0: + resolution: {integrity: sha512-Hp0Q4ZzChs8C0DUdGZOChWKMrhzZ53V0Q681puREZ9S1E6o2yWM0Vb+cYuWoyPOylwuzP2fjNjJZGtB7WuFd3w==} + engines: {node: '>=12.0.0'} + dependencies: + '@azure/abort-controller': 1.0.4 + '@azure/core-auth': 1.3.2 + '@azure/core-client': 1.4.0 + '@azure/core-lro': 2.2.3 + '@azure/core-paging': 1.2.1 + '@azure/core-rest-pipeline': 1.4.0 + tslib: 2.3.1 + transitivePeerDependencies: + - supports-color + dev: false + /@azure/communication-common/1.1.0: resolution: {integrity: sha512-vqTtzDtb4NG3LWoWoqlOOJApZRRIIImNUKlGyTa6c1YC+v5A7UEOL9TX8NRDxvFVUF2wDHsSnkhLBVBgkcAhIQ==} engines: {node: '>=12.0.0'} @@ -9481,11 +9496,12 @@ packages: dev: false file:projects/arm-compute.tgz: - resolution: {integrity: sha512-hmINbh19nn8k1jqs1nWFUU2duhpE4z8dFI3PpCUI1LKxEWlzJhpu2vMzeR0KDn6wfXakBgXe4Bd51pim+3t58Q==, tarball: file:projects/arm-compute.tgz} + resolution: {integrity: sha512-UZ3mzh/7NfafSh6NlhCC59jkaSp6CxuytZAsMT2h38DGLHCzXZ3uazaEJTbzzimS1BOCCzKWh1uCiiblPCxG5Q==, tarball: file:projects/arm-compute.tgz} name: '@rush-temp/arm-compute' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 + '@azure/arm-network': 26.0.0 '@microsoft/api-extractor': 7.19.4 '@rollup/plugin-commonjs': 21.0.1_rollup@2.66.1 '@rollup/plugin-json': 4.1.0_rollup@2.66.1 @@ -10106,11 +10122,12 @@ packages: dev: false file:projects/arm-eventhub.tgz: - resolution: {integrity: sha512-sW2h3heuRNq8XmwlPIv5KhIaasqs7H5J38SYe91IzGkZNSw2Vvk5cCH/KHrxiE7I7XGtgdw8HP8+FzXPI5bpJw==, tarball: file:projects/arm-eventhub.tgz} + resolution: {integrity: sha512-9qvrSFoh2Al6tFbnlK3fRZVCvmhELwG50dZVjAXQ7cc0fHB5yYZiAIm4BR6o5yJRQHU0Rpy+8z7yJc8e6IrR+w==, tarball: file:projects/arm-eventhub.tgz} name: '@rush-temp/arm-eventhub' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 + '@azure/arm-network': 26.0.0 '@microsoft/api-extractor': 7.19.4 '@rollup/plugin-commonjs': 21.0.1_rollup@2.66.1 '@rollup/plugin-json': 4.1.0_rollup@2.66.1 @@ -11031,22 +11048,22 @@ packages: dev: false file:projects/arm-network.tgz: - resolution: {integrity: sha512-0mEBeoMkDJut0+QxS9FrGyI5AqRU7OTX1QijIAYaIP5/o1buyWud5cQeD0v5CWKbsZ2rfJLpKixzsHYnA49gJw==, tarball: file:projects/arm-network.tgz} + resolution: {integrity: sha512-F0jII+BPxVfU0wq/hm2i2XXptnRmSyly/ESV6X+UtvAD5xWcbLUb1KEh1EzIsKUkPPbxUOhSiAiACHVDPDbjSg==, tarball: file:projects/arm-network.tgz} name: '@rush-temp/arm-network' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@microsoft/api-extractor': 7.19.4 - '@rollup/plugin-commonjs': 21.0.1_rollup@2.66.1 - '@rollup/plugin-json': 4.1.0_rollup@2.66.1 - '@rollup/plugin-multi-entry': 3.0.1_rollup@2.66.1 - '@rollup/plugin-node-resolve': 8.4.0_rollup@2.66.1 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 - rollup: 2.66.1 - rollup-plugin-sourcemaps: 0.4.2_rollup@2.66.1 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 @@ -11531,11 +11548,12 @@ packages: dev: false file:projects/arm-rediscache.tgz: - resolution: {integrity: sha512-/fTxuaVcm7BjOSj22KpfbZ8lTZMGC1AGAOGAZZ735huyBjUh7ljhS882uCXQVzQTYb8BrwK6ePeUGYEHpk626w==, tarball: file:projects/arm-rediscache.tgz} + resolution: {integrity: sha512-nbjg4xKSQz5aPPDXxpijRorXWiqm5eK8ejcGkWFn1ze43MEi4j8Xa0HuxQ/wTzzKhRf+DUmjX4Rf7abYJQyzrA==, tarball: file:projects/arm-rediscache.tgz} name: '@rush-temp/arm-rediscache' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 + '@azure/arm-network': 26.0.0 '@microsoft/api-extractor': 7.19.4 '@rollup/plugin-commonjs': 21.0.1_rollup@2.66.1 '@rollup/plugin-json': 4.1.0_rollup@2.66.1 @@ -15739,7 +15757,7 @@ packages: dev: false file:projects/search-documents.tgz: - resolution: {integrity: sha512-ENpAvvdCwGkqJ4unWOWpywLDjQIYT2+T+YqE7QarLd7IMf+aWx6HLFlhlvUpgNM0Tw8oL3txyCOGvI6rFqtz+Q==, tarball: file:projects/search-documents.tgz} + resolution: {integrity: sha512-v95+TnIgfPJtOulZuW73xOA/OgPCA72RP5aMD0ZAlp3qJNclhxBxULu3r7TUdQVfRrPqKuJaAGCiLUCLPqFRuQ==, tarball: file:projects/search-documents.tgz} name: '@rush-temp/search-documents' version: 0.0.0 dependencies: @@ -15785,7 +15803,6 @@ packages: - '@swc/wasm' - bufferutil - debug - - encoding - supports-color - utf-8-validate dev: false diff --git a/sdk/network/arm-network/CHANGELOG.md b/sdk/network/arm-network/CHANGELOG.md index 2f51a4fc784e..6a8b143daf07 100644 --- a/sdk/network/arm-network/CHANGELOG.md +++ b/sdk/network/arm-network/CHANGELOG.md @@ -1,15 +1,42 @@ # Release History - -## 26.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + +## 27.0.0 (2022-01-29) + +**Features** + + - Added operation group ConfigurationPolicyGroups + - Added Interface ConfigurationPolicyGroupsCreateOrUpdateOptionalParams + - Added Interface ConfigurationPolicyGroupsDeleteOptionalParams + - Added Interface ConfigurationPolicyGroupsGetOptionalParams + - Added Interface ConfigurationPolicyGroupsListByVpnServerConfigurationNextOptionalParams + - Added Interface ConfigurationPolicyGroupsListByVpnServerConfigurationOptionalParams + - Added Interface ListVpnServerConfigurationPolicyGroupsResult + - Added Interface VpnServerConfigurationPolicyGroupMember + - Added Type Alias AttributeType + - Added Type Alias ConfigurationPolicyGroupsCreateOrUpdateResponse + - Added Type Alias ConfigurationPolicyGroupsGetResponse + - Added Type Alias ConfigurationPolicyGroupsListByVpnServerConfigurationNextResponse + - Added Type Alias ConfigurationPolicyGroupsListByVpnServerConfigurationResponse + - Added Type Alias SingleQueryResultDirection + - Added Type Alias SingleQueryResultMode + - Added Type Alias SingleQueryResultSeverity + - Added Type Alias VpnServerConfigurationPolicyGroup + - Class NetworkManagementClient has a new parameter configurationPolicyGroups + - Type Alias P2SConnectionConfiguration has a new parameter configurationPolicyGroupAssociations + - Type Alias P2SConnectionConfiguration has a new parameter previousConfigurationPolicyGroupAssociations + - Type Alias VpnServerConfiguration has a new parameter configurationPolicyGroups + - Added Enum KnownAttributeType + - Added Enum KnownSingleQueryResultDirection + - Added Enum KnownSingleQueryResultMode + - Added Enum KnownSingleQueryResultSeverity + +**Breaking Changes** + + - Removed Enum KnownEnum69 + - Removed Enum KnownEnum70 + - Removed Enum KnownEnum71 + + ## 26.0.0 (2021-12-06) The package of @azure/arm-network is using our next generation design principles since version 26.0.0, which contains breaking changes. diff --git a/sdk/network/arm-network/LICENSE b/sdk/network/arm-network/LICENSE index ccb63b166732..5d1d36e0af80 100644 --- a/sdk/network/arm-network/LICENSE +++ b/sdk/network/arm-network/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/network/arm-network/_meta.json b/sdk/network/arm-network/_meta.json index ee7107f7c5e6..ff79f450c23e 100644 --- a/sdk/network/arm-network/_meta.json +++ b/sdk/network/arm-network/_meta.json @@ -1,7 +1,7 @@ { - "commit": "3b2f85d320fac5b282bc80240f9e5c2c57753bad", + "commit": "f258dbef0be5c7022045b5e212cfa3e043f50ca4", "readme": "specification/network/resource-manager/readme.md", - "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/network/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211130.1", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/network/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-alpha.16.20211130.1" + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" } \ No newline at end of file diff --git a/sdk/network/arm-network/api-extractor.json b/sdk/network/arm-network/api-extractor.json index fb18609746bc..f1d9c8954e48 100644 --- a/sdk/network/arm-network/api-extractor.json +++ b/sdk/network/arm-network/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/arm-network.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/network/arm-network/package.json b/sdk/network/arm-network/package.json index 34d2a35cd669..814145146821 100644 --- a/sdk/network/arm-network/package.json +++ b/sdk/network/arm-network/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for NetworkManagementClient.", - "version": "26.0.1", + "version": "27.0.0", "engines": { "node": ">=12.0.0" }, @@ -29,12 +29,12 @@ "types": "./types/arm-network.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.18.11", - "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-commonjs": "11.0.2", "@rollup/plugin-json": "^4.0.0", "@rollup/plugin-multi-entry": "^3.0.0", "@rollup/plugin-node-resolve": "^8.0.0", "mkdirp": "^1.0.4", - "rollup": "^2.0.0", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", "uglify-js": "^3.4.9", @@ -99,4 +99,4 @@ }, "sideEffects": false, "autoPublish": true -} +} \ No newline at end of file diff --git a/sdk/network/arm-network/review/arm-network.api.md b/sdk/network/arm-network/review/arm-network.api.md index 41797866987d..0d530e06d735 100644 --- a/sdk/network/arm-network/review/arm-network.api.md +++ b/sdk/network/arm-network/review/arm-network.api.md @@ -960,6 +960,9 @@ export type ApplicationSecurityGroupsUpdateTagsResponse = ApplicationSecurityGro // @public export type AssociationType = string; +// @public +export type AttributeType = string; + // @public export type AuthenticationMethod = string; @@ -1822,6 +1825,52 @@ export interface Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserass readonly principalId?: string; } +// @public +export interface ConfigurationPolicyGroups { + beginCreateOrUpdate(resourceGroupName: string, vpnServerConfigurationName: string, configurationPolicyGroupName: string, vpnServerConfigurationPolicyGroupParameters: VpnServerConfigurationPolicyGroup, options?: ConfigurationPolicyGroupsCreateOrUpdateOptionalParams): Promise, ConfigurationPolicyGroupsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, vpnServerConfigurationName: string, configurationPolicyGroupName: string, vpnServerConfigurationPolicyGroupParameters: VpnServerConfigurationPolicyGroup, options?: ConfigurationPolicyGroupsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, vpnServerConfigurationName: string, configurationPolicyGroupName: string, options?: ConfigurationPolicyGroupsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, vpnServerConfigurationName: string, configurationPolicyGroupName: string, options?: ConfigurationPolicyGroupsDeleteOptionalParams): Promise; + get(resourceGroupName: string, vpnServerConfigurationName: string, configurationPolicyGroupName: string, options?: ConfigurationPolicyGroupsGetOptionalParams): Promise; + listByVpnServerConfiguration(resourceGroupName: string, vpnServerConfigurationName: string, options?: ConfigurationPolicyGroupsListByVpnServerConfigurationOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ConfigurationPolicyGroupsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ConfigurationPolicyGroupsCreateOrUpdateResponse = VpnServerConfigurationPolicyGroup; + +// @public +export interface ConfigurationPolicyGroupsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ConfigurationPolicyGroupsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConfigurationPolicyGroupsGetResponse = VpnServerConfigurationPolicyGroup; + +// @public +export interface ConfigurationPolicyGroupsListByVpnServerConfigurationNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConfigurationPolicyGroupsListByVpnServerConfigurationNextResponse = ListVpnServerConfigurationPolicyGroupsResult; + +// @public +export interface ConfigurationPolicyGroupsListByVpnServerConfigurationOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConfigurationPolicyGroupsListByVpnServerConfigurationResponse = ListVpnServerConfigurationPolicyGroupsResult; + // @public export interface ConnectionMonitor { autoStart?: boolean; @@ -2737,15 +2786,6 @@ export interface EndpointServicesListResult { // @public export type EndpointType = string; -// @public -export type Enum69 = number; - -// @public -export type Enum70 = number; - -// @public -export type Enum71 = number; - // @public export interface ErrorDetails { code?: string; @@ -5261,6 +5301,16 @@ export enum KnownAssociationType { Contains = "Contains" } +// @public +export enum KnownAttributeType { + // (undocumented) + AADGroupId = "AADGroupId", + // (undocumented) + CertificateGroupId = "CertificateGroupId", + // (undocumented) + RadiusAzureGroupId = "RadiusAzureGroupId" +} + // @public export enum KnownAuthenticationMethod { // (undocumented) @@ -5597,36 +5647,6 @@ export enum KnownEndpointType { MMAWorkspaceNetwork = "MMAWorkspaceNetwork" } -// @public -export enum KnownEnum69 { - // (undocumented) - One = 1, - // (undocumented) - Two = 2, - // (undocumented) - Zero = 0 -} - -// @public -export enum KnownEnum70 { - // (undocumented) - One = 1, - // (undocumented) - Three = 3, - // (undocumented) - Two = 2 -} - -// @public -export enum KnownEnum71 { - // (undocumented) - One = 1, - // (undocumented) - Two = 2, - // (undocumented) - Zero = 0 -} - // @public export enum KnownEvaluationState { // (undocumented) @@ -6489,6 +6509,36 @@ export enum KnownSeverity { Warning = "Warning" } +// @public +export enum KnownSingleQueryResultDirection { + // (undocumented) + One = 1, + // (undocumented) + Two = 2, + // (undocumented) + Zero = 0 +} + +// @public +export enum KnownSingleQueryResultMode { + // (undocumented) + One = 1, + // (undocumented) + Two = 2, + // (undocumented) + Zero = 0 +} + +// @public +export enum KnownSingleQueryResultSeverity { + // (undocumented) + One = 1, + // (undocumented) + Three = 3, + // (undocumented) + Two = 2 +} + // @public export enum KnownSyncRemoteAddressSpace { // (undocumented) @@ -6989,6 +7039,12 @@ export interface ListVpnGatewaysResult { value?: VpnGateway[]; } +// @public +export interface ListVpnServerConfigurationPolicyGroupsResult { + nextLink?: string; + value?: VpnServerConfigurationPolicyGroup[]; +} + // @public export interface ListVpnServerConfigurationsResult { nextLink?: string; @@ -8177,6 +8233,8 @@ export class NetworkManagementClient extends coreClient.ServiceClient { bgpServiceCommunities: BgpServiceCommunities; checkDnsNameAvailability(location: string, domainNameLabel: string, options?: CheckDnsNameAvailabilityOptionalParams): Promise; // (undocumented) + configurationPolicyGroups: ConfigurationPolicyGroups; + // (undocumented) connectionMonitors: ConnectionMonitors; // (undocumented) customIPPrefixes: CustomIPPrefixes; @@ -9035,6 +9093,8 @@ export type P2SConnectionConfiguration = SubResource & { vpnClientAddressPool?: AddressSpace; routingConfiguration?: RoutingConfiguration; enableInternetSecurity?: boolean; + readonly configurationPolicyGroupAssociations?: SubResource[]; + readonly previousConfigurationPolicyGroupAssociations?: VpnServerConfigurationPolicyGroup[]; readonly provisioningState?: ProvisioningState; }; @@ -11200,17 +11260,26 @@ export interface SignaturesOverridesProperties { export interface SingleQueryResult { description?: string; destinationPorts?: string[]; - direction?: Enum71; + direction?: SingleQueryResultDirection; group?: string; inheritedFromParentPolicy?: boolean; lastUpdated?: string; - mode?: Enum69; + mode?: SingleQueryResultMode; protocol?: string; - severity?: Enum70; + severity?: SingleQueryResultSeverity; signatureId?: number; sourcePorts?: string[]; } +// @public +export type SingleQueryResultDirection = number; + +// @public +export type SingleQueryResultMode = number; + +// @public +export type SingleQueryResultSeverity = number; + // @public export interface Sku { name?: BastionHostSkuName; @@ -13575,9 +13644,29 @@ export type VpnServerConfiguration = Resource & { aadAuthenticationParameters?: AadAuthenticationParameters; readonly provisioningState?: string; readonly p2SVpnGateways?: P2SVpnGateway[]; + configurationPolicyGroups?: VpnServerConfigurationPolicyGroup[]; readonly etagPropertiesEtag?: string; }; +// @public +export type VpnServerConfigurationPolicyGroup = SubResource & { + readonly etag?: string; + name?: string; + readonly type?: string; + isDefault?: boolean; + priority?: number; + policyMembers?: VpnServerConfigurationPolicyGroupMember[]; + readonly p2SConnectionConfigurations?: SubResource[]; + readonly provisioningState?: ProvisioningState; +}; + +// @public +export interface VpnServerConfigurationPolicyGroupMember { + attributeType?: AttributeType; + attributeValue: string; + name: string; +} + // @public export interface VpnServerConfigurations { beginCreateOrUpdate(resourceGroupName: string, vpnServerConfigurationName: string, vpnServerConfigurationParameters: VpnServerConfiguration, options?: VpnServerConfigurationsCreateOrUpdateOptionalParams): Promise, VpnServerConfigurationsCreateOrUpdateResponse>>; diff --git a/sdk/network/arm-network/src/models/index.ts b/sdk/network/arm-network/src/models/index.ts index 597c7c32cc82..3c270af92d8e 100644 --- a/sdk/network/arm-network/src/models/index.ts +++ b/sdk/network/arm-network/src/models/index.ts @@ -1706,11 +1706,11 @@ export interface SingleQueryResult { /** The ID of the signature */ signatureId?: number; /** The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny */ - mode?: Enum69; + mode?: SingleQueryResultMode; /** Describes the severity of signature: 1 - Low, 2 - Medium, 3 - High */ - severity?: Enum70; + severity?: SingleQueryResultSeverity; /** Describes in which direction signature is being enforced: 0 - Inbound, 1 - OutBound, 2 - Bidirectional */ - direction?: Enum71; + direction?: SingleQueryResultDirection; /** Describes the groups the signature belongs to */ group?: string; /** Describes what is the signature enforces */ @@ -4540,6 +4540,16 @@ export interface StaticRoute { nextHopIpAddress?: string; } +/** VpnServerConfiguration PolicyGroup member */ +export interface VpnServerConfigurationPolicyGroupMember { + /** Name of the VpnServerConfigurationPolicyGroupMember. */ + name: string; + /** The Vpn Policy member attribute type. */ + attributeType?: AttributeType; + /** The value of Attribute used for this VpnServerConfigurationPolicyGroupMember. */ + attributeValue: string; +} + /** VpnClientConnectionHealth properties. */ export interface VpnClientConnectionHealth { /** @@ -4566,6 +4576,14 @@ export interface ListVpnServerConfigurationsResult { nextLink?: string; } +/** Result of the request to list VpnServerConfigurationPolicyGroups. It contains a list of VpnServerConfigurationPolicyGroups and a URL nextLink to get the next set of results. */ +export interface ListVpnServerConfigurationPolicyGroupsResult { + /** List of VpnServerConfigurationPolicyGroups. */ + value?: VpnServerConfigurationPolicyGroup[]; + /** URL to get the next set of operation list results if there are any. */ + nextLink?: string; +} + /** VirtualHub route table. */ export interface VirtualHubRouteTable { /** List of all routes. */ @@ -7331,6 +7349,38 @@ export type VpnSiteLink = SubResource & { readonly provisioningState?: ProvisioningState; }; +/** VpnServerConfigurationPolicyGroup Resource. */ +export type VpnServerConfigurationPolicyGroup = SubResource & { + /** + * A unique read-only string that changes whenever the resource is updated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly etag?: string; + /** The name of the resource that is unique within a resource group. This name can be used to access the resource. */ + name?: string; + /** + * Resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Shows if this is a Default VpnServerConfigurationPolicyGroup or not. */ + isDefault?: boolean; + /** Priority for VpnServerConfigurationPolicyGroup. */ + priority?: number; + /** Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. */ + policyMembers?: VpnServerConfigurationPolicyGroupMember[]; + /** + * List of references to P2SConnectionConfigurations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly p2SConnectionConfigurations?: SubResource[]; + /** + * The provisioning state of the VpnServerConfigurationPolicyGroup resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +}; + /** P2SConnectionConfiguration Resource. */ export type P2SConnectionConfiguration = SubResource & { /** The name of the resource that is unique within a resource group. This name can be used to access the resource. */ @@ -7346,6 +7396,16 @@ export type P2SConnectionConfiguration = SubResource & { routingConfiguration?: RoutingConfiguration; /** Flag indicating whether the enable internet security flag is turned on for the P2S Connections or not. */ enableInternetSecurity?: boolean; + /** + * List of Configuration Policy Groups that this P2SConnectionConfiguration is attached to. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly configurationPolicyGroupAssociations?: SubResource[]; + /** + * List of previous Configuration Policy Groups that this P2SConnectionConfiguration was attached to. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly previousConfigurationPolicyGroupAssociations?: VpnServerConfigurationPolicyGroup[]; /** * The provisioning state of the P2SConnectionConfiguration resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -9527,6 +9587,8 @@ export type VpnServerConfiguration = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly p2SVpnGateways?: P2SVpnGateway[]; + /** List of all VpnServerConfigurationPolicyGroups. */ + configurationPolicyGroups?: VpnServerConfigurationPolicyGroup[]; /** * A unique read-only string that changes whenever the resource is updated. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -11105,59 +11167,59 @@ export enum KnownOrderByOrder { */ export type OrderByOrder = string; -/** Known values of {@link Enum69} that the service accepts. */ -export enum KnownEnum69 { +/** Known values of {@link SingleQueryResultMode} that the service accepts. */ +export enum KnownSingleQueryResultMode { Zero = 0, One = 1, Two = 2 } /** - * Defines values for Enum69. \ - * {@link KnownEnum69} can be used interchangeably with Enum69, + * Defines values for SingleQueryResultMode. \ + * {@link KnownSingleQueryResultMode} can be used interchangeably with SingleQueryResultMode, * this enum contains the known values that the service supports. * ### Known values supported by the service * **0** \ * **1** \ * **2** */ -export type Enum69 = number; +export type SingleQueryResultMode = number; -/** Known values of {@link Enum70} that the service accepts. */ -export enum KnownEnum70 { +/** Known values of {@link SingleQueryResultSeverity} that the service accepts. */ +export enum KnownSingleQueryResultSeverity { One = 1, Two = 2, Three = 3 } /** - * Defines values for Enum70. \ - * {@link KnownEnum70} can be used interchangeably with Enum70, + * Defines values for SingleQueryResultSeverity. \ + * {@link KnownSingleQueryResultSeverity} can be used interchangeably with SingleQueryResultSeverity, * this enum contains the known values that the service supports. * ### Known values supported by the service * **1** \ * **2** \ * **3** */ -export type Enum70 = number; +export type SingleQueryResultSeverity = number; -/** Known values of {@link Enum71} that the service accepts. */ -export enum KnownEnum71 { +/** Known values of {@link SingleQueryResultDirection} that the service accepts. */ +export enum KnownSingleQueryResultDirection { Zero = 0, One = 1, Two = 2 } /** - * Defines values for Enum71. \ - * {@link KnownEnum71} can be used interchangeably with Enum71, + * Defines values for SingleQueryResultDirection. \ + * {@link KnownSingleQueryResultDirection} can be used interchangeably with SingleQueryResultDirection, * this enum contains the known values that the service supports. * ### Known values supported by the service * **0** \ * **1** \ * **2** */ -export type Enum71 = number; +export type SingleQueryResultDirection = number; /** Known values of {@link IpAllocationType} that the service accepts. */ export enum KnownIpAllocationType { @@ -12563,6 +12625,24 @@ export enum KnownVpnGatewayTunnelingProtocol { */ export type VpnGatewayTunnelingProtocol = string; +/** Known values of {@link AttributeType} that the service accepts. */ +export enum KnownAttributeType { + CertificateGroupId = "CertificateGroupId", + AADGroupId = "AADGroupId", + RadiusAzureGroupId = "RadiusAzureGroupId" +} + +/** + * Defines values for AttributeType. \ + * {@link KnownAttributeType} can be used interchangeably with AttributeType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CertificateGroupId** \ + * **AADGroupId** \ + * **RadiusAzureGroupId** + */ +export type AttributeType = string; + /** Known values of {@link RoutingState} that the service accepts. */ export enum KnownRoutingState { None = "None", @@ -18041,6 +18121,48 @@ export interface VpnServerConfigurationsListNextOptionalParams /** Contains response data for the listNext operation. */ export type VpnServerConfigurationsListNextResponse = ListVpnServerConfigurationsResult; +/** Optional parameters. */ +export interface ConfigurationPolicyGroupsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type ConfigurationPolicyGroupsCreateOrUpdateResponse = VpnServerConfigurationPolicyGroup; + +/** Optional parameters. */ +export interface ConfigurationPolicyGroupsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface ConfigurationPolicyGroupsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ConfigurationPolicyGroupsGetResponse = VpnServerConfigurationPolicyGroup; + +/** Optional parameters. */ +export interface ConfigurationPolicyGroupsListByVpnServerConfigurationOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByVpnServerConfiguration operation. */ +export type ConfigurationPolicyGroupsListByVpnServerConfigurationResponse = ListVpnServerConfigurationPolicyGroupsResult; + +/** Optional parameters. */ +export interface ConfigurationPolicyGroupsListByVpnServerConfigurationNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByVpnServerConfigurationNext operation. */ +export type ConfigurationPolicyGroupsListByVpnServerConfigurationNextResponse = ListVpnServerConfigurationPolicyGroupsResult; + /** Optional parameters. */ export interface VirtualHubsGetOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/network/arm-network/src/models/mappers.ts b/sdk/network/arm-network/src/models/mappers.ts index 0850c58d9d8b..461bf85d3211 100644 --- a/sdk/network/arm-network/src/models/mappers.ts +++ b/sdk/network/arm-network/src/models/mappers.ts @@ -12665,6 +12665,35 @@ export const StaticRoute: coreClient.CompositeMapper = { } }; +export const VpnServerConfigurationPolicyGroupMember: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VpnServerConfigurationPolicyGroupMember", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + attributeType: { + serializedName: "attributeType", + type: { + name: "String" + } + }, + attributeValue: { + serializedName: "attributeValue", + required: true, + type: { + name: "String" + } + } + } + } +}; + export const VpnClientConnectionHealth: coreClient.CompositeMapper = { type: { name: "Composite", @@ -12732,6 +12761,33 @@ export const ListVpnServerConfigurationsResult: coreClient.CompositeMapper = { } }; +export const ListVpnServerConfigurationPolicyGroupsResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ListVpnServerConfigurationPolicyGroupsResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VpnServerConfigurationPolicyGroup" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const VirtualHubRouteTable: coreClient.CompositeMapper = { type: { name: "Composite", @@ -19569,6 +19625,80 @@ export const VpnSiteLink: coreClient.CompositeMapper = { } }; +export const VpnServerConfigurationPolicyGroup: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VpnServerConfigurationPolicyGroup", + modelProperties: { + ...SubResource.type.modelProperties, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + isDefault: { + serializedName: "properties.isDefault", + type: { + name: "Boolean" + } + }, + priority: { + serializedName: "properties.priority", + type: { + name: "Number" + } + }, + policyMembers: { + serializedName: "properties.policyMembers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VpnServerConfigurationPolicyGroupMember" + } + } + } + }, + p2SConnectionConfigurations: { + serializedName: "properties.p2SConnectionConfigurations", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SubResource" + } + } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const P2SConnectionConfiguration: coreClient.CompositeMapper = { type: { name: "Composite", @@ -19608,6 +19738,33 @@ export const P2SConnectionConfiguration: coreClient.CompositeMapper = { name: "Boolean" } }, + configurationPolicyGroupAssociations: { + serializedName: "properties.configurationPolicyGroupAssociations", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SubResource" + } + } + } + }, + previousConfigurationPolicyGroupAssociations: { + serializedName: + "properties.previousConfigurationPolicyGroupAssociations", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VpnServerConfigurationPolicyGroup" + } + } + } + }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, @@ -25244,6 +25401,18 @@ export const VpnServerConfiguration: coreClient.CompositeMapper = { } } }, + configurationPolicyGroups: { + serializedName: "properties.configurationPolicyGroups", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VpnServerConfigurationPolicyGroup" + } + } + } + }, etagPropertiesEtag: { serializedName: "properties.etag", readOnly: true, diff --git a/sdk/network/arm-network/src/models/parameters.ts b/sdk/network/arm-network/src/models/parameters.ts index 4f81f563b0d9..770374b3ec86 100644 --- a/sdk/network/arm-network/src/models/parameters.ts +++ b/sdk/network/arm-network/src/models/parameters.ts @@ -109,6 +109,7 @@ import { VpnSite as VpnSiteMapper, GetVpnSitesConfigurationRequest as GetVpnSitesConfigurationRequestMapper, VpnServerConfiguration as VpnServerConfigurationMapper, + VpnServerConfigurationPolicyGroup as VpnServerConfigurationPolicyGroupMapper, VirtualHub as VirtualHubMapper, EffectiveRoutesParameters as EffectiveRoutesParametersMapper, HubVirtualNetworkConnection as HubVirtualNetworkConnectionMapper, @@ -181,7 +182,7 @@ export const applicationGatewayName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-05-01", + defaultValue: "2021-08-01", isConstant: true, serializedName: "api-version", type: { @@ -1751,6 +1752,22 @@ export const vpnServerConfigurationParameters1: OperationParameter = { mapper: TagsObjectMapper }; +export const vpnServerConfigurationPolicyGroupParameters: OperationParameter = { + parameterPath: "vpnServerConfigurationPolicyGroupParameters", + mapper: VpnServerConfigurationPolicyGroupMapper +}; + +export const configurationPolicyGroupName: OperationURLParameter = { + parameterPath: "configurationPolicyGroupName", + mapper: { + serializedName: "configurationPolicyGroupName", + required: true, + type: { + name: "String" + } + } +}; + export const virtualHubName: OperationURLParameter = { parameterPath: "virtualHubName", mapper: { diff --git a/sdk/network/arm-network/src/networkManagementClient.ts b/sdk/network/arm-network/src/networkManagementClient.ts index 86d87cc2dbfe..3295f07343db 100644 --- a/sdk/network/arm-network/src/networkManagementClient.ts +++ b/sdk/network/arm-network/src/networkManagementClient.ts @@ -106,6 +106,7 @@ import { VpnSiteLinksImpl, VpnSitesConfigurationImpl, VpnServerConfigurationsImpl, + ConfigurationPolicyGroupsImpl, VirtualHubsImpl, HubVirtualNetworkConnectionsImpl, VpnGatewaysImpl, @@ -220,6 +221,7 @@ import { VpnSiteLinks, VpnSitesConfiguration, VpnServerConfigurations, + ConfigurationPolicyGroups, VirtualHubs, HubVirtualNetworkConnections, VpnGateways, @@ -307,7 +309,7 @@ export class NetworkManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-network/26.0.0`; + const packageDetails = `azsdk-js-arm-network/27.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -480,6 +482,7 @@ export class NetworkManagementClient extends coreClient.ServiceClient { this.vpnSiteLinks = new VpnSiteLinksImpl(this); this.vpnSitesConfiguration = new VpnSitesConfigurationImpl(this); this.vpnServerConfigurations = new VpnServerConfigurationsImpl(this); + this.configurationPolicyGroups = new ConfigurationPolicyGroupsImpl(this); this.virtualHubs = new VirtualHubsImpl(this); this.hubVirtualNetworkConnections = new HubVirtualNetworkConnectionsImpl( this @@ -1390,6 +1393,7 @@ export class NetworkManagementClient extends coreClient.ServiceClient { vpnSiteLinks: VpnSiteLinks; vpnSitesConfiguration: VpnSitesConfiguration; vpnServerConfigurations: VpnServerConfigurations; + configurationPolicyGroups: ConfigurationPolicyGroups; virtualHubs: VirtualHubs; hubVirtualNetworkConnections: HubVirtualNetworkConnections; vpnGateways: VpnGateways; diff --git a/sdk/network/arm-network/src/operations/configurationPolicyGroups.ts b/sdk/network/arm-network/src/operations/configurationPolicyGroups.ts new file mode 100644 index 000000000000..2a1288ade4ce --- /dev/null +++ b/sdk/network/arm-network/src/operations/configurationPolicyGroups.ts @@ -0,0 +1,500 @@ +/* + * 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 { ConfigurationPolicyGroups } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkManagementClient } from "../networkManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + VpnServerConfigurationPolicyGroup, + ConfigurationPolicyGroupsListByVpnServerConfigurationNextOptionalParams, + ConfigurationPolicyGroupsListByVpnServerConfigurationOptionalParams, + ConfigurationPolicyGroupsCreateOrUpdateOptionalParams, + ConfigurationPolicyGroupsCreateOrUpdateResponse, + ConfigurationPolicyGroupsDeleteOptionalParams, + ConfigurationPolicyGroupsGetOptionalParams, + ConfigurationPolicyGroupsGetResponse, + ConfigurationPolicyGroupsListByVpnServerConfigurationResponse, + ConfigurationPolicyGroupsListByVpnServerConfigurationNextResponse +} from "../models"; + +/// +/** Class containing ConfigurationPolicyGroups operations. */ +export class ConfigurationPolicyGroupsImpl + implements ConfigurationPolicyGroups { + private readonly client: NetworkManagementClient; + + /** + * Initialize a new instance of the class ConfigurationPolicyGroups class. + * @param client Reference to the service client + */ + constructor(client: NetworkManagementClient) { + this.client = client; + } + + /** + * Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param options The options parameters. + */ + public listByVpnServerConfiguration( + resourceGroupName: string, + vpnServerConfigurationName: string, + options?: ConfigurationPolicyGroupsListByVpnServerConfigurationOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByVpnServerConfigurationPagingAll( + resourceGroupName, + vpnServerConfigurationName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByVpnServerConfigurationPagingPage( + resourceGroupName, + vpnServerConfigurationName, + options + ); + } + }; + } + + private async *listByVpnServerConfigurationPagingPage( + resourceGroupName: string, + vpnServerConfigurationName: string, + options?: ConfigurationPolicyGroupsListByVpnServerConfigurationOptionalParams + ): AsyncIterableIterator { + let result = await this._listByVpnServerConfiguration( + resourceGroupName, + vpnServerConfigurationName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByVpnServerConfigurationNext( + resourceGroupName, + vpnServerConfigurationName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByVpnServerConfigurationPagingAll( + resourceGroupName: string, + vpnServerConfigurationName: string, + options?: ConfigurationPolicyGroupsListByVpnServerConfigurationOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByVpnServerConfigurationPagingPage( + resourceGroupName, + vpnServerConfigurationName, + options + )) { + yield* page; + } + } + + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + vpnServerConfigurationName: string, + configurationPolicyGroupName: string, + vpnServerConfigurationPolicyGroupParameters: VpnServerConfigurationPolicyGroup, + options?: ConfigurationPolicyGroupsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ConfigurationPolicyGroupsCreateOrUpdateResponse + > + > { + 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, + vpnServerConfigurationName, + configurationPolicyGroupName, + vpnServerConfigurationPolicyGroupParameters, + options + }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + vpnServerConfigurationName: string, + configurationPolicyGroupName: string, + vpnServerConfigurationPolicyGroupParameters: VpnServerConfigurationPolicyGroup, + options?: ConfigurationPolicyGroupsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + vpnServerConfigurationName, + configurationPolicyGroupName, + vpnServerConfigurationPolicyGroupParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a ConfigurationPolicyGroup. + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + vpnServerConfigurationName: string, + configurationPolicyGroupName: string, + options?: ConfigurationPolicyGroupsDeleteOptionalParams + ): 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, + vpnServerConfigurationName, + configurationPolicyGroupName, + options + }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + + /** + * Deletes a ConfigurationPolicyGroup. + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + vpnServerConfigurationName: string, + configurationPolicyGroupName: string, + options?: ConfigurationPolicyGroupsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + vpnServerConfigurationName, + configurationPolicyGroupName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Retrieves the details of a ConfigurationPolicyGroup. + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup being retrieved. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + vpnServerConfigurationName: string, + configurationPolicyGroupName: string, + options?: ConfigurationPolicyGroupsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + vpnServerConfigurationName, + configurationPolicyGroupName, + options + }, + getOperationSpec + ); + } + + /** + * Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param options The options parameters. + */ + private _listByVpnServerConfiguration( + resourceGroupName: string, + vpnServerConfigurationName: string, + options?: ConfigurationPolicyGroupsListByVpnServerConfigurationOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, vpnServerConfigurationName, options }, + listByVpnServerConfigurationOperationSpec + ); + } + + /** + * ListByVpnServerConfigurationNext + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param nextLink The nextLink from the previous successful call to the ListByVpnServerConfiguration + * method. + * @param options The options parameters. + */ + private _listByVpnServerConfigurationNext( + resourceGroupName: string, + vpnServerConfigurationName: string, + nextLink: string, + options?: ConfigurationPolicyGroupsListByVpnServerConfigurationNextOptionalParams + ): Promise< + ConfigurationPolicyGroupsListByVpnServerConfigurationNextResponse + > { + return this.client.sendOperationRequest( + { resourceGroupName, vpnServerConfigurationName, nextLink, options }, + listByVpnServerConfigurationNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.VpnServerConfigurationPolicyGroup + }, + 201: { + bodyMapper: Mappers.VpnServerConfigurationPolicyGroup + }, + 202: { + bodyMapper: Mappers.VpnServerConfigurationPolicyGroup + }, + 204: { + bodyMapper: Mappers.VpnServerConfigurationPolicyGroup + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.vpnServerConfigurationPolicyGroupParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.vpnServerConfigurationName, + Parameters.configurationPolicyGroupName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.vpnServerConfigurationName, + Parameters.configurationPolicyGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VpnServerConfigurationPolicyGroup + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.vpnServerConfigurationName, + Parameters.configurationPolicyGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByVpnServerConfigurationOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ListVpnServerConfigurationPolicyGroupsResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.vpnServerConfigurationName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByVpnServerConfigurationNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ListVpnServerConfigurationPolicyGroupsResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.vpnServerConfigurationName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/network/arm-network/src/operations/index.ts b/sdk/network/arm-network/src/operations/index.ts index 19e1496111f9..93fb4ae28fab 100644 --- a/sdk/network/arm-network/src/operations/index.ts +++ b/sdk/network/arm-network/src/operations/index.ts @@ -100,6 +100,7 @@ export * from "./vpnSites"; export * from "./vpnSiteLinks"; export * from "./vpnSitesConfiguration"; export * from "./vpnServerConfigurations"; +export * from "./configurationPolicyGroups"; export * from "./virtualHubs"; export * from "./hubVirtualNetworkConnections"; export * from "./vpnGateways"; diff --git a/sdk/network/arm-network/src/operationsInterfaces/configurationPolicyGroups.ts b/sdk/network/arm-network/src/operationsInterfaces/configurationPolicyGroups.ts new file mode 100644 index 000000000000..537b4a9e71fe --- /dev/null +++ b/sdk/network/arm-network/src/operationsInterfaces/configurationPolicyGroups.ts @@ -0,0 +1,111 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + VpnServerConfigurationPolicyGroup, + ConfigurationPolicyGroupsListByVpnServerConfigurationOptionalParams, + ConfigurationPolicyGroupsCreateOrUpdateOptionalParams, + ConfigurationPolicyGroupsCreateOrUpdateResponse, + ConfigurationPolicyGroupsDeleteOptionalParams, + ConfigurationPolicyGroupsGetOptionalParams, + ConfigurationPolicyGroupsGetResponse +} from "../models"; + +/// +/** Interface representing a ConfigurationPolicyGroups. */ +export interface ConfigurationPolicyGroups { + /** + * Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param options The options parameters. + */ + listByVpnServerConfiguration( + resourceGroupName: string, + vpnServerConfigurationName: string, + options?: ConfigurationPolicyGroupsListByVpnServerConfigurationOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + vpnServerConfigurationName: string, + configurationPolicyGroupName: string, + vpnServerConfigurationPolicyGroupParameters: VpnServerConfigurationPolicyGroup, + options?: ConfigurationPolicyGroupsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ConfigurationPolicyGroupsCreateOrUpdateResponse + > + >; + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + vpnServerConfigurationName: string, + configurationPolicyGroupName: string, + vpnServerConfigurationPolicyGroupParameters: VpnServerConfigurationPolicyGroup, + options?: ConfigurationPolicyGroupsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a ConfigurationPolicyGroup. + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + vpnServerConfigurationName: string, + configurationPolicyGroupName: string, + options?: ConfigurationPolicyGroupsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a ConfigurationPolicyGroup. + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + vpnServerConfigurationName: string, + configurationPolicyGroupName: string, + options?: ConfigurationPolicyGroupsDeleteOptionalParams + ): Promise; + /** + * Retrieves the details of a ConfigurationPolicyGroup. + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup being retrieved. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + vpnServerConfigurationName: string, + configurationPolicyGroupName: string, + options?: ConfigurationPolicyGroupsGetOptionalParams + ): Promise; +} diff --git a/sdk/network/arm-network/src/operationsInterfaces/index.ts b/sdk/network/arm-network/src/operationsInterfaces/index.ts index 19e1496111f9..93fb4ae28fab 100644 --- a/sdk/network/arm-network/src/operationsInterfaces/index.ts +++ b/sdk/network/arm-network/src/operationsInterfaces/index.ts @@ -100,6 +100,7 @@ export * from "./vpnSites"; export * from "./vpnSiteLinks"; export * from "./vpnSitesConfiguration"; export * from "./vpnServerConfigurations"; +export * from "./configurationPolicyGroups"; export * from "./virtualHubs"; export * from "./hubVirtualNetworkConnections"; export * from "./vpnGateways"; diff --git a/sdk/network/arm-network/test/sampleTest.ts b/sdk/network/arm-network/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/network/arm-network/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * 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 { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + 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" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/network/arm-network/tsconfig.json b/sdk/network/arm-network/tsconfig.json index 6e3251194117..3e6ae96443f3 100644 --- a/sdk/network/arm-network/tsconfig.json +++ b/sdk/network/arm-network/tsconfig.json @@ -9,11 +9,19 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "declaration": true, "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts", "./test/**/*.ts"], - "exclude": ["node_modules"] -} + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file