diff --git a/sdk/network/arm-network/CHANGELOG.md b/sdk/network/arm-network/CHANGELOG.md index 5b85e1bd3339..5de608c0bfec 100644 --- a/sdk/network/arm-network/CHANGELOG.md +++ b/sdk/network/arm-network/CHANGELOG.md @@ -1,15 +1,33 @@ # Release History + +## 32.0.0 (2023-06-16) + +**Features** -## 31.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added Type Alias AdminState + - Interface ActiveDefaultSecurityAdminRule has a new optional parameter resourceGuid + - Interface ActiveSecurityAdminRule has a new optional parameter resourceGuid + - Interface AdminRule has a new optional parameter resourceGuid + - Interface AdminRuleCollection has a new optional parameter resourceGuid + - Interface ApplicationGateway has a new optional parameter defaultPredefinedSslPolicy + - Interface ConfigurationGroup has a new optional parameter resourceGuid + - Interface ConnectivityConfiguration has a new optional parameter resourceGuid + - Interface DefaultAdminRule has a new optional parameter resourceGuid + - Interface EffectiveConnectivityConfiguration has a new optional parameter resourceGuid + - Interface EffectiveDefaultSecurityAdminRule has a new optional parameter resourceGuid + - Interface EffectiveSecurityAdminRule has a new optional parameter resourceGuid + - Interface NetworkGroup has a new optional parameter resourceGuid + - Interface NetworkManager has a new optional parameter resourceGuid + - Interface SecurityAdminConfiguration has a new optional parameter resourceGuid + - Interface VirtualNetworkGateway has a new optional parameter adminState + - Added Enum KnownAdminState -### Other Changes +**Breaking Changes** + - Class NetworkManagementClient has a new signature + - Enum KnownApplicationGatewayCustomErrorStatusCode no longer has value HttpStatus499 + + ## 31.0.0 (2023-05-19) **Features** diff --git a/sdk/network/arm-network/_meta.json b/sdk/network/arm-network/_meta.json index 260ce06e74a8..c069c0903a1c 100644 --- a/sdk/network/arm-network/_meta.json +++ b/sdk/network/arm-network/_meta.json @@ -1,8 +1,8 @@ { - "commit": "ec1dd632841c121d2e2eac3d9e5e24a0428fa741", + "commit": "f622dab48d3f9b17341453085c89a16f48f56123", "readme": "specification/network/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\network\\resource-manager\\readme.md --use=@autorest/typescript@6.0.2 --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/network/resource-manager/readme.md --use=@autorest/typescript@^6.0.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.2" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.1", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/network/arm-network/package.json b/sdk/network/arm-network/package.json index 0f26c75e7780..58c0821b5f5b 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": "31.0.1", + "version": "32.0.0", "engines": { "node": ">=14.0.0" }, @@ -111,13 +111,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/network/arm-network", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-network?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/network/arm-network" +} \ 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 1b96bd189147..31e553e3584b 100644 --- a/sdk/network/arm-network/review/arm-network.api.md +++ b/sdk/network/arm-network/review/arm-network.api.md @@ -74,6 +74,7 @@ export interface ActiveDefaultSecurityAdminRule extends ActiveBaseSecurityAdminR readonly priority?: number; readonly protocol?: SecurityConfigurationRuleProtocol; readonly provisioningState?: ProvisioningState; + readonly resourceGuid?: string; readonly sourcePortRanges?: string[]; readonly sources?: AddressPrefixItem[]; } @@ -89,6 +90,7 @@ export interface ActiveSecurityAdminRule extends ActiveBaseSecurityAdminRule { priority?: number; protocol?: SecurityConfigurationRuleProtocol; readonly provisioningState?: ProvisioningState; + readonly resourceGuid?: string; sourcePortRanges?: string[]; sources?: AddressPrefixItem[]; } @@ -124,6 +126,7 @@ export interface AdminRule extends BaseAdminRule { priority?: number; protocol?: SecurityConfigurationRuleProtocol; readonly provisioningState?: ProvisioningState; + readonly resourceGuid?: string; sourcePortRanges?: string[]; sources?: AddressPrefixItem[]; } @@ -133,6 +136,7 @@ export interface AdminRuleCollection extends ChildResource { appliesToGroups?: NetworkManagerSecurityGroupItem[]; description?: string; readonly provisioningState?: ProvisioningState; + readonly resourceGuid?: string; readonly systemData?: SystemData; } @@ -253,6 +257,9 @@ export interface AdminRulesListOptionalParams extends coreClient.OperationOption // @public export type AdminRulesListResponse = AdminRuleListResult; +// @public +export type AdminState = string; + // @public export interface ApplicationGateway extends Resource { authenticationCertificates?: ApplicationGatewayAuthenticationCertificate[]; @@ -261,6 +268,7 @@ export interface ApplicationGateway extends Resource { backendHttpSettingsCollection?: ApplicationGatewayBackendHttpSettings[]; backendSettingsCollection?: ApplicationGatewayBackendSettings[]; customErrorConfigurations?: ApplicationGatewayCustomError[]; + readonly defaultPredefinedSslPolicy?: ApplicationGatewaySslPolicyName; enableFips?: boolean; enableHttp2?: boolean; readonly etag?: string; @@ -2249,6 +2257,7 @@ export interface ConfigurationGroup { description?: string; id?: string; readonly provisioningState?: ProvisioningState; + readonly resourceGuid?: string; } // @public @@ -2610,6 +2619,7 @@ export interface ConnectivityConfiguration extends ChildResource { hubs?: Hub[]; isGlobal?: IsGlobal; readonly provisioningState?: ProvisioningState; + readonly resourceGuid?: string; readonly systemData?: SystemData; } @@ -3061,6 +3071,7 @@ export interface DefaultAdminRule extends BaseAdminRule { readonly priority?: number; readonly protocol?: SecurityConfigurationRuleProtocol; readonly provisioningState?: ProvisioningState; + readonly resourceGuid?: string; readonly sourcePortRanges?: string[]; readonly sources?: AddressPrefixItem[]; } @@ -3287,6 +3298,7 @@ export interface EffectiveConnectivityConfiguration { id?: string; isGlobal?: IsGlobal; readonly provisioningState?: ProvisioningState; + readonly resourceGuid?: string; } // @public @@ -3301,6 +3313,7 @@ export interface EffectiveDefaultSecurityAdminRule extends EffectiveBaseSecurity readonly priority?: number; readonly protocol?: SecurityConfigurationRuleProtocol; readonly provisioningState?: ProvisioningState; + readonly resourceGuid?: string; readonly sourcePortRanges?: string[]; readonly sources?: AddressPrefixItem[]; } @@ -3397,6 +3410,7 @@ export interface EffectiveSecurityAdminRule extends EffectiveBaseSecurityAdminRu priority?: number; protocol?: SecurityConfigurationRuleProtocol; readonly provisioningState?: ProvisioningState; + readonly resourceGuid?: string; sourcePortRanges?: string[]; sources?: AddressPrefixItem[]; } @@ -5949,6 +5963,12 @@ export enum KnownAdminRuleKind { Default = "Default" } +// @public +export enum KnownAdminState { + Disabled = "Disabled", + Enabled = "Enabled" +} + // @public export enum KnownApplicationGatewayBackendHealthServerHealth { Down = "Down", @@ -5977,7 +5997,6 @@ export enum KnownApplicationGatewayCustomErrorStatusCode { HttpStatus404 = "HttpStatus404", HttpStatus405 = "HttpStatus405", HttpStatus408 = "HttpStatus408", - HttpStatus499 = "HttpStatus499", HttpStatus500 = "HttpStatus500", HttpStatus502 = "HttpStatus502", HttpStatus503 = "HttpStatus503", @@ -8424,6 +8443,7 @@ export interface NetworkConfigurationDiagnosticResult { export interface NetworkGroup extends ChildResource { description?: string; readonly provisioningState?: ProvisioningState; + readonly resourceGuid?: string; readonly systemData?: SystemData; } @@ -8912,6 +8932,7 @@ export class NetworkManagementClient extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: NetworkManagementClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: NetworkManagementClientOptionalParams); // (undocumented) adminRuleCollections: AdminRuleCollections; // (undocumented) @@ -9131,7 +9152,7 @@ export class NetworkManagementClient extends coreClient.ServiceClient { // (undocumented) subnets: Subnets; // (undocumented) - subscriptionId: string; + subscriptionId?: string; // (undocumented) subscriptionNetworkManagerConnections: SubscriptionNetworkManagerConnections; supportedSecurityProviders(resourceGroupName: string, virtualWANName: string, options?: SupportedSecurityProvidersOptionalParams): Promise; @@ -9208,6 +9229,7 @@ export interface NetworkManager extends Resource { networkManagerScopeAccesses?: ConfigurationType[]; networkManagerScopes?: NetworkManagerPropertiesNetworkManagerScopes; readonly provisioningState?: ProvisioningState; + readonly resourceGuid?: string; readonly systemData?: SystemData; } @@ -12038,6 +12060,7 @@ export interface SecurityAdminConfiguration extends ChildResource { applyOnNetworkIntentPolicyBasedServices?: NetworkIntentPolicyBasedService[]; description?: string; readonly provisioningState?: ProvisioningState; + readonly resourceGuid?: string; readonly systemData?: SystemData; } @@ -13583,6 +13606,7 @@ export type VirtualNetworkEncryptionEnforcement = string; // @public export interface VirtualNetworkGateway extends Resource { active?: boolean; + adminState?: AdminState; allowRemoteVnetTraffic?: boolean; allowVirtualWanTraffic?: boolean; bgpSettings?: BgpSettings; diff --git a/sdk/network/arm-network/src/models/index.ts b/sdk/network/arm-network/src/models/index.ts index 514ba5e57c58..bcd3e86f9210 100644 --- a/sdk/network/arm-network/src/models/index.ts +++ b/sdk/network/arm-network/src/models/index.ts @@ -2338,6 +2338,11 @@ export interface EffectiveConnectivityConfiguration { readonly provisioningState?: ProvisioningState; /** Flag if need to remove current existing peerings. */ deleteExistingPeering?: DeleteExistingPeering; + /** + * Unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceGuid?: string; } /** Hub Item. */ @@ -2371,6 +2376,11 @@ export interface ConfigurationGroup { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; + /** + * Unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceGuid?: string; } /** Result of the request to list active security admin rules. It contains a list of active security admin rules and a skiptoken to get the next set of results. */ @@ -2614,9 +2624,9 @@ export interface VirtualApplianceNicProperties { /** Network Virtual Appliance Additional NIC properties. */ export interface VirtualApplianceAdditionalNicProperties { - /** Customer Name for additional nic */ + /** Name of additional nic */ name?: string; - /** Customer Intent for Public Ip on additional nic */ + /** Flag (true or false) for Intent for Public Ip on additional nic */ hasPublicIp?: boolean; } @@ -9424,6 +9434,11 @@ export interface ApplicationGateway extends Resource { loadDistributionPolicies?: ApplicationGatewayLoadDistributionPolicy[]; /** Global Configuration. */ globalConfiguration?: ApplicationGatewayGlobalConfiguration; + /** + * The default predefined SSL Policy applied on the application gateway resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly defaultPredefinedSslPolicy?: ApplicationGatewaySslPolicyName; } /** A web application firewall rule set. */ @@ -10067,6 +10082,11 @@ export interface NetworkManager extends Resource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; + /** + * Unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceGuid?: string; } /** Network profile resource. */ @@ -10424,6 +10444,8 @@ export interface VirtualNetworkGateway extends Resource { allowVirtualWanTraffic?: boolean; /** Configure this gateway to accept traffic from other Azure Virtual Networks. This configuration does not support connectivity to Azure Virtual WAN. */ allowRemoteVnetTraffic?: boolean; + /** Property to indicate if the Express Route Gateway serves traffic when there are multiple Express Route Gateways in the vnet */ + adminState?: AdminState; } /** A common class for general resource information. */ @@ -11016,6 +11038,11 @@ export interface ActiveSecurityAdminRule extends ActiveBaseSecurityAdminRule { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; + /** + * Unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceGuid?: string; } /** Network default admin rule. */ @@ -11075,6 +11102,11 @@ export interface ActiveDefaultSecurityAdminRule * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; + /** + * Unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceGuid?: string; } /** The Network Manager Connection resource */ @@ -11119,6 +11151,11 @@ export interface ConnectivityConfiguration extends ChildResource { readonly provisioningState?: ProvisioningState; /** Flag if need to remove current existing peerings. */ deleteExistingPeering?: DeleteExistingPeering; + /** + * Unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceGuid?: string; } /** The network group resource */ @@ -11135,6 +11172,11 @@ export interface NetworkGroup extends ChildResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; + /** + * Unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceGuid?: string; } /** StaticMember Item. */ @@ -11194,6 +11236,11 @@ export interface SecurityAdminConfiguration extends ChildResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; + /** + * Unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceGuid?: string; } /** Defines the admin rule collection. */ @@ -11212,6 +11259,11 @@ export interface AdminRuleCollection extends ChildResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; + /** + * Unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceGuid?: string; } /** Network base admin rule. */ @@ -11253,6 +11305,11 @@ export interface EffectiveSecurityAdminRule * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; + /** + * Unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceGuid?: string; } /** Network default admin rule. */ @@ -11312,6 +11369,11 @@ export interface EffectiveDefaultSecurityAdminRule * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; + /** + * Unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceGuid?: string; } /** The properties of a packet capture session. */ @@ -11443,6 +11505,11 @@ export interface AdminRule extends BaseAdminRule { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; + /** + * Unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceGuid?: string; } /** Network default admin rule. */ @@ -11501,6 +11568,11 @@ export interface DefaultAdminRule extends BaseAdminRule { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; + /** + * Unique identifier for this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceGuid?: string; } /** Defines headers for AzureFirewalls_packetCapture operation. */ @@ -12411,8 +12483,6 @@ export enum KnownApplicationGatewayCustomErrorStatusCode { HttpStatus405 = "HttpStatus405", /** HttpStatus408 */ HttpStatus408 = "HttpStatus408", - /** HttpStatus499 */ - HttpStatus499 = "HttpStatus499", /** HttpStatus500 */ HttpStatus500 = "HttpStatus500", /** HttpStatus502 */ @@ -12433,7 +12503,6 @@ export enum KnownApplicationGatewayCustomErrorStatusCode { * **HttpStatus404** \ * **HttpStatus405** \ * **HttpStatus408** \ - * **HttpStatus499** \ * **HttpStatus500** \ * **HttpStatus502** \ * **HttpStatus503** \ @@ -15183,6 +15252,24 @@ export enum KnownVpnNatRuleMode { */ export type VpnNatRuleMode = string; +/** Known values of {@link AdminState} that the service accepts. */ +export enum KnownAdminState { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled" +} + +/** + * Defines values for AdminState. \ + * {@link KnownAdminState} can be used interchangeably with AdminState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type AdminState = string; + /** Known values of {@link VirtualNetworkGatewayConnectionType} that the service accepts. */ export enum KnownVirtualNetworkGatewayConnectionType { /** IPsec */ diff --git a/sdk/network/arm-network/src/models/mappers.ts b/sdk/network/arm-network/src/models/mappers.ts index 13321224e0ab..2129e3df6570 100644 --- a/sdk/network/arm-network/src/models/mappers.ts +++ b/sdk/network/arm-network/src/models/mappers.ts @@ -6656,6 +6656,13 @@ export const EffectiveConnectivityConfiguration: coreClient.CompositeMapper = { type: { name: "String" } + }, + resourceGuid: { + serializedName: "properties.resourceGuid", + readOnly: true, + type: { + name: "String" + } } } } @@ -6740,6 +6747,13 @@ export const ConfigurationGroup: coreClient.CompositeMapper = { type: { name: "String" } + }, + resourceGuid: { + serializedName: "properties.resourceGuid", + readOnly: true, + type: { + name: "String" + } } } } @@ -25274,6 +25288,13 @@ export const ApplicationGateway: coreClient.CompositeMapper = { name: "Composite", className: "ApplicationGatewayGlobalConfiguration" } + }, + defaultPredefinedSslPolicy: { + serializedName: "properties.defaultPredefinedSslPolicy", + readOnly: true, + type: { + name: "String" + } } } } @@ -26918,6 +26939,13 @@ export const NetworkManager: coreClient.CompositeMapper = { type: { name: "String" } + }, + resourceGuid: { + serializedName: "properties.resourceGuid", + readOnly: true, + type: { + name: "String" + } } } } @@ -27829,6 +27857,12 @@ export const VirtualNetworkGateway: coreClient.CompositeMapper = { type: { name: "Boolean" } + }, + adminState: { + serializedName: "properties.adminState", + type: { + name: "String" + } } } } @@ -29455,6 +29489,13 @@ export const ActiveSecurityAdminRule: coreClient.CompositeMapper = { type: { name: "String" } + }, + resourceGuid: { + serializedName: "properties.resourceGuid", + readOnly: true, + type: { + name: "String" + } } } } @@ -29567,6 +29608,13 @@ export const ActiveDefaultSecurityAdminRule: coreClient.CompositeMapper = { type: { name: "String" } + }, + resourceGuid: { + serializedName: "properties.resourceGuid", + readOnly: true, + type: { + name: "String" + } } } } @@ -29675,6 +29723,13 @@ export const ConnectivityConfiguration: coreClient.CompositeMapper = { type: { name: "String" } + }, + resourceGuid: { + serializedName: "properties.resourceGuid", + readOnly: true, + type: { + name: "String" + } } } } @@ -29705,6 +29760,13 @@ export const NetworkGroup: coreClient.CompositeMapper = { type: { name: "String" } + }, + resourceGuid: { + serializedName: "properties.resourceGuid", + readOnly: true, + type: { + name: "String" + } } } } @@ -29825,6 +29887,13 @@ export const SecurityAdminConfiguration: coreClient.CompositeMapper = { type: { name: "String" } + }, + resourceGuid: { + serializedName: "properties.resourceGuid", + readOnly: true, + type: { + name: "String" + } } } } @@ -29867,6 +29936,13 @@ export const AdminRuleCollection: coreClient.CompositeMapper = { type: { name: "String" } + }, + resourceGuid: { + serializedName: "properties.resourceGuid", + readOnly: true, + type: { + name: "String" + } } } } @@ -29998,6 +30074,13 @@ export const EffectiveSecurityAdminRule: coreClient.CompositeMapper = { type: { name: "String" } + }, + resourceGuid: { + serializedName: "properties.resourceGuid", + readOnly: true, + type: { + name: "String" + } } } } @@ -30110,6 +30193,13 @@ export const EffectiveDefaultSecurityAdminRule: coreClient.CompositeMapper = { type: { name: "String" } + }, + resourceGuid: { + serializedName: "properties.resourceGuid", + readOnly: true, + type: { + name: "String" + } } } } @@ -30561,6 +30651,13 @@ export const AdminRule: coreClient.CompositeMapper = { type: { name: "String" } + }, + resourceGuid: { + serializedName: "properties.resourceGuid", + readOnly: true, + type: { + name: "String" + } } } } @@ -30672,6 +30769,13 @@ export const DefaultAdminRule: coreClient.CompositeMapper = { type: { name: "String" } + }, + resourceGuid: { + serializedName: "properties.resourceGuid", + readOnly: true, + type: { + name: "String" + } } } } diff --git a/sdk/network/arm-network/src/models/parameters.ts b/sdk/network/arm-network/src/models/parameters.ts index 1684aa0207e6..661a2dabda53 100644 --- a/sdk/network/arm-network/src/models/parameters.ts +++ b/sdk/network/arm-network/src/models/parameters.ts @@ -203,7 +203,7 @@ export const applicationGatewayName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-11-01", + defaultValue: "2023-02-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/network/arm-network/src/networkManagementClient.ts b/sdk/network/arm-network/src/networkManagementClient.ts index c4f772e14d5f..b70ccefcca41 100644 --- a/sdk/network/arm-network/src/networkManagementClient.ts +++ b/sdk/network/arm-network/src/networkManagementClient.ts @@ -335,7 +335,7 @@ import { /// export class NetworkManagementClient extends coreClient.ServiceClient { $host: string; - subscriptionId: string; + subscriptionId?: string; /** * Initializes a new instance of the NetworkManagementClient class. @@ -348,12 +348,26 @@ export class NetworkManagementClient extends coreClient.ServiceClient { credentials: coreAuth.TokenCredential, subscriptionId: string, options?: NetworkManagementClientOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: NetworkManagementClientOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: NetworkManagementClientOptionalParams | string, + options?: NetworkManagementClientOptionalParams ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); + + let subscriptionId: string | undefined; + + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } // Initializing default values for options @@ -365,7 +379,7 @@ export class NetworkManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-network/31.0.1`; + const packageDetails = `azsdk-js-arm-network/32.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/network/arm-network/test/sampleTest.ts b/sdk/network/arm-network/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/network/arm-network/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/network/arm-network/tsconfig.json b/sdk/network/arm-network/tsconfig.json index 094dfbf3dbe3..3e6ae96443f3 100644 --- a/sdk/network/arm-network/tsconfig.json +++ b/sdk/network/arm-network/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-network": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"