From d45a3faa01835becd794c06bec8405b48b574cf9 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 4 Aug 2022 06:24:28 +0000 Subject: [PATCH] CodeGen from PR 20108 in Azure/azure-rest-api-specs Merge bd191f9f32f6dfc1b5aca9732396bbda62af1a90 into 66fcf8b0d60a8d869ac06d6b804a7fbca52d9d28 --- common/config/rush/pnpm-lock.yaml | 5 +- sdk/servicebus/arm-servicebus/CHANGELOG.md | 45 ++- sdk/servicebus/arm-servicebus/README.md | 2 +- sdk/servicebus/arm-servicebus/_meta.json | 12 +- sdk/servicebus/arm-servicebus/package.json | 27 +- .../review/arm-servicebus.api.md | 332 ++++++++++------ .../arm-servicebus/src/models/index.ts | 363 +++++++++++++++--- .../arm-servicebus/src/models/mappers.ts | 53 ++- .../arm-servicebus/src/models/parameters.ts | 2 +- .../operations/privateEndpointConnections.ts | 3 + .../src/serviceBusManagementClient.ts | 38 +- .../arm-servicebus/test/sampleTest.ts | 144 +------ sdk/servicebus/arm-servicebus/tsconfig.json | 10 +- 13 files changed, 647 insertions(+), 389 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3bf6040cbd0c..58d5991b5a1c 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -14148,7 +14148,7 @@ packages: dev: false file:projects/arm-servicebus.tgz: - resolution: {integrity: sha512-YUg4BG9kNFHRW6HLeR35uKp9GixSgvOCsxPmg/OUw+GjobPUP1th43jDz1qkSulFjd2NgdVrtjZm5Q/Hqj7dzQ==, tarball: file:projects/arm-servicebus.tgz} + resolution: {integrity: sha512-INiJnRsFpDFuGxq3GiKFlZCrFuWCyi7/dK0iHCAKFpfp2ppnAdtZ8DLehTBqDGUuPM7Q0R/wEf2zlOxPhpVGdQ==, tarball: file:projects/arm-servicebus.tgz} name: '@rush-temp/arm-servicebus' version: 0.0.0 dependencies: @@ -14160,6 +14160,8 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@2.77.0 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.77.0 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.0 + '@types/chai': 4.3.1 + chai: 4.3.6 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 @@ -14171,7 +14173,6 @@ packages: uglify-js: 3.16.3 transitivePeerDependencies: - '@types/node' - - encoding - supports-color dev: false diff --git a/sdk/servicebus/arm-servicebus/CHANGELOG.md b/sdk/servicebus/arm-servicebus/CHANGELOG.md index 2ded2c86e810..2828114bc307 100644 --- a/sdk/servicebus/arm-servicebus/CHANGELOG.md +++ b/sdk/servicebus/arm-servicebus/CHANGELOG.md @@ -1,15 +1,40 @@ # Release History + +## 6.1.0-beta.1 (2022-08-04) + +**Features** -## 6.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added Interface ArmDisasterRecovery + - Added Interface MigrationConfigProperties + - Added Interface NetworkRuleSet + - Added Interface PrivateEndpointConnection + - Added Interface ResourceNamespacePatch + - Added Interface Rule + - Added Interface SBAuthorizationRule + - Added Interface SBNamespace + - Added Interface SBNamespaceUpdateParameters + - Added Interface SBQueue + - Added Interface SBSubscription + - Added Interface SBTopic + - Added Interface SqlRuleAction + - Added Interface TrackedResource + - Added Type Alias KeySource + - Added Type Alias PublicNetworkAccess + - Added Type Alias TlsVersion + - Added Enum KnownAccessRights + - Added Enum KnownFilterType + - Added Enum KnownKeySource + - Added Enum KnownKeyType + - Added Enum KnownManagedServiceIdentityType + - Added Enum KnownProvisioningStateDR + - Added Enum KnownPublicNetworkAccess + - Added Enum KnownRoleDisasterRecovery + - Added Enum KnownSkuName + - Added Enum KnownSkuTier + - Added Enum KnownTlsVersion + - Added Enum KnownUnavailableReason + + ## 6.0.0 (2022-05-01) **Features** diff --git a/sdk/servicebus/arm-servicebus/README.md b/sdk/servicebus/arm-servicebus/README.md index 2b35d6adae1d..e2c74a9d9fb0 100644 --- a/sdk/servicebus/arm-servicebus/README.md +++ b/sdk/servicebus/arm-servicebus/README.md @@ -6,7 +6,7 @@ Azure Service Bus client for managing Namespace [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicebus/arm-servicebus) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-servicebus) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-servicebus) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-servicebus?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/servicebus/arm-servicebus/_meta.json b/sdk/servicebus/arm-servicebus/_meta.json index f240026fc0ba..de5001997c38 100644 --- a/sdk/servicebus/arm-servicebus/_meta.json +++ b/sdk/servicebus/arm-servicebus/_meta.json @@ -1,8 +1,8 @@ { - "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", - "readme": "specification\\servicebus\\resource-manager\\readme.md", - "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=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\servicebus\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "commit": "6843878d3c705342ab0bc4240adb33cf414366b5", + "readme": "specification/servicebus/resource-manager/readme.md", + "autorest_command": "", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" -} + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.1", + "use": "@autorest/typescript@6.0.0-rc.1" +} \ No newline at end of file diff --git a/sdk/servicebus/arm-servicebus/package.json b/sdk/servicebus/arm-servicebus/package.json index 778312fc539a..57080cc3abb7 100644 --- a/sdk/servicebus/arm-servicebus/package.json +++ b/sdk/servicebus/arm-servicebus/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ServiceBusManagementClient.", - "version": "6.0.1", + "version": "6.1.0-beta.1", "engines": { "node": ">=12.0.0" }, @@ -40,9 +40,13 @@ "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicebus/arm-servicebus", "repository": { @@ -93,9 +97,8 @@ "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", - "integration-test:browser": "echo skipped", - "docs": "echo skipped" + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -106,13 +109,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-servicebus?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/servicebus/arm-servicebus/review/arm-servicebus.api.md b/sdk/servicebus/arm-servicebus/review/arm-servicebus.api.md index f2966d909123..2cf22e1fcd68 100644 --- a/sdk/servicebus/arm-servicebus/review/arm-servicebus.api.md +++ b/sdk/servicebus/arm-servicebus/review/arm-servicebus.api.md @@ -22,7 +22,7 @@ export interface AccessKeys { } // @public -export type AccessRights = "Manage" | "Send" | "Listen"; +export type AccessRights = string; // @public export interface Action { @@ -32,14 +32,14 @@ export interface Action { } // @public -export type ArmDisasterRecovery = ProxyResource & { - readonly systemData?: SystemData; - readonly provisioningState?: ProvisioningStateDR; - readonly pendingReplicationOperationsCount?: number; - partnerNamespace?: string; +export interface ArmDisasterRecovery extends ProxyResource { alternateName?: string; + partnerNamespace?: string; + readonly pendingReplicationOperationsCount?: number; + readonly provisioningState?: ProvisioningStateDR; readonly role?: RoleDisasterRecovery; -}; + readonly systemData?: SystemData; +} // @public export interface ArmDisasterRecoveryListResult { @@ -179,7 +179,7 @@ export type DisasterRecoveryConfigsListResponse = ArmDisasterRecoveryListResult; // @public export interface Encryption { - keySource?: "Microsoft.KeyVault"; + keySource?: KeySource; keyVaultProperties?: KeyVaultProperties[]; requireInfrastructureEncryption?: boolean; } @@ -216,7 +216,7 @@ export interface FailoverProperties { } // @public -export type FilterType = "SqlFilter" | "CorrelationFilter"; +export type FilterType = string; // @public export interface Identity { @@ -229,7 +229,10 @@ export interface Identity { } // @public -type KeyType_2 = "PrimaryKey" | "SecondaryKey"; +export type KeySource = string; + +// @public +type KeyType_2 = string; export { KeyType_2 as KeyType } // @public @@ -241,76 +244,140 @@ export interface KeyVaultProperties { keyVersion?: string; } +// @public +export enum KnownAccessRights { + Listen = "Listen", + Manage = "Manage", + Send = "Send" +} + // @public export enum KnownCreatedByType { - // (undocumented) Application = "Application", - // (undocumented) Key = "Key", - // (undocumented) ManagedIdentity = "ManagedIdentity", - // (undocumented) User = "User" } // @public export enum KnownDefaultAction { - // (undocumented) Allow = "Allow", - // (undocumented) Deny = "Deny" } // @public export enum KnownEndPointProvisioningState { - // (undocumented) Canceled = "Canceled", - // (undocumented) Creating = "Creating", - // (undocumented) Deleting = "Deleting", - // (undocumented) Failed = "Failed", - // (undocumented) Succeeded = "Succeeded", - // (undocumented) Updating = "Updating" } +// @public +export enum KnownFilterType { + CorrelationFilter = "CorrelationFilter", + SqlFilter = "SqlFilter" +} + +// @public +export enum KnownKeySource { + MicrosoftKeyVault = "Microsoft.KeyVault" +} + +// @public +export enum KnownKeyType { + PrimaryKey = "PrimaryKey", + SecondaryKey = "SecondaryKey" +} + +// @public +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", + UserAssigned = "UserAssigned" +} + // @public export enum KnownMigrationConfigurationName { - // (undocumented) Default = "$default" } // @public export enum KnownNetworkRuleIPAction { - // (undocumented) Allow = "Allow" } // @public export enum KnownPrivateLinkConnectionStatus { - // (undocumented) Approved = "Approved", - // (undocumented) Disconnected = "Disconnected", - // (undocumented) Pending = "Pending", - // (undocumented) Rejected = "Rejected" } +// @public +export enum KnownProvisioningStateDR { + Accepted = "Accepted", + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownPublicNetworkAccess { + Disabled = "Disabled", + Enabled = "Enabled", + SecuredByPerimeter = "SecuredByPerimeter" +} + // @public export enum KnownPublicNetworkAccessFlag { - // (undocumented) Disabled = "Disabled", - // (undocumented) Enabled = "Enabled" } // @public -export type ManagedServiceIdentityType = "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned" | "None"; +export enum KnownRoleDisasterRecovery { + Primary = "Primary", + PrimaryNotReplicating = "PrimaryNotReplicating", + Secondary = "Secondary" +} + +// @public +export enum KnownSkuName { + Basic = "Basic", + Premium = "Premium", + Standard = "Standard" +} + +// @public +export enum KnownSkuTier { + Basic = "Basic", + Premium = "Premium", + Standard = "Standard" +} + +// @public +export enum KnownTlsVersion { + One0 = "1.0", + One1 = "1.1", + One2 = "1.2" +} + +// @public +export enum KnownUnavailableReason { + InvalidName = "InvalidName", + NameInLockdown = "NameInLockdown", + NameInUse = "NameInUse", + None = "None", + SubscriptionIsDisabled = "SubscriptionIsDisabled", + TooManyNamespaceInCurrentSubscription = "TooManyNamespaceInCurrentSubscription" +} + +// @public +export type ManagedServiceIdentityType = string; // @public export interface MessageCountDetails { @@ -328,14 +395,14 @@ export interface MigrationConfigListResult { } // @public -export type MigrationConfigProperties = ProxyResource & { - readonly systemData?: SystemData; - readonly provisioningState?: string; +export interface MigrationConfigProperties extends ProxyResource { + readonly migrationState?: string; readonly pendingReplicationOperationsCount?: number; - targetNamespace?: string; postMigrationName?: string; - readonly migrationState?: string; -}; + readonly provisioningState?: string; + readonly systemData?: SystemData; + targetNamespace?: string; +} // @public export interface MigrationConfigs { @@ -557,14 +624,14 @@ export type NamespacesUpdateResponse = SBNamespace; export type NetworkRuleIPAction = string; // @public -export type NetworkRuleSet = ProxyResource & { - readonly systemData?: SystemData; - trustedServiceAccessEnabled?: boolean; +export interface NetworkRuleSet extends ProxyResource { defaultAction?: DefaultAction; - virtualNetworkRules?: NWRuleSetVirtualNetworkRules[]; ipRules?: NWRuleSetIpRules[]; publicNetworkAccess?: PublicNetworkAccessFlag; -}; + readonly systemData?: SystemData; + trustedServiceAccessEnabled?: boolean; + virtualNetworkRules?: NWRuleSetVirtualNetworkRules[]; +} // @public export interface NetworkRuleSetListResult { @@ -632,12 +699,12 @@ export interface PrivateEndpoint { } // @public -export type PrivateEndpointConnection = ProxyResource & { - readonly systemData?: SystemData; +export interface PrivateEndpointConnection extends ProxyResource { privateEndpoint?: PrivateEndpoint; privateLinkServiceConnectionState?: ConnectionState; provisioningState?: EndPointProvisioningState; -}; + readonly systemData?: SystemData; +} // @public export interface PrivateEndpointConnectionListResult { @@ -721,7 +788,7 @@ export interface PrivateLinkResourcesListResult { } // @public -export type ProvisioningStateDR = "Accepted" | "Succeeded" | "Failed"; +export type ProvisioningStateDR = string; // @public export interface ProxyResource { @@ -731,6 +798,9 @@ export interface ProxyResource { readonly type?: string; } +// @public +export type PublicNetworkAccess = string; + // @public export type PublicNetworkAccessFlag = string; @@ -844,24 +914,24 @@ export interface Resource { } // @public -export type ResourceNamespacePatch = Resource & { +export interface ResourceNamespacePatch extends Resource { location?: string; tags?: { [propertyName: string]: string; }; -}; +} // @public -export type RoleDisasterRecovery = "Primary" | "PrimaryNotReplicating" | "Secondary"; +export type RoleDisasterRecovery = string; // @public -export type Rule = ProxyResource & { - readonly systemData?: SystemData; +export interface Rule extends ProxyResource { action?: Action; + correlationFilter?: CorrelationFilter; filterType?: FilterType; sqlFilter?: SqlFilter; - correlationFilter?: CorrelationFilter; -}; + readonly systemData?: SystemData; +} // @public export interface RuleListResult { @@ -914,10 +984,10 @@ export interface RulesListBySubscriptionsOptionalParams extends coreClient.Opera export type RulesListBySubscriptionsResponse = RuleListResult; // @public -export type SBAuthorizationRule = ProxyResource & { - readonly systemData?: SystemData; +export interface SBAuthorizationRule extends ProxyResource { rights?: AccessRights[]; -}; + readonly systemData?: SystemData; +} // @public export interface SBAuthorizationRuleListResult { @@ -933,22 +1003,24 @@ export interface SBClientAffineProperties { } // @public -export type SBNamespace = TrackedResource & { - sku?: SBSku; +export interface SBNamespace extends TrackedResource { + alternateName?: string; + readonly createdAt?: Date; + disableLocalAuth?: boolean; + encryption?: Encryption; identity?: Identity; - readonly systemData?: SystemData; + readonly metricId?: string; + minimumTlsVersion?: TlsVersion; + privateEndpointConnections?: PrivateEndpointConnection[]; readonly provisioningState?: string; + publicNetworkAccess?: PublicNetworkAccess; + readonly serviceBusEndpoint?: string; + sku?: SBSku; readonly status?: string; - readonly createdAt?: Date; + readonly systemData?: SystemData; readonly updatedAt?: Date; - readonly serviceBusEndpoint?: string; - readonly metricId?: string; zoneRedundant?: boolean; - encryption?: Encryption; - privateEndpointConnections?: PrivateEndpointConnection[]; - disableLocalAuth?: boolean; - alternateName?: string; -}; +} // @public export interface SBNamespaceListResult { @@ -957,47 +1029,47 @@ export interface SBNamespaceListResult { } // @public -export type SBNamespaceUpdateParameters = ResourceNamespacePatch & { - sku?: SBSku; +export interface SBNamespaceUpdateParameters extends ResourceNamespacePatch { + alternateName?: string; + readonly createdAt?: Date; + disableLocalAuth?: boolean; + encryption?: Encryption; identity?: Identity; + readonly metricId?: string; + privateEndpointConnections?: PrivateEndpointConnection[]; readonly provisioningState?: string; + readonly serviceBusEndpoint?: string; + sku?: SBSku; readonly status?: string; - readonly createdAt?: Date; readonly updatedAt?: Date; - readonly serviceBusEndpoint?: string; - readonly metricId?: string; - encryption?: Encryption; - privateEndpointConnections?: PrivateEndpointConnection[]; - disableLocalAuth?: boolean; - alternateName?: string; -}; +} // @public -export type SBQueue = ProxyResource & { - readonly systemData?: SystemData; +export interface SBQueue extends ProxyResource { + readonly accessedAt?: Date; + autoDeleteOnIdle?: string; readonly countDetails?: MessageCountDetails; readonly createdAt?: Date; - readonly updatedAt?: Date; - readonly accessedAt?: Date; - readonly sizeInBytes?: number; - readonly messageCount?: number; - lockDuration?: string; - maxSizeInMegabytes?: number; - maxMessageSizeInKilobytes?: number; - requiresDuplicateDetection?: boolean; - requiresSession?: boolean; - defaultMessageTimeToLive?: string; deadLetteringOnMessageExpiration?: boolean; + defaultMessageTimeToLive?: string; duplicateDetectionHistoryTimeWindow?: string; - maxDeliveryCount?: number; - status?: EntityStatus; enableBatchedOperations?: boolean; - autoDeleteOnIdle?: string; - enablePartitioning?: boolean; enableExpress?: boolean; - forwardTo?: string; + enablePartitioning?: boolean; forwardDeadLetteredMessagesTo?: string; -}; + forwardTo?: string; + lockDuration?: string; + maxDeliveryCount?: number; + maxMessageSizeInKilobytes?: number; + maxSizeInMegabytes?: number; + readonly messageCount?: number; + requiresDuplicateDetection?: boolean; + requiresSession?: boolean; + readonly sizeInBytes?: number; + status?: EntityStatus; + readonly systemData?: SystemData; + readonly updatedAt?: Date; +} // @public export interface SBQueueListResult { @@ -1013,28 +1085,28 @@ export interface SBSku { } // @public -export type SBSubscription = ProxyResource & { - readonly systemData?: SystemData; - readonly messageCount?: number; - readonly createdAt?: Date; +export interface SBSubscription extends ProxyResource { readonly accessedAt?: Date; - readonly updatedAt?: Date; + autoDeleteOnIdle?: string; + clientAffineProperties?: SBClientAffineProperties; readonly countDetails?: MessageCountDetails; - lockDuration?: string; - requiresSession?: boolean; - defaultMessageTimeToLive?: string; + readonly createdAt?: Date; deadLetteringOnFilterEvaluationExceptions?: boolean; deadLetteringOnMessageExpiration?: boolean; + defaultMessageTimeToLive?: string; duplicateDetectionHistoryTimeWindow?: string; - maxDeliveryCount?: number; - status?: EntityStatus; enableBatchedOperations?: boolean; - autoDeleteOnIdle?: string; - forwardTo?: string; forwardDeadLetteredMessagesTo?: string; + forwardTo?: string; isClientAffine?: boolean; - clientAffineProperties?: SBClientAffineProperties; -}; + lockDuration?: string; + maxDeliveryCount?: number; + readonly messageCount?: number; + requiresSession?: boolean; + status?: EntityStatus; + readonly systemData?: SystemData; + readonly updatedAt?: Date; +} // @public export interface SBSubscriptionListResult { @@ -1043,26 +1115,26 @@ export interface SBSubscriptionListResult { } // @public -export type SBTopic = ProxyResource & { - readonly systemData?: SystemData; - readonly sizeInBytes?: number; - readonly createdAt?: Date; - readonly updatedAt?: Date; +export interface SBTopic extends ProxyResource { readonly accessedAt?: Date; - readonly subscriptionCount?: number; + autoDeleteOnIdle?: string; readonly countDetails?: MessageCountDetails; + readonly createdAt?: Date; defaultMessageTimeToLive?: string; - maxSizeInMegabytes?: number; - maxMessageSizeInKilobytes?: number; - requiresDuplicateDetection?: boolean; duplicateDetectionHistoryTimeWindow?: string; enableBatchedOperations?: boolean; + enableExpress?: boolean; + enablePartitioning?: boolean; + maxMessageSizeInKilobytes?: number; + maxSizeInMegabytes?: number; + requiresDuplicateDetection?: boolean; + readonly sizeInBytes?: number; status?: EntityStatus; + readonly subscriptionCount?: number; supportOrdering?: boolean; - autoDeleteOnIdle?: string; - enablePartitioning?: boolean; - enableExpress?: boolean; -}; + readonly systemData?: SystemData; + readonly updatedAt?: Date; +} // @public export interface SBTopicListResult { @@ -1109,10 +1181,10 @@ export interface ServiceBusManagementClientOptionalParams extends coreClient.Ser } // @public -export type SkuName = "Basic" | "Standard" | "Premium"; +export type SkuName = string; // @public -export type SkuTier = "Basic" | "Standard" | "Premium"; +export type SkuTier = string; // @public export interface SqlFilter { @@ -1122,7 +1194,8 @@ export interface SqlFilter { } // @public -export type SqlRuleAction = Action & {}; +export interface SqlRuleAction extends Action { +} // @public export interface Subnet { @@ -1183,6 +1256,9 @@ export interface SystemData { lastModifiedByType?: CreatedByType; } +// @public +export type TlsVersion = string; + // @public export interface Topics { createOrUpdate(resourceGroupName: string, namespaceName: string, topicName: string, parameters: SBTopic, options?: TopicsCreateOrUpdateOptionalParams): Promise; @@ -1280,15 +1356,15 @@ export interface TopicsRegenerateKeysOptionalParams extends coreClient.Operation export type TopicsRegenerateKeysResponse = AccessKeys; // @public -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { location: string; tags?: { [propertyName: string]: string; }; -}; +} // @public -export type UnavailableReason = "None" | "InvalidName" | "SubscriptionIsDisabled" | "NameInUse" | "NameInLockdown" | "TooManyNamespaceInCurrentSubscription"; +export type UnavailableReason = string; // @public export interface UserAssignedIdentity { diff --git a/sdk/servicebus/arm-servicebus/src/models/index.ts b/sdk/servicebus/arm-servicebus/src/models/index.ts index acf9549edc51..bb10d31a8eb7 100644 --- a/sdk/servicebus/arm-servicebus/src/models/index.ts +++ b/sdk/servicebus/arm-servicebus/src/models/index.ts @@ -79,7 +79,7 @@ export interface Encryption { /** Properties of KeyVault */ keyVaultProperties?: KeyVaultProperties[]; /** Enumerates the possible value of keySource for Encryption */ - keySource?: "Microsoft.KeyVault"; + keySource?: KeySource; /** Enable Infrastructure Encryption (Double Encryption) */ requireInfrastructureEncryption?: boolean; } @@ -540,7 +540,7 @@ export interface CheckNameAvailabilityResult { } /** Properties of the PrivateEndpointConnection. */ -export type PrivateEndpointConnection = ProxyResource & { +export interface PrivateEndpointConnection extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -552,10 +552,10 @@ export type PrivateEndpointConnection = ProxyResource & { privateLinkServiceConnectionState?: ConnectionState; /** Provisioning state of the Private Endpoint Connection. */ provisioningState?: EndPointProvisioningState; -}; +} /** Single item in List or Get Alias(Disaster Recovery configuration) operation */ -export type ArmDisasterRecovery = ProxyResource & { +export interface ArmDisasterRecovery extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -580,10 +580,10 @@ export type ArmDisasterRecovery = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly role?: RoleDisasterRecovery; -}; +} /** Single item in List or Get Migration Config operation */ -export type MigrationConfigProperties = ProxyResource & { +export interface MigrationConfigProperties extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -608,10 +608,10 @@ export type MigrationConfigProperties = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly migrationState?: string; -}; +} /** Description of NetworkRuleSet resource. */ -export type NetworkRuleSet = ProxyResource & { +export interface NetworkRuleSet extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -627,10 +627,10 @@ export type NetworkRuleSet = ProxyResource & { ipRules?: NWRuleSetIpRules[]; /** This determines if traffic is allowed over public network. By default it is enabled. */ publicNetworkAccess?: PublicNetworkAccessFlag; -}; +} /** Description of a namespace authorization rule. */ -export type SBAuthorizationRule = ProxyResource & { +export interface SBAuthorizationRule extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -638,10 +638,10 @@ export type SBAuthorizationRule = ProxyResource & { readonly systemData?: SystemData; /** The rights associated with the rule. */ rights?: AccessRights[]; -}; +} /** Description of queue Resource. */ -export type SBQueue = ProxyResource & { +export interface SBQueue extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -709,10 +709,10 @@ export type SBQueue = ProxyResource & { forwardTo?: string; /** Queue/Topic name to forward the Dead Letter message */ forwardDeadLetteredMessagesTo?: string; -}; +} /** Description of topic resource. */ -export type SBTopic = ProxyResource & { +export interface SBTopic extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -770,10 +770,10 @@ export type SBTopic = ProxyResource & { enablePartitioning?: boolean; /** Value that indicates whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage. */ enableExpress?: boolean; -}; +} /** Description of Rule Resource. */ -export type Rule = ProxyResource & { +export interface Rule extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -787,10 +787,10 @@ export type Rule = ProxyResource & { sqlFilter?: SqlFilter; /** Properties of correlationFilter */ correlationFilter?: CorrelationFilter; -}; +} /** Description of subscription resource. */ -export type SBSubscription = ProxyResource & { +export interface SBSubscription extends ProxyResource { /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -849,29 +849,29 @@ export type SBSubscription = ProxyResource & { isClientAffine?: boolean; /** Properties specific to client affine subscriptions. */ clientAffineProperties?: SBClientAffineProperties; -}; +} /** The Resource definition. */ -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { /** The Geo-location where the resource lives */ location: string; /** Resource tags */ tags?: { [propertyName: string]: string }; -}; +} /** The Resource definition. */ -export type ResourceNamespacePatch = Resource & { +export interface ResourceNamespacePatch extends Resource { /** Resource location */ location?: string; /** Resource tags */ tags?: { [propertyName: string]: string }; -}; +} /** Represents set of actions written in SQL language-based syntax that is performed against a ServiceBus.Messaging.BrokeredMessage */ -export type SqlRuleAction = Action & {}; +export interface SqlRuleAction extends Action {} /** Description of a namespace resource. */ -export type SBNamespace = TrackedResource & { +export interface SBNamespace extends TrackedResource { /** Properties of SKU */ sku?: SBSku; /** Properties of BYOK Identity description */ @@ -881,6 +881,8 @@ export type SBNamespace = TrackedResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly systemData?: SystemData; + /** The minimum TLS version for the cluster to support, e.g. '1.2' */ + minimumTlsVersion?: TlsVersion; /** * Provisioning state of the namespace. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -921,10 +923,12 @@ export type SBNamespace = TrackedResource & { disableLocalAuth?: boolean; /** Alternate name for namespace */ alternateName?: string; -}; + /** This determines if traffic is allowed over public network. By default it is enabled. */ + publicNetworkAccess?: PublicNetworkAccess; +} /** Description of a namespace resource. */ -export type SBNamespaceUpdateParameters = ResourceNamespacePatch & { +export interface SBNamespaceUpdateParameters extends ResourceNamespacePatch { /** Properties of SKU */ sku?: SBSku; /** Properties of BYOK Identity description */ @@ -967,13 +971,83 @@ export type SBNamespaceUpdateParameters = ResourceNamespacePatch & { disableLocalAuth?: boolean; /** Alternate name for namespace */ alternateName?: string; -}; +} + +/** Known values of {@link SkuName} that the service accepts. */ +export enum KnownSkuName { + /** Basic */ + Basic = "Basic", + /** Standard */ + Standard = "Standard", + /** Premium */ + Premium = "Premium" +} + +/** + * Defines values for SkuName. \ + * {@link KnownSkuName} can be used interchangeably with SkuName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Basic** \ + * **Standard** \ + * **Premium** + */ +export type SkuName = string; + +/** Known values of {@link SkuTier} that the service accepts. */ +export enum KnownSkuTier { + /** Basic */ + Basic = "Basic", + /** Standard */ + Standard = "Standard", + /** Premium */ + Premium = "Premium" +} + +/** + * Defines values for SkuTier. \ + * {@link KnownSkuTier} can be used interchangeably with SkuTier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Basic** \ + * **Standard** \ + * **Premium** + */ +export type SkuTier = string; + +/** Known values of {@link ManagedServiceIdentityType} that the service accepts. */ +export enum KnownManagedServiceIdentityType { + /** SystemAssigned */ + SystemAssigned = "SystemAssigned", + /** UserAssigned */ + UserAssigned = "UserAssigned", + /** SystemAssignedUserAssigned */ + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", + /** None */ + None = "None" +} + +/** + * Defines values for ManagedServiceIdentityType. \ + * {@link KnownManagedServiceIdentityType} can be used interchangeably with ManagedServiceIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SystemAssigned** \ + * **UserAssigned** \ + * **SystemAssigned, UserAssigned** \ + * **None** + */ +export type ManagedServiceIdentityType = string; /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { + /** User */ User = "User", + /** Application */ Application = "Application", + /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", + /** Key */ Key = "Key" } @@ -989,11 +1063,51 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; +/** Known values of {@link TlsVersion} that the service accepts. */ +export enum KnownTlsVersion { + /** One0 */ + One0 = "1.0", + /** One1 */ + One1 = "1.1", + /** One2 */ + One2 = "1.2" +} + +/** + * Defines values for TlsVersion. \ + * {@link KnownTlsVersion} can be used interchangeably with TlsVersion, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **1.0** \ + * **1.1** \ + * **1.2** + */ +export type TlsVersion = string; + +/** Known values of {@link KeySource} that the service accepts. */ +export enum KnownKeySource { + /** MicrosoftKeyVault */ + MicrosoftKeyVault = "Microsoft.KeyVault" +} + +/** + * Defines values for KeySource. \ + * {@link KnownKeySource} can be used interchangeably with KeySource, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Microsoft.KeyVault** + */ +export type KeySource = string; + /** Known values of {@link PrivateLinkConnectionStatus} that the service accepts. */ export enum KnownPrivateLinkConnectionStatus { + /** Pending */ Pending = "Pending", + /** Approved */ Approved = "Approved", + /** Rejected */ Rejected = "Rejected", + /** Disconnected */ Disconnected = "Disconnected" } @@ -1011,11 +1125,17 @@ export type PrivateLinkConnectionStatus = string; /** Known values of {@link EndPointProvisioningState} that the service accepts. */ export enum KnownEndPointProvisioningState { + /** Creating */ Creating = "Creating", + /** Updating */ Updating = "Updating", + /** Deleting */ Deleting = "Deleting", + /** Succeeded */ Succeeded = "Succeeded", + /** Canceled */ Canceled = "Canceled", + /** Failed */ Failed = "Failed" } @@ -1033,8 +1153,72 @@ export enum KnownEndPointProvisioningState { */ export type EndPointProvisioningState = string; +/** Known values of {@link PublicNetworkAccess} that the service accepts. */ +export enum KnownPublicNetworkAccess { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled", + /** SecuredByPerimeter */ + SecuredByPerimeter = "SecuredByPerimeter" +} + +/** + * Defines values for PublicNetworkAccess. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** \ + * **SecuredByPerimeter** + */ +export type PublicNetworkAccess = string; + +/** Known values of {@link ProvisioningStateDR} that the service accepts. */ +export enum KnownProvisioningStateDR { + /** Accepted */ + Accepted = "Accepted", + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed" +} + +/** + * Defines values for ProvisioningStateDR. \ + * {@link KnownProvisioningStateDR} can be used interchangeably with ProvisioningStateDR, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Accepted** \ + * **Succeeded** \ + * **Failed** + */ +export type ProvisioningStateDR = string; + +/** Known values of {@link RoleDisasterRecovery} that the service accepts. */ +export enum KnownRoleDisasterRecovery { + /** Primary */ + Primary = "Primary", + /** PrimaryNotReplicating */ + PrimaryNotReplicating = "PrimaryNotReplicating", + /** Secondary */ + Secondary = "Secondary" +} + +/** + * Defines values for RoleDisasterRecovery. \ + * {@link KnownRoleDisasterRecovery} can be used interchangeably with RoleDisasterRecovery, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Primary** \ + * **PrimaryNotReplicating** \ + * **Secondary** + */ +export type RoleDisasterRecovery = string; + /** Known values of {@link MigrationConfigurationName} that the service accepts. */ export enum KnownMigrationConfigurationName { + /** Default */ Default = "$default" } @@ -1049,7 +1233,9 @@ export type MigrationConfigurationName = string; /** Known values of {@link DefaultAction} that the service accepts. */ export enum KnownDefaultAction { + /** Allow */ Allow = "Allow", + /** Deny */ Deny = "Deny" } @@ -1065,6 +1251,7 @@ export type DefaultAction = string; /** Known values of {@link NetworkRuleIPAction} that the service accepts. */ export enum KnownNetworkRuleIPAction { + /** Allow */ Allow = "Allow" } @@ -1079,7 +1266,9 @@ export type NetworkRuleIPAction = string; /** Known values of {@link PublicNetworkAccessFlag} that the service accepts. */ export enum KnownPublicNetworkAccessFlag { + /** Enabled */ Enabled = "Enabled", + /** Disabled */ Disabled = "Disabled" } @@ -1092,27 +1281,93 @@ export enum KnownPublicNetworkAccessFlag { * **Disabled** */ export type PublicNetworkAccessFlag = string; -/** Defines values for SkuName. */ -export type SkuName = "Basic" | "Standard" | "Premium"; -/** Defines values for SkuTier. */ -export type SkuTier = "Basic" | "Standard" | "Premium"; -/** Defines values for ManagedServiceIdentityType. */ -export type ManagedServiceIdentityType = - | "SystemAssigned" - | "UserAssigned" - | "SystemAssigned, UserAssigned" - | "None"; -/** Defines values for ProvisioningStateDR. */ -export type ProvisioningStateDR = "Accepted" | "Succeeded" | "Failed"; -/** Defines values for RoleDisasterRecovery. */ -export type RoleDisasterRecovery = - | "Primary" - | "PrimaryNotReplicating" - | "Secondary"; -/** Defines values for AccessRights. */ -export type AccessRights = "Manage" | "Send" | "Listen"; -/** Defines values for KeyType. */ -export type KeyType = "PrimaryKey" | "SecondaryKey"; + +/** Known values of {@link AccessRights} that the service accepts. */ +export enum KnownAccessRights { + /** Manage */ + Manage = "Manage", + /** Send */ + Send = "Send", + /** Listen */ + Listen = "Listen" +} + +/** + * Defines values for AccessRights. \ + * {@link KnownAccessRights} can be used interchangeably with AccessRights, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Manage** \ + * **Send** \ + * **Listen** + */ +export type AccessRights = string; + +/** Known values of {@link KeyType} that the service accepts. */ +export enum KnownKeyType { + /** PrimaryKey */ + PrimaryKey = "PrimaryKey", + /** SecondaryKey */ + SecondaryKey = "SecondaryKey" +} + +/** + * Defines values for KeyType. \ + * {@link KnownKeyType} can be used interchangeably with KeyType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PrimaryKey** \ + * **SecondaryKey** + */ +export type KeyType = string; + +/** Known values of {@link FilterType} that the service accepts. */ +export enum KnownFilterType { + /** SqlFilter */ + SqlFilter = "SqlFilter", + /** CorrelationFilter */ + CorrelationFilter = "CorrelationFilter" +} + +/** + * Defines values for FilterType. \ + * {@link KnownFilterType} can be used interchangeably with FilterType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SqlFilter** \ + * **CorrelationFilter** + */ +export type FilterType = string; + +/** Known values of {@link UnavailableReason} that the service accepts. */ +export enum KnownUnavailableReason { + /** None */ + None = "None", + /** InvalidName */ + InvalidName = "InvalidName", + /** SubscriptionIsDisabled */ + SubscriptionIsDisabled = "SubscriptionIsDisabled", + /** NameInUse */ + NameInUse = "NameInUse", + /** NameInLockdown */ + NameInLockdown = "NameInLockdown", + /** TooManyNamespaceInCurrentSubscription */ + TooManyNamespaceInCurrentSubscription = "TooManyNamespaceInCurrentSubscription" +} + +/** + * Defines values for UnavailableReason. \ + * {@link KnownUnavailableReason} can be used interchangeably with UnavailableReason, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **InvalidName** \ + * **SubscriptionIsDisabled** \ + * **NameInUse** \ + * **NameInLockdown** \ + * **TooManyNamespaceInCurrentSubscription** + */ +export type UnavailableReason = string; /** Defines values for EntityStatus. */ export type EntityStatus = | "Active" @@ -1124,16 +1379,6 @@ export type EntityStatus = | "Deleting" | "Renaming" | "Unknown"; -/** Defines values for FilterType. */ -export type FilterType = "SqlFilter" | "CorrelationFilter"; -/** Defines values for UnavailableReason. */ -export type UnavailableReason = - | "None" - | "InvalidName" - | "SubscriptionIsDisabled" - | "NameInUse" - | "NameInLockdown" - | "TooManyNamespaceInCurrentSubscription"; /** Optional parameters. */ export interface NamespacesListOptionalParams diff --git a/sdk/servicebus/arm-servicebus/src/models/mappers.ts b/sdk/servicebus/arm-servicebus/src/models/mappers.ts index ea8928ac5ab7..76a825fa3536 100644 --- a/sdk/servicebus/arm-servicebus/src/models/mappers.ts +++ b/sdk/servicebus/arm-servicebus/src/models/mappers.ts @@ -44,15 +44,13 @@ export const SBSku: coreClient.CompositeMapper = { serializedName: "name", required: true, type: { - name: "Enum", - allowedValues: ["Basic", "Standard", "Premium"] + name: "String" } }, tier: { serializedName: "tier", type: { - name: "Enum", - allowedValues: ["Basic", "Standard", "Premium"] + name: "String" } }, capacity: { @@ -87,13 +85,7 @@ export const Identity: coreClient.CompositeMapper = { type: { serializedName: "type", type: { - name: "Enum", - allowedValues: [ - "SystemAssigned", - "UserAssigned", - "SystemAssigned, UserAssigned", - "None" - ] + name: "String" } }, userAssignedIdentities: { @@ -196,7 +188,6 @@ export const Encryption: coreClient.CompositeMapper = { }, keySource: { defaultValue: "Microsoft.KeyVault", - isConstant: true, serializedName: "keySource", type: { name: "String" @@ -929,8 +920,7 @@ export const RegenerateAccessKeyParameters: coreClient.CompositeMapper = { serializedName: "keyType", required: true, type: { - name: "Enum", - allowedValues: ["PrimaryKey", "SecondaryKey"] + name: "String" } }, key: { @@ -1286,15 +1276,7 @@ export const CheckNameAvailabilityResult: coreClient.CompositeMapper = { reason: { serializedName: "reason", type: { - name: "Enum", - allowedValues: [ - "None", - "InvalidName", - "SubscriptionIsDisabled", - "NameInUse", - "NameInLockdown", - "TooManyNamespaceInCurrentSubscription" - ] + name: "String" } } } @@ -1355,8 +1337,7 @@ export const ArmDisasterRecovery: coreClient.CompositeMapper = { serializedName: "properties.provisioningState", readOnly: true, type: { - name: "Enum", - allowedValues: ["Accepted", "Succeeded", "Failed"] + name: "String" } }, pendingReplicationOperationsCount: { @@ -1382,8 +1363,7 @@ export const ArmDisasterRecovery: coreClient.CompositeMapper = { serializedName: "properties.role", readOnly: true, type: { - name: "Enum", - allowedValues: ["Primary", "PrimaryNotReplicating", "Secondary"] + name: "String" } } } @@ -1519,8 +1499,7 @@ export const SBAuthorizationRule: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "Enum", - allowedValues: ["Manage", "Send", "Listen"] + name: "String" } } } @@ -1854,8 +1833,7 @@ export const Rule: coreClient.CompositeMapper = { filterType: { serializedName: "properties.filterType", type: { - name: "Enum", - allowedValues: ["SqlFilter", "CorrelationFilter"] + name: "String" } }, sqlFilter: { @@ -2108,6 +2086,12 @@ export const SBNamespace: coreClient.CompositeMapper = { className: "SystemData" } }, + minimumTlsVersion: { + serializedName: "properties.minimumTlsVersion", + type: { + name: "String" + } + }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, @@ -2186,6 +2170,13 @@ export const SBNamespace: coreClient.CompositeMapper = { type: { name: "String" } + }, + publicNetworkAccess: { + defaultValue: "Enabled", + serializedName: "properties.publicNetworkAccess", + type: { + name: "String" + } } } } diff --git a/sdk/servicebus/arm-servicebus/src/models/parameters.ts b/sdk/servicebus/arm-servicebus/src/models/parameters.ts index 67b35a71e23f..04f32a4feade 100644 --- a/sdk/servicebus/arm-servicebus/src/models/parameters.ts +++ b/sdk/servicebus/arm-servicebus/src/models/parameters.ts @@ -55,7 +55,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-11-01", + defaultValue: "2022-01-01-preview", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/servicebus/arm-servicebus/src/operations/privateEndpointConnections.ts b/sdk/servicebus/arm-servicebus/src/operations/privateEndpointConnections.ts index 8cc902cf6b38..59a83763e047 100644 --- a/sdk/servicebus/arm-servicebus/src/operations/privateEndpointConnections.ts +++ b/sdk/servicebus/arm-servicebus/src/operations/privateEndpointConnections.ts @@ -316,6 +316,9 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { 201: { bodyMapper: Mappers.PrivateEndpointConnection }, + 202: { + bodyMapper: Mappers.PrivateEndpointConnection + }, default: { bodyMapper: Mappers.ErrorResponse } diff --git a/sdk/servicebus/arm-servicebus/src/serviceBusManagementClient.ts b/sdk/servicebus/arm-servicebus/src/serviceBusManagementClient.ts index ccc1de365f09..dd0b8fb61192 100644 --- a/sdk/servicebus/arm-servicebus/src/serviceBusManagementClient.ts +++ b/sdk/servicebus/arm-servicebus/src/serviceBusManagementClient.ts @@ -8,6 +8,11 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { NamespacesImpl, @@ -68,7 +73,7 @@ export class ServiceBusManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-servicebus/6.0.1`; + const packageDetails = `azsdk-js-arm-servicebus/6.1.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -115,7 +120,7 @@ export class ServiceBusManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-11-01"; + this.apiVersion = options.apiVersion || "2022-01-01-preview"; this.namespaces = new NamespacesImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); this.privateLinkResources = new PrivateLinkResourcesImpl(this); @@ -126,6 +131,35 @@ export class ServiceBusManagementClient extends coreClient.ServiceClient { this.topics = new TopicsImpl(this); this.rules = new RulesImpl(this); this.subscriptions = new SubscriptionsImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); } namespaces: Namespaces; diff --git a/sdk/servicebus/arm-servicebus/test/sampleTest.ts b/sdk/servicebus/arm-servicebus/test/sampleTest.ts index 6daec06d4385..25aeb3ebcc36 100644 --- a/sdk/servicebus/arm-servicebus/test/sampleTest.ts +++ b/sdk/servicebus/arm-servicebus/test/sampleTest.ts @@ -7,143 +7,37 @@ */ import { - env, - record, - RecorderEnvironmentSetup, Recorder, - delay, - isPlaybackMode + RecorderStartOptions, + env } from "@azure-tools/test-recorder"; -import * as assert from "assert"; -import { ClientSecretCredential } from "@azure/identity"; -import { ServiceBusManagementClient } from "../src/serviceBusManagementClient"; - -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: [] +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" }; -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables }; -describe("ServiceBus test", () => { +describe("My test", () => { let recorder: Recorder; - let subscriptionId: string; - let client: ServiceBusManagementClient; - let location: string; - let resourceGroup: string; - let namespacesName: string; - let authorizationRuleName: string; - let queueName: string; - let topicName: string; - beforeEach(async function () { - recorder = record(this, recorderEnvSetup); - subscriptionId = env.SUBSCRIPTION_ID; - // This is an example of how the environment variables are used - const credential = new ClientSecretCredential( - env.AZURE_TENANT_ID, - env.AZURE_CLIENT_ID, - env.AZURE_CLIENT_SECRET - ); - client = new ServiceBusManagementClient(credential, subscriptionId); - location = "eastus"; - resourceGroup = "myjstest"; - namespacesName = "mynamespacexxx"; - authorizationRuleName = "myAuthoriztionRule"; - queueName = "myQueue"; - topicName = "mytopic"; + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); }); - afterEach(async function () { + afterEach(async function() { await recorder.stop(); }); - it("namespaces create test", async function () { - const res = await client.namespaces.beginCreateOrUpdateAndWait(resourceGroup, namespacesName, { - sku: { - name: "Standard", - tier: "Standard", - }, - location: location, - tags: { - tag1: "value1", - tag2: "value2", - } - }, testPollingOptions) - assert.equal(res.name, namespacesName); - }); - - it("queues create test", async function () { - const res = await client.queues.createOrUpdate(resourceGroup, namespacesName, queueName, { enablePartitioning: true }); - assert.equal(res.name, queueName); - }); - - it("queues get test", async function () { - const res = await client.queues.get(resourceGroup, namespacesName, queueName); - assert.equal(res.name, queueName); - }); - - it("queues list test", async function () { - const resArray = new Array(); - for await (let item of client.queues.listByNamespace(resourceGroup, namespacesName)) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("topics create test", async function () { - const res = await client.topics.createOrUpdate(resourceGroup, namespacesName, topicName, { - enableExpress: true - }) - assert.equal(res.name, topicName); - }); - - it("topics get test", async function () { - const res = await client.topics.get(resourceGroup, namespacesName, topicName); - assert.equal(res.name, topicName); - }); - - it("topics list test", async function () { - const resArray = new Array(); - for await (let item of client.topics.listByNamespace(resourceGroup, namespacesName)) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("queues delete test", async function () { - const res = await client.queues.delete(resourceGroup, namespacesName, queueName); - const resArray = new Array(); - for await (let item of client.queues.listByNamespace(resourceGroup, namespacesName)) { - resArray.push(item); - } - assert.equal(resArray.length, 0); - }); - - it("topics delete test", async function () { - const res = await client.topics.delete(resourceGroup, namespacesName, topicName); - const resArray = new Array(); - for await (let item of client.topics.listByNamespace(resourceGroup, namespacesName)) { - resArray.push(item); - } - assert.equal(resArray.length, 0); - }); - - it("namespaces delete test", async function () { - const res = await client.namespaces.beginDeleteAndWait(resourceGroup, namespacesName, testPollingOptions); + it("sample test", async function() { + console.log("Hi, I'm a test!"); }); }); diff --git a/sdk/servicebus/arm-servicebus/tsconfig.json b/sdk/servicebus/arm-servicebus/tsconfig.json index 035ce6434f28..3e6ae96443f3 100644 --- a/sdk/servicebus/arm-servicebus/tsconfig.json +++ b/sdk/servicebus/arm-servicebus/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-servicebus": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"