From 32c641ea151e6b8ef71d775c51c749abd89c5d29 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 31 Oct 2022 03:42:50 +0000 Subject: [PATCH] CodeGen from PR 21196 in Azure/azure-rest-api-specs [Hub Generated] Review request for Microsoft.Peering to add version stable/2022-10-01 (#21196) * Adds base for updating Microsoft.Peering from version stable/2022-06-01 to version 2022-10-01 * Updates readme * Updates API version in new specs and examples * update peering api version * update peering api version * fixing resource inheritance * making readme.md consistent with previous versions * lint diff fix * fixing serialization for examples --- common/config/rush/pnpm-lock.yaml | 13 +- sdk/peering/arm-peering/CHANGELOG.md | 44 ++- sdk/peering/arm-peering/_meta.json | 10 +- sdk/peering/arm-peering/package.json | 29 +- .../arm-peering/review/arm-peering.api.md | 244 +++++++--------- sdk/peering/arm-peering/src/models/index.ts | 275 ++++++++++++++---- sdk/peering/arm-peering/src/models/mappers.ts | 57 ++++ .../arm-peering/src/models/parameters.ts | 24 +- .../arm-peering/src/operations/index.ts | 1 + .../src/operations/legacyPeerings.ts | 6 +- .../src/operations/peeringLocations.ts | 4 +- .../src/operations/registeredPrefixes.ts | 45 +++ .../src/operations/rpUnbilledPrefixes.ts | 177 +++++++++++ .../src/operationsInterfaces/index.ts | 1 + .../registeredPrefixes.ts | 18 +- .../rpUnbilledPrefixes.ts | 29 ++ .../src/peeringManagementClient.ts | 83 ++++-- sdk/peering/arm-peering/test/sampleTest.ts | 39 ++- sdk/peering/arm-peering/tsconfig.json | 10 +- 19 files changed, 816 insertions(+), 293 deletions(-) create mode 100644 sdk/peering/arm-peering/src/operations/rpUnbilledPrefixes.ts create mode 100644 sdk/peering/arm-peering/src/operationsInterfaces/rpUnbilledPrefixes.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 7adce4d66edc..b9b018714b13 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4123,7 +4123,7 @@ packages: dependencies: semver: 7.3.7 shelljs: 0.8.5 - typescript: 4.9.0-dev.20221027 + typescript: 4.9.0-dev.20221030 dev: false /downlevel-dts/0.8.0: @@ -9196,8 +9196,8 @@ packages: hasBin: true dev: false - /typescript/4.9.0-dev.20221027: - resolution: {integrity: sha512-CIkuppg1AjXN2O+njxomS97BHqIMH+NqXXD661ViFdVvesx9YLsNjiATUlfIkeVtVyG0PGpzES8lmzIhoSaniA==} + /typescript/4.9.0-dev.20221030: + resolution: {integrity: sha512-XG8DSF/qMB33CJJ8Vh6xpGRrGX0DLSVj8lHkVacXraX18XqF8aojL+Gateei6ghL2o1E2rJpAd06wnZjEF/RpA==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -14070,7 +14070,7 @@ packages: dev: false file:projects/arm-peering.tgz: - resolution: {integrity: sha512-ehr86gsyqIXKPHDZTLPT6GodMXCDeab7gd+0D1Z9pow2QzQ1nJG42RQIqBIMbKIrk16a8sIFRywKsV9kJAs7tQ==, tarball: file:projects/arm-peering.tgz} + resolution: {integrity: sha512-X5Ixk10NVmuJWKT/YP4We1Vcgl2tUAUCokMaZkksE0/hQn8tvMYnD/zXQwfOEnjJCvamY3xeBlhBRrdXmiya6Q==, tarball: file:projects/arm-peering.tgz} name: '@rush-temp/arm-peering' version: 0.0.0 dependencies: @@ -14081,6 +14081,8 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@2.79.0 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.0 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.0 + '@types/chai': 4.3.1 + chai: 4.3.6 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 @@ -14088,11 +14090,10 @@ packages: rollup: 2.79.0 rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.0 tslib: 2.4.0 - typescript: 4.2.4 + typescript: 4.6.4 uglify-js: 3.16.3 transitivePeerDependencies: - '@types/node' - - encoding - supports-color dev: false diff --git a/sdk/peering/arm-peering/CHANGELOG.md b/sdk/peering/arm-peering/CHANGELOG.md index d6aa73b4d112..7e9a5f7e9b04 100644 --- a/sdk/peering/arm-peering/CHANGELOG.md +++ b/sdk/peering/arm-peering/CHANGELOG.md @@ -1,15 +1,39 @@ # Release History + +## 2.1.0 (2022-10-31) + +**Features** -## 2.0.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group RpUnbilledPrefixes + - Added operation RegisteredPrefixes.validate + - Added Interface CdnPeeringPrefix + - Added Interface ConnectionMonitorTest + - Added Interface PeerAsn + - Added Interface Peering + - Added Interface PeeringLocation + - Added Interface PeeringRegisteredAsn + - Added Interface PeeringRegisteredPrefix + - Added Interface PeeringService + - Added Interface PeeringServiceCountry + - Added Interface PeeringServiceLocation + - Added Interface PeeringServicePrefix + - Added Interface PeeringServiceProvider + - Added Interface RegisteredPrefixesValidateOptionalParams + - Added Interface RpUnbilledPrefix + - Added Interface RpUnbilledPrefixesListNextOptionalParams + - Added Interface RpUnbilledPrefixesListOptionalParams + - Added Interface RpUnbilledPrefixListResult + - Added Type Alias RegisteredPrefixesValidateResponse + - Added Type Alias RpUnbilledPrefixesListNextResponse + - Added Type Alias RpUnbilledPrefixesListResponse + - Interface LegacyPeeringsListNextOptionalParams has a new optional parameter directPeeringType + - Interface LegacyPeeringsListOptionalParams has a new optional parameter directPeeringType + - Class PeeringManagementClient has a new parameter rpUnbilledPrefixes + - Enum KnownConnectionState has a new value TypeChangeInProgress + - Enum KnownConnectionState has a new value TypeChangeRequested + - Enum KnownDirectPeeringType has a new value EdgeZoneForOperators + - Enum KnownPeeringLocationsDirectPeeringType has a new value EdgeZoneForOperators + ## 2.0.1 (2022-04-27) **Features** diff --git a/sdk/peering/arm-peering/_meta.json b/sdk/peering/arm-peering/_meta.json index 71c11306e50d..ae652db52b66 100644 --- a/sdk/peering/arm-peering/_meta.json +++ b/sdk/peering/arm-peering/_meta.json @@ -1,8 +1,8 @@ { - "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", - "readme": "specification\\peering\\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\\peering\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "commit": "5fc05d0f0b15cbf16de942cadce464b495c66a58", + "readme": "specification/peering/resource-manager/readme.md", + "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/peering/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.2", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.6", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.4", + "use": "@autorest/typescript@6.0.0-rc.2" } \ No newline at end of file diff --git a/sdk/peering/arm-peering/package.json b/sdk/peering/arm-peering/package.json index ceba89b967c6..cb75da67ff40 100644 --- a/sdk/peering/arm-peering/package.json +++ b/sdk/peering/arm-peering/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for PeeringManagementClient.", - "version": "2.0.2", + "version": "2.1.0", "engines": { "node": ">=14.0.0" }, @@ -34,13 +34,17 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.2.0", + "typescript": "~4.6.0", "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/peering/arm-peering", "repository": { @@ -91,9 +95,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": { @@ -104,13 +107,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-peering?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/peering/arm-peering/review/arm-peering.api.md b/sdk/peering/arm-peering/review/arm-peering.api.md index b4d1ec9aa2de..494171d37037 100644 --- a/sdk/peering/arm-peering/review/arm-peering.api.md +++ b/sdk/peering/arm-peering/review/arm-peering.api.md @@ -24,13 +24,13 @@ export interface BgpSession { } // @public -export type CdnPeeringPrefix = Resource & { - readonly prefix?: string; +export interface CdnPeeringPrefix extends Resource { readonly azureRegion?: string; readonly azureService?: string; - readonly isPrimaryRegion?: boolean; readonly bgpCommunity?: string; -}; + readonly isPrimaryRegion?: boolean; + readonly prefix?: string; +} // @public export interface CdnPeeringPrefixes { @@ -76,15 +76,15 @@ export type CheckServiceProviderAvailabilityResponse = { export type Command = string; // @public -export type ConnectionMonitorTest = Resource & { - sourceAgent?: string; +export interface ConnectionMonitorTest extends Resource { destination?: string; destinationPort?: number; - testFrequencyInSec?: number; readonly isTestSuccessful?: boolean; readonly path?: string[]; readonly provisioningState?: ProvisioningState; -}; + sourceAgent?: string; + testFrequencyInSec?: number; +} // @public export interface ConnectionMonitorTestListResult { @@ -210,271 +210,182 @@ export type Kind = string; // @public export enum KnownCommand { - // (undocumented) BgpRoute = "BgpRoute", - // (undocumented) Ping = "Ping", - // (undocumented) Traceroute = "Traceroute" } // @public export enum KnownConnectionState { - // (undocumented) Active = "Active", - // (undocumented) Approved = "Approved", - // (undocumented) None = "None", - // (undocumented) PendingApproval = "PendingApproval", - // (undocumented) ProvisioningCompleted = "ProvisioningCompleted", - // (undocumented) ProvisioningFailed = "ProvisioningFailed", - // (undocumented) ProvisioningStarted = "ProvisioningStarted", - // (undocumented) + TypeChangeInProgress = "TypeChangeInProgress", + TypeChangeRequested = "TypeChangeRequested", Validating = "Validating" } // @public export enum KnownDirectPeeringType { - // (undocumented) Cdn = "Cdn", - // (undocumented) Edge = "Edge", - // (undocumented) + EdgeZoneForOperators = "EdgeZoneForOperators", Internal = "Internal", - // (undocumented) Ix = "Ix", - // (undocumented) IxRs = "IxRs", - // (undocumented) Transit = "Transit", - // (undocumented) Voice = "Voice" } // @public export enum KnownEnum0 { - // (undocumented) Available = "Available", - // (undocumented) Unavailable = "Unavailable" } // @public export enum KnownFamily { - // (undocumented) Direct = "Direct", - // (undocumented) Exchange = "Exchange" } // @public export enum KnownKind { - // (undocumented) Direct = "Direct", - // (undocumented) Exchange = "Exchange" } // @public export enum KnownLearnedType { - // (undocumented) None = "None", - // (undocumented) ViaServiceProvider = "ViaServiceProvider", - // (undocumented) ViaSession = "ViaSession" } // @public export enum KnownLegacyPeeringsKind { - // (undocumented) Direct = "Direct", - // (undocumented) Exchange = "Exchange" } // @public export enum KnownLookingGlassCommand { - // (undocumented) BgpRoute = "BgpRoute", - // (undocumented) Ping = "Ping", - // (undocumented) Traceroute = "Traceroute" } // @public export enum KnownLookingGlassSourceType { - // (undocumented) AzureRegion = "AzureRegion", - // (undocumented) EdgeSite = "EdgeSite" } // @public export enum KnownPeeringLocationsDirectPeeringType { - // (undocumented) Cdn = "Cdn", - // (undocumented) Edge = "Edge", - // (undocumented) + EdgeZoneForOperators = "EdgeZoneForOperators", Internal = "Internal", - // (undocumented) Ix = "Ix", - // (undocumented) IxRs = "IxRs", - // (undocumented) Transit = "Transit", - // (undocumented) Voice = "Voice" } // @public export enum KnownPeeringLocationsKind { - // (undocumented) Direct = "Direct", - // (undocumented) Exchange = "Exchange" } // @public export enum KnownPrefixValidationState { - // (undocumented) Failed = "Failed", - // (undocumented) Invalid = "Invalid", - // (undocumented) None = "None", - // (undocumented) Pending = "Pending", - // (undocumented) Unknown = "Unknown", - // (undocumented) Verified = "Verified", - // (undocumented) Warning = "Warning" } // @public export enum KnownProvisioningState { - // (undocumented) Deleting = "Deleting", - // (undocumented) Failed = "Failed", - // (undocumented) Succeeded = "Succeeded", - // (undocumented) Updating = "Updating" } // @public export enum KnownRole { - // (undocumented) Escalation = "Escalation", - // (undocumented) Noc = "Noc", - // (undocumented) Other = "Other", - // (undocumented) Policy = "Policy", - // (undocumented) Service = "Service", - // (undocumented) Technical = "Technical" } // @public export enum KnownSessionAddressProvider { - // (undocumented) Microsoft = "Microsoft", - // (undocumented) Peer = "Peer" } // @public export enum KnownSessionStateV4 { - // (undocumented) Active = "Active", - // (undocumented) Connect = "Connect", - // (undocumented) Established = "Established", - // (undocumented) Idle = "Idle", - // (undocumented) None = "None", - // (undocumented) OpenConfirm = "OpenConfirm", - // (undocumented) OpenReceived = "OpenReceived", - // (undocumented) OpenSent = "OpenSent", - // (undocumented) PendingAdd = "PendingAdd", - // (undocumented) PendingRemove = "PendingRemove", - // (undocumented) PendingUpdate = "PendingUpdate" } // @public export enum KnownSessionStateV6 { - // (undocumented) Active = "Active", - // (undocumented) Connect = "Connect", - // (undocumented) Established = "Established", - // (undocumented) Idle = "Idle", - // (undocumented) None = "None", - // (undocumented) OpenConfirm = "OpenConfirm", - // (undocumented) OpenReceived = "OpenReceived", - // (undocumented) OpenSent = "OpenSent", - // (undocumented) PendingAdd = "PendingAdd", - // (undocumented) PendingRemove = "PendingRemove", - // (undocumented) PendingUpdate = "PendingUpdate" } // @public export enum KnownSize { - // (undocumented) Free = "Free", - // (undocumented) Metered = "Metered", - // (undocumented) Unlimited = "Unlimited" } // @public export enum KnownTier { - // (undocumented) Basic = "Basic", - // (undocumented) Premium = "Premium" } // @public export enum KnownValidationState { - // (undocumented) Approved = "Approved", - // (undocumented) Failed = "Failed", - // (undocumented) None = "None", - // (undocumented) Pending = "Pending" } @@ -492,6 +403,7 @@ export type LegacyPeeringsKind = string; // @public export interface LegacyPeeringsListNextOptionalParams extends coreClient.OperationOptions { asn?: number; + directPeeringType?: DirectPeeringType; } // @public @@ -500,6 +412,7 @@ export type LegacyPeeringsListNextResponse = PeeringListResult; // @public export interface LegacyPeeringsListOptionalParams extends coreClient.OperationOptions { asn?: number; + directPeeringType?: DirectPeeringType; } // @public @@ -595,13 +508,13 @@ export interface OperationsListOptionalParams extends coreClient.OperationOption export type OperationsListResponse = OperationListResult; // @public -export type PeerAsn = Resource & { +export interface PeerAsn extends Resource { + readonly errorMessage?: string; peerAsn?: number; peerContactDetail?: ContactDetail[]; peerName?: string; readonly validationState?: ValidationState; - readonly errorMessage?: string; -}; +} // @public export interface PeerAsnListResult { @@ -650,18 +563,18 @@ export interface PeerAsnsListBySubscriptionOptionalParams extends coreClient.Ope export type PeerAsnsListBySubscriptionResponse = PeerAsnListResult; // @public -export type Peering = Resource & { - sku: PeeringSku; +export interface Peering extends Resource { + direct?: PeeringPropertiesDirect; + exchange?: PeeringPropertiesExchange; kind: Kind; location: string; + peeringLocation?: string; + readonly provisioningState?: ProvisioningState; + sku: PeeringSku; tags?: { [propertyName: string]: string; }; - direct?: PeeringPropertiesDirect; - exchange?: PeeringPropertiesExchange; - peeringLocation?: string; - readonly provisioningState?: ProvisioningState; -}; +} // @public export interface PeeringBandwidthOffer { @@ -676,14 +589,14 @@ export interface PeeringListResult { } // @public -export type PeeringLocation = Resource & { - kind?: Kind; +export interface PeeringLocation extends Resource { + azureRegion?: string; + country?: string; direct?: PeeringLocationPropertiesDirect; exchange?: PeeringLocationPropertiesExchange; + kind?: Kind; peeringLocation?: string; - country?: string; - azureRegion?: string; -}; +} // @public export interface PeeringLocationListResult { @@ -770,6 +683,8 @@ export class PeeringManagementClient extends coreClient.ServiceClient { // (undocumented) registeredPrefixes: RegisteredPrefixes; // (undocumented) + rpUnbilledPrefixes: RpUnbilledPrefixes; + // (undocumented) subscriptionId: string; } @@ -812,11 +727,11 @@ export interface PeeringReceivedRouteListResult { } // @public -export type PeeringRegisteredAsn = Resource & { +export interface PeeringRegisteredAsn extends Resource { asn?: number; readonly peeringServicePrefixKey?: string; readonly provisioningState?: ProvisioningState; -}; +} // @public export interface PeeringRegisteredAsnListResult { @@ -825,13 +740,13 @@ export interface PeeringRegisteredAsnListResult { } // @public -export type PeeringRegisteredPrefix = Resource & { +export interface PeeringRegisteredPrefix extends Resource { + readonly errorMessage?: string; + readonly peeringServicePrefixKey?: string; prefix?: string; readonly prefixValidationState?: PrefixValidationState; - readonly peeringServicePrefixKey?: string; - readonly errorMessage?: string; readonly provisioningState?: ProvisioningState; -}; +} // @public export interface PeeringRegisteredPrefixListResult { @@ -861,19 +776,19 @@ export interface PeeringsDeleteOptionalParams extends coreClient.OperationOption } // @public -export type PeeringService = Resource & { - sku?: PeeringServiceSku; +export interface PeeringService extends Resource { location: string; - tags?: { - [propertyName: string]: string; - }; + logAnalyticsWorkspaceProperties?: LogAnalyticsWorkspaceProperties; peeringServiceLocation?: string; peeringServiceProvider?: string; - readonly provisioningState?: ProvisioningState; - providerPrimaryPeeringLocation?: string; providerBackupPeeringLocation?: string; - logAnalyticsWorkspaceProperties?: LogAnalyticsWorkspaceProperties; -}; + providerPrimaryPeeringLocation?: string; + readonly provisioningState?: ProvisioningState; + sku?: PeeringServiceSku; + tags?: { + [propertyName: string]: string; + }; +} // @public export interface PeeringServiceCountries { @@ -895,7 +810,8 @@ export interface PeeringServiceCountriesListOptionalParams extends coreClient.Op export type PeeringServiceCountriesListResponse = PeeringServiceCountryListResult; // @public -export type PeeringServiceCountry = Resource & {}; +export interface PeeringServiceCountry extends Resource { +} // @public export interface PeeringServiceCountryListResult { @@ -910,11 +826,11 @@ export interface PeeringServiceListResult { } // @public -export type PeeringServiceLocation = Resource & { +export interface PeeringServiceLocation extends Resource { + azureRegion?: string; country?: string; state?: string; - azureRegion?: string; -}; +} // @public export interface PeeringServiceLocationListResult { @@ -944,15 +860,15 @@ export interface PeeringServiceLocationsListOptionalParams extends coreClient.Op export type PeeringServiceLocationsListResponse = PeeringServiceLocationListResult; // @public -export type PeeringServicePrefix = Resource & { - prefix?: string; - readonly prefixValidationState?: PrefixValidationState; - readonly learnedType?: LearnedType; +export interface PeeringServicePrefix extends Resource { readonly errorMessage?: string; readonly events?: PeeringServicePrefixEvent[]; + readonly learnedType?: LearnedType; peeringServicePrefixKey?: string; + prefix?: string; + readonly prefixValidationState?: PrefixValidationState; readonly provisioningState?: ProvisioningState; -}; +} // @public export interface PeeringServicePrefixEvent { @@ -970,10 +886,10 @@ export interface PeeringServicePrefixListResult { } // @public -export type PeeringServiceProvider = Resource & { - serviceProviderName?: string; +export interface PeeringServiceProvider extends Resource { peeringLocations?: string[]; -}; + serviceProviderName?: string; +} // @public export interface PeeringServiceProviderListResult { @@ -1247,6 +1163,7 @@ export interface RegisteredPrefixes { delete(resourceGroupName: string, peeringName: string, registeredPrefixName: string, options?: RegisteredPrefixesDeleteOptionalParams): Promise; get(resourceGroupName: string, peeringName: string, registeredPrefixName: string, options?: RegisteredPrefixesGetOptionalParams): Promise; listByPeering(resourceGroupName: string, peeringName: string, options?: RegisteredPrefixesListByPeeringOptionalParams): PagedAsyncIterableIterator; + validate(resourceGroupName: string, peeringName: string, registeredPrefixName: string, options?: RegisteredPrefixesValidateOptionalParams): Promise; } // @public @@ -1281,6 +1198,13 @@ export interface RegisteredPrefixesListByPeeringOptionalParams extends coreClien // @public export type RegisteredPrefixesListByPeeringResponse = PeeringRegisteredPrefixListResult; +// @public +export interface RegisteredPrefixesValidateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RegisteredPrefixesValidateResponse = PeeringRegisteredPrefix; + // @public export interface Resource { readonly id?: string; @@ -1298,6 +1222,40 @@ export interface ResourceTags { // @public export type Role = string; +// @public +export interface RpUnbilledPrefix { + readonly azureRegion?: string; + readonly peerAsn?: number; + readonly prefix?: string; +} + +// @public +export interface RpUnbilledPrefixes { + list(resourceGroupName: string, peeringName: string, options?: RpUnbilledPrefixesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface RpUnbilledPrefixesListNextOptionalParams extends coreClient.OperationOptions { + consolidate?: boolean; +} + +// @public +export type RpUnbilledPrefixesListNextResponse = RpUnbilledPrefixListResult; + +// @public +export interface RpUnbilledPrefixesListOptionalParams extends coreClient.OperationOptions { + consolidate?: boolean; +} + +// @public +export type RpUnbilledPrefixesListResponse = RpUnbilledPrefixListResult; + +// @public +export interface RpUnbilledPrefixListResult { + nextLink?: string; + value?: RpUnbilledPrefix[]; +} + // @public export interface ServiceSpecification { readonly metricSpecifications?: MetricSpecification[]; diff --git a/sdk/peering/arm-peering/src/models/index.ts b/sdk/peering/arm-peering/src/models/index.ts index fcb782de6485..392df584a7a5 100644 --- a/sdk/peering/arm-peering/src/models/index.ts +++ b/sdk/peering/arm-peering/src/models/index.ts @@ -484,11 +484,11 @@ export interface PeeringReceivedRoute { readonly receivedTimestamp?: string; } -/** The paginated list of [T]. */ +/** The paginated list of Connection Monitor Tests. */ export interface ConnectionMonitorTestListResult { - /** The list of [T]. */ + /** The list of Connection Monitor Tests. */ value?: ConnectionMonitorTest[]; - /** The link to fetch the next page of [T]. */ + /** The link to fetch the next page of Connection Monitor Tests. */ nextLink?: string; } @@ -586,8 +586,35 @@ export interface PeeringServiceListResult { nextLink?: string; } +/** The paginated list of RP unbilled prefixes. */ +export interface RpUnbilledPrefixListResult { + /** The list of RP unbilled prefixes. */ + value?: RpUnbilledPrefix[]; + /** The link to fetch the next page of RP unbilled prefixes. */ + nextLink?: string; +} + +/** The Routing Preference unbilled prefix */ +export interface RpUnbilledPrefix { + /** + * The prefix. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly prefix?: string; + /** + * The Azure region. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly azureRegion?: string; + /** + * The peer ASN. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly peerAsn?: number; +} + /** The CDN peering prefix */ -export type CdnPeeringPrefix = Resource & { +export interface CdnPeeringPrefix extends Resource { /** * The prefix. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -613,10 +640,10 @@ export type CdnPeeringPrefix = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly bgpCommunity?: string; -}; +} /** Peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location. */ -export type Peering = Resource & { +export interface Peering extends Resource { /** The SKU that defines the tier and kind of the peering. */ sku: PeeringSku; /** The kind of the peering. */ @@ -636,10 +663,10 @@ export type Peering = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; -}; +} /** The essential information related to the peer's ASN. */ -export type PeerAsn = Resource & { +export interface PeerAsn extends Resource { /** The Autonomous System Number (ASN) of the peer. */ peerAsn?: number; /** The contact details of the peer. */ @@ -656,10 +683,10 @@ export type PeerAsn = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly errorMessage?: string; -}; +} /** Peering location is where connectivity could be established to the Microsoft Cloud Edge. */ -export type PeeringLocation = Resource & { +export interface PeeringLocation extends Resource { /** The kind of peering that the peering location supports. */ kind?: Kind; /** The properties that define a direct peering location. */ @@ -672,10 +699,10 @@ export type PeeringLocation = Resource & { country?: string; /** The Azure region associated with the peering location. */ azureRegion?: string; -}; +} /** The customer's ASN that is registered by the peering service provider. */ -export type PeeringRegisteredAsn = Resource & { +export interface PeeringRegisteredAsn extends Resource { /** The customer's ASN from which traffic originates. */ asn?: number; /** @@ -688,10 +715,10 @@ export type PeeringRegisteredAsn = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; -}; +} /** The customer's prefix that is registered by the peering service provider. */ -export type PeeringRegisteredPrefix = Resource & { +export interface PeeringRegisteredPrefix extends Resource { /** The customer's prefix from which traffic originates. */ prefix?: string; /** @@ -714,10 +741,10 @@ export type PeeringRegisteredPrefix = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; -}; +} /** The Connection Monitor Test class. */ -export type ConnectionMonitorTest = Resource & { +export interface ConnectionMonitorTest extends Resource { /** The Connection Monitor test source agent */ sourceAgent?: string; /** The Connection Monitor test destination */ @@ -741,23 +768,23 @@ export type ConnectionMonitorTest = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; -}; +} /** The peering service country. */ -export type PeeringServiceCountry = Resource & {}; +export interface PeeringServiceCountry extends Resource {} /** The peering service location. */ -export type PeeringServiceLocation = Resource & { +export interface PeeringServiceLocation extends Resource { /** Country of the customer */ country?: string; /** State of the customer */ state?: string; /** Azure region for the location */ azureRegion?: string; -}; +} /** The peering service prefix class. */ -export type PeeringServicePrefix = Resource & { +export interface PeeringServicePrefix extends Resource { /** The prefix from which your traffic originates. */ prefix?: string; /** @@ -787,18 +814,18 @@ export type PeeringServicePrefix = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; -}; +} /** PeeringService provider */ -export type PeeringServiceProvider = Resource & { +export interface PeeringServiceProvider extends Resource { /** The name of the service provider. */ serviceProviderName?: string; /** The list of locations at which the service provider peers with Microsoft. */ peeringLocations?: string[]; -}; +} /** Peering Service */ -export type PeeringService = Resource & { +export interface PeeringService extends Resource { /** The SKU that defines the type of the peering service. */ sku?: PeeringServiceSku; /** The location of the resource. */ @@ -820,11 +847,13 @@ export type PeeringService = Resource & { providerBackupPeeringLocation?: string; /** The Log Analytics Workspace Properties */ logAnalyticsWorkspaceProperties?: LogAnalyticsWorkspaceProperties; -}; +} /** Known values of {@link Enum0} that the service accepts. */ export enum KnownEnum0 { + /** Available */ Available = "Available", + /** Unavailable */ Unavailable = "Unavailable" } @@ -840,7 +869,9 @@ export type Enum0 = string; /** Known values of {@link LegacyPeeringsKind} that the service accepts. */ export enum KnownLegacyPeeringsKind { + /** Direct */ Direct = "Direct", + /** Exchange */ Exchange = "Exchange" } @@ -854,9 +885,47 @@ export enum KnownLegacyPeeringsKind { */ export type LegacyPeeringsKind = string; +/** Known values of {@link DirectPeeringType} that the service accepts. */ +export enum KnownDirectPeeringType { + /** Edge */ + Edge = "Edge", + /** Transit */ + Transit = "Transit", + /** Cdn */ + Cdn = "Cdn", + /** Internal */ + Internal = "Internal", + /** Ix */ + Ix = "Ix", + /** IxRs */ + IxRs = "IxRs", + /** Voice */ + Voice = "Voice", + /** EdgeZoneForOperators */ + EdgeZoneForOperators = "EdgeZoneForOperators" +} + +/** + * Defines values for DirectPeeringType. \ + * {@link KnownDirectPeeringType} can be used interchangeably with DirectPeeringType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Edge** \ + * **Transit** \ + * **Cdn** \ + * **Internal** \ + * **Ix** \ + * **IxRs** \ + * **Voice** \ + * **EdgeZoneForOperators** + */ +export type DirectPeeringType = string; + /** Known values of {@link Tier} that the service accepts. */ export enum KnownTier { + /** Basic */ Basic = "Basic", + /** Premium */ Premium = "Premium" } @@ -872,7 +941,9 @@ export type Tier = string; /** Known values of {@link Family} that the service accepts. */ export enum KnownFamily { + /** Direct */ Direct = "Direct", + /** Exchange */ Exchange = "Exchange" } @@ -888,8 +959,11 @@ export type Family = string; /** Known values of {@link Size} that the service accepts. */ export enum KnownSize { + /** Free */ Free = "Free", + /** Metered */ Metered = "Metered", + /** Unlimited */ Unlimited = "Unlimited" } @@ -906,7 +980,9 @@ export type Size = string; /** Known values of {@link Kind} that the service accepts. */ export enum KnownKind { + /** Direct */ Direct = "Direct", + /** Exchange */ Exchange = "Exchange" } @@ -922,7 +998,9 @@ export type Kind = string; /** Known values of {@link SessionAddressProvider} that the service accepts. */ export enum KnownSessionAddressProvider { + /** Microsoft */ Microsoft = "Microsoft", + /** Peer */ Peer = "Peer" } @@ -938,14 +1016,26 @@ export type SessionAddressProvider = string; /** Known values of {@link ConnectionState} that the service accepts. */ export enum KnownConnectionState { + /** None */ None = "None", + /** PendingApproval */ PendingApproval = "PendingApproval", + /** Approved */ Approved = "Approved", + /** ProvisioningStarted */ ProvisioningStarted = "ProvisioningStarted", + /** ProvisioningFailed */ ProvisioningFailed = "ProvisioningFailed", + /** ProvisioningCompleted */ ProvisioningCompleted = "ProvisioningCompleted", + /** Validating */ Validating = "Validating", - Active = "Active" + /** Active */ + Active = "Active", + /** TypeChangeRequested */ + TypeChangeRequested = "TypeChangeRequested", + /** TypeChangeInProgress */ + TypeChangeInProgress = "TypeChangeInProgress" } /** @@ -960,22 +1050,35 @@ export enum KnownConnectionState { * **ProvisioningFailed** \ * **ProvisioningCompleted** \ * **Validating** \ - * **Active** + * **Active** \ + * **TypeChangeRequested** \ + * **TypeChangeInProgress** */ export type ConnectionState = string; /** Known values of {@link SessionStateV4} that the service accepts. */ export enum KnownSessionStateV4 { + /** None */ None = "None", + /** Idle */ Idle = "Idle", + /** Connect */ Connect = "Connect", + /** Active */ Active = "Active", + /** OpenSent */ OpenSent = "OpenSent", + /** OpenConfirm */ OpenConfirm = "OpenConfirm", + /** OpenReceived */ OpenReceived = "OpenReceived", + /** Established */ Established = "Established", + /** PendingAdd */ PendingAdd = "PendingAdd", + /** PendingUpdate */ PendingUpdate = "PendingUpdate", + /** PendingRemove */ PendingRemove = "PendingRemove" } @@ -1000,16 +1103,27 @@ export type SessionStateV4 = string; /** Known values of {@link SessionStateV6} that the service accepts. */ export enum KnownSessionStateV6 { + /** None */ None = "None", + /** Idle */ Idle = "Idle", + /** Connect */ Connect = "Connect", + /** Active */ Active = "Active", + /** OpenSent */ OpenSent = "OpenSent", + /** OpenConfirm */ OpenConfirm = "OpenConfirm", + /** OpenReceived */ OpenReceived = "OpenReceived", + /** Established */ Established = "Established", + /** PendingAdd */ PendingAdd = "PendingAdd", + /** PendingUpdate */ PendingUpdate = "PendingUpdate", + /** PendingRemove */ PendingRemove = "PendingRemove" } @@ -1032,37 +1146,15 @@ export enum KnownSessionStateV6 { */ export type SessionStateV6 = string; -/** Known values of {@link DirectPeeringType} that the service accepts. */ -export enum KnownDirectPeeringType { - Edge = "Edge", - Transit = "Transit", - Cdn = "Cdn", - Internal = "Internal", - Ix = "Ix", - IxRs = "IxRs", - Voice = "Voice" -} - -/** - * Defines values for DirectPeeringType. \ - * {@link KnownDirectPeeringType} can be used interchangeably with DirectPeeringType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Edge** \ - * **Transit** \ - * **Cdn** \ - * **Internal** \ - * **Ix** \ - * **IxRs** \ - * **Voice** - */ -export type DirectPeeringType = string; - /** Known values of {@link ProvisioningState} that the service accepts. */ export enum KnownProvisioningState { + /** Succeeded */ Succeeded = "Succeeded", + /** Updating */ Updating = "Updating", + /** Deleting */ Deleting = "Deleting", + /** Failed */ Failed = "Failed" } @@ -1080,8 +1172,11 @@ export type ProvisioningState = string; /** Known values of {@link LookingGlassCommand} that the service accepts. */ export enum KnownLookingGlassCommand { + /** Traceroute */ Traceroute = "Traceroute", + /** Ping */ Ping = "Ping", + /** BgpRoute */ BgpRoute = "BgpRoute" } @@ -1098,7 +1193,9 @@ export type LookingGlassCommand = string; /** Known values of {@link LookingGlassSourceType} that the service accepts. */ export enum KnownLookingGlassSourceType { + /** EdgeSite */ EdgeSite = "EdgeSite", + /** AzureRegion */ AzureRegion = "AzureRegion" } @@ -1114,8 +1211,11 @@ export type LookingGlassSourceType = string; /** Known values of {@link Command} that the service accepts. */ export enum KnownCommand { + /** Traceroute */ Traceroute = "Traceroute", + /** Ping */ Ping = "Ping", + /** BgpRoute */ BgpRoute = "BgpRoute" } @@ -1132,11 +1232,17 @@ export type Command = string; /** Known values of {@link Role} that the service accepts. */ export enum KnownRole { + /** Noc */ Noc = "Noc", + /** Policy */ Policy = "Policy", + /** Technical */ Technical = "Technical", + /** Service */ Service = "Service", + /** Escalation */ Escalation = "Escalation", + /** Other */ Other = "Other" } @@ -1156,9 +1262,13 @@ export type Role = string; /** Known values of {@link ValidationState} that the service accepts. */ export enum KnownValidationState { + /** None */ None = "None", + /** Pending */ Pending = "Pending", + /** Approved */ Approved = "Approved", + /** Failed */ Failed = "Failed" } @@ -1176,7 +1286,9 @@ export type ValidationState = string; /** Known values of {@link PeeringLocationsKind} that the service accepts. */ export enum KnownPeeringLocationsKind { + /** Direct */ Direct = "Direct", + /** Exchange */ Exchange = "Exchange" } @@ -1192,13 +1304,22 @@ export type PeeringLocationsKind = string; /** Known values of {@link PeeringLocationsDirectPeeringType} that the service accepts. */ export enum KnownPeeringLocationsDirectPeeringType { + /** Edge */ Edge = "Edge", + /** Transit */ Transit = "Transit", + /** Cdn */ Cdn = "Cdn", + /** Internal */ Internal = "Internal", + /** Ix */ Ix = "Ix", + /** IxRs */ IxRs = "IxRs", - Voice = "Voice" + /** Voice */ + Voice = "Voice", + /** EdgeZoneForOperators */ + EdgeZoneForOperators = "EdgeZoneForOperators" } /** @@ -1212,18 +1333,26 @@ export enum KnownPeeringLocationsDirectPeeringType { * **Internal** \ * **Ix** \ * **IxRs** \ - * **Voice** + * **Voice** \ + * **EdgeZoneForOperators** */ export type PeeringLocationsDirectPeeringType = string; /** Known values of {@link PrefixValidationState} that the service accepts. */ export enum KnownPrefixValidationState { + /** None */ None = "None", + /** Invalid */ Invalid = "Invalid", + /** Verified */ Verified = "Verified", + /** Failed */ Failed = "Failed", + /** Pending */ Pending = "Pending", + /** Warning */ Warning = "Warning", + /** Unknown */ Unknown = "Unknown" } @@ -1244,8 +1373,11 @@ export type PrefixValidationState = string; /** Known values of {@link LearnedType} that the service accepts. */ export enum KnownLearnedType { + /** None */ None = "None", + /** ViaServiceProvider */ ViaServiceProvider = "ViaServiceProvider", + /** ViaSession */ ViaSession = "ViaSession" } @@ -1289,6 +1421,8 @@ export interface LegacyPeeringsListOptionalParams extends coreClient.OperationOptions { /** The ASN number associated with a legacy peering. */ asn?: number; + /** The direct peering type. */ + directPeeringType?: DirectPeeringType; } /** Contains response data for the list operation. */ @@ -1299,6 +1433,8 @@ export interface LegacyPeeringsListNextOptionalParams extends coreClient.OperationOptions { /** The ASN number associated with a legacy peering. */ asn?: number; + /** The direct peering type. */ + directPeeringType?: DirectPeeringType; } /** Contains response data for the listNext operation. */ @@ -1434,6 +1570,13 @@ export interface RegisteredPrefixesListByPeeringOptionalParams /** Contains response data for the listByPeering operation. */ export type RegisteredPrefixesListByPeeringResponse = PeeringRegisteredPrefixListResult; +/** Optional parameters. */ +export interface RegisteredPrefixesValidateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the validate operation. */ +export type RegisteredPrefixesValidateResponse = PeeringRegisteredPrefix; + /** Optional parameters. */ export interface RegisteredPrefixesListByPeeringNextOptionalParams extends coreClient.OperationOptions {} @@ -1707,6 +1850,26 @@ export interface PeeringServicesListBySubscriptionNextOptionalParams /** Contains response data for the listBySubscriptionNext operation. */ export type PeeringServicesListBySubscriptionNextResponse = PeeringServiceListResult; +/** Optional parameters. */ +export interface RpUnbilledPrefixesListOptionalParams + extends coreClient.OperationOptions { + /** Flag to enable consolidation prefixes */ + consolidate?: boolean; +} + +/** Contains response data for the list operation. */ +export type RpUnbilledPrefixesListResponse = RpUnbilledPrefixListResult; + +/** Optional parameters. */ +export interface RpUnbilledPrefixesListNextOptionalParams + extends coreClient.OperationOptions { + /** Flag to enable consolidation prefixes */ + consolidate?: boolean; +} + +/** Contains response data for the listNext operation. */ +export type RpUnbilledPrefixesListNextResponse = RpUnbilledPrefixListResult; + /** Optional parameters. */ export interface PeeringManagementClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/peering/arm-peering/src/models/mappers.ts b/sdk/peering/arm-peering/src/models/mappers.ts index b496eb1f5622..994bdaf9e3f1 100644 --- a/sdk/peering/arm-peering/src/models/mappers.ts +++ b/sdk/peering/arm-peering/src/models/mappers.ts @@ -1358,6 +1358,63 @@ export const PeeringServiceListResult: coreClient.CompositeMapper = { } }; +export const RpUnbilledPrefixListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RpUnbilledPrefixListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RpUnbilledPrefix" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const RpUnbilledPrefix: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RpUnbilledPrefix", + modelProperties: { + prefix: { + serializedName: "prefix", + readOnly: true, + type: { + name: "String" + } + }, + azureRegion: { + serializedName: "azureRegion", + readOnly: true, + type: { + name: "String" + } + }, + peerAsn: { + serializedName: "peerAsn", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + export const CdnPeeringPrefix: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/peering/arm-peering/src/models/parameters.ts b/sdk/peering/arm-peering/src/models/parameters.ts index c446c78f1834..e8fa09462b51 100644 --- a/sdk/peering/arm-peering/src/models/parameters.ts +++ b/sdk/peering/arm-peering/src/models/parameters.ts @@ -72,7 +72,7 @@ export const subscriptionId: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-06-01", + defaultValue: "2022-10-01", isConstant: true, serializedName: "api-version", type: { @@ -131,6 +131,16 @@ export const asn: OperationQueryParameter = { } }; +export const directPeeringType: OperationQueryParameter = { + parameterPath: ["options", "directPeeringType"], + mapper: { + serializedName: "directPeeringType", + type: { + name: "String" + } + } +}; + export const command: OperationQueryParameter = { parameterPath: "command", mapper: { @@ -202,7 +212,7 @@ export const kind1: OperationQueryParameter = { } }; -export const directPeeringType: OperationQueryParameter = { +export const directPeeringType1: OperationQueryParameter = { parameterPath: ["options", "directPeeringType"], mapper: { serializedName: "directPeeringType", @@ -393,3 +403,13 @@ export const peeringService: OperationParameter = { parameterPath: "peeringService", mapper: PeeringServiceMapper }; + +export const consolidate: OperationQueryParameter = { + parameterPath: ["options", "consolidate"], + mapper: { + serializedName: "consolidate", + type: { + name: "Boolean" + } + } +}; diff --git a/sdk/peering/arm-peering/src/operations/index.ts b/sdk/peering/arm-peering/src/operations/index.ts index 18dac5516dbd..6eec3a663c06 100644 --- a/sdk/peering/arm-peering/src/operations/index.ts +++ b/sdk/peering/arm-peering/src/operations/index.ts @@ -22,3 +22,4 @@ export * from "./peeringServiceLocations"; export * from "./prefixes"; export * from "./peeringServiceProviders"; export * from "./peeringServices"; +export * from "./rpUnbilledPrefixes"; diff --git a/sdk/peering/arm-peering/src/operations/legacyPeerings.ts b/sdk/peering/arm-peering/src/operations/legacyPeerings.ts index e23fef24cd4f..c30377a7fd4d 100644 --- a/sdk/peering/arm-peering/src/operations/legacyPeerings.ts +++ b/sdk/peering/arm-peering/src/operations/legacyPeerings.ts @@ -150,7 +150,8 @@ const listOperationSpec: coreClient.OperationSpec = { Parameters.peeringLocation, Parameters.apiVersion, Parameters.kind, - Parameters.asn + Parameters.asn, + Parameters.directPeeringType ], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], @@ -171,7 +172,8 @@ const listNextOperationSpec: coreClient.OperationSpec = { Parameters.peeringLocation, Parameters.apiVersion, Parameters.kind, - Parameters.asn + Parameters.asn, + Parameters.directPeeringType ], urlParameters: [ Parameters.$host, diff --git a/sdk/peering/arm-peering/src/operations/peeringLocations.ts b/sdk/peering/arm-peering/src/operations/peeringLocations.ts index 14e56b33fefb..f19b54153ee1 100644 --- a/sdk/peering/arm-peering/src/operations/peeringLocations.ts +++ b/sdk/peering/arm-peering/src/operations/peeringLocations.ts @@ -130,7 +130,7 @@ const listOperationSpec: coreClient.OperationSpec = { queryParameters: [ Parameters.apiVersion, Parameters.kind1, - Parameters.directPeeringType + Parameters.directPeeringType1 ], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], @@ -150,7 +150,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { queryParameters: [ Parameters.apiVersion, Parameters.kind1, - Parameters.directPeeringType + Parameters.directPeeringType1 ], urlParameters: [ Parameters.$host, diff --git a/sdk/peering/arm-peering/src/operations/registeredPrefixes.ts b/sdk/peering/arm-peering/src/operations/registeredPrefixes.ts index e8bf75656a65..49c1f22545dc 100644 --- a/sdk/peering/arm-peering/src/operations/registeredPrefixes.ts +++ b/sdk/peering/arm-peering/src/operations/registeredPrefixes.ts @@ -22,6 +22,8 @@ import { RegisteredPrefixesCreateOrUpdateResponse, RegisteredPrefixesDeleteOptionalParams, RegisteredPrefixesListByPeeringResponse, + RegisteredPrefixesValidateOptionalParams, + RegisteredPrefixesValidateResponse, RegisteredPrefixesListByPeeringNextResponse } from "../models"; @@ -194,6 +196,26 @@ export class RegisteredPrefixesImpl implements RegisteredPrefixes { ); } + /** + * Validates an existing registered prefix with the specified name under the given subscription, + * resource group and peering. + * @param resourceGroupName The name of the resource group. + * @param peeringName The name of the peering. + * @param registeredPrefixName The name of the registered prefix. + * @param options The options parameters. + */ + validate( + resourceGroupName: string, + peeringName: string, + registeredPrefixName: string, + options?: RegisteredPrefixesValidateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, peeringName, registeredPrefixName, options }, + validateOperationSpec + ); + } + /** * ListByPeeringNext * @param resourceGroupName The name of the resource group. @@ -311,6 +333,29 @@ const listByPeeringOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const validateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}/registeredPrefixes/{registeredPrefixName}/validate", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PeeringRegisteredPrefix + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.peeringName, + Parameters.registeredPrefixName + ], + headerParameters: [Parameters.accept], + serializer +}; const listByPeeringNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", diff --git a/sdk/peering/arm-peering/src/operations/rpUnbilledPrefixes.ts b/sdk/peering/arm-peering/src/operations/rpUnbilledPrefixes.ts new file mode 100644 index 000000000000..da7588be8bc8 --- /dev/null +++ b/sdk/peering/arm-peering/src/operations/rpUnbilledPrefixes.ts @@ -0,0 +1,177 @@ +/* + * 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 { RpUnbilledPrefixes } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PeeringManagementClient } from "../peeringManagementClient"; +import { + RpUnbilledPrefix, + RpUnbilledPrefixesListNextOptionalParams, + RpUnbilledPrefixesListOptionalParams, + RpUnbilledPrefixesListResponse, + RpUnbilledPrefixesListNextResponse +} from "../models"; + +/// +/** Class containing RpUnbilledPrefixes operations. */ +export class RpUnbilledPrefixesImpl implements RpUnbilledPrefixes { + private readonly client: PeeringManagementClient; + + /** + * Initialize a new instance of the class RpUnbilledPrefixes class. + * @param client Reference to the service client + */ + constructor(client: PeeringManagementClient) { + this.client = client; + } + + /** + * Lists all of the RP unbilled prefixes for the specified peering + * @param resourceGroupName The Azure resource group name. + * @param peeringName The peering name. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + peeringName: string, + options?: RpUnbilledPrefixesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, peeringName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, peeringName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + peeringName: string, + options?: RpUnbilledPrefixesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, peeringName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + peeringName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + peeringName: string, + options?: RpUnbilledPrefixesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + peeringName, + options + )) { + yield* page; + } + } + + /** + * Lists all of the RP unbilled prefixes for the specified peering + * @param resourceGroupName The Azure resource group name. + * @param peeringName The peering name. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + peeringName: string, + options?: RpUnbilledPrefixesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, peeringName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The Azure resource group name. + * @param peeringName The peering name. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + peeringName: string, + nextLink: string, + options?: RpUnbilledPrefixesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, peeringName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}/rpUnbilledPrefixes", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RpUnbilledPrefixListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.consolidate], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.peeringName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RpUnbilledPrefixListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.consolidate], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName, + Parameters.peeringName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/peering/arm-peering/src/operationsInterfaces/index.ts b/sdk/peering/arm-peering/src/operationsInterfaces/index.ts index 18dac5516dbd..6eec3a663c06 100644 --- a/sdk/peering/arm-peering/src/operationsInterfaces/index.ts +++ b/sdk/peering/arm-peering/src/operationsInterfaces/index.ts @@ -22,3 +22,4 @@ export * from "./peeringServiceLocations"; export * from "./prefixes"; export * from "./peeringServiceProviders"; export * from "./peeringServices"; +export * from "./rpUnbilledPrefixes"; diff --git a/sdk/peering/arm-peering/src/operationsInterfaces/registeredPrefixes.ts b/sdk/peering/arm-peering/src/operationsInterfaces/registeredPrefixes.ts index f5a0141ba74e..8d944815bce4 100644 --- a/sdk/peering/arm-peering/src/operationsInterfaces/registeredPrefixes.ts +++ b/sdk/peering/arm-peering/src/operationsInterfaces/registeredPrefixes.ts @@ -14,7 +14,9 @@ import { RegisteredPrefixesGetResponse, RegisteredPrefixesCreateOrUpdateOptionalParams, RegisteredPrefixesCreateOrUpdateResponse, - RegisteredPrefixesDeleteOptionalParams + RegisteredPrefixesDeleteOptionalParams, + RegisteredPrefixesValidateOptionalParams, + RegisteredPrefixesValidateResponse } from "../models"; /// @@ -75,4 +77,18 @@ export interface RegisteredPrefixes { registeredPrefixName: string, options?: RegisteredPrefixesDeleteOptionalParams ): Promise; + /** + * Validates an existing registered prefix with the specified name under the given subscription, + * resource group and peering. + * @param resourceGroupName The name of the resource group. + * @param peeringName The name of the peering. + * @param registeredPrefixName The name of the registered prefix. + * @param options The options parameters. + */ + validate( + resourceGroupName: string, + peeringName: string, + registeredPrefixName: string, + options?: RegisteredPrefixesValidateOptionalParams + ): Promise; } diff --git a/sdk/peering/arm-peering/src/operationsInterfaces/rpUnbilledPrefixes.ts b/sdk/peering/arm-peering/src/operationsInterfaces/rpUnbilledPrefixes.ts new file mode 100644 index 000000000000..e3bf44e28cd3 --- /dev/null +++ b/sdk/peering/arm-peering/src/operationsInterfaces/rpUnbilledPrefixes.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + RpUnbilledPrefix, + RpUnbilledPrefixesListOptionalParams +} from "../models"; + +/// +/** Interface representing a RpUnbilledPrefixes. */ +export interface RpUnbilledPrefixes { + /** + * Lists all of the RP unbilled prefixes for the specified peering + * @param resourceGroupName The Azure resource group name. + * @param peeringName The peering name. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + peeringName: string, + options?: RpUnbilledPrefixesListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/peering/arm-peering/src/peeringManagementClient.ts b/sdk/peering/arm-peering/src/peeringManagementClient.ts index f6a4ee1b9104..c6b4fef7bbd0 100644 --- a/sdk/peering/arm-peering/src/peeringManagementClient.ts +++ b/sdk/peering/arm-peering/src/peeringManagementClient.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 { CdnPeeringPrefixesImpl, @@ -25,7 +30,8 @@ import { PeeringServiceLocationsImpl, PrefixesImpl, PeeringServiceProvidersImpl, - PeeringServicesImpl + PeeringServicesImpl, + RpUnbilledPrefixesImpl } from "./operations"; import { CdnPeeringPrefixes, @@ -43,7 +49,8 @@ import { PeeringServiceLocations, Prefixes, PeeringServiceProviders, - PeeringServices + PeeringServices, + RpUnbilledPrefixes } from "./operationsInterfaces"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; @@ -86,7 +93,7 @@ export class PeeringManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-peering/2.0.2`; + const packageDetails = `azsdk-js-arm-peering/2.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -106,34 +113,41 @@ export class PeeringManagementClient extends coreClient.ServiceClient { }; super(optionsWithDefaults); + let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName ); - if (!bearerTokenAuthenticationPolicyFound) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - scopes: `${optionsWithDefaults.baseUri}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) - ); - } + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: `${optionsWithDefaults.credentialScopes}`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); } // Parameter assignments this.subscriptionId = subscriptionId; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-06-01"; + this.apiVersion = options.apiVersion || "2022-10-01"; this.cdnPeeringPrefixes = new CdnPeeringPrefixesImpl(this); this.legacyPeerings = new LegacyPeeringsImpl(this); this.lookingGlass = new LookingGlassImpl(this); @@ -150,6 +164,36 @@ export class PeeringManagementClient extends coreClient.ServiceClient { this.prefixes = new PrefixesImpl(this); this.peeringServiceProviders = new PeeringServiceProvidersImpl(this); this.peeringServices = new PeeringServicesImpl(this); + this.rpUnbilledPrefixes = new RpUnbilledPrefixesImpl(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); } /** @@ -184,6 +228,7 @@ export class PeeringManagementClient extends coreClient.ServiceClient { prefixes: Prefixes; peeringServiceProviders: PeeringServiceProviders; peeringServices: PeeringServices; + rpUnbilledPrefixes: RpUnbilledPrefixes; } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); diff --git a/sdk/peering/arm-peering/test/sampleTest.ts b/sdk/peering/arm-peering/test/sampleTest.ts index 7ed89b043e1b..25aeb3ebcc36 100644 --- a/sdk/peering/arm-peering/test/sampleTest.ts +++ b/sdk/peering/arm-peering/test/sampleTest.ts @@ -7,35 +7,30 @@ */ import { - env, - record, - RecorderEnvironmentSetup, - Recorder + Recorder, + RecorderStartOptions, + env } from "@azure-tools/test-recorder"; -import * as assert from "assert"; +import { assert } from "chai"; +import { Context } from "mocha"; -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: [] +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() { - recorder = record(this, recorderEnvSetup); + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); }); afterEach(async function() { diff --git a/sdk/peering/arm-peering/tsconfig.json b/sdk/peering/arm-peering/tsconfig.json index 1ffe03c887c5..3e6ae96443f3 100644 --- a/sdk/peering/arm-peering/tsconfig.json +++ b/sdk/peering/arm-peering/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-peering": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"